diff --git a/app/adapters/user-message.ts b/app/adapters/user-message.ts new file mode 100644 index 00000000000..a92b865c714 --- /dev/null +++ b/app/adapters/user-message.ts @@ -0,0 +1,13 @@ +// app/adapters/user-message.js +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.user; + return `${apiUrl}/v2/users/${userId}/messages/`; + } +} diff --git a/app/institutions/dashboard/-components/institutional-users-list/component.ts b/app/institutions/dashboard/-components/institutional-users-list/component.ts index 9c879700ddc..2268909b0c1 100644 --- a/app/institutions/dashboard/-components/institutional-users-list/component.ts +++ b/app/institutions/dashboard/-components/institutional-users-list/component.ts @@ -1,3 +1,4 @@ +import { task } from 'ember-concurrency'; import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import { action } from '@ember/object'; @@ -10,6 +11,7 @@ import InstitutionModel from 'ember-osf-web/models/institution'; import InstitutionDepartmentsModel from 'ember-osf-web/models/institution-department'; import Analytics from 'ember-osf-web/services/analytics'; import { RelationshipWithLinks } from 'osf-api'; +import {MessageTypeChoices} from 'ember-osf-web/models/user-message'; interface Column { key: string; @@ -27,6 +29,8 @@ interface InstitutionalUsersListArgs { export default class InstitutionalUsersList extends Component { @service analytics!: Analytics; @service intl!: Intl; + @service store; + @service currentUser!: CurrentUser; institution?: InstitutionModel; @@ -37,6 +41,12 @@ export default class InstitutionalUsersList extends Component {{institutionalUser.userName}} + {{else if (eq column.type 'osf_link')}} {{institutionalUser.userGuid}} @@ -204,4 +212,50 @@ {{t 'institutions.dashboard.users_list.empty'}} + + + {{t 'institutions.dashboard.send_message_modal.title'}} + + +
+ +