chore: 🤖 misc name changes
This commit is contained in:
8 files changed
+17
-20
No files matched your search
@@ -21,7 +21,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
host_sources;
|
||||
|
||||
/**
|
||||
* Credential library ids are read only and can be
|
||||
* Credential source ids are read only and can be
|
||||
* persisted via a dedicated call to `addCredentialSources()`.
|
||||
*/
|
||||
@fragmentArray('fragment-string', {
|
||||
@@ -55,11 +55,8 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
@computed('application_credential_source_ids.[]', 'store')
|
||||
get credentialLibraries() {
|
||||
return this.application_credential_source_ids
|
||||
.map((credential_library_fragment) =>
|
||||
this.store.peekRecord(
|
||||
'credential-library',
|
||||
credential_library_fragment.value
|
||||
)
|
||||
.map((source) =>
|
||||
this.store.peekRecord('credential-library', source.value)
|
||||
)
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ export default class TargetSerializer extends ApplicationSerializer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a payload containing only the host_source_ids array using IDs
|
||||
* passed into the function (rather than existing host sets on the model).
|
||||
* Returns a payload containing only version and an array of passed IDs,
|
||||
* rather than existing instances on the model.
|
||||
* @param {Snapshot} snapshot
|
||||
* @param {[string]} hostSetIDs
|
||||
* @return {object}
|
||||
@@ -45,10 +45,10 @@ export default class TargetSerializer extends ApplicationSerializer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a payload containing only the credential_library_ids array using IDs
|
||||
* passed into the function (rather than existing credential libraries on the model).
|
||||
* Returns a payload containing only version and an array of passed IDs,
|
||||
* rather than existing instances on the model.
|
||||
* @param {Snapshot} snapshot
|
||||
* @param {[string]} credentialLibraryIDs
|
||||
* @param {[string]} credentialSourceIDs
|
||||
* @return {object}
|
||||
*/
|
||||
serializeWithCredentialSources(snapshot, credentialSourceIDs) {
|
||||
|
||||
@@ -367,7 +367,7 @@ export default function () {
|
||||
const updatedAttrs = {
|
||||
version: attrs.version,
|
||||
};
|
||||
// If adding host sets, push them into the array
|
||||
// If adding host sources, push them into the array
|
||||
if (method === 'add-host-sources') {
|
||||
updatedAttrs.hostSetIds = target.hostSetIds;
|
||||
attrs.hostSourceIds.forEach((id) => {
|
||||
@@ -376,14 +376,14 @@ export default function () {
|
||||
}
|
||||
});
|
||||
}
|
||||
// If deleting host sets, filter them out of the array
|
||||
// If deleting host sources, filter them out of the array
|
||||
if (method === 'remove-host-sources') {
|
||||
updatedAttrs.hostSetIds = target.hostSetIds;
|
||||
updatedAttrs.hostSetIds = updatedAttrs.hostSetIds.filter((id) => {
|
||||
return !attrs.hostSourceIds.includes(id);
|
||||
});
|
||||
}
|
||||
// If adding credential libraries, push them into the array
|
||||
// If adding credential sources, push them into the array
|
||||
if (method === 'add-credential-sources') {
|
||||
updatedAttrs.credentialLibraryIds = target.credentialLibraryIds;
|
||||
attrs.applicationCredentialSourceIds.forEach((id) => {
|
||||
@@ -392,7 +392,7 @@ export default function () {
|
||||
}
|
||||
});
|
||||
}
|
||||
// If deleting credential libraries, filter them out of the array
|
||||
// If deleting credential sources, filter them out of the array
|
||||
if (method === 'remove-credential-sources') {
|
||||
updatedAttrs.credentialLibraryIds = target.credentialLibraryIds;
|
||||
updatedAttrs.credentialLibraryIds =
|
||||
|
||||
@@ -123,7 +123,7 @@ module('Unit | Serializer | target', function (hooks) {
|
||||
});
|
||||
});
|
||||
|
||||
test('it normalizes missing host_sources and credential libraries to empty array', function (assert) {
|
||||
test('it normalizes missing host_sources and application_credential_source_ids to empty array', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('target');
|
||||
|
||||
@@ -32,7 +32,7 @@ export default class FormTargetAddCredentialLibrariesIndexComponent extends Comp
|
||||
// Get IDs for credential libraries already added to the current target
|
||||
const currentCredentialLibraryIDs =
|
||||
this.args.model.application_credential_source_ids.map(
|
||||
(credentialLibrary) => credentialLibrary.value
|
||||
(source) => source.value
|
||||
);
|
||||
const notAddedCredentialLibraries = this.args.credentialLibraries.filter(
|
||||
({ id }) => !currentCredentialLibraryIDs.includes(id)
|
||||
|
||||
@@ -82,7 +82,7 @@ export default class ScopesScopeTargetsTargetAddCredentialSourcesRoute extends R
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to target credential libraries as if nothing ever happened.
|
||||
* Redirect to target credential sources as if nothing ever happened.
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
|
||||
@@ -76,7 +76,7 @@ export default class ScopesScopeTargetsTargetAddHostSourcesRoute extends Route {
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to target host sets as if nothing ever happened.
|
||||
* Redirect to target host sources as if nothing ever happened.
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
|
||||
@@ -65,7 +65,7 @@ module('Acceptance | targets | host-sources', function (hooks) {
|
||||
authenticateSession({});
|
||||
});
|
||||
|
||||
test('visiting target host sets', async function (assert) {
|
||||
test('visiting target host sources', async function (assert) {
|
||||
assert.expect(3);
|
||||
const targetHostSetCount = instances.target.hostSets.length;
|
||||
await visit(urls.targetHostSources);
|
||||
|
||||
Reference in new issue
Block a user