You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "rfellows (via GitHub)" <gi...@apache.org> on 2024/02/27 15:07:45 UTC
[PR] [NIFI-12537] Open cluster/node dialog from Summary screen. [nifi]
rfellows opened a new pull request, #8454:
URL: https://github.com/apache/nifi/pull/8454
[NIFI-12537](https://issues.apache.org/jira/browse/NIFI-12537)
* Refactored the Summary Listing tables to all extend an abstract base class to reduce code duplication
* Created an abstract base class for the cluster dialog tables
* Added cluster node filtering dropdown when in clustered mode on the summary screen
--
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-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [NIFI-12537] Open cluster/node dialog from Summary screen. [nifi]
Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows commented on PR #8454:
URL: https://github.com/apache/nifi/pull/8454#issuecomment-1971169560
> As I was verifying the sort (and multi-sort) capabilities and clicking on the headers the text kept selecting. I'd be interested to get your thoughts on possibly disabling that by setting `user-select: none` for all `mat-sort-header-content` in the base styles.scss.
I agree. We have many issues in the app allowing too much text selection. I can add this to the base listing table style since it happens so regularly when just clicking on the headers to sort them.
--
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-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [NIFI-12537] Open cluster/node dialog from Summary screen. [nifi]
Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on PR #8454:
URL: https://github.com/apache/nifi/pull/8454#issuecomment-1969939571
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-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [NIFI-12537] Open cluster/node dialog from Summary screen. [nifi]
Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #8454:
URL: https://github.com/apache/nifi/pull/8454#discussion_r1506733607
##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/summary/state/component-cluster-status/component-cluster-status.effects.ts:
##########
@@ -0,0 +1,102 @@
+/*
+ * 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, concatLatestFrom, createEffect, ofType } from '@ngrx/effects';
+import { NiFiState } from '../../../../state';
+import { Store } from '@ngrx/store';
+import { ErrorHelper } from '../../../../service/error-helper.service';
+import * as ClusterStatusActions from './component-cluster-status.actions';
+import { catchError, from, map, of, switchMap, tap } from 'rxjs';
+import { ComponentClusterStatusService } from '../../service/component-cluster-status.service';
+import { MatDialog } from '@angular/material/dialog';
+import { ClusterSummaryDialog } from '../../ui/common/cluster-summary-dialog/cluster-summary-dialog.component';
+import { selectComponentClusterStatusLatestRequest } from './component-cluster-status.selectors';
+import { isDefinedAndNotNull } from '../../../../state/shared';
+
+@Injectable()
+export class ComponentClusterStatusEffects {
+ constructor(
+ private actions$: Actions,
+ private store: Store<NiFiState>,
+ private errorHelper: ErrorHelper,
+ private clusterStatusService: ComponentClusterStatusService,
+ private dialog: MatDialog
+ ) {}
+
+ loadComponentClusterStatusAndOpenDialog$ = createEffect(() =>
+ this.actions$.pipe(
+ ofType(ClusterStatusActions.loadComponentClusterStatusAndOpenDialog),
+ map((action) => action.request),
+ switchMap((request) =>
+ from(this.clusterStatusService.getClusterStatus(request.id, request.componentType)).pipe(
+ map((response) => {
+ return ClusterStatusActions.openComponentClusterStatusDialog({
+ response: {
+ clusterStatusEntity: response,
+ componentType: request.componentType
+ }
+ });
+ }),
+ catchError((error) => of(this.errorHelper.handleLoadingError(error.error, error)))
+ )
+ )
+ )
+ );
+
+ loadComponentClusterStatus$ = createEffect(() =>
+ this.actions$.pipe(
+ ofType(ClusterStatusActions.loadComponentClusterStatus),
+ map((action) => action.request),
+ switchMap((request) =>
+ from(this.clusterStatusService.getClusterStatus(request.id, request.componentType)).pipe(
+ map((response) => {
+ return ClusterStatusActions.loadComponentClusterStatusSuccess({
+ response: {
+ clusterStatusEntity: response,
+ componentType: request.componentType
+ }
+ });
+ }),
+ catchError((error) => of(this.errorHelper.handleLoadingError(error.error, error)))
Review Comment:
Same as above.
##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/summary/ui/common/component-status-table/component-status-table.component.ts:
##########
@@ -0,0 +1,239 @@
+/*
+ * 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 { AfterViewInit, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
+import { BaseSnapshotEntity } from '../../../state';
+import { MatTableDataSource, MatTableModule } from '@angular/material/table';
+import { MatSortModule, Sort, SortDirection } from '@angular/material/sort';
+import { MultiSort } from '../index';
+import { SummaryTableFilterContext } from '../summary-table-filter/summary-table-filter.component';
+import { MatPaginator } from '@angular/material/paginator';
+import { NodeSearchResult } from '../../../../../state/cluster-summary';
+
+@Component({
+ selector: 'component-status-table',
+ standalone: true,
+ imports: [MatTableModule, MatSortModule],
+ template: ''
+})
+export abstract class ComponentStatusTable<T extends BaseSnapshotEntity> implements AfterViewInit {
+ private _summaryListingStatus: string | null = null;
+ private _loadedTimestamp: string | null = null;
+ private _initialSortColumn!: string;
+ private _initialSortDirection: SortDirection = 'asc';
+ private _connectedToCluster: boolean = false;
+ private _clusterNodes: NodeSearchResult[] | null = null;
+ private _selectedClusterNode: NodeSearchResult | null = null;
+ private _selectedId: string | null = null;
+ private currentFilter: SummaryTableFilterContext | null = null;
Review Comment:
This doesn't appear to be used (though maybe I missed it).
##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/summary/state/component-cluster-status/component-cluster-status.effects.ts:
##########
@@ -0,0 +1,102 @@
+/*
+ * 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, concatLatestFrom, createEffect, ofType } from '@ngrx/effects';
+import { NiFiState } from '../../../../state';
+import { Store } from '@ngrx/store';
+import { ErrorHelper } from '../../../../service/error-helper.service';
+import * as ClusterStatusActions from './component-cluster-status.actions';
+import { catchError, from, map, of, switchMap, tap } from 'rxjs';
+import { ComponentClusterStatusService } from '../../service/component-cluster-status.service';
+import { MatDialog } from '@angular/material/dialog';
+import { ClusterSummaryDialog } from '../../ui/common/cluster-summary-dialog/cluster-summary-dialog.component';
+import { selectComponentClusterStatusLatestRequest } from './component-cluster-status.selectors';
+import { isDefinedAndNotNull } from '../../../../state/shared';
+
+@Injectable()
+export class ComponentClusterStatusEffects {
+ constructor(
+ private actions$: Actions,
+ private store: Store<NiFiState>,
+ private errorHelper: ErrorHelper,
+ private clusterStatusService: ComponentClusterStatusService,
+ private dialog: MatDialog
+ ) {}
+
+ loadComponentClusterStatusAndOpenDialog$ = createEffect(() =>
+ this.actions$.pipe(
+ ofType(ClusterStatusActions.loadComponentClusterStatusAndOpenDialog),
+ map((action) => action.request),
+ switchMap((request) =>
+ from(this.clusterStatusService.getClusterStatus(request.id, request.componentType)).pipe(
+ map((response) => {
+ return ClusterStatusActions.openComponentClusterStatusDialog({
+ response: {
+ clusterStatusEntity: response,
+ componentType: request.componentType
+ }
+ });
+ }),
+ catchError((error) => of(this.errorHelper.handleLoadingError(error.error, error)))
Review Comment:
I don't think we want to be using `handleLoadingError` here. I think we probably want to check the error and see if it should be shown in context and then either use a snackbar or full screen. `handlingLoadingError` accepts an argument that is the current store `status` and uses that as part of the logic to determine how to sure the error message.
--
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-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [NIFI-12537] Open cluster/node dialog from Summary screen. [nifi]
Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman merged PR #8454:
URL: https://github.com/apache/nifi/pull/8454
--
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-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org