rfellows commented on code in PR #11270: URL: https://github.com/apache/nifi/pull/11270#discussion_r3276308304
########## nifi-frontend/src/main/frontend/libs/shared/src/components/banner/banner.component.scss: ########## @@ -0,0 +1,27 @@ +/* + * 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. + */ + +.banner-container { + ul { + list-style-type: disc; + list-style-position: inside; + } + + .error-banner-message { + word-break: break-word; + } +} Review Comment: these can all be just tailwind styles in the template. ########## nifi-frontend/src/main/frontend/libs/shared/src/components/status-banner/status-banner.component.ts: ########## @@ -0,0 +1,54 @@ +/* + * 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. + */ + +import { NgClass } from '@angular/common'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { MatIconButton } from '@angular/material/button'; +import { StatusVariant } from '../../types'; + +@Component({ + selector: 'status-banner', + standalone: true, + imports: [MatIconButton, NgClass], + templateUrl: './status-banner.component.html', + styleUrl: './status-banner.component.scss' +}) +export class StatusBanner { + @Input() variant: StatusVariant = 'critical'; + @Input() allowDismiss = true; + + @Output() dismiss: EventEmitter<void> = new EventEmitter<void>(); + + getBannerIcon(variant: StatusVariant): string { + switch (variant) { + case 'success': + return 'fa-check-circle'; + case 'active': Review 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` ```suggestion ``` ########## nifi-frontend/src/main/frontend/libs/shared/src/components/status-banner/status-banner.component.html: ########## @@ -0,0 +1,37 @@ +<!-- + 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. +--> + +<div class="status-banner-container status-variant p-4 flex gap-x-2 text-sm rounded-lg" [class]="variant"> Review Comment: I'm concerned that we now have 2 competing flavors of warning/caution banners. one is the `overlapping-connections-banner` used on the canvas: <img width="998" height="111" alt="Image" src="https://github.com/user-attachments/assets/1c35536b-8c17-49d1-8be9-17489483c203" /> and now this one that looks much more re-usable but also not as clean to look at. <img width="474" height="194" alt="Image" src="https://github.com/user-attachments/assets/6a6d81d6-e45a-4357-9486-4e49f7416e7e" /> I think we should leverage the new component, but consider updating the look of it to be more pleasing to the eye. -- 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]
