mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
42b3e3a412
requires 8ceabbcfba
- if the API responds with `meta.import_label` after an import, use it to reset and apply the filter across the members list so that it's quick to see the results of the import and perform further bulk actions (coming later)
- added ability to pass arguments through `<GhFullscreenModal>`'s `@confirm` action
- added a `console.error()` call to the members csv import so that any underlying error is not completely lost by the custom error handling
60 lines
1.5 KiB
JavaScript
60 lines
1.5 KiB
JavaScript
import Component from '@ember/component';
|
|
import RSVP from 'rsvp';
|
|
import {computed} from '@ember/object';
|
|
import {A as emberA} from '@ember/array';
|
|
import {isBlank} from '@ember/utils';
|
|
import {run} from '@ember/runloop';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
const FullScreenModalComponent = Component.extend({
|
|
dropdown: service(),
|
|
|
|
model: null,
|
|
modifier: null,
|
|
|
|
modalPath: computed('modal', function () {
|
|
return `modal-${this.modal || 'unknown'}`;
|
|
}),
|
|
|
|
modalClasses: computed('modifiers', function () {
|
|
let modalClass = 'fullscreen-modal';
|
|
let modifiers = (this.modifier || '').split(' ');
|
|
let modalClasses = emberA([modalClass]);
|
|
|
|
modifiers.forEach((modifier) => {
|
|
if (!isBlank(modifier)) {
|
|
let className = `${modalClass}-${modifier}`;
|
|
modalClasses.push(className);
|
|
}
|
|
});
|
|
|
|
return modalClasses.join(' ');
|
|
}),
|
|
|
|
didInsertElement() {
|
|
run.schedule('afterRender', this, function () {
|
|
this.dropdown.closeDropdowns();
|
|
});
|
|
},
|
|
|
|
actions: {
|
|
close() {
|
|
return this.close(...arguments);
|
|
},
|
|
|
|
confirm() {
|
|
return this.confirm(...arguments);
|
|
},
|
|
|
|
clickOverlay() {
|
|
this.send('close');
|
|
}
|
|
},
|
|
|
|
// Allowed actions
|
|
close: () => RSVP.resolve(),
|
|
confirm: () => RSVP.resolve()
|
|
});
|
|
|
|
export default FullScreenModalComponent;
|