fix: 🐛 alias disappearing on target details page (#2519)

* fix: 🐛 alias disappearing on target details page

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-15296

* test: 💍 fix test

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-15296
This commit is contained in:
Lisbet Alvarez authored and GitHub committed 2024-10-15 12:58:43 -07:00
1 parent 2424395415
commit c0d7af7899
5 files changed
+13 -1

No files matched your search

@@ -328,6 +328,7 @@ export default class ScopesScopeTargetsIndexController extends Controller {
async saveWorkerFilter(target) {
await target.save();
await this.router.replaceWith('scopes.scope.targets.target.workers');
await this.router.refresh('scopes.scope.targets.target');
}
/**
@@ -61,6 +61,7 @@ export default class ScopesScopeTargetsTargetAddBrokeredCredentialSourcesControl
this.router.replaceWith(
'scopes.scope.targets.target.brokered-credential-sources',
);
this.router.refresh('scopes.scope.targets.target');
}
/**
@@ -23,6 +23,7 @@ export default class ScopesScopeTargetsTargetAddHostSourcesController extends Co
async save(target, hostSetIDs) {
await target.addHostSources(hostSetIDs);
this.router.replaceWith('scopes.scope.targets.target.host-sources');
this.router.refresh('scopes.scope.targets.target');
}
/**
@@ -60,6 +60,7 @@ export default class ScopesScopeTargetsTargetAddInjectedApplicationCredentialSou
this.router.replaceWith(
'scopes.scope.targets.target.injected-application-credential-sources',
);
this.router.refresh('scopes.scope.targets.target');
}
/**
@@ -25,6 +25,7 @@ module(
project: null,
},
target: null,
hostCatalog: null,
hostSet: null,
};
@@ -53,8 +54,12 @@ module(
instances.target = this.server.create('target', {
scope: instances.scopes.project,
});
instances.hostCatalog = this.server.create('host-catalog', {
scope: instances.scopes.project,
});
instances.hostSet = this.server.create('host-set', {
scope: instances.scopes.project,
hostCatalog: instances.hostCatalog,
});
urls.projectScope = `/scopes/${instances.scopes.project.id}`;
@@ -75,7 +80,10 @@ module(
await controller.save(target, [instances.hostSet.id]);
assert.deepEqual(target.host_sources, [
{ host_source_id: instances.hostSet.id },
{
host_catalog_id: instances.hostCatalog.id,
host_source_id: instances.hostSet.id,
},
]);
});