Skip to content

Commit

Permalink
Merge pull request #1489 from appknox/PD-1561-ember-5-upgrade-fix-dep…
Browse files Browse the repository at this point in the history
…recation-in-partner-routes

fix deprecation warnings in partner routes
  • Loading branch information
future-pirate-king authored Nov 19, 2024
2 parents 1c43312 + e3ab621 commit d7c1d45
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export default class HomePageOrganizationDashboardSideNavComponent extends Compo
route: 'authenticated.partner.clients',
hasBadge: true,
badgeLabel: this.intl.t('beta'),
currentWhen:
'authenticated.partner.clients authenticated.partner.client authenticated.partner.analytics',
},
this.args.isSecurityEnabled && {
label: this.intl.t('security'),
Expand Down
2 changes: 1 addition & 1 deletion app/components/partner/client-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class PartnerClientListComponent extends Component {
}

get partnerClientList() {
return this.partnerClientReponse?.toArray() || [];
return this.partnerClientReponse?.slice() || [];
}

get totalParnterClientCount() {
Expand Down
2 changes: 1 addition & 1 deletion app/components/partner/client-plan/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class ClientPlanComponent extends Component {

@task(function* () {
try {
this.clientPlan = yield this.store.find(
this.clientPlan = yield this.store.findRecord(
'partner/partnerclient-plan',
this.args.clientId
);
Expand Down
2 changes: 1 addition & 1 deletion app/components/partner/client-project-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class PartnerClientProjectListComponent extends Component<Partner
}

get partnerClientProjectList() {
return this.partnerClientProjectsReponse?.toArray() || [];
return this.partnerClientProjectsReponse?.slice() || [];
}

get totalParnterClientProjectsCount() {
Expand Down
4 changes: 1 addition & 3 deletions app/components/partner/client-report-download/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ export default class PartnerClientReportDownloadComponent extends Component {
}
);
if (this.reports.length) {
await waitForPromise(
this.getReport.perform(this.reports.firstObject.id)
);
await waitForPromise(this.getReport.perform(this.reports[0].id));

this.pollReportProgress();
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/components/partner/client-uploads-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class PartnerClientUploadsListComponent extends Component<Partner
}

get partnerClientUploadList() {
return this.partnerClientUploadsReponse?.toArray() || [];
return this.partnerClientUploadsReponse?.slice() || [];
}

get totalParnterClientUploadsCount() {
Expand Down
2 changes: 1 addition & 1 deletion app/components/partner/credit-transfer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default class PartnerCreditTransferComponent extends Component {

fetchClientPlan = task(async () => {
try {
this.clientPlan = await this.store.find(
this.clientPlan = await this.store.findRecord(
'partner/partnerclient-plan',
this.args.client.id
);
Expand Down
9 changes: 5 additions & 4 deletions app/components/partner/invitation-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';
import IntlService from 'ember-intl/services/intl';
import Store from '@ember-data/store';
import dayjs from 'dayjs';

// eslint-disable-next-line ember/use-ember-data-rfc-395-imports
import { DS } from 'ember-data';
Expand Down Expand Up @@ -33,8 +34,6 @@ export default class PartnerInvitationListComponent extends Component {
@tracked limit = 10;
@tracked offset = 0;

sortProperties = ['updatedOn:asc'];

constructor(owner: unknown, args: object) {
super(owner, args);

Expand Down Expand Up @@ -71,8 +70,10 @@ export default class PartnerInvitationListComponent extends Component {
get partnerRegistrationRequestList() {
return (
this.partnerRegistrationRequestReponse
?.toArray()
.sortBy(...this.sortProperties) || []
?.slice()
.sort(
(a, b) => dayjs(b.updatedOn).valueOf() - dayjs(a.updatedOn).valueOf()
) || []
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { task } from 'ember-concurrency';
import IntlService from 'ember-intl/services/intl';
import Store from '@ember-data/store';
import { waitForPromise } from '@ember/test-waiters';
import dayjs from 'dayjs';

// eslint-disable-next-line ember/use-ember-data-rfc-395-imports
import { DS } from 'ember-data';
Expand Down Expand Up @@ -34,8 +35,6 @@ export default class PartnerRegistrationRequestPendingListComponent extends Comp
@tracked limit = 10;
@tracked offset = 0;

sortProperties = ['createdOn:desc'];

constructor(owner: unknown, args: object) {
super(owner, args);

Expand Down Expand Up @@ -73,8 +72,10 @@ export default class PartnerRegistrationRequestPendingListComponent extends Comp
get partnerRegistrationRequestList() {
return (
this.partnerRegistrationRequestReponse
?.toArray()
.sortBy(...this.sortProperties) || []
?.slice()
.sort(
(a, b) => dayjs(b.createdOn).valueOf() - dayjs(a.createdOn).valueOf()
) || []
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';
import IntlService from 'ember-intl/services/intl';
import Store from '@ember-data/store';
import dayjs from 'dayjs';

// eslint-disable-next-line ember/use-ember-data-rfc-395-imports
import { DS } from 'ember-data';
Expand Down Expand Up @@ -33,8 +34,6 @@ export default class PartnerRegistrationRequestRejectedListComponent extends Com
@tracked limit = 10;
@tracked offset = 0;

sortProperties = ['createdOn:desc'];

constructor(owner: unknown, args: object) {
super(owner, args);

Expand Down Expand Up @@ -71,8 +70,10 @@ export default class PartnerRegistrationRequestRejectedListComponent extends Com
get partnerRegistrationRequestList() {
return (
this.partnerRegistrationRequestReponse
?.toArray()
.sortBy(...this.sortProperties) || []
?.slice()
.sort(
(a, b) => dayjs(b.createdOn).valueOf() - dayjs(a.createdOn).valueOf()
) || []
);
}

Expand Down

0 comments on commit d7c1d45

Please sign in to comment.