Skip to content

Commit

Permalink
use proper Ember input tags, remove extra close modal command
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Dec 16, 2024
1 parent d5803a6 commit 434288e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export default class InstitutionalUsersList extends Component<InstitutionalUsers
@tracked filteredUsers = [];
@tracked messageModalShown = false;
@tracked messageText = '';
@tracked bcc_sender = false;
@tracked replyTo = false;
@tracked selectedUserId = null;
@service toast!: Toast;

Expand Down Expand Up @@ -289,26 +291,11 @@ export default class InstitutionalUsersList extends Component<InstitutionalUsers
@action
resetModalFields() {
this.messageText = '';
this.cc = false;
this.bcc_sender = false;
this.replyTo = false;
this.selectedUserId = null;
}

@action
updateMessageText(event: Event) {
this.messageText = (event.target as HTMLTextAreaElement).value;
}

@action
toggleCc() {
this.cc = !this.cc;
}

@action
toggleReplyTo() {
this.replyTo = !this.replyTo;
}

@task
@waitFor
async sendMessage() {
Expand All @@ -321,7 +308,7 @@ export default class InstitutionalUsersList extends Component<InstitutionalUsers
const userMessage = this.store.createRecord('user-message', {
messageText: this.messageText.trim(),
messageType: MessageTypeChoices.InstitutionalRequest,
cc: this.cc,
bcc_sender: this.bcc_sender,
replyTo: this.replyTo,
institution: this.args.institution,
user: this.selectedUserId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@
</div>
<div local-class='checkbox-container'>
<label local-class='checkbox-item'>
<input type='checkbox' checked={{this.cc}} {{on 'change' this.toggleCc}} />
<Input @type='checkbox' @checked={{this.bcc_sender}} />
{{t 'institutions.dashboard.send_message_modal.cc_label'}}
</label>
<label local-class='checkbox-item'>
<input type='checkbox' checked={{this.replyTo}} {{on 'change' this.toggleReplyTo}} />
<Input @type='checkbox' @checked={{this.replyTo}} />
{{t 'institutions.dashboard.send_message_modal.reply_to_label'}}
</label>
</div>
Expand All @@ -252,7 +252,6 @@
@type='primary'
@disabled={{not this.messageText.trim}}
{{on 'click' (queue (perform this.sendMessage))}}
{{on 'click' this.toggleMessageModal}}

>
{{t 'institutions.dashboard.send_message_modal.send'}}
Expand Down
2 changes: 1 addition & 1 deletion app/models/user-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export enum MessageTypeChoices {
export default class UserMessageModel extends Model {
@attr('string') messageText;
@attr('string') messageType: MessageTypeChoices;
@attr('boolean') cc;
@attr('boolean') bcc_sender;
@attr('boolean') replyTo;
@belongsTo('institution') institution;
}

0 comments on commit 434288e

Please sign in to comment.