mcgilman commented on code in PR #11237:
URL: https://github.com/apache/nifi/pull/11237#discussion_r3228304783
##########
nifi-frontend/src/main/frontend/libs/shared/src/components/property-group-card/property-group-card.component.ts:
##########
@@ -31,35 +32,8 @@ import {
*/
@Component({
selector: 'property-group-card',
- standalone: true,
- imports: [MatCard, MatError],
- template: `
- <mat-card appearance="outlined" class="p-4">
- @if (!hideGroupName()) {
- <h4 class="font-semibold mb-4">{{
propertyGroup().propertyGroupName }}</h4>
- }
- <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3
xl:grid-cols-4 gap-x-6 gap-y-4">
- @for (propertyName of getPropertyNames(); track propertyName) {
- <div class="flex flex-col gap-y-1">
- <div class="flex items-center pt-1">
- <span class="text-sm tertiary-color leading-5">{{
propertyName }}</span>
- @if (isRequired(propertyName)) {
- <span class="error-color ml-1 text-sm">*</span>
- }
- </div>
- @if (hasValue(propertyName)) {
- <span class="text-sm">{{
getDisplayValueForProperty(propertyName) }}</span>
- } @else {
- <span class="unset neutral-color text-sm">No value
set</span>
- }
- @if (getFieldError(propertyName); as errorMessage) {
- <mat-error class="error-color text-xs">{{
errorMessage }}</mat-error>
- }
- </div>
- }
- </div>
- </mat-card>
- `
+ imports: [MatCard, MatCardHeader, MatCardTitle, MatError,
EllipsisTooltipDirective],
Review Comment:
`MatCardHeader` and `MatCardTitle` are imported but never used in the
template.
##########
nifi-frontend/src/main/frontend/libs/shared/src/components/property-group-card/property-group-card.component.html:
##########
@@ -0,0 +1,44 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<mat-card appearance="outlined" class="p-4">
+ @if (!hideGroupName()) {
+ <div class="font-semibold mb-4">{{ propertyGroup().propertyGroupName
}}</div>
Review Comment:
Is `h4` more appropriate here?
##########
nifi-frontend/src/main/frontend/libs/shared/src/components/property-group-card/property-group-card.component.ts:
##########
@@ -31,35 +32,8 @@ import {
*/
@Component({
selector: 'property-group-card',
- standalone: true,
- imports: [MatCard, MatError],
- template: `
- <mat-card appearance="outlined" class="p-4">
- @if (!hideGroupName()) {
- <h4 class="font-semibold mb-4">{{
propertyGroup().propertyGroupName }}</h4>
- }
- <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3
xl:grid-cols-4 gap-x-6 gap-y-4">
- @for (propertyName of getPropertyNames(); track propertyName) {
- <div class="flex flex-col gap-y-1">
- <div class="flex items-center pt-1">
- <span class="text-sm tertiary-color leading-5">{{
propertyName }}</span>
- @if (isRequired(propertyName)) {
- <span class="error-color ml-1 text-sm">*</span>
- }
- </div>
- @if (hasValue(propertyName)) {
- <span class="text-sm">{{
getDisplayValueForProperty(propertyName) }}</span>
- } @else {
- <span class="unset neutral-color text-sm">No value
set</span>
- }
- @if (getFieldError(propertyName); as errorMessage) {
- <mat-error class="error-color text-xs">{{
errorMessage }}</mat-error>
- }
- </div>
- }
- </div>
- </mat-card>
- `
+ imports: [MatCard, MatCardHeader, MatCardTitle, MatError,
EllipsisTooltipDirective],
+ templateUrl: './property-group-card.component.html'
})
export class PropertyGroupCard {
Review Comment:
Not an issue with this PR specifically but it would be nice to have some
test coverage for this component.
##########
nifi-frontend/src/main/frontend/libs/shared/src/components/property-group-card/property-group-card.component.html:
##########
@@ -0,0 +1,44 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<mat-card appearance="outlined" class="p-4">
+ @if (!hideGroupName()) {
+ <div class="font-semibold mb-4">{{ propertyGroup().propertyGroupName
}}</div>
+ }
+ <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4
gap-x-6 gap-y-4">
+ @for (propertyName of getPropertyNames(); track propertyName) {
+ <div class="min-w-0 flex flex-col gap-y-1">
+ <div class="flex items-center pt-1">
+ <mat-label ellipsisTooltip>{{ propertyName }}</mat-label>
Review Comment:
`<mat-label>` is used outside a `<mat-form-field>` and `MatLabel` isn't in
the imports array.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]