1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/models/notification.js
Kevin Ansfield 63fe1b1a88
🎨 Move "Update available" notification to the About screen (#894)
refs https://github.com/TryGhost/Ghost/issues/5071

Upgrade messages are now shown on the About screen rather than as alerts. Notifications that are marked as `top` or `custom` are still shown as alerts to allow for certain upgrade messages to be given more visibility.

- remove old `upgrade-notification` service
- update the `upgrade-status` service:
  - add a `message` property that contains an upgrade notification if any exists
  - add a `handleUpgradeNotification` method that accepts a Notification model instance and extracts the `notification.message` property into a html safe string for use in templates
- when loading server notifications during app boot, pass notifications that aren't marked as `top` or `custom` to the new `handleUpgradeNotification` method
- update the `about.hbs` template to pull the upgrade message from the `upgradeStatus` service
2018-01-09 14:23:36 +00:00

12 lines
279 B
JavaScript

import Model from 'ember-data/model';
import attr from 'ember-data/attr';
export default Model.extend({
custom: attr('boolean'),
dismissible: attr('boolean'),
key: attr('string'),
message: attr('string'),
status: attr('string'),
type: attr('string')
});