mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
space related bug fixesx
This commit is contained in:
parent
f2794a9836
commit
c77b384215
10 changed files with 675 additions and 655 deletions
|
@ -31,7 +31,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.loadBlocks();
|
||||
|
||||
Ember.run.schedule('afterRender', () => {
|
||||
|
@ -44,13 +43,11 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
didRender() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.contentLinkHandler();
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.setupAddWizard();
|
||||
|
||||
let self = this;
|
||||
|
@ -61,9 +58,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
$('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
|
||||
|
||||
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
|
@ -112,7 +108,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
// out
|
||||
$(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
||||
} });
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
addSection(model) {
|
||||
|
@ -261,7 +257,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
this.set('toEdit', '');
|
||||
}
|
||||
|
||||
this.setupAddWizard();
|
||||
this.setupAddWizard();
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -298,8 +294,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
const promise = this.addSection(model);
|
||||
promise.then((id) => {
|
||||
this.set('pageId', id);
|
||||
|
||||
this.setupAddWizard();
|
||||
|
||||
this.setupAddWizard();
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -311,6 +307,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -100,6 +100,16 @@ export default Ember.Component.extend(NotifierMixin, {
|
|||
permission.get('documentMove') || permission.get('documentCopy') || permission.get('documentTemplate'));
|
||||
});
|
||||
|
||||
// see if more than oen user is granted access to space (excluding everyone)
|
||||
let roleCount = 0;
|
||||
permissions.forEach((permission) => {
|
||||
if (permission.get('userId') !== "0" &&
|
||||
(permission.get('spaceView') || permission.get('documentAdd') || permission.get('documentEdit') || permission.get('documentDelete') ||
|
||||
permission.get('documentMove') || permission.get('documentCopy') || permission.get('documentTemplate'))) {
|
||||
roleCount += 1;
|
||||
}
|
||||
});
|
||||
|
||||
this.get('folderService').savePermissions(folder.get('id'), payload).then(() => {
|
||||
this.showNotification('Saved permissions');
|
||||
});
|
||||
|
@ -108,7 +118,7 @@ export default Ember.Component.extend(NotifierMixin, {
|
|||
folder.markAsPublic();
|
||||
this.showNotification('Marked space as public');
|
||||
} else {
|
||||
if (permissions.length > 1) {
|
||||
if (roleCount > 1) {
|
||||
folder.markAsRestricted();
|
||||
this.showNotification('Marked space as protected');
|
||||
} else {
|
||||
|
|
|
@ -41,10 +41,10 @@ export default Ember.Component.extend(TooltipMixin, NotifierMixin, AuthMixin, {
|
|||
publicFolders.pushObject(folder);
|
||||
}
|
||||
if (folder.get('folderType') === constants.FolderType.Private) {
|
||||
protectedFolders.pushObject(folder);
|
||||
privateFolders.pushObject(folder);
|
||||
}
|
||||
if (folder.get('folderType') === constants.FolderType.Protected) {
|
||||
privateFolders.pushObject(folder);
|
||||
protectedFolders.pushObject(folder);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue