Namespace banner bug Secrets Sync (#26790)

* replace transitionTo with router.refresh

* cleanup

* changelog

* nice test catch

* words are hard
This commit is contained in:
Angel Garbarino 2024-05-02 13:25:34 -06:00 committed by GitHub
parent 6d0e4f654e
commit 77d10891b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

3
changelog/26790.txt Normal file
View file

@ -0,0 +1,3 @@
```release-note:bug
ui: Refresh model within a namespace on the Secrets Sync overview page.
```

View file

@ -75,7 +75,8 @@ export default class SyncSecretsDestinationsPageComponent extends Component<Args
yield this.store
.adapterFor('application')
.ajax('/v1/sys/activation-flags/secrets-sync/activate', 'POST', { namespace: null });
this.router.transitionTo('vault.cluster.sync.secrets.overview');
// must refresh and not transition because transition does not refresh the model from within a namespace
yield this.router.refresh();
} catch (error) {
this.error = errorMessage(error);
this.flashMessages.danger(`Error enabling feature \n ${errorMessage(error)}`);

View file

@ -148,8 +148,8 @@ module('Acceptance | sync | overview', function (hooks) {
});
test('it should make activation-flag requests to correct namespace', async function (assert) {
assert.expect(3);
assert.expect(4);
// should call GET activation-flags twice because we need an updated response after activating the feature
this.server.get('/sys/activation-flags', (_, req) => {
assert.deepEqual(req.requestHeaders, {}, 'Request is unauthenticated and in root namespace');
return {