This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new bb44ffe357 NIFI-13050 Add bundle dependencies info in NiFi Registry UI
bb44ffe357 is described below

commit bb44ffe357e081077152357c3813dff696e89356
Author: Pierre Villard <[email protected]>
AuthorDate: Mon Apr 15 21:26:02 2024 +0200

    NIFI-13050 Add bundle dependencies info in NiFi Registry UI
    
    This closes #8651
    
    Signed-off-by: David Handermann <[email protected]>
---
 .../registry/nf-registry-grid-list-viewer.html     | 14 ++++++++++++
 .../src/main/webapp/services/nf-registry.api.js    | 25 ++++++++++++++++++++++
 .../main/webapp/services/nf-registry.service.js    | 11 ++++++++++
 .../explorer/grid-list/_structureElements.scss     | 18 ++++++++++++++++
 4 files changed, 68 insertions(+)

diff --git 
a/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/components/explorer/grid-list/registry/nf-registry-grid-list-viewer.html
 
b/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/components/explorer/grid-list/registry/nf-registry-grid-list-viewer.html
index eeb73dd6d6..4a5e34e5b2 100644
--- 
a/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/components/explorer/grid-list/registry/nf-registry-grid-list-viewer.html
+++ 
b/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/components/explorer/grid-list/registry/nf-registry-grid-list-viewer.html
@@ -142,6 +142,20 @@ limitations under the License.
                                                     </ul>
                                                 </div>
                                             </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>
+                                            </div>
                                             <div *ngIf="snapshotMeta.comments" 
fxLayout="row" class="mat-body-2">
                                                 {{snapshotMeta.comments}}
                                             </div>
diff --git 
a/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.api.js
 
b/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.api.js
index fbc6740afe..836a06ae6a 100644
--- 
a/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.api.js
+++ 
b/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.api.js
@@ -77,6 +77,31 @@ NfRegistryApi.prototype = {
         );
     },
 
+    /**
+     * Retrieves the version details for an existing snapshot the registry has 
stored.
+     *
+     * @param {string}  versionUri     The uri of the version to request.
+     * @returns {*}
+     */
+    getDropletSnapshotVersionDetails: function (versionUri) {
+        var self = this;
+        var url = '../nifi-registry-api/' + versionUri;
+        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.
      *
diff --git 
a/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.service.js
 
b/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.service.js
index c5d1a5cc88..4fa5a4bb72 100644
--- 
a/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.service.js
+++ 
b/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/services/nf-registry.service.js
@@ -562,6 +562,17 @@ NfRegistryService.prototype = {
         });
     },
 
+    /**
+     * Retrieves the snapshot version details for the given snapshot.
+     *
+     * @param snapshot       The snapshot.
+     */
+    getDropletSnapshotVersionDetails: function (snapshot) {
+        this.api.getDropletSnapshotVersionDetails(snapshot.link.href, 
true).subscribe(function (versionDetails) {
+            snapshot.versionDetails = versionDetails;
+        });
+    },
+
     /**
      * Sort `filteredDroplets` by `column`.
      *
diff --git 
a/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/theming/components/explorer/grid-list/_structureElements.scss
 
b/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/theming/components/explorer/grid-list/_structureElements.scss
index ddf48b1800..5717261b15 100644
--- 
a/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/theming/components/explorer/grid-list/_structureElements.scss
+++ 
b/nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/webapp/theming/components/explorer/grid-list/_structureElements.scss
@@ -66,3 +66,21 @@ button.nf-registry-change-log-refresh.mat-icon-button {
     font-size: 12px;
     color: #5a656d;
 }
+
+mat-expansion-panel.dep-panel {
+    background: none;
+    box-shadow: none !important;
+    width: 50%;
+}
+
+mat-expansion-panel-header.dep-panel {
+    padding-left: 0;
+}
+
+mat-expansion-panel-header.mat-expanded.dep-panel {
+    height: 48px;
+}
+
+.mat-expansion-panel-body {
+    padding-left: 0 !important;
+}
\ No newline at end of file

Reply via email to