Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix deprecations in analytics, billing & account-settings #1481

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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() || [];
Yibaebi marked this conversation as resolved.
Show resolved Hide resolved
}

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('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;
}
future-pirate-king marked this conversation as resolved.
Show resolved Hide resolved

@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;
}
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>;
}
future-pirate-king marked this conversation as resolved.
Show resolved Hide resolved

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