]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: rbd-mirroring - hide create/import token buttons for 69282/head
authorAashish Sharma <aashish@li-e9bf2ecc-2ad7-11b2-a85c-baf05c5182ab.ibm.com>
Thu, 4 Jun 2026 09:55:45 +0000 (15:25 +0530)
committerAashish Sharma <aashish@li-e9bf2ecc-2ad7-11b2-a85c-baf05c5182ab.ibm.com>
Thu, 11 Jun 2026 05:08:49 +0000 (10:38 +0530)
read-only users

Fixes: https://tracker.ceph.com/issues/77115
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.ts

index 0e708ed4354a59381c3c19f5d0ea6ce2f9cff24b..440d6fb100a6222e13bb0cce0c22c647f1ce3fb4 100644 (file)
     <div cdsCol="{md:5}">
       <div class="d-flex flex-row-reverse gap-3">
         <ng-container *ngFor="let action of tableActions">
-          <button type="button"
-                  [cdsButton]="action.buttonKind"
-                  [title]="action.name"
-                  (click)="action.click($event)"
-                  [disabled]="action.disable()"
-                  [attr.aria-label]="action.name"
-                  [attr.data-testid]="action.name"
-                  [preserveFragment]="action.preserveFragment ? '' : null">
-            <span i18n>{{ action.name }}</span>
-            <svg class="cds--btn__icon"
-                 [cdsIcon]="action.icon"
-                 size="16"></svg>
-          </button>
+          @if (!action.visible || action.visible(selection)) {
+            <button
+              type="button"
+              [cdsButton]="action.buttonKind"
+              [title]="action.name"
+              (click)="action.click($event)"
+              [disabled]="action.disable()"
+              [attr.aria-label]="action.name"
+              [attr.data-testid]="action.name"
+              [preserveFragment]="action.preserveFragment ? '' : null">
+              <span i18n>{{ action.name }}</span>
+              <svg
+                class="cds--btn__icon"
+                [cdsIcon]="action.icon"
+                size="16">
+              </svg>
+            </button>
+          }
         </ng-container>
       </div>
     </div>
index c4fef43e021da954ab5c8dc144e52600cfd36e78..efe1d53ea962955360bb0ba79c77a45d4e56b0ad 100644 (file)
@@ -53,6 +53,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
       name: $localize`Create Bootstrap Token`,
       canBePrimary: () => true,
       disable: () => false,
+      visible: () => this.permission.update,
       buttonKind: 'primary'
     };
     const importBootstrapAction: CdTableAction = {
@@ -61,6 +62,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
       click: () => this.importBootstrapModal(),
       name: $localize`Import Bootstrap Token`,
       disable: () => false,
+      visible: () => this.permission.update,
       buttonKind: 'tertiary'
     };
     this.tableActions = [createBootstrapAction, importBootstrapAction];