Transit Active Tab (#25614)

* fixes issue with no active tab in transit show route

* adds changelog

* updates test assertion
This commit is contained in:
Jordan Reimer 2024-02-26 09:02:05 -07:00 committed by GitHub
parent 15238e3819
commit d4706b5318
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 3 deletions

3
changelog/25614.txt Normal file
View file

@ -0,0 +1,3 @@
```release-note:bug
ui: Fixes issue with no active tab when viewing transit encryption key
```

View file

@ -80,7 +80,7 @@ export default Component.extend(FocusOnInsertMixin, {
'save',
() => {
this.hasDataChanges();
this.transitionToRoute(SHOW_ROUTE, keyId);
this.transitionToRoute(SHOW_ROUTE, keyId, { queryParams: { tab: 'details' } });
},
type === 'create'
);

View file

@ -100,7 +100,13 @@
</div>
{{/if}}
<div class="control">
<Hds::Button @text="Cancel" @color="secondary" @route="vault.cluster.secrets.backend.show" @model={{@key.id}} />
<Hds::Button
@text="Cancel"
@color="secondary"
@route="vault.cluster.secrets.backend.show"
@model={{@key.id}}
@query={{hash tab="details"}}
/>
</div>
</div>
{{#if (and @key.canDelete @capabilities.canDelete)}}

View file

@ -237,7 +237,11 @@ module('Acceptance | transit (flaky)', function (hooks) {
await click('[data-test-toggle-label="Auto-rotation period"]');
await click(SELECTORS.form('create'));
assert.strictEqual(currentURL(), `/vault/secrets/${this.path}/show/${name}`, 'it navigates to show page');
assert.strictEqual(
currentURL(),
`/vault/secrets/${this.path}/show/${name}?tab=details`,
'it navigates to show page'
);
assert.dom(SELECTORS.infoRow('Auto-rotation period')).hasText('30 days');
assert.dom(SELECTORS.infoRow('Deletion allowed')).hasText('false');
assert.dom(SELECTORS.infoRow('Derived')).hasText('Yes');