mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +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
782 B
JavaScript
34 lines
782 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.addLabelTask.perform();
|
|
},
|
|
|
|
setLabel(label) {
|
|
this.set('selectedLabel', label);
|
|
}
|
|
},
|
|
|
|
addLabelTask: task(function* () {
|
|
try {
|
|
yield this.confirm(this.selectedLabel);
|
|
this.membersStats.invalidate();
|
|
} finally {
|
|
this.send('closeModal');
|
|
}
|
|
}).drop()
|
|
});
|