From: Pedro Gonzalez Gomez Date: Tue, 30 May 2023 11:49:17 +0000 (+0200) Subject: mgr/dashboard: disable promote on mirroring not enabled X-Git-Tag: v17.2.7~217^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2a73ac1edc65d35e60f4855c408647e9a59c14af;p=ceph.git mgr/dashboard: disable promote on mirroring not enabled Fixes: https://tracker.ceph.com/issues/61507 Signed-off-by: Pedro Gonzalez Gomez (cherry picked from commit 999ce877b5fc7da69275d37e7a2b8509effd2c3a) --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts index 6a8910d32328..364143aedb5b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts @@ -214,14 +214,22 @@ export class RbdListComponent extends ListWithDetails implements OnInit { icon: Icons.edit, click: () => this.actionPrimary(true), name: this.actionLabels.PROMOTE, - visible: () => this.selection.first() != null && !this.selection.first().primary + visible: () => this.selection.first() != null && !this.selection.first().primary, + disable: () => + this.selection.first().mirror_mode === 'Disabled' + ? 'Mirroring needs to be enabled on the image to perform this action' + : '' }; const demoteAction: CdTableAction = { permission: 'update', icon: Icons.edit, click: () => this.actionPrimary(false), name: this.actionLabels.DEMOTE, - visible: () => this.selection.first() != null && this.selection.first().primary + visible: () => this.selection.first() != null && this.selection.first().primary, + disable: () => + this.selection.first().mirror_mode === 'Disabled' + ? 'Mirroring needs to be enabled on the image to perform this action' + : '' }; this.tableActions = [ addAction,