-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2421 from Johnetordoff/institutional-access-user-…
…message-modal [ENG-6665] Add user messaging modal to user's tab on institutional dashboard
- Loading branch information
Showing
6 changed files
with
192 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// app/models/user-message.js | ||
import Model, { attr, belongsTo } from '@ember-data/model'; | ||
|
||
export enum MessageTypeChoices { | ||
InstitutionalRequest = 'institutional_request', | ||
} | ||
|
||
|
||
export default class UserMessageModel extends Model { | ||
@attr('string') messageText; | ||
@attr('string') messageType: MessageTypeChoices; | ||
@attr('boolean') bcc_sender; | ||
@attr('boolean') replyTo; | ||
@belongsTo('institution') institution; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters