1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-21 14:19:43 +02:00

Pinned documents

Closes #278

Pin documents to the top of each space.
This commit is contained in:
sauls8t 2020-02-03 21:00:35 +00:00
parent 2b66d0096a
commit e014f5b5c1
18 changed files with 541 additions and 88 deletions

View file

@ -30,6 +30,7 @@ export default Model.extend({
versioned: attr('boolean'),
versionId: attr('string'),
versionOrder: attr('number', { defaultValue: 0 }),
sequence: attr('number', { defaultValue: 99999 }),
groupId: attr('string'),
created: attr(),
revised: attr(),
@ -46,12 +47,12 @@ export default Model.extend({
isDraft: computed('lifecycle', function () {
let constants = this.get('constants');
return this.get('lifecycle') == constants.Lifecycle.Draft;
return this.get('lifecycle') === constants.Lifecycle.Draft;
}),
isLive: computed('lifecycle', function () {
let constants = this.get('constants');
return this.get('lifecycle') == constants.Lifecycle.Live;
return this.get('lifecycle') === constants.Lifecycle.Live;
}),
lifecycleLabel: computed('lifecycle', function () {
@ -77,5 +78,10 @@ export default Model.extend({
let after = moment().subtract(7, 'days');
return moment(this.get('revised')).isSameOrAfter(after) &&
moment(this.get('created')).isBefore(after);
})
}),
isSequenced: computed('sequence', function () {
let constants = this.get('constants');
return this.get('sequence') !== constants.Unsequenced;
}),
});