Ghost/ghost/admin/app/components/modal-remove-label-members.js
Rishabh 38a3962368 Added bulk operations UI for filtered members
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
2021-08-13 17:11:34 +05:30

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()
});