fix: 🐛 toarray deprecation warning (#1865)

This commit is contained in:
Dharini Jeeva authored and GitHub committed 2023-08-25 09:43:02 -07:00
1 parent 638753d7bc
commit 3f731867ac
5 files changed
+12 -8

No files matched your search

@@ -5,12 +5,17 @@
import { registerDeprecationHandler } from '@ember/debug';
const deprecationList = [
'ember-data:deprecate-early-static',
'ember-data:deprecate-array-like',
];
export function initialize() {
registerDeprecationHandler((message, options, next) => {
// TODO: fix `deprecate-early-static` warning before ember 5 upgrade
// TODO: fix `deprecate-early-static` and `deprecate-array-prototype-extension` warning before ember 5 upgrade
//silence deprecate-early-static warnings till we find a way to
//fix ember-cli-mirage discoverEmberDataModels
if (options?.id === 'ember-data:deprecate-early-static') {
if (options?.id && deprecationList.includes(options.id)) {
return;
}
if (options?.url) {
@@ -46,7 +46,7 @@ export default class ScopesScopeRolesRoleAddPrincipalsRoute extends Route {
*/
async model() {
const role = this.modelFor('scopes.scope.roles.role');
const scopes = this.store.peekAll('scope').toArray();
const scopes = this.store.peekAll('scope');
const scopeIDs = this.scope?.map((scope) => scope.id);
const users = scopeIDs?.length
? this.resourceFilterStore.queryBy(
@@ -41,8 +41,8 @@ export default class ScopesScopeTargetsTargetEnableSessionRecordingIndexRoute ex
});
const storageBucketList = [
...globalScopeStorageBuckets.toArray(),
...orgScopeStorageBuckets.toArray(),
...globalScopeStorageBuckets,
...orgScopeStorageBuckets,
];
this.storageBucketList = storageBucketList;
}
+1 -2
View File
@@ -14,7 +14,6 @@ export default class ScopesScopeUsersRoute extends Route {
// =services
@service store;
@service intl;
@service session;
@service can;
@service router;
@@ -32,7 +31,7 @@ export default class ScopesScopeUsersRoute extends Route {
* Load all users under current scope.
* @return {Promise{[UserModel]}}
*/
async model() {
model() {
const scope = this.modelFor('scopes.scope');
const { id: scope_id } = scope;
if (this.can.can('list model', scope, { collection: 'users' })) {
@@ -19,7 +19,7 @@ export default class ScopesScopeUsersUserRoute extends Route {
* @param {string} params.user_id
* @return {UserModel}
*/
async model({ user_id }) {
model({ user_id }) {
return this.store.findRecord('user', user_id);
}
}