mirror of
https://github.com/documize/community.git
synced 2025-07-22 22:59:43 +02:00
Streamline document meta view and editing experience
Meta data: 1. Condensed layout. 2. Unified editing. Co-Authored-By: Saul S <sauls8t@users.noreply.github.com>
This commit is contained in:
parent
f70d4b33a3
commit
27fde0dac8
26 changed files with 2389 additions and 1956 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
import { Promise as EmberPromise } from 'rsvp';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { computed } from '@ember/object';
|
||||
import Tooltips from '../../../mixins/tooltip';
|
||||
import Notifier from '../../../mixins/notifier';
|
||||
import Controller from '@ember/controller';
|
||||
|
@ -22,6 +23,12 @@ export default Controller.extend(Tooltips, Notifier, {
|
|||
linkService: service('link'),
|
||||
tab: 'content',
|
||||
queryParams: ['currentPageId'],
|
||||
showRevisions: computed('permissions', 'document.protection', function() {
|
||||
if (this.get('document.protection') === this.get('constants').ProtectionType.None) return true;
|
||||
if (this.get('document.protection') === this.get('constants').ProtectionType.Review && this.get('permissions.documentApprove')) return true;
|
||||
|
||||
return false;
|
||||
}),
|
||||
|
||||
actions: {
|
||||
onTabChange(tab) {
|
||||
|
@ -229,7 +236,7 @@ export default Controller.extend(Tooltips, Notifier, {
|
|||
});
|
||||
},
|
||||
|
||||
refresh() {
|
||||
refresh(reloadPage) {
|
||||
return new EmberPromise((resolve) => {
|
||||
this.get('documentService').fetchDocumentData(this.get('document.id')).then((data) => {
|
||||
this.set('document', data.document);
|
||||
|
@ -247,7 +254,11 @@ export default Controller.extend(Tooltips, Notifier, {
|
|||
this.set('blocks', data);
|
||||
});
|
||||
|
||||
if (reloadPage) {
|
||||
window.location.reload();
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue