diff --git a/app/components/organization-email-domain/index.js b/app/components/organization-email-domain/index.js index 8aee8cf88..e62506d02 100644 --- a/app/components/organization-email-domain/index.js +++ b/app/components/organization-email-domain/index.js @@ -26,7 +26,7 @@ export default class OrganizationEmailDomainComponent extends Component { fetchDomains = task(async () => { this.domains = ( await this.store.findAll('organization-email-domain') - ).toArray(); + ).slice(); }); addDomain = task(async () => { diff --git a/app/components/organization-invitation-list/index.ts b/app/components/organization-invitation-list/index.ts index 10f1c16fa..65efa342b 100644 --- a/app/components/organization-invitation-list/index.ts +++ b/app/components/organization-invitation-list/index.ts @@ -126,7 +126,7 @@ export default class OrganizationInvitationListComponent extends Component ({ user, diff --git a/app/components/organization-team/add-team-project/index.ts b/app/components/organization-team/add-team-project/index.ts index 14ec248b0..e6abd7a09 100644 --- a/app/components/organization-team/add-team-project/index.ts +++ b/app/components/organization-team/add-team-project/index.ts @@ -56,7 +56,7 @@ export default class OrganizationTeamAddTeamProjectComponent extends Component ({ project, diff --git a/app/components/organization-team/index.ts b/app/components/organization-team/index.ts index 94e3dde93..9696299b5 100644 --- a/app/components/organization-team/index.ts +++ b/app/components/organization-team/index.ts @@ -52,7 +52,7 @@ export default class OrganizationTeamComponent extends Component { @service declare store: Store; + @service('notifications') declare notify: NotificationService; + + @tracked teamProject: ProjectModel | null = null; - get teamProject() { - return this.store.findRecord('project', this.args.project.id); + constructor( + owner: object, + args: OrganizationTeamProjectListProjectInfoComponentSignature['Args'] + ) { + super(owner, args); + + this.fetchProjectDetail.perform(); } + + fetchProjectDetail = task(async () => { + try { + this.teamProject = await this.store.findRecord( + 'project', + this.args.project.id + ); + } catch (e) { + this.notify.error(parseError(e)); + } + }); } declare module '@glint/environment-ember-loose/registry' { diff --git a/app/components/sso-settings/index.js b/app/components/sso-settings/index.js index 894b60f51..20d5db1eb 100644 --- a/app/components/sso-settings/index.js +++ b/app/components/sso-settings/index.js @@ -20,6 +20,7 @@ export default class SsoSettingsComponent extends Component { @tracked idpMetadata = null; @tracked idpMetadataXml = null; @tracked spConfig = 'manual'; + @tracked sso = null; spMetadataKeys = [ { labelKey: 'entityID', valueKey: 'entity_id' }, @@ -38,10 +39,7 @@ export default class SsoSettingsComponent extends Component { this.SPMetadata.perform(); this.getIdPMetadata.perform(); - } - - get sso() { - return this.store.queryRecord('organization-sso', {}); + this.getSSOData.perform(); } // Switch SP config format @@ -77,6 +75,14 @@ export default class SsoSettingsComponent extends Component { } }); + getSSOData = task(async () => { + try { + this.sso = await this.store.queryRecord('organization-sso', {}); + } catch (e) { + this.notify.error(parseError(e)); + } + }); + // Parse & upload IdP metadata parseIdpMetadataXml = task(async (file) => { let idpMetadataXml = await file.readAsText(); diff --git a/app/models/organization-invitation.ts b/app/models/organization-invitation.ts index 577f3c8e6..630617596 100644 --- a/app/models/organization-invitation.ts +++ b/app/models/organization-invitation.ts @@ -12,10 +12,10 @@ export default class OrganizationInvitationModel extends Model { @attr('date') declare updatedOn: Date; - @belongsTo('organization-team') + @belongsTo('organization-team', { async: true, inverse: null }) declare team: AsyncBelongsTo; - @belongsTo('organization') + @belongsTo('organization', { async: true, inverse: null }) declare organization: AsyncBelongsTo; resend() { diff --git a/app/models/organization-team-invitation.ts b/app/models/organization-team-invitation.ts index 844dfbee9..6945f57c9 100644 --- a/app/models/organization-team-invitation.ts +++ b/app/models/organization-team-invitation.ts @@ -11,7 +11,7 @@ export default class OrganizationTeamInvitationModel extends Model { @attr('date') declare updatedOn: Date; - @belongsTo('organization') + @belongsTo('organization', { async: true, inverse: null }) declare organization: AsyncBelongsTo; async delete() { diff --git a/app/models/service-account-project.ts b/app/models/service-account-project.ts index 37db9c7e9..1f4dd187b 100644 --- a/app/models/service-account-project.ts +++ b/app/models/service-account-project.ts @@ -4,10 +4,10 @@ import type ProjectModel from './project'; import type ServiceAccountModel from './service-account'; export default class ServiceAccountProjectModel extends Model { - @belongsTo('project') + @belongsTo('project', { async: true, inverse: null }) declare project: AsyncBelongsTo; - @belongsTo('service-account') + @belongsTo('service-account', { async: true, inverse: null }) declare serviceAccount: AsyncBelongsTo; @attr('date') diff --git a/app/models/service-account.ts b/app/models/service-account.ts index a734595c5..e6a756acd 100644 --- a/app/models/service-account.ts +++ b/app/models/service-account.ts @@ -33,7 +33,7 @@ export default class ServiceAccountModel extends Model { @attr('boolean') declare allProjects: boolean; - @hasMany('service-account-project') + @hasMany('service-account-project', { async: true, inverse: null }) declare projects: AsyncHasMany; @attr('date') @@ -60,10 +60,10 @@ export default class ServiceAccountModel extends Model { @attr('date') declare createdOn: Date; - @belongsTo('organization-user') + @belongsTo('organization-user', { async: true, inverse: null }) declare updatedByUser: AsyncBelongsTo | null; - @belongsTo('organization-user') + @belongsTo('organization-user', { async: true, inverse: null }) declare createdByUser: AsyncBelongsTo; async resetKey(expiry: Date | null) {