Icu 6657 auth method model fragments refactor (#1507)
* refactor: 💡 Remove fragment usage for arrays in auth method * chore: 🤖 Remove ember-data-model-fragments ✅ Closes: ICU-6657
This commit is contained in:
1 parent
f8429b15e9
commit
c3d9fd8fc5
32 files changed
+161
-341
No files matched your search
@@ -71,4 +71,34 @@ export default class GeneratedAuthMethodModel extends BaseModel {
|
||||
disable_discovered_config_validation;
|
||||
|
||||
@attr('boolean', { isNestedAttribute: true }) dry_run;
|
||||
|
||||
@attr('string-array', {
|
||||
emptyArrayIfMissing: true,
|
||||
isNestedAttribute: true,
|
||||
})
|
||||
claims_scopes;
|
||||
|
||||
@attr('string-array', {
|
||||
emptyArrayIfMissing: true,
|
||||
isNestedAttribute: true,
|
||||
})
|
||||
signing_algorithms;
|
||||
|
||||
@attr('string-array', {
|
||||
emptyArrayIfMissing: true,
|
||||
isNestedAttribute: true,
|
||||
})
|
||||
allowed_audiences;
|
||||
|
||||
@attr('string-array', {
|
||||
emptyArrayIfMissing: true,
|
||||
isNestedAttribute: true,
|
||||
})
|
||||
idp_ca_certs;
|
||||
|
||||
@attr('account-claim-map-array', {
|
||||
emptyArrayIfMissing: true,
|
||||
isNestedAttribute: true,
|
||||
})
|
||||
account_claim_maps;
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
// app/initializers/fragment-serializer.js
|
||||
import FragmentAuthMethodAttributesAccountClaimMapSerializer from '../serializers/fragment-auth-method-attributes-account-claim-map';
|
||||
|
||||
export function initialize(application) {
|
||||
application.register(
|
||||
'serializer:fragment-auth-method-attributes-account-claim-map',
|
||||
FragmentAuthMethodAttributesAccountClaimMapSerializer
|
||||
);
|
||||
}
|
||||
|
||||
// Fragment serializers must be manually registered
|
||||
export default {
|
||||
name: 'fragment-auth-method-attributes-account-claim-map',
|
||||
initialize: initialize,
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
// app/initializers/fragment-serializer.js
|
||||
import FragmentStringSerializer from '../serializers/fragment-string';
|
||||
|
||||
export function initialize(application) {
|
||||
application.register('serializer:fragment-string', FragmentStringSerializer);
|
||||
}
|
||||
|
||||
// Fragment serializers must be manually registered
|
||||
export default {
|
||||
name: 'fragment-string',
|
||||
initialize: initialize,
|
||||
};
|
||||
@@ -1,5 +1,4 @@
|
||||
import GeneratedAuthMethodModel from '../generated/models/auth-method';
|
||||
import { fragmentArray } from 'ember-data-model-fragments/attributes';
|
||||
import { equal } from '@ember/object/computed';
|
||||
|
||||
/**
|
||||
@@ -29,36 +28,6 @@ export const options = {
|
||||
export default class AuthMethodModel extends GeneratedAuthMethodModel {
|
||||
// =attributes
|
||||
|
||||
@fragmentArray('fragment-auth-method-attributes-account-claim-map', {
|
||||
emptyArrayIfMissing: true,
|
||||
isNestedAttribute: true,
|
||||
})
|
||||
account_claim_maps;
|
||||
|
||||
@fragmentArray('fragment-string', {
|
||||
emptyArrayIfMissing: true,
|
||||
isNestedAttribute: true,
|
||||
})
|
||||
claims_scopes;
|
||||
|
||||
@fragmentArray('fragment-string', {
|
||||
emptyArrayIfMissing: true,
|
||||
isNestedAttribute: true,
|
||||
})
|
||||
signing_algorithms;
|
||||
|
||||
@fragmentArray('fragment-string', {
|
||||
emptyArrayIfMissing: true,
|
||||
isNestedAttribute: true,
|
||||
})
|
||||
allowed_audiences;
|
||||
|
||||
@fragmentArray('fragment-string', {
|
||||
emptyArrayIfMissing: true,
|
||||
isNestedAttribute: true,
|
||||
})
|
||||
idp_ca_certs;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import Fragment from 'ember-data-model-fragments/fragment';
|
||||
import { attr } from '@ember-data/model';
|
||||
|
||||
export default class FragmentAuthMethodAttributesAccountClaimMapModel extends Fragment {
|
||||
// =attributes (OIDC)
|
||||
|
||||
@attr('string') from;
|
||||
@attr('string') to;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import Fragment from 'ember-data-model-fragments/fragment';
|
||||
import { attr } from '@ember-data/model';
|
||||
|
||||
/**
|
||||
* Represents an item in an array of strings.
|
||||
*/
|
||||
export default class FragmentStringModel extends Fragment {
|
||||
// =attributes
|
||||
|
||||
@attr('string', {
|
||||
description: 'The value of the string.',
|
||||
})
|
||||
value;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
import JSONSerializer from '@ember-data/serializer/json';
|
||||
|
||||
export default class FragmentHostSourceSerializer extends JSONSerializer {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Serializes an account claim to string.
|
||||
* @param {Snapshot} snapshot
|
||||
* @return {string}
|
||||
*/
|
||||
serialize(snapshot) {
|
||||
const from = snapshot.attr('from');
|
||||
const to = snapshot.attr('to');
|
||||
return `${from}=${to}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes account claim strings into JSON API objects.
|
||||
* @param {Model} typeClass
|
||||
* @param {string} value
|
||||
* @return {object}
|
||||
*/
|
||||
normalize(typeClass, value) {
|
||||
const normalizedHash = {
|
||||
from: value.split('=')[0],
|
||||
to: value.split('=')[1],
|
||||
};
|
||||
return super.normalize(typeClass, normalizedHash);
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import JSONSerializer from '@ember-data/serializer/json';
|
||||
|
||||
export default class FragmentStringSerializer extends JSONSerializer {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Serializes a to string.
|
||||
* @param {Snapshot} snapshot
|
||||
* @return {string}
|
||||
*/
|
||||
serialize(snapshot) {
|
||||
return snapshot.attr('value');
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes from strings.
|
||||
* @param {Model} typeClass
|
||||
* @param {string} value
|
||||
* @return {object}
|
||||
*/
|
||||
normalize(typeClass, value) {
|
||||
return super.normalize(typeClass, { value });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import Transform from '@ember-data/serializer/transform';
|
||||
|
||||
export default class AccountClaimMapArrayTransform extends Transform {
|
||||
deserialize(serialized) {
|
||||
const accountClaims = serialized || [];
|
||||
return accountClaims.map((accountClaimString) => ({
|
||||
from: accountClaimString.split('=')[0],
|
||||
to: accountClaimString.split('=')[1],
|
||||
}));
|
||||
}
|
||||
|
||||
serialize(deserialized) {
|
||||
const accountClaims = deserialized || [];
|
||||
return accountClaims.map(({ from, to }) => `${from}=${to}`);
|
||||
}
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
export {
|
||||
default,
|
||||
initialize,
|
||||
} from 'api/initializers/fragment-auth-method-attributes-account-claim-map-serializer';
|
||||
@@ -1 +0,0 @@
|
||||
export { default, initialize } from 'api/initializers/fragment-string';
|
||||
@@ -1 +0,0 @@
|
||||
export { default } from 'api/models/fragment-auth-method-attributes-account-claim-map';
|
||||
@@ -1 +0,0 @@
|
||||
export { default } from 'api/models/fragment-string';
|
||||
@@ -1 +0,0 @@
|
||||
export { default } from 'api/serializers/fragment-string';
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from 'api/transforms/account-claim-map-array';
|
||||
@@ -81,7 +81,17 @@ export default function () {
|
||||
return authMethods.create(attrs);
|
||||
});
|
||||
this.get('/auth-methods/:id');
|
||||
this.patch('/auth-methods/:id');
|
||||
this.patch(
|
||||
'/auth-methods/:id',
|
||||
function ({ authMethods }, { params: { id } }) {
|
||||
const attrs = this.normalizedRequestAttrs();
|
||||
if (attrs.type === 'oidc') {
|
||||
attrs.attributes.state = 'active-public';
|
||||
}
|
||||
|
||||
return authMethods.find(id).update(attrs);
|
||||
}
|
||||
);
|
||||
this.del('/auth-methods/:id', ({ authMethods }, { params: { id } }) => {
|
||||
const authMethod = authMethods.find(id);
|
||||
const scope = authMethod.scope;
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
"ember-cli-babel": "^7.26.10",
|
||||
"ember-cli-htmlbars": "^6.1.0",
|
||||
"ember-cli-mirage": "^2.2.0",
|
||||
"ember-copy": "^2.0.1",
|
||||
"ember-data": "^3.20.0",
|
||||
"ember-data-model-fragments": "5.0.0-beta.2",
|
||||
"ember-fetch": "^8.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -50,7 +50,6 @@
|
||||
"ember-cli-inject-live-reload": "^2.1.0",
|
||||
"ember-cli-sri": "^2.1.1",
|
||||
"ember-cli-terser": "^4.0.2",
|
||||
"ember-copy": "^2.0.1",
|
||||
"ember-disable-prototype-extensions": "^1.1.3",
|
||||
"ember-export-application-global": "^2.0.1",
|
||||
"ember-load-initializers": "^2.1.2",
|
||||
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
import Application from '@ember/application';
|
||||
|
||||
import { initialize } from 'dummy/initializers/fragment-auth-method-attributes-account-claim-map-serializer';
|
||||
import { module, test } from 'qunit';
|
||||
import Resolver from 'ember-resolver';
|
||||
import { run } from '@ember/runloop';
|
||||
|
||||
module(
|
||||
'Unit | Initializer | fragment-auth-method-attributes-account-claim-map-serializer',
|
||||
function (hooks) {
|
||||
hooks.beforeEach(function () {
|
||||
this.TestApplication = class TestApplication extends Application {};
|
||||
this.TestApplication.initializer({
|
||||
name: 'initializer under test',
|
||||
initialize,
|
||||
});
|
||||
|
||||
this.application = this.TestApplication.create({
|
||||
autoboot: false,
|
||||
Resolver,
|
||||
});
|
||||
});
|
||||
|
||||
hooks.afterEach(function () {
|
||||
run(this.application, 'destroy');
|
||||
});
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it works', async function (assert) {
|
||||
await this.application.boot();
|
||||
|
||||
assert.ok(true);
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -1,32 +0,0 @@
|
||||
import Application from '@ember/application';
|
||||
|
||||
import { initialize } from 'dummy/initializers/fragment-string';
|
||||
import { module, test } from 'qunit';
|
||||
import Resolver from 'ember-resolver';
|
||||
import { run } from '@ember/runloop';
|
||||
|
||||
module('Unit | Initializer | fragment-string', function (hooks) {
|
||||
hooks.beforeEach(function () {
|
||||
this.TestApplication = class TestApplication extends Application {};
|
||||
this.TestApplication.initializer({
|
||||
name: 'initializer under test',
|
||||
initialize,
|
||||
});
|
||||
|
||||
this.application = this.TestApplication.create({
|
||||
autoboot: false,
|
||||
Resolver,
|
||||
});
|
||||
});
|
||||
|
||||
hooks.afterEach(function () {
|
||||
run(this.application, 'destroy');
|
||||
});
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it works', async function (assert) {
|
||||
await this.application.boot();
|
||||
|
||||
assert.ok(true);
|
||||
});
|
||||
});
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module(
|
||||
'Unit | Model | fragment auth method attributes account claim map',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord(
|
||||
'fragment-auth-method-attributes-account-claim-map',
|
||||
{}
|
||||
);
|
||||
assert.ok(model);
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -1,12 +0,0 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Model | fragment string', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('fragment-string', {});
|
||||
assert.ok(model);
|
||||
});
|
||||
});
|
||||
@@ -157,16 +157,10 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
this.server.get('/v1/auth-methods/oidc123', () => ({
|
||||
attributes: {
|
||||
account_claim_maps: ['from=to', 'foo=bar'],
|
||||
claims_scopes: [{ value: 'profile' }, { value: 'email' }],
|
||||
signing_algorithms: [{ value: 'RS256' }, { value: 'RS384' }],
|
||||
allowed_audiences: [
|
||||
{ value: 'www.alice.com' },
|
||||
{ value: 'www.alice.com/admin' },
|
||||
],
|
||||
idp_ca_certs: [
|
||||
{ value: 'certificate-1234' },
|
||||
{ value: 'certificate-5678' },
|
||||
],
|
||||
claims_scopes: ['profile', 'email'],
|
||||
signing_algorithms: ['RS256', 'RS384'],
|
||||
allowed_audiences: ['www.alice.com', 'www.alice.com/admin'],
|
||||
idp_ca_certs: ['certificate-1234', 'certificate-5678'],
|
||||
api_url_prefix: apiUrlPrefix,
|
||||
client_id: clientId,
|
||||
client_secret: clientSecret,
|
||||
@@ -181,12 +175,31 @@ module('Unit | Serializer | auth method', function (hooks) {
|
||||
}));
|
||||
|
||||
const record = await store.findRecord('auth-method', 'oidc123');
|
||||
const { account_claim_maps } = record;
|
||||
|
||||
assert.strictEqual(account_claim_maps.firstObject.from, 'from');
|
||||
assert.strictEqual(account_claim_maps.firstObject.to, 'to');
|
||||
assert.strictEqual(account_claim_maps.lastObject.from, 'foo');
|
||||
assert.strictEqual(account_claim_maps.lastObject.to, 'bar');
|
||||
const {
|
||||
account_claim_maps,
|
||||
claims_scopes,
|
||||
allowed_audiences,
|
||||
signing_algorithms,
|
||||
idp_ca_certs,
|
||||
} = record;
|
||||
console.log(record);
|
||||
assert.deepEqual(account_claim_maps, [
|
||||
{ from: 'from', to: 'to' },
|
||||
{ from: 'foo', to: 'bar' },
|
||||
]);
|
||||
assert.deepEqual(claims_scopes, [{ value: 'profile' }, { value: 'email' }]);
|
||||
assert.deepEqual(allowed_audiences, [
|
||||
{ value: 'www.alice.com' },
|
||||
{ value: 'www.alice.com/admin' },
|
||||
]);
|
||||
assert.deepEqual(signing_algorithms, [
|
||||
{ value: 'RS256' },
|
||||
{ value: 'RS384' },
|
||||
]);
|
||||
assert.deepEqual(idp_ca_certs, [
|
||||
{ value: 'certificate-1234' },
|
||||
{ value: 'certificate-5678' },
|
||||
]);
|
||||
assert.strictEqual(record.api_url_prefix, apiUrlPrefix);
|
||||
assert.strictEqual(record.client_id, clientId);
|
||||
assert.strictEqual(record.client_secret, clientSecret);
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Serializer | fragment string', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let serializer = store.serializerFor('fragment-string');
|
||||
|
||||
assert.ok(serializer);
|
||||
});
|
||||
|
||||
test('it serializes records', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let record = store.createRecord('fragment-string', {
|
||||
value: 'string value',
|
||||
});
|
||||
|
||||
let serializedRecord = record.serialize();
|
||||
|
||||
assert.strictEqual(serializedRecord, 'string value');
|
||||
});
|
||||
|
||||
test('it normalizes records', function (assert) {
|
||||
assert.expect(1);
|
||||
const store = this.owner.lookup('service:store');
|
||||
const serializer = store.serializerFor('fragment-string');
|
||||
const modelClass = store.createRecord('fragment-string').constructor;
|
||||
const payload = 'string value';
|
||||
const normalized = serializer.normalizeSingleResponse(
|
||||
store,
|
||||
modelClass,
|
||||
payload
|
||||
);
|
||||
assert.deepEqual(normalized, {
|
||||
included: [],
|
||||
data: {
|
||||
id: null,
|
||||
type: 'fragment-string',
|
||||
attributes: {
|
||||
value: 'string value',
|
||||
},
|
||||
relationships: {},
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Transform | account claim map array', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it deserializes an array of account claims', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:account-claim-map-array');
|
||||
const deserialized = transform.deserialize(['oid=sub', 'full_name=name']);
|
||||
assert.deepEqual(deserialized, [
|
||||
{ from: 'oid', to: 'sub' },
|
||||
{ from: 'full_name', to: 'name' },
|
||||
]);
|
||||
});
|
||||
|
||||
test('it serializes an array of account claims', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:account-claim-map-array');
|
||||
const serialized = transform.serialize([
|
||||
{ from: 'oid', to: 'sub' },
|
||||
{ from: 'full_name', to: 'name' },
|
||||
]);
|
||||
assert.deepEqual(serialized, ['oid=sub', 'full_name=name']);
|
||||
});
|
||||
});
|
||||
@@ -3,7 +3,7 @@ import { set } from '@ember/object';
|
||||
|
||||
export function setFromEvent([context, field]) {
|
||||
// The Ember `set` function is used here because `field` may be in dotted
|
||||
// notation, refering to nested fields within `context`.
|
||||
// notation, referring to nested fields within `context`.
|
||||
return (event) =>
|
||||
event?.target ? set(context, field, event.target.value) : null;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
{{component
|
||||
(concat 'form/auth-method/' @model.type)
|
||||
model=@model
|
||||
edit=@edit
|
||||
submit=@submit
|
||||
cancel=@cancel
|
||||
removeItemByIndex=@removeItemByIndex
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<Rose::Form
|
||||
@edit={{@edit}}
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
|
||||
@@ -165,8 +165,8 @@ export default class ScopesScopeAuthMethodsRoute extends Route {
|
||||
*/
|
||||
@action
|
||||
async removeItemByIndex(authMethod, property, index) {
|
||||
const array = authMethod.get(property);
|
||||
array.removeAt(index);
|
||||
const array = authMethod.get(property).filter((item, i) => i !== index);
|
||||
authMethod.set(property, array);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,21 +179,22 @@ export default class ScopesScopeAuthMethodsRoute extends Route {
|
||||
*/
|
||||
@action
|
||||
async addStringItem(authMethod, property, value) {
|
||||
const array = authMethod.get(property);
|
||||
array.addObject({ value });
|
||||
const existingArray = authMethod[property] ?? [];
|
||||
const array = [...existingArray, { value }];
|
||||
authMethod.set(property, array);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an account claim map fragment to the passed OIDC `authMethod`.
|
||||
* @param {AuthMethodModel} authMethod
|
||||
* @param {string} property
|
||||
* @param {string} value
|
||||
* @param {string} from
|
||||
* @param {string} to
|
||||
*/
|
||||
@action
|
||||
async addAccountClaimMapItem(authMethod, from, to) {
|
||||
const array = authMethod.account_claim_maps;
|
||||
const value = { from, to };
|
||||
array.addObject(value);
|
||||
const existingArray = authMethod.account_claim_maps ?? [];
|
||||
const array = [...existingArray, { from, to }];
|
||||
authMethod.set('account_claim_maps', array);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@ import Route from '@ember/routing/route';
|
||||
import { action } from '@ember/object';
|
||||
import { notifySuccess, notifyError } from 'core/decorators/notify';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { copy } from 'ember-copy';
|
||||
|
||||
export default class ScopesScopeAuthMethodsAuthMethodRoute extends Route {
|
||||
// =services
|
||||
@@ -22,6 +23,35 @@ export default class ScopesScopeAuthMethodsAuthMethodRoute extends Route {
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Copies the contents of string array fields in order to force the instance
|
||||
* into a dirty state. This ensures that `model.rollbackAttributes()` reverts
|
||||
* to the original expected array.
|
||||
*
|
||||
* The deep copy implemented here is required to ensure that both the
|
||||
* array itself and its members are all new.
|
||||
*
|
||||
* @param {authMethodModel} authMethod
|
||||
*/
|
||||
@action
|
||||
edit(authMethod) {
|
||||
if (authMethod.claims_scopes) {
|
||||
authMethod.claims_scopes = copy(authMethod.claims_scopes, true);
|
||||
}
|
||||
if (authMethod.signing_algorithms) {
|
||||
authMethod.signing_algorithms = copy(authMethod.signing_algorithms, true);
|
||||
}
|
||||
if (authMethod.allowed_audiences) {
|
||||
authMethod.allowed_audiences = copy(authMethod.allowed_audiences, true);
|
||||
}
|
||||
if (authMethod.idp_ca_certs) {
|
||||
authMethod.idp_ca_certs = copy(authMethod.idp_ca_certs, true);
|
||||
}
|
||||
if (authMethod.account_claim_maps) {
|
||||
authMethod.account_claim_maps = copy(authMethod.account_claim_maps, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update state of OIDC auth method
|
||||
* @param {string} state
|
||||
|
||||
@@ -32,7 +32,8 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsNewRoute extends
|
||||
*/
|
||||
@action
|
||||
async addStringItem(hostSet, property, value) {
|
||||
const array = [...(hostSet.get(property) ?? []), { value }];
|
||||
const existingArray = hostSet[property] ?? [];
|
||||
const array = [...existingArray, { value }];
|
||||
hostSet.set(property, array);
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<page.body>
|
||||
<Form::AuthMethod
|
||||
@model={{@model}}
|
||||
@edit={{route-action 'edit' @model}}
|
||||
@submit={{route-action 'save' @model}}
|
||||
@cancel={{route-action 'cancel' @model}}
|
||||
@removeItemByIndex={{route-action 'removeItemByIndex' @model}}
|
||||
|
||||
@@ -9841,13 +9841,6 @@ cachedir@2.2.0:
|
||||
resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.2.0.tgz#19afa4305e05d79e417566882e0c8f960f62ff0e"
|
||||
integrity sha512-VvxA0xhNqIIfg0V9AmJkDg91DaJwryutH5rVEZAhcNi4iJFj9f+QxmAjgK1LT9I8OgToX27fypX6/MeCXVbBjQ==
|
||||
|
||||
calculate-cache-key-for-tree@^1.1.0:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/calculate-cache-key-for-tree/-/calculate-cache-key-for-tree-1.2.3.tgz#5a5e4fcfa2d374a63e47fe967593f179e8282825"
|
||||
integrity sha512-PPQorvdNw8K8k7UftCeradwOmKDSDJs8wcqYTtJPEt3fHbZyK8QsorybJA+lOmk0dgE61vX6R+5Kd3W9h4EMGg==
|
||||
dependencies:
|
||||
json-stable-stringify "^1.0.1"
|
||||
|
||||
calculate-cache-key-for-tree@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/calculate-cache-key-for-tree/-/calculate-cache-key-for-tree-2.0.0.tgz#7ac57f149a4188eacb0a45b210689215d3fef8d6"
|
||||
@@ -12765,27 +12758,13 @@ ember-cookies@^0.5.0, ember-cookies@^0.5.2:
|
||||
ember-cli-babel "^7.1.0"
|
||||
ember-getowner-polyfill "^1.1.0 || ^2.0.0"
|
||||
|
||||
ember-copy@2.0.1, ember-copy@^2.0.1:
|
||||
ember-copy@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ember-copy/-/ember-copy-2.0.1.tgz#13192b12a250324bb4a8b4547a680b113f4e3041"
|
||||
integrity sha512-N/XFvZszrzyyX4IcNoeK4mJvIItNuONumhPLqi64T8NDjJkxBj4Pq61rvMkJx/9eZ8alzE4I8vYKOLxT0FvRuQ==
|
||||
dependencies:
|
||||
ember-cli-babel "^7.22.1"
|
||||
|
||||
ember-data-model-fragments@5.0.0-beta.2:
|
||||
version "5.0.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/ember-data-model-fragments/-/ember-data-model-fragments-5.0.0-beta.2.tgz#cc5f6e37363216a227394b31beb8eecc4c267a3e"
|
||||
integrity sha512-LMObs51btOpHFX0DABReU68hpzkZp/yCKCh5w6CSGEm7MM5Bcj8p7Wb4GQIPZANKidVSvdCOT4qnyCREyUatBg==
|
||||
dependencies:
|
||||
broccoli-file-creator "^2.1.1"
|
||||
broccoli-merge-trees "^3.0.0"
|
||||
calculate-cache-key-for-tree "^1.1.0"
|
||||
ember-cli-babel "^7.23.0"
|
||||
ember-compatibility-helpers "^1.2.1"
|
||||
ember-copy "2.0.1"
|
||||
git-repo-info "^2.1.1"
|
||||
npm-git-info "^1.0.3"
|
||||
|
||||
ember-data@^3.20.0:
|
||||
version "3.27.1"
|
||||
resolved "https://registry.yarnpkg.com/ember-data/-/ember-data-3.27.1.tgz#02d6b76c1d5de0f50d24274147b8711f6ca4f28d"
|
||||
|
||||
Reference in new issue
Block a user