Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NIFI-13053] Cluster page #8685

Merged
merged 11 commits into from Apr 25, 2024
Merged

[NIFI-13053] Cluster page #8685

merged 11 commits into from Apr 25, 2024

Conversation

rfellows
Copy link
Contributor

NIFI-13053

  • New Cluster page accessible from the main menu
  • Listings for:
    • Nodes
    • System
    • JVM
    • FlowFile Storage
    • Content Storage
    • Provenance Storage
    • Versions

All table here extend a base table ClusterTable and leverage the same filter component. The "Storage" pages all share the same same table implementation.

@rfellows rfellows added the new ui Pull requests for work relating to the new user interface being developed. label Apr 22, 2024
@mcgilman
Copy link
Contributor

Will review...

@mcgilman mcgilman self-requested a review April 22, 2024 18:04
Copy link
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @rfellows! I've left a few comments below. Most are minor but did notice one bigger issue. In the existing NiFi UI, the tabs that are populated through system diagnostics are hidden when the user lacks those permissions.

const routes: Routes = [
{
path: '',
component: Cluster,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the changes to navigation.component.html we should be using the authorizationGuard to ensure the user has:

user.controllerPermissions.canRead

Comment on lines 95 to 106
from(this.clusterService.disconnectNode(request.nodeId)).pipe(
map((entity) => {
this.dialog.closeAll();
return ClusterListingActions.updateNodeSuccess({ response: entity });
}),
catchError((errorResponse: HttpErrorResponse) => {
this.dialog.closeAll();
return of(ClusterListingActions.clusterNodeSnackbarError({ error: errorResponse.error }));
})
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The this.dialog.closeAll() in this effect is unnecessary. The YesNoDialog does not stay open when the user presses Yes or No.

Comment on lines 136 to 145
from(this.clusterService.connectNode(request.nodeId)).pipe(
map((entity) => {
this.dialog.closeAll();
return ClusterListingActions.updateNodeSuccess({ response: entity });
}),
catchError((errorResponse: HttpErrorResponse) => {
this.dialog.closeAll();
return of(ClusterListingActions.clusterNodeSnackbarError({ error: errorResponse.error }));
})
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The this.dialog.closeAll() in this effect is unnecessary. The YesNoDialog does not stay open when the user presses Yes or No.

Comment on lines 177 to 184
from(this.clusterService.offloadNode(request.nodeId)).pipe(
map((entity) => {
this.dialog.closeAll();
return ClusterListingActions.updateNodeSuccess({ response: entity });
}),
catchError((errorResponse: HttpErrorResponse) => {
this.dialog.closeAll();
return of(ClusterListingActions.clusterNodeSnackbarError({ error: errorResponse.error }));
})
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The this.dialog.closeAll() in this effect is unnecessary. The YesNoDialog does not stay open when the user presses Yes or No.

Comment on lines 218 to 223
from(this.clusterService.removeNode(request.nodeId)).pipe(
map(() => {
this.dialog.closeAll();
return ClusterListingActions.removeNodeSuccess({ response: request });
}),
catchError((errorResponse: HttpErrorResponse) => {
this.dialog.closeAll();
return of(ClusterListingActions.clusterNodeSnackbarError({ error: errorResponse.error }));
})
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The this.dialog.closeAll() in this effect is unnecessary. The YesNoDialog does not stay open when the user presses Yes or No.

return this._initialSortDirection;
}

@Input({}) set components(components: T[]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this {} empty object needed here?

<!-- Node Address -->
<ng-container matColumnDef="address">
<th mat-header-cell *matHeaderCellDef mat-sort-header title="Node Address">
<div class="flex-1 overflow-ellipsis overflow-hidden whitespace-nowrap">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that flex-1 isn needed in our column headers. This would apply to all headers in all tables in this PR.

Comment on lines 18 to 19
.cluster-table-filter-container {
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed?

import { ClusterVersionTable } from './cluster-version-table.component';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

describe('ClusterVersionTableComponent', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
describe('ClusterVersionTableComponent', () => {
describe('ClusterVersionTable', () => {

Comment on lines 41 to 46
{ label: 'System', link: 'system' },
{ label: 'JVM', link: 'jvm' },
{ label: 'FlowFile Storage', link: 'flowfile-storage' },
{ label: 'Content Storage', link: 'content-storage' },
{ label: 'Provenance Storage', link: 'provenance-storage' },
{ label: 'Versions', link: 'versions' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The presence of these tabs should be conditional on the users permissions to System Diagnostics.

Copy link
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @rfellows! Will merge once CI completes.

@mcgilman mcgilman merged commit 0311bff into apache:main Apr 25, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new ui Pull requests for work relating to the new user interface being developed.
Projects
None yet
2 participants