mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
267889993f
refs https://github.com/TryGhost/Team/issues/1084 - updates shareable offer link UI to to open directly instead of route - calculates offer url from code and updates in link modal - wires copy button on link modal - removes route based link code for modal
33 lines
834 B
JavaScript
33 lines
834 B
JavaScript
import Controller from '@ember/controller';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
import {task} from 'ember-concurrency-decorators';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
export default class MembersController extends Controller {
|
|
@tracked offers = [];
|
|
@service modals;
|
|
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
|
|
get offersExist() {
|
|
return this.offers.length > 0;
|
|
}
|
|
|
|
@action
|
|
openLinkDialog(offer) {
|
|
this.advancedModal = this.modals.open('modals/offers/link', {
|
|
offer: offer
|
|
}, {
|
|
className: 'fullscreen-modal-action fullscreen-modal-wide'
|
|
});
|
|
}
|
|
|
|
@task({restartable: true})
|
|
*fetchOffersTask() {
|
|
this.offers = yield this.store.query('offer', {limit: 'all'});
|
|
}
|
|
}
|