From af22ef957a4d8e87fa6207536faff84265fdc804 Mon Sep 17 00:00:00 2001 From: John Tordoff Date: Fri, 17 Jan 2025 15:00:23 -0500 Subject: [PATCH 1/2] remove debugging return --- .../-components/object-list/contributors-field/component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/institutions/dashboard/-components/object-list/contributors-field/component.ts b/app/institutions/dashboard/-components/object-list/contributors-field/component.ts index 022528b4da..4b5e4925bb 100644 --- a/app/institutions/dashboard/-components/object-list/contributors-field/component.ts +++ b/app/institutions/dashboard/-components/object-list/contributors-field/component.ts @@ -74,7 +74,7 @@ export default class InstitutionalObjectListContributorsField extends Component< function hasInstitutionAffiliation(contributors: any[], attribution: any, institutionIris: string[]) { const attributedContributor = getContributorById(contributors, getSingleOsfmapValue(attribution, ['agent'])); - return true; + if (!attributedContributor.affiliation) { return false; } From 2da6676a3e0afa4bcca2bbb8aeb4a3c63b5feda1 Mon Sep 17 00:00:00 2001 From: John Tordoff Date: Fri, 17 Jan 2025 15:05:13 -0500 Subject: [PATCH 2/2] remove superfluous import and type Institution model correctly --- app/adapters/user-message.ts | 2 -- app/models/user-message.ts | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/adapters/user-message.ts b/app/adapters/user-message.ts index dad3feb9ef..60edd8f198 100644 --- a/app/adapters/user-message.ts +++ b/app/adapters/user-message.ts @@ -1,10 +1,8 @@ -import { inject as service } from '@ember/service'; import config from 'ember-osf-web/config/environment'; const { OSF: { apiUrl } } = config; import OsfAdapter from './osf-adapter'; export default class UserMessageAdapter extends OsfAdapter { - @service session; urlForCreateRecord(modelName, snapshot) { const userId = snapshot.record.messageRecipient; return `${apiUrl}/v2/users/${userId}/messages/`; diff --git a/app/models/user-message.ts b/app/models/user-message.ts index 89e9453756..838afef701 100644 --- a/app/models/user-message.ts +++ b/app/models/user-message.ts @@ -1,5 +1,6 @@ // app/models/user-message.js import Model, { attr, belongsTo } from '@ember-data/model'; +import InstitutionModel from 'ember-osf-web/models/institution'; export enum MessageTypeChoices { InstitutionalRequest = 'institutional_request', @@ -11,5 +12,5 @@ export default class UserMessageModel extends Model { @attr('string') messageType: MessageTypeChoices; @attr('boolean') bccSender; @attr('boolean') replyTo; - @belongsTo('institution') institution; + @belongsTo('institution') institution!: AsyncBelongsTo & InstitutionModel; }