Skip to content

Commit

Permalink
Merge pull request #1481 from appknox/PD-1559-fix-deprecation-analyti…
Browse files Browse the repository at this point in the history
…cs-billing-ac-settings

fix deprecations in analytics, billing & account-settings
  • Loading branch information
future-pirate-king authored Nov 7, 2024
2 parents 11c3dbc + 7bba24d commit 6edbeed
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class AccountSettingsDeveloperSettingsPersonaltokenListComponent
);

get personalTokenList() {
return this.personalTokens.records?.toArray() || [];
return this.personalTokens.records?.slice() || [];
}

get hasPersonalTokens() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ export default class AccountSettingsSecurityMultiFactorAuthComponent extends Com

@computed('[email protected]')
get isMFAEnabled() {
return !!this.mfas.records?.findBy('enabled', true);
return !!this.mfas.records?.find((it) => it.enabled === true);
}

@computed('[email protected]')
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('[email protected]')
get isAppMFAEnabled() {
const appMFA = this.mfas.records?.findBy('isApp', true);
const appMFA = this.mfas.records?.find((it) => it.isApp === true);

return appMFA?.enabled ?? false;
}
Expand Down
1 change: 1 addition & 0 deletions app/components/ak-date-picker/calendar-nav/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ export default class AkDatePickerCalendarNavComponent extends Component<AkDatePi
declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'AkDatePicker::CalendarNav': typeof AkDatePickerCalendarNavComponent;
'ak-date-picker/calendar-nav': typeof AkDatePickerCalendarNavComponent;
}
}
7 changes: 2 additions & 5 deletions app/components/ak-date-picker/index.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{{#let
(component (ensure-safe-component this.componentName))
as |CalendarComponent|
}}
{{#let (component this.componentName) as |CalendarComponent|}}
<div ...attributes>
<div
local-class='ak-date-picker-trigger'
Expand Down Expand Up @@ -29,7 +26,7 @@
<CalendarComponent
data-test-akDatePicker-calendar
class='ak-date-picker-calendar'
@navComponent={{this.navComponent}}
@navComponent={{component this.navComponent}}
@center={{this.center}}
@onCenterChange={{this.handleCenterChange}}
@selected={{@selected}}
Expand Down
10 changes: 7 additions & 3 deletions app/components/organization-billing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ export default class OrganizationBillingComponent extends Component {
}
});

get subscriptionList() {
return this.subscriptions?.slice() || [];
}

get subscription() {
return this.subscriptions?.firstObject;
return this.subscriptionList[0];
}

get subscriptionCount() {
return (this.subscriptions?.slice() || []).length;
return this.subscriptionList.length;
}

get hasSubscription() {
Expand All @@ -60,7 +64,7 @@ export default class OrganizationBillingComponent extends Component {
}

get sortedPlans() {
return this.plans?.sortBy(...this.sortPlanProperties);
return this.plans?.slice().sortBy(...this.sortPlanProperties);
}

get durations() {
Expand Down
2 changes: 1 addition & 1 deletion app/components/organization-billing/invoice-list/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<AkTable
class='my-2'
@variant='bordered'
@variant='full-bordered'
@borderColor='dark'
data-test-billingInvoice-list
as |t|
Expand Down
2 changes: 1 addition & 1 deletion app/components/organization-billing/subscription/index.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div {{style width='400px'}}>
{{#if this.isNotPerScan}}
<AkTable class='my-2' @variant='bordered' @borderColor='dark' as |t|>
<AkTable class='my-2' @variant='full-bordered' @borderColor='dark' as |t|>
<t.head @columns={{this.columns}} as |h|>
<h.row as |r|>
<r.cell colspan='2' as |columnValue|>
Expand Down
8 changes: 4 additions & 4 deletions app/models/analytics/recent-issue.ts
Original file line number Diff line number Diff line change
@@ -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<VulnerabilityModel>;
}

declare module 'ember-data/types/registries/model' {
Expand Down

0 comments on commit 6edbeed

Please sign in to comment.