scottyaslan commented on code in PR #10347: URL: https://github.com/apache/nifi/pull/10347#discussion_r2389251485
########## nifi-frontend/src/main/frontend/apps/nifi-registry/src/app/ui/common/about-dialog/about-dialog.component.ts: ########## @@ -0,0 +1,59 @@ +/* + * 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 { AsyncPipe, NgOptimizedImage } from '@angular/common'; +import { Component, inject } from '@angular/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { CloseOnEscapeDialog } from '@nifi/shared'; +import { Store } from '@ngrx/store'; +import { AboutState } from '../../../state/about'; +import { selectAbout } from '../../../state/about/about.selectors'; +import { loadAbout } from '../../../state/about/about.actions'; +import { ContextErrorBanner } from '../context-error-banner/context-error-banner.component'; +import { ErrorContextKey } from '../../../state/error'; + +@Component({ + selector: 'registry-about-dialog', + templateUrl: './about-dialog.component.html', + styleUrl: './about-dialog.component.scss', + standalone: true, + imports: [ + MatButtonModule, + MatDialogModule, + AsyncPipe, + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + NgOptimizedImage, + ContextErrorBanner + ] +}) +export class AboutDialogComponent extends CloseOnEscapeDialog { + private store = inject<Store<AboutState>>(Store); + + constructor() { + super(); + this.store.dispatch(loadAbout()); Review Comment: In the current nifi registry application the about dialog calls GET on the about url each time the dialog is opened: https://github.com/apache/nifi/blob/main/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.api.js#L1113 I tried to follow that approach since that is how it worked previously. I can appreciate that we are changing some things so I am open to discussing when and where this call should be happening. I was simply trying to replace what exists. To that point, I realize we have changed some things. Also to that point, the legacy nifi registry UI did not have any error handling for the GET call to the about url so no snackbar or banner error was ever surfaced to the user. If we want to follow what nifi has done I can. -- 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]
