2022-04-20 20:41:29 +03:00
|
|
|
import Component from '@glimmer/component';
|
2022-04-25 13:22:50 +03:00
|
|
|
import {action} from '@ember/object';
|
2022-05-04 12:30:37 +03:00
|
|
|
import {task} from 'ember-concurrency';
|
2022-04-27 20:20:46 +03:00
|
|
|
import {tracked} from '@glimmer/tracking';
|
2022-04-20 20:41:29 +03:00
|
|
|
|
|
|
|
export default class PublishModalComponent extends Component {
|
|
|
|
static modalOptions = {
|
|
|
|
className: 'fullscreen-modal-total-overlay',
|
2022-04-21 12:35:24 +03:00
|
|
|
omitBackdrop: true,
|
|
|
|
ignoreBackdropClick: true
|
2022-04-20 20:41:29 +03:00
|
|
|
};
|
2022-04-25 13:22:50 +03:00
|
|
|
|
2022-04-28 17:35:50 +03:00
|
|
|
@tracked isConfirming = false;
|
2022-05-04 12:30:37 +03:00
|
|
|
@tracked isComplete = false;
|
2022-04-25 13:22:50 +03:00
|
|
|
|
2022-04-27 20:20:46 +03:00
|
|
|
@action
|
2022-04-28 17:35:50 +03:00
|
|
|
toggleConfirm() {
|
|
|
|
// TODO: validate?
|
|
|
|
this.isConfirming = !this.isConfirming;
|
2022-04-25 13:22:50 +03:00
|
|
|
}
|
2022-05-04 12:30:37 +03:00
|
|
|
|
|
|
|
@task
|
|
|
|
*saveTask() {
|
|
|
|
yield this.args.data.saveTask.perform();
|
|
|
|
|
|
|
|
this.isConfirming = false;
|
|
|
|
this.isComplete = true;
|
|
|
|
}
|
2022-04-20 20:41:29 +03:00
|
|
|
}
|