NIFI-15959: Rendering a banner when a previously selected value in a …#11270
Conversation
…STRING_LIST property is no longer available. STRING_LIST is handled specifically because the UI automatically deselects it unlike single selection.
|
reviewing... |
rfellows
left a comment
There was a problem hiding this comment.
A few things inline... I'd also welcome some eyes on this from @scottyaslan when he has a chance.
| .banner-container { | ||
| ul { | ||
| list-style-type: disc; | ||
| list-style-position: inside; | ||
| } | ||
|
|
||
| .error-banner-message { | ||
| word-break: break-word; | ||
| } | ||
| } |
There was a problem hiding this comment.
these can all be just tailwind styles in the template.
| switch (variant) { | ||
| case 'success': | ||
| return 'fa-check-circle'; | ||
| case 'active': |
There was a problem hiding this comment.
The shared .status-variant theme only defines neutral, critical, caution, success, and info in nifi-frontend/src/main/frontend/libs/shared/src/assets/themes/material.scss:366 and :883. That means a future status-banner caller using active would get the icon choice but not the matching container styling.
I think we can get rid of this case
| case 'active': |
| .fa { | ||
| &.neutral { | ||
| color: var(--mat-sys-on-surface); | ||
| } | ||
|
|
||
| &.critical { | ||
| color: var(--mat-sys-on-error); | ||
| } | ||
|
|
||
| &.caution { | ||
| color: var(--nf-caution-contrast); | ||
| } | ||
|
|
||
| &.success { | ||
| color: var(--nf-success-contrast); | ||
| } | ||
|
|
||
| &.info { | ||
| color: var(--nf-success-contrast); | ||
| } | ||
|
|
||
| &.active { | ||
| color: var(--nf-success-contrast); | ||
| } | ||
| } |
There was a problem hiding this comment.
These belong with the other .status-variant class rules in the material.scss file.
| .fa { | |
| &.neutral { | |
| color: var(--mat-sys-on-surface); | |
| } | |
| &.critical { | |
| color: var(--mat-sys-on-error); | |
| } | |
| &.caution { | |
| color: var(--nf-caution-contrast); | |
| } | |
| &.success { | |
| color: var(--nf-success-contrast); | |
| } | |
| &.info { | |
| color: var(--nf-success-contrast); | |
| } | |
| &.active { | |
| color: var(--nf-success-contrast); | |
| } | |
| } |
| // Inherit variant foreground from .status-variant (e.g. caution contrast on amber) | ||
| button.mat-mdc-icon-button { | ||
| color: inherit; | ||
|
|
||
| .fa { | ||
| color: inherit; | ||
| } | ||
| } |
There was a problem hiding this comment.
mat-icon-button should already inherit its rules from the design system
| // Inherit variant foreground from .status-variant (e.g. caution contrast on amber) | |
| button.mat-mdc-icon-button { | |
| color: inherit; | |
| .fa { | |
| color: inherit; | |
| } | |
| } |
| case 'critical': | ||
| case 'caution': | ||
| default: | ||
| return 'fa-exclamation-triangle'; |
There was a problem hiding this comment.
| return 'fa-exclamation-triangle'; | |
| return 'fa-warning'; |
| getBannerIcon(variant: StatusVariant): string { | ||
| switch (variant) { | ||
| case 'success': | ||
| return 'fa-check-circle'; |
There was a problem hiding this comment.
| return 'fa-check-circle'; | |
| return 'fa-check-circle-o'; |
|
|
||
| @Component({ | ||
| selector: 'status-banner', | ||
| standalone: true, |
There was a problem hiding this comment.
Nit: not needed as all components are standalone by default.
| standalone: true, |
…STRING_LIST property is no longer available. STRING_LIST is handled specifically because the UI automatically deselects it unlike single selection.
Summary
When a connector configuration step loads allowable values for a STRING_LIST multi-select, saved selections that are no longer in the catalog are automatically removed from the form control. The configuration step shows a dismissible caution banner listing which property(ies) lost values and what was stripped. Single-select properties are unchanged: stale values remain visible as disabled “(no longer available)” options so the user can pick a replacement.
Also introduces reusable
StatusBannerandBannercomponents and migratesWizardContextBannerfrom legacyErrorBannertoBanner→StatusBanner, sovariant(e.g.critical) is honored for wizard store errors. Verify-all general errors on the config step still useErrorBannerfor now.Changes
STRING_LIST orphan detection (
connector-property-input)afterNextRender(stringListStripScheduled) and emitsstringListOrphansStrippedonce per strip pass.StringListOrphansStrippedEventinconnector-property-input.types.ts.Configuration step banner
stringListOrphansStripped, maintains per-property banner entries (replace on re-strip for same property).StatusBannerwith intro copy, property labels, removed values (cap 20 + “… and N more”), dismiss, and clear on form re-init.(stringListOrphansStripped)on eachconnector-property-inputin the step template.Banner components
StatusBanner: themed status shell (FA4 icons,fa-2xto matchErrorBanner), icon dismiss, content projection +statusBannerTitle/statusBannerDescriptiondirectives.Banner: message list wrapper (single vs list, dedupe) overStatusBanner.WizardContextBanner: thin store adapter →<banner>(replacesErrorBanner).Exports
banner,status-banner, directives, andconnector-property-input.typesexported fromlibs/sharedindex.ts.