Ghost/ghost/admin/app/components/dashboard/v5/resources/whats-new.js
Simon Backx 9b8875c4be Added Whats New component to Dashboard 5.0
refs https://github.com/TryGhost/Team/issues/1486

Includes a new component that correctly fetches the changelog and displays them in the old format (still requires some design changes).
2022-04-06 15:43:41 +02:00

25 lines
653 B
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
import {tracked} from '@glimmer/tracking';
export default class WhatsNew extends Component {
@service whatsNew;
@tracked entries = null;
@tracked loading = null;
@tracked error = null;
@action
load() {
this.loading = true;
this.whatsNew.fetchLatest.perform().then(() => {
this.loading = false;
this.entries = this.whatsNew.entries.slice(0, 3);
}, (error) => {
this.error = error;
this.loading = false;
});
}
}