WIP
This commit is contained in:
parent
19c2542499
commit
572a9a4223
|
|
@ -1,6 +1,6 @@
|
||||||
<Assignment
|
<Assignment
|
||||||
@assigneeError={{this.assigneeError}}
|
|
||||||
@model={{@model}}
|
@model={{@model}}
|
||||||
@note={{@model.note}}
|
@note={{@model.note}}
|
||||||
@status={{@model.status}}
|
@status={{@model.status}}
|
||||||
@onSubmit={{this.assign}} />
|
@onSubmit={{this.assign}}
|
||||||
|
@showAssigneeError={{this.assigneeError}}/>
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@ export default class AssignUserForm extends Component {
|
||||||
@service capabilities;
|
@service capabilities;
|
||||||
|
|
||||||
@tracked assigneeError = false;
|
@tracked assigneeError = false;
|
||||||
@tracked
|
|
||||||
assigneeName = this.args.model.username || this.args.model.group_name;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
|
|
||||||
|
|
@ -20,8 +17,7 @@ export default class AssignUserForm extends Component {
|
||||||
|
|
||||||
@action
|
@action
|
||||||
async assign() {
|
async assign() {
|
||||||
console.log("ass");
|
if (!(this.args.model.username || this.args.model.group_name)) {
|
||||||
if (!this.assigneeName) {
|
|
||||||
this.assigneeError = true;
|
this.assigneeError = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="control-group {{if @assigneeError 'assignee-error'}}">
|
<div class="control-group {{if @showAssigneeError 'assignee-error'}}">
|
||||||
<label>{{i18n "discourse_assign.assign_modal.assignee_label"}}</label>
|
<label>{{i18n "discourse_assign.assign_modal.assignee_label"}}</label>
|
||||||
<AssigneeChooser
|
<AssigneeChooser
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{{#if @assigneeError}}
|
{{#if @showAssigneeError}}
|
||||||
<span class="error-label">
|
<span class="error-label">
|
||||||
{{d-icon "exclamation-triangle"}}
|
{{d-icon "exclamation-triangle"}}
|
||||||
{{i18n "discourse_assign.assign_modal.choose_assignee"}}
|
{{i18n "discourse_assign.assign_modal.choose_assignee"}}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ export default class Assignment extends Component {
|
||||||
@action
|
@action
|
||||||
setAssignee([newAssignee]) {
|
setAssignee([newAssignee]) {
|
||||||
this.assignee = newAssignee;
|
this.assignee = newAssignee;
|
||||||
this.args.assigneeError = false;
|
// this.args.showAssigneeError = false;
|
||||||
|
|
||||||
if (this.taskActions.allowedGroupsForAssignment.includes(newAssignee)) {
|
if (this.taskActions.allowedGroupsForAssignment.includes(newAssignee)) {
|
||||||
this.args.model.username = null;
|
this.args.model.username = null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue