mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
6d9b8175a2
closes https://github.com/TryGhost/Team/issues/969 Wires the bulk action operation UI to Ghost API to perform operations on filtered member list - unsubscribe filtered members, add label to filtered members or remove label from filtered members
34 lines
788 B
JavaScript
34 lines
788 B
JavaScript
import ModalComponent from 'ghost-admin/components/modal-base';
|
|
import {alias} from '@ember/object/computed';
|
|
import {inject as service} from '@ember/service';
|
|
import {task} from 'ember-concurrency';
|
|
|
|
export default ModalComponent.extend({
|
|
membersStats: service(),
|
|
selectedLabel: null,
|
|
|
|
// Allowed actions
|
|
confirm: () => {},
|
|
|
|
member: alias('model'),
|
|
|
|
actions: {
|
|
confirm() {
|
|
this.removeLabelTask.perform();
|
|
},
|
|
|
|
setLabel(label) {
|
|
this.set('selectedLabel', label);
|
|
}
|
|
},
|
|
|
|
removeLabelTask: task(function* () {
|
|
try {
|
|
yield this.confirm(this.selectedLabel);
|
|
this.membersStats.invalidate();
|
|
} finally {
|
|
this.send('closeModal');
|
|
}
|
|
}).drop()
|
|
});
|