Skip to content

Commit

Permalink
complete deprecations in store monitoring routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yibaebi committed Nov 5, 2024
1 parent 1573f5e commit 01286b2
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from '@glimmer/component';

interface AppMonitoringSettingsFilterSelectedItemArgs {
extra?: Record<string, unknown>;
extra?: Record<string, string>;
}

export default class AppMonitoringSettingsFilterSelectedItemComponent extends Component<AppMonitoringSettingsFilterSelectedItemArgs> {
Expand All @@ -18,7 +18,7 @@ export default class AppMonitoringSettingsFilterSelectedItemComponent extends Co
}

get iconName() {
return this.args.extra?.['iconName'];
return this.args.extra?.['iconName'] as string;
}
}

Expand Down
4 changes: 3 additions & 1 deletion app/components/app-monitoring/settings/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
showLabel=true
iconName='filter-list'
}}
@selectedItemComponent='app-monitoring/settings/filter-selected-item'
@selectedItemComponent={{component
'app-monitoring/settings/filter-selected-item'
}}
{{style width='auto'}}
class='select-platform-class'
data-test-select-platform-container
Expand Down
2 changes: 1 addition & 1 deletion app/components/app-monitoring/table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class AppMonitoringTableComponent extends Component<AppMonitoring
}

get monitoringData() {
return this.appmonitoring.appMonitoringData?.toArray();
return this.appmonitoring.appMonitoringData?.slice();
}

get limit() {
Expand Down
2 changes: 1 addition & 1 deletion app/components/app-monitoring/table/store-version/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class AppMonitoringTableStoreVersionComponent extends Component<A

// Fetch the latest versions for
const latestAmAppVersions = await this.store.query('am-app-version', query);
const versions = latestAmAppVersions.toArray();
const versions = latestAmAppVersions.slice();

this.latestAmAppVersions = versions;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class AppMonitoringVersionTableCountriesComponent extends Compone
amAppVersionId,
})) as AmAppRecordModelArray;

const records = amAppRecords.toArray();
const records = amAppRecords.slice();
const countryCodes = [];

for (let idx = 0; idx < records.length; idx++) {
Expand Down
2 changes: 1 addition & 1 deletion app/components/app-monitoring/version-table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default class AppMonitoringVersionTableComponent extends Component<AppMon
})) as AmAppVersionsModelArray;

this.totalStoreVersions = amAppVersions.meta.count;
this.storeVersionsToDisplay = amAppVersions.toArray();
this.storeVersionsToDisplay = amAppVersions.slice();
} catch (error) {
this.notify.error(parseError(error));
}
Expand Down
6 changes: 3 additions & 3 deletions app/models/am-app-record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import AmAppSyncModel from './am-app-sync';
import AmAppStoreInstanceModel from './am-app-store-instance';

export default class AmAppRecordModel extends Model {
@belongsTo('am-app-version', { inverse: null })
@belongsTo('am-app-version', { async: true, inverse: null })
declare amAppVersion: AsyncBelongsTo<AmAppVersionModel>;

@belongsTo('am-app-sync', { inverse: null })
@belongsTo('am-app-sync', { async: true, inverse: null })
declare amAppSync: AsyncBelongsTo<AmAppSyncModel>;

@belongsTo('am-app-store-instance', { inverse: null })
@belongsTo('am-app-store-instance', { async: true, inverse: null })
declare amAppStoreInstance: AsyncBelongsTo<AmAppStoreInstanceModel>;
}
2 changes: 1 addition & 1 deletion app/models/am-app-store-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export default class AmAppStoreInstanceModel extends Model {
@attr('string')
declare countryCode: string;

@belongsTo('am-app')
@belongsTo('am-app', { async: true, inverse: null })
declare amApp: AsyncBelongsTo<AmAppModel>;
}
2 changes: 1 addition & 1 deletion app/models/am-app-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class AmAppSyncModel extends Model {
@attr('date')
declare syncedOn: Date;

@belongsTo('am-app')
@belongsTo('am-app', { async: true, inverse: 'lastSync' })
declare amApp: AsyncBelongsTo<AmAppModel>;
}

Expand Down
6 changes: 3 additions & 3 deletions app/models/am-app-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export default class AmAppVersionModel extends Model {
@attr('string')
declare appName: string;

@belongsTo('am-app')
@belongsTo('am-app', { async: true, inverse: null })
declare amApp: AsyncBelongsTo<AmAppModel>;

@belongsTo('submission')
@belongsTo('submission', { async: true, inverse: null })
declare uploadSubmission: AsyncBelongsTo<SubmissionModel>;

@belongsTo('file', { inverse: null })
@belongsTo('file', { async: true, inverse: null })
declare latestFile: AsyncBelongsTo<FileModel>;
}

Expand Down
14 changes: 7 additions & 7 deletions app/models/am-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ export default class AmAppModel extends Model {
@attr('boolean')
declare isActive: boolean;

@belongsTo('amconfiguration')
@belongsTo('amconfiguration', { async: true, inverse: null })
declare amConfiguration: AsyncBelongsTo<AMConfigurationModel>;

@belongsTo('project')
@belongsTo('project', { async: true, inverse: null })
declare project: AsyncBelongsTo<ProjectModel>;

@belongsTo('am-app-sync', { inverse: null })
@belongsTo('am-app-sync', { async: true, inverse: 'amApp' })
declare lastSync: AsyncBelongsTo<AmAppSyncModel>;

@belongsTo('am-app-version', { inverse: null })
@belongsTo('am-app-version', { async: true, inverse: null })
declare latestAmAppVersion: AsyncBelongsTo<AmAppVersionModel>;

@belongsTo('am-app-version', { inverse: null })
@belongsTo('am-app-version', { async: true, inverse: null })
declare relevantAmAppVersion: AsyncBelongsTo<AmAppVersionModel>;

@hasMany('am-app-sync')
@hasMany('am-app-sync', { async: true, inverse: 'amApp' })
declare amAppSyncs: AsyncHasMany<AmAppSyncModel>;

@hasMany('am-app-version')
@hasMany('am-app-version', { async: true, inverse: 'amApp' })
declare amAppVersions: AsyncHasMany<AmAppVersionModel>;

get isPending() {
Expand Down
2 changes: 1 addition & 1 deletion app/models/amconfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class AMConfigurationModel extends Model {
@attr('boolean')
declare enabled: boolean;

@belongsTo('organization')
@belongsTo('organization', { async: true, inverse: null })
declare organization: AsyncBelongsTo<OrganizationModel>;
}

Expand Down

0 comments on commit 01286b2

Please sign in to comment.