hide unload action in non root namespaces (#9718) (#9741)

Co-authored-by: lane-wetmore <lane.wetmore@hashicorp.com>
This commit is contained in:
Vault Automation 2025-09-29 18:47:03 -04:00 committed by GitHub
parent 0154b89fd3
commit bcd98f23e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -48,7 +48,9 @@
@route="vault.cluster.recovery.snapshots.snapshot.manage"
@models={{array @model.snapshot.snapshot_id}}
>Manage secrets</dd.Interactive>
<dd.Interactive @color="critical" @icon="trash" {{on "click" this.unloadSnapshot}}>Unload snapshot</dd.Interactive>
{{#if this.namespace.inRootNamespace}}
<dd.Interactive @color="critical" @icon="trash" {{on "click" this.unloadSnapshot}}>Unload snapshot</dd.Interactive>
{{/if}}
</Hds::Dropdown>
</B.Td>
</B.Tr>

View file

@ -14,6 +14,7 @@ import { dateFormat } from 'core/helpers/date-format';
import { tracked } from '@glimmer/tracking';
import type ApiService from 'vault/services/api';
import type NamespaceService from 'vault/services/namespace';
import type RouterService from '@ember/routing/router-service';
import type { SnapshotManageModel } from 'vault/routes/vault/cluster/recovery/snapshots/snapshot/manage';
import type FlashMessageService from 'vault/services/flash-messages';
@ -25,6 +26,7 @@ interface Args {
export default class SnapshotDetails extends Component<Args> {
@service declare readonly api: ApiService;
@service declare readonly flashMessages: FlashMessageService;
@service declare readonly namespace: NamespaceService;
@service declare readonly router: RouterService;
@tracked snapshotStatus?: string = '';