2019-12-17 16:57:42 +03:00
|
|
|
import ModalComponent from 'ghost-admin/components/modal-base';
|
|
|
|
import {computed} from '@ember/object';
|
2021-04-28 11:13:24 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2019-12-17 16:57:42 +03:00
|
|
|
|
|
|
|
export default ModalComponent.extend({
|
2021-04-28 11:13:24 +03:00
|
|
|
router: service(),
|
2021-09-30 15:54:54 +03:00
|
|
|
billing: service(),
|
2021-04-28 11:13:24 +03:00
|
|
|
|
2021-07-28 13:47:16 +03:00
|
|
|
headerMessage: computed('details', function () {
|
|
|
|
let header = 'Upgrade to enable publishing';
|
|
|
|
|
|
|
|
if (this.model.message && this.model.message.match(/account is currently in review/gi)) {
|
2021-07-29 12:53:52 +03:00
|
|
|
header = `Hold up, we're missing some details`;
|
2021-07-28 13:47:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return header;
|
|
|
|
}),
|
|
|
|
|
2019-12-17 16:57:42 +03:00
|
|
|
upgradeMessage: computed('details', function () {
|
2021-07-28 13:27:03 +03:00
|
|
|
const {limit, total} = this.model.details || {};
|
2021-05-10 14:04:10 +03:00
|
|
|
const message = this.model.message;
|
|
|
|
|
|
|
|
return {limit, total, message};
|
2019-12-17 16:57:42 +03:00
|
|
|
}),
|
2021-06-18 12:12:36 +03:00
|
|
|
|
2019-12-17 16:57:42 +03:00
|
|
|
actions: {
|
2021-06-18 12:12:36 +03:00
|
|
|
upgrade() {
|
2021-09-30 15:54:54 +03:00
|
|
|
this.router.transitionTo('pro', {queryParams: {action: 'checkout'}});
|
2021-06-18 12:12:36 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
confirm() {
|
|
|
|
this.send('upgrade');
|
2019-12-17 16:57:42 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|