Re: [PR] NIFI-12663: Error Handling in CS Listing [nifi]

2024-01-29 Thread via GitHub


rfellows merged PR #8305:
URL: https://github.com/apache/nifi/pull/8305


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12663: Error Handling in CS Listing [nifi]

2024-01-29 Thread via GitHub


rfellows commented on code in PR #8305:
URL: https://github.com/apache/nifi/pull/8305#discussion_r1469948325


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/service/property-table-helper.service.ts:
##
@@ -153,6 +180,20 @@ export class PropertyTableHelperService {
 .getPropertyDescriptor(id, 
descriptor.name, false)
 .pipe(
 take(1),
+tap({
+error: (errorResponse: 
HttpErrorResponse) => {
+// we've errored 
getting the descriptor but since the service
+// was already 
created, we should close the create service dialog
+// so multiple service 
instances are not inadvertently created
+
createServiceDialogReference.close();
+
+this.store.dispatch(
+snackBarError({
+error: 
`Service created but until to reload Property Descriptor: 
${errorResponse.error}`

Review Comment:
   I'm a bit confused by this wording. Can we clarify it a bit more?



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12663: Error Handling in CS Listing [nifi]

2024-01-29 Thread via GitHub


rfellows commented on code in PR #8305:
URL: https://github.com/apache/nifi/pull/8305#discussion_r1469594883


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/page-content/page-content.component.scss:
##
@@ -15,7 +15,9 @@
  * limitations under the License.
  */
 
-.message {
+.page-content {
+//width: 500px;

Review Comment:
   can this be removed?



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12663: Error Handling in CS Listing [nifi]

2024-01-26 Thread via GitHub


mcgilman commented on PR #8305:
URL: https://github.com/apache/nifi/pull/8305#issuecomment-1912757719

   Thanks for the review @rfellows! I hadn't targeted the property descriptor 
and new inline service error handling but it makes sense to address it now 
since it's exposed through the edit service dialog. I've already addressed a 
few of the items above but still need to consider the descriptor and inline 
service concerns. Will comment again once it's all ready for re-review.


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12663: Error Handling in CS Listing [nifi]

2024-01-26 Thread via GitHub


rfellows commented on code in PR #8305:
URL: https://github.com/apache/nifi/pull/8305#discussion_r1468061938


##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/message/message.component.ts:
##
@@ -16,15 +16,19 @@
  */
 
 import { Component, Input } from '@angular/core';
-import { AuthStorage } from '../../../../service/auth-storage.service';
-import { AuthService } from '../../../../service/auth.service';
+import { AuthStorage } from '../../../service/auth-storage.service';
+import { AuthService } from '../../../service/auth.service';
+import { RouterLink } from '@angular/router';
+import { NgIf } from '@angular/common';
 
 @Component({
-selector: 'login-message',
-templateUrl: './login-message.component.html',
-styleUrls: ['./login-message.component.scss']
+selector: 'message',
+standalone: true,
+templateUrl: './message.component.html',
+imports: [RouterLink, NgIf],
+styleUrls: ['./message.component.scss']
 })
-export class LoginMessage {
+export class Message {

Review Comment:
   We should probably rename this one too, Its not really a generic message 
component.
   
   Also...
   I think we should allow the "message" to be `ng-content` instead of a basic 
`@Input()`.
   That way we could provide whatever we want in the message
   ```
   
 
 {{someMessageHere}}
   
   ```



##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/banner/banner.component.ts:
##
@@ -17,28 +17,25 @@
 
 import { Component } from '@angular/core';
 import { Store } from '@ngrx/store';
-import { CanvasState } from '../../../state';
-import { selectApiError } from '../../../state/flow/flow.selectors';
-import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
-import { NgClass, NgIf } from '@angular/common';
+import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
+import { MatButtonModule } from '@angular/material/button';
+import { NiFiState } from '../../../state';
+import { selectBannerErrors } from '../../../state/error/error.selectors';
+import { clearBannerErrors } from '../../../state/error/error.actions';
 
 @Component({
 selector: 'banner',
 standalone: true,
-imports: [NgClass, NgIf],
+imports: [NgIf, NgForOf, MatButtonModule, AsyncPipe],
 templateUrl: './banner.component.html',
 styleUrls: ['./banner.component.scss']
 })
 export class Banner {

Review Comment:
   Banner is a generic term that implies broader re-use capabilities than this 
provides. Maybe we should rename it to be more specific to what it does, like 
`ErrorBanner` or something.



##
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/state/error/error.effects.ts:
##
@@ -0,0 +1,55 @@
+/*
+ * 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 { Injectable } from '@angular/core';
+import { Actions, createEffect, ofType } from '@ngrx/effects';
+import * as ErrorActions from './error.actions';
+import { map, tap } from 'rxjs';
+import { Router } from '@angular/router';
+import { MatSnackBar } from '@angular/material/snack-bar';
+
+@Injectable()
+export class ErrorEffects {
+constructor(
+private actions$: Actions,
+private router: Router,
+private snackBar: MatSnackBar
+) {}
+
+fullScreenError$ = createEffect(
+() =>
+this.actions$.pipe(
+ofType(ErrorActions.fullScreenError),
+tap(() => {
+this.router.navigate(['/error']);
+})
+),
+{ dispatch: false }
+);
+
+snackBarError$ = createEffect(
+() =>
+this.actions$.pipe(
+ofType(ErrorActions.snackBarError),
+map((action) => action.error),
+tap((error) => {
+this.snackBar.open(error, 'Dismiss');

Review Comment:
   We might want to consider putting an auto-close duration on these. The 
snackbar remains until dismissed... even if the user navigates away from the 
page/route where the error originated.
   
   Maybe this is 

Re: [PR] NIFI-12663: Error Handling in CS Listing [nifi]

2024-01-26 Thread via GitHub


rfellows commented on PR #8305:
URL: https://github.com/apache/nifi/pull/8305#issuecomment-1912511527

   will review...


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] NIFI-12663: Error Handling in CS Listing [nifi]

2024-01-26 Thread via GitHub


mcgilman opened a new pull request, #8305:
URL: https://github.com/apache/nifi/pull/8305

   NIFI-12663:
   - Handling API error responses in the Management Controller Services page.
   
   The following items are covered in this PR
   1) Snackbar errors for management service creation or deletion failure.
   2) Banner errors in edit management service dialog. (enable/disable not 
covered in this PR)
   3) Full screen error when initially loading management service listing.
   4) Full screen error with missing or expired token.


-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org