From 7bba24d7af6e9a477bf6dbe63519aa8897969591 Mon Sep 17 00:00:00 2001 From: Sam David Date: Fri, 25 Oct 2024 23:20:48 +0530 Subject: [PATCH] fix deprecations in analytics, billing & account-settings --- .../developer-settings/personal-token-list/index.ts | 2 +- .../security/multi-factor-auth/index.ts | 6 +++--- app/components/ak-date-picker/calendar-nav/index.ts | 1 + app/components/ak-date-picker/index.hbs | 7 ++----- app/components/organization-billing/index.ts | 10 +++++++--- .../organization-billing/invoice-list/index.hbs | 2 +- .../organization-billing/subscription/index.hbs | 2 +- app/models/analytics/recent-issue.ts | 8 ++++---- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/app/components/account-settings/developer-settings/personal-token-list/index.ts b/app/components/account-settings/developer-settings/personal-token-list/index.ts index ff7ba28bd..01ac49667 100644 --- a/app/components/account-settings/developer-settings/personal-token-list/index.ts +++ b/app/components/account-settings/developer-settings/personal-token-list/index.ts @@ -26,7 +26,7 @@ export default class AccountSettingsDeveloperSettingsPersonaltokenListComponent ); get personalTokenList() { - return this.personalTokens.records?.toArray() || []; + return this.personalTokens.records?.slice() || []; } get hasPersonalTokens() { diff --git a/app/components/account-settings/security/multi-factor-auth/index.ts b/app/components/account-settings/security/multi-factor-auth/index.ts index 9b4065035..fa65cae87 100644 --- a/app/components/account-settings/security/multi-factor-auth/index.ts +++ b/app/components/account-settings/security/multi-factor-auth/index.ts @@ -72,19 +72,19 @@ export default class AccountSettingsSecurityMultiFactorAuthComponent extends Com @computed('mfas.records.@each.enabled') get isMFAEnabled() { - return !!this.mfas.records?.findBy('enabled', true); + return !!this.mfas.records?.find((it) => it.enabled === true); } @computed('mfas.records.@each.enabled') get isEmailMFAEnabled() { - const emailMFA = this.mfas.records?.findBy('isEmail', true); + const emailMFA = this.mfas.records?.find((it) => it.isEmail === true); return emailMFA?.enabled ?? false; } @computed('mfas.records.@each.enabled') get isAppMFAEnabled() { - const appMFA = this.mfas.records?.findBy('isApp', true); + const appMFA = this.mfas.records?.find((it) => it.isApp === true); return appMFA?.enabled ?? false; } diff --git a/app/components/ak-date-picker/calendar-nav/index.ts b/app/components/ak-date-picker/calendar-nav/index.ts index 57163b83f..0323c6d49 100644 --- a/app/components/ak-date-picker/calendar-nav/index.ts +++ b/app/components/ak-date-picker/calendar-nav/index.ts @@ -35,5 +35,6 @@ export default class AkDatePickerCalendarNavComponent extends Component
{{#if this.isNotPerScan}} - + diff --git a/app/models/analytics/recent-issue.ts b/app/models/analytics/recent-issue.ts index af55747d7..ff4a91bcf 100644 --- a/app/models/analytics/recent-issue.ts +++ b/app/models/analytics/recent-issue.ts @@ -1,12 +1,12 @@ -import Model, { attr, belongsTo } from '@ember-data/model'; -import VulnerabilityModel from 'irene/models/vulnerability'; +import Model, { attr, belongsTo, type AsyncBelongsTo } from '@ember-data/model'; +import type VulnerabilityModel from 'irene/models/vulnerability'; export default class AnalyticsRecentIssueModel extends Model { @attr('number') declare count: number; - @belongsTo('vulnerability') - declare vulnerability: VulnerabilityModel; + @belongsTo('vulnerability', { async: true, inverse: null }) + declare vulnerability: AsyncBelongsTo; } declare module 'ember-data/types/registries/model' {