Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-6991][ENG-6997][ENG-7001][ENG-7002][IAC] Simple FE Fixes #2486

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions app/adapters/node-request.ts
Original file line number Diff line number Diff line change
@@ -1,11 +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 NodeRequestAdapter extends OsfAdapter {
@service session;

urlForCreateRecord(modelName, snapshot) {
const nodeId = snapshot.record.target;
return `${apiUrl}/v2/nodes/${nodeId}/requests/`;
Expand Down
11 changes: 8 additions & 3 deletions app/institutions/dashboard/-components/object-list/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,18 @@ export default class InstitutionalObjectList extends Component<InstitutionalObje
try {
if (this.activeTab === 'send-message') {
await taskFor(this._sendUserMessage).perform();
this.toast.success(
this.intl.t('institutions.dashboard.object-list.' +
'request-project-message-modal.message_sent_success'),
);
} else if (this.activeTab === 'request-access') {
await taskFor(this._sendNodeRequest).perform();
this.toast.success(
this.intl.t('institutions.dashboard.object-list.' +
'request-project-message-modal.request_sent_success'),
);
}

this.toast.success(
this.intl.t('institutions.dashboard.object-list.request-project-message-modal.message_sent_success'),
);
this.resetFields();
} catch (error) {
const errorDetail = error?.errors?.[0]?.detail.user || error?.errors?.[0]?.detail || '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ as |list|>
{{t 'institutions.dashboard.object-list.request-project-message-modal.write_permission_label'}}
</label>
<Textarea
aria-label={{t 'institutions.dashboard.aira_label_project_request_textarea'}}
local-class='message-textarea'
@value={{this.messageText}}
/>
Expand All @@ -352,6 +353,7 @@ as |list|>
{{t 'institutions.dashboard.object-list.request-project-message-modal.opening_message_label'}}
</p>
<Textarea
aria-label={{t 'institutions.dashboard.aira_label_user_message_textarea'}}
local-class='message-textarea'
@value={{this.messageText}}
/>
Expand Down Expand Up @@ -381,7 +383,7 @@ as |list|>
<Button
@type='primary'
@disabled={{not this.messageText.trim}}
{{on 'click' (queue (perform this.handleSend) dialog.close)}}
{{on 'click' (queue (perform this.handleSend) (fn (mut this.projectRequestModalShown) false))}}
>
{{t 'institutions.dashboard.object-list.request-project-message-modal.send'}}
</Button>
Expand Down
4 changes: 3 additions & 1 deletion translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,8 @@ institutions:
title: '{institutionName} Dashboard'
updated: 'Updated {date}'
download_past_reports_label: 'Previous reports'
aira_label_project_request_textarea: 'Project Request Message Text Area'
aira_label_user_message_textarea: 'User Message Text Area'
download_dropdown_label: 'Download data'
download_csv: 'Download CSV'
download_tsv: 'Download TSV'
Expand Down Expand Up @@ -917,7 +919,7 @@ institutions:
reply_to_label: 'Allow reply to sender address'
send_message_prompt:
title: "Can't Request Access"
message: "This user has their request access feature turned off. Reach out to the user via the User tab by pressing the 'Back' button below."
message: 'The user has their request access feature turned off. Reach out to the user by sending an email message by pressing the Back" button below.'
back: "Back"
table-headers:
title: Title
Expand Down
Loading