diff --git a/ui/app/components/mfa/mfa-login-enforcement-form.js b/ui/app/components/mfa/mfa-login-enforcement-form.js index 868ea1d942..f12f9d279c 100644 --- a/ui/app/components/mfa/mfa-login-enforcement-form.js +++ b/ui/app/components/mfa/mfa-login-enforcement-form.js @@ -74,7 +74,7 @@ export default class MfaLoginEnforcementForm extends Component { const types = ['identity/group', 'identity/entity']; for (const type of types) { try { - options[type] = (await this.store.query(type, {})).slice(); + options[type] = await this.store.query(type, {}); } catch (error) { options[type] = []; } @@ -89,7 +89,7 @@ export default class MfaLoginEnforcementForm extends Component { } } async fetchAuthMethods() { - const mounts = (await this.store.findAll('auth-method')).slice(); + const mounts = await this.store.findAll('auth-method'); this.authMethods = mounts.map((auth) => auth.type); } diff --git a/ui/app/components/mfa/mfa-login-enforcement-header.js b/ui/app/components/mfa/mfa-login-enforcement-header.js index 17ea852e06..03c424213c 100644 --- a/ui/app/components/mfa/mfa-login-enforcement-header.js +++ b/ui/app/components/mfa/mfa-login-enforcement-header.js @@ -41,7 +41,7 @@ export default class MfaLoginEnforcementHeaderComponent extends Component { async fetchEnforcements() { try { // cache initial values for lookup in select handler - this._enforcements = (await this.store.query('mfa-login-enforcement', {})).slice(); + this._enforcements = await this.store.query('mfa-login-enforcement', {}); this.enforcements = [...this._enforcements]; } catch (error) { this.enforcements = []; diff --git a/ui/app/services/wizard.js b/ui/app/services/wizard.js index 89f32ad7a1..b38b3af713 100644 --- a/ui/app/services/wizard.js +++ b/ui/app/services/wizard.js @@ -324,7 +324,7 @@ export default Service.extend(DEFAULTS, { getCompletedFeatures() { if (this.storageHasKey(COMPLETED_FEATURES)) { - return this.getExtState(COMPLETED_FEATURES).slice(); + return this.getExtState(COMPLETED_FEATURES); } return []; }, @@ -337,7 +337,7 @@ export default Service.extend(DEFAULTS, { completed.push(done); this.saveExtState(COMPLETED_FEATURES, completed); } else { - this.saveExtState(COMPLETED_FEATURES, this.getExtState(COMPLETED_FEATURES).slice().addObject(done)); + this.saveExtState(COMPLETED_FEATURES, this.getExtState(COMPLETED_FEATURES).addObject(done)); } this.saveExtState(FEATURE_LIST, features.length ? features : null); diff --git a/ui/lib/core/addon/components/search-select-with-modal.js b/ui/lib/core/addon/components/search-select-with-modal.js index 369cf90ad9..85e66a872a 100644 --- a/ui/lib/core/addon/components/search-select-with-modal.js +++ b/ui/lib/core/addon/components/search-select-with-modal.js @@ -69,7 +69,7 @@ export default class SearchSelectWithModal extends Component { addSearchText(optionsToFormat) { // maps over array models from query - return optionsToFormat.slice().map((option) => { + return optionsToFormat.map((option) => { option.searchText = `${option.name} ${option.id}`; return option; }); diff --git a/ui/lib/core/addon/components/search-select.js b/ui/lib/core/addon/components/search-select.js index 2c76d4f63e..555941ef8b 100644 --- a/ui/lib/core/addon/components/search-select.js +++ b/ui/lib/core/addon/components/search-select.js @@ -100,7 +100,7 @@ export default class SearchSelect extends Component { addSearchText(optionsToFormat) { // maps over array of objects or response from query - return optionsToFormat.slice().map((option) => { + return optionsToFormat.map((option) => { const id = option[this.idKey] ? option[this.idKey] : option.id; option.searchText = `${option[this.nameKey]} ${id}`; return option; diff --git a/ui/mirage/handlers/mfa-config.js b/ui/mirage/handlers/mfa-config.js index f078286379..2563f9b5d8 100644 --- a/ui/mirage/handlers/mfa-config.js +++ b/ui/mirage/handlers/mfa-config.js @@ -50,7 +50,7 @@ export default function (server) { records.push(server.create(`mfa-${type}-method`)); }); } else { - records = server.createList('mfa-login-enforcement', 4).slice(); + records = server.createList('mfa-login-enforcement', 4); } } const dataKey = isMethod ? 'id' : 'name'; diff --git a/ui/tests/helpers/sync/setup-models.js b/ui/tests/helpers/sync/setup-models.js index 7449704f9c..801861d5b1 100644 --- a/ui/tests/helpers/sync/setup-models.js +++ b/ui/tests/helpers/sync/setup-models.js @@ -17,7 +17,7 @@ export function setupModels(hooks) { id: destination.name, }); this.destination = this.store.peekRecord(destinationModelName, destination.name); - this.destinations = this.store.peekAll(destinationModelName).slice(); + this.destinations = this.store.peekAll(destinationModelName); this.destinations.meta = { filteredTotal: this.destinations.length, currentPage: 1, @@ -43,7 +43,7 @@ export function setupModels(hooks) { }); this.association = this.store.peekRecord(associationModelName, associationId); - this.associations = this.store.peekAll(associationModelName).slice(); + this.associations = this.store.peekAll(associationModelName); this.associations.meta = { filteredTotal: this.associations.length, currentPage: 1, diff --git a/ui/tests/integration/components/mfa-login-enforcement-form-test.js b/ui/tests/integration/components/mfa-login-enforcement-form-test.js index 2f61bb12bf..e593f2d19e 100644 --- a/ui/tests/integration/components/mfa-login-enforcement-form-test.js +++ b/ui/tests/integration/components/mfa-login-enforcement-form-test.js @@ -152,7 +152,7 @@ module('Integration | Component | mfa-login-enforcement-form', function (hooks) test('it should populate fields with model data', async function (assert) { this.model.name = 'foo'; - const [method] = (await this.store.query('mfa-method', {})).slice(); + const [method] = await this.store.query('mfa-method', {}); this.model.mfa_methods.addObject(method); this.model.auth_method_accessors.addObject('auth_userpass_1234'); @@ -209,9 +209,9 @@ module('Integration | Component | mfa-login-enforcement-form', function (hooks) })); this.model.auth_method_accessors.addObject('auth_userpass_1234'); this.model.auth_method_types.addObject('userpass'); - const [entity] = (await this.store.query('identity/entity', {})).slice(); + const [entity] = await this.store.query('identity/entity', {}); this.model.identity_entities.addObject(entity); - const [group] = (await this.store.query('identity/group', {})).slice(); + const [group] = await this.store.query('identity/group', {}); this.model.identity_groups.addObject(group); await render(hbs` diff --git a/ui/tests/integration/components/pki-paginated-list-test.js b/ui/tests/integration/components/pki-paginated-list-test.js index f99d6fddb7..f6a7ff065e 100644 --- a/ui/tests/integration/components/pki-paginated-list-test.js +++ b/ui/tests/integration/components/pki-paginated-list-test.js @@ -35,7 +35,7 @@ module('Integration | Component | pki-paginated-list', function (hooks) { }, }); // mimic what happens in lazyPaginatedQuery - const keyModels = this.store.peekAll('pki/key').slice(); + const keyModels = this.store.peekAll('pki/key'); keyModels.meta = STANDARD_META; this.list = keyModels; const emptyList = this.store.peekAll('pki/foo'); diff --git a/ui/tests/integration/components/sync/secrets/page/destinations-test.js b/ui/tests/integration/components/sync/secrets/page/destinations-test.js index ed1f407317..51b93bbf9d 100644 --- a/ui/tests/integration/components/sync/secrets/page/destinations-test.js +++ b/ui/tests/integration/components/sync/secrets/page/destinations-test.js @@ -46,7 +46,7 @@ module('Integration | Component | sync | Page::Destinations', function (hooks) { }); // mimic what happens in lazyPaginatedQuery - this.destinations = store.peekAll(modelName).slice(); + this.destinations = store.peekAll(modelName); this.destinations.meta = { filteredTotal: this.destinations.length, currentPage: 1,