NIFI-13138 Add Bundle extensions name and description in NiFi Registry

This closes #8740

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Pierre Villard 2024-05-03 18:24:10 +02:00 committed by exceptionfactory
parent 210e0b1655
commit b768b23e0f
No known key found for this signature in database
4 changed files with 109 additions and 12 deletions

View File

@ -142,19 +142,70 @@ limitations under the License.
</ul>
</div>
</div>
<div fxLayout="row" class="mat-body-3">
<mat-expansion-panel class="dep-panel" (opened)="version = nfRegistryService.getDropletSnapshotExtensionsDetails(snapshotMeta)">
<mat-expansion-panel-header class="dep-panel">
<mat-panel-title>
Extensions:
</mat-panel-title>
</mat-expansion-panel-header>
<ul *ngIf="snapshotMeta.extensionDetails">
<li>{{ nfRegistryService.getExtensionNumber(snapshotMeta.extensionDetails, 'PROCESSOR') }} Processors</li>
<ul>
<ng-container *ngFor="let extension of (snapshotMeta.extensionDetails || [])">
<li *ngIf="extension.type === 'PROCESSOR'">
<b>{{extension.name}}</b>: {{extension.description}}
</li>
</ng-container>
</ul>
<li>{{ nfRegistryService.getExtensionNumber(snapshotMeta.extensionDetails, 'CONTROLLER_SERVICE') }} Controller Services</li>
<ul>
<ng-container *ngFor="let extension of (snapshotMeta.extensionDetails || [])">
<li *ngIf="extension.type === 'CONTROLLER_SERVICE'">
<b>{{extension.name}}</b>: {{extension.description}}
</li>
</ng-container>
</ul>
<li>{{ nfRegistryService.getExtensionNumber(snapshotMeta.extensionDetails, 'REPORTING_TASK') }} Reporting Tasks</li>
<ul>
<ng-container *ngFor="let extension of (snapshotMeta.extensionDetails || [])">
<li *ngIf="extension.type === 'REPORTING_TASK'">
<b>{{extension.name}}</b>: {{extension.description}}
</li>
</ng-container>
</ul>
<li>{{ nfRegistryService.getExtensionNumber(snapshotMeta.extensionDetails, 'PARAMETER_PROVIDER') }} Parameter Providers</li>
<ul>
<ng-container *ngFor="let extension of (snapshotMeta.extensionDetails || [])">
<li *ngIf="extension.type === 'PARAMETER_PROVIDER'">
<b>{{extension.name}}</b>: {{extension.description}}
</li>
</ng-container>
</ul>
<li>{{ nfRegistryService.getExtensionNumber(snapshotMeta.extensionDetails, 'FLOW_ANALYSIS_RULE') }} Flow Analysis Rules</li>
<ul>
<ng-container *ngFor="let extension of (snapshotMeta.extensionDetails || [])">
<li *ngIf="extension.type === 'FLOW_ANALYSIS_RULE'">
<b>{{extension.name}}</b>: {{extension.description}}
</li>
</ng-container>
</ul>
</ul>
</mat-expansion-panel>
</div>
<div fxLayout="row" class="mat-body-3">
<mat-expansion-panel class="dep-panel" (opened)="version = nfRegistryService.getDropletSnapshotVersionDetails(snapshotMeta)">
<mat-expansion-panel-header class="dep-panel">
<mat-panel-title>
Dependencies:
</mat-panel-title>
</mat-expansion-panel-header>
<ul *ngIf="snapshotMeta.versionDetails">
<li *ngFor="let dep of (snapshotMeta.versionDetails.dependencies || [])">
{{dep.groupId}}:{{dep.artifactId}}:{{dep.version}}
</li>
</ul>
</mat-expansion-panel>
<mat-expansion-panel-header class="dep-panel">
<mat-panel-title>
Dependencies:
</mat-panel-title>
</mat-expansion-panel-header>
<ul *ngIf="snapshotMeta.versionDetails">
<li *ngFor="let dep of (snapshotMeta.versionDetails.dependencies || [])">
{{dep.groupId}}:{{dep.artifactId}}:{{dep.version}}
</li>
</ul>
</mat-expansion-panel>
</div>
<div *ngIf="snapshotMeta.comments" fxLayout="row" class="mat-body-2">
{{snapshotMeta.comments}}

View File

@ -102,6 +102,31 @@ NfRegistryApi.prototype = {
);
},
/**
* Retrieves the extension details for an existing snapshot the registry has stored.
*
* @param {string} versionUri The uri of the version to request.
* @returns {*}
*/
getDropletSnapshotExtensionsDetails: function (versionUri) {
var self = this;
var url = '../nifi-registry-api/' + versionUri + '/extensions';
return this.http.get(url).pipe(
map(function (response) {
return response;
}),
catchError(function (error) {
self.dialogService.openConfirm({
title: 'Error',
message: error.error,
acceptButton: 'Ok',
acceptButtonColor: 'fds-warn'
});
return of(error);
})
);
},
/**
* Retrieves the specified versioned flow snapshot for an existing droplet the registry has stored.
*

View File

@ -573,6 +573,27 @@ NfRegistryService.prototype = {
});
},
/**
* Retrieves the extension details for the given snapshot.
*
* @param snapshot The snapshot.
*/
getDropletSnapshotExtensionsDetails: function (snapshot) {
this.api.getDropletSnapshotExtensionsDetails(snapshot.link.href, true).subscribe(function (extensionDetails) {
snapshot.extensionDetails = extensionDetails;
});
},
/**
* Retrieves the number of extensions for a given type
*
* @param extensionDetails The extension details.
* @param type The type.
*/
getExtensionNumber: function (extensionDetails, type) {
return (extensionDetails || []).filter((e) => e.type === type).length;
},
/**
* Sort `filteredDroplets` by `column`.
*

View File

@ -70,7 +70,7 @@ button.nf-registry-change-log-refresh.mat-icon-button {
mat-expansion-panel.dep-panel {
background: none;
box-shadow: none !important;
width: 50%;
width: 80%;
}
mat-expansion-panel-header.dep-panel {