mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
38a3962368
refs https://github.com/TryGhost/Team/issues/969 A lot of power of filtering members comes from ability to perform actions on the filtered member list. This change adds bulk operation actions on the the UI to apply on filtered members, but has not wired them up to the API yet. - adds unsubscribe bulk operation UI - adds label addition bulk operation UI - adds label removal bulk operation UI - adds new single label selection UI for add/remove label to members UI
34 lines
794 B
JavaScript
34 lines
794 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.deleteMember.perform();
|
|
},
|
|
|
|
setLabel(label) {
|
|
this.set('selectedLabel', label);
|
|
}
|
|
},
|
|
|
|
deleteMember: task(function* () {
|
|
try {
|
|
yield this.confirm(this.shouldCancelSubscriptions);
|
|
this.membersStats.invalidate();
|
|
} finally {
|
|
this.send('closeModal');
|
|
}
|
|
}).drop()
|
|
});
|