mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 13:39:22 +03:00
Some improvements for ACL Support #157
This commit is contained in:
parent
a0f7114a39
commit
b0d4b56cee
9 changed files with 160 additions and 20 deletions
|
|
@ -27,6 +27,9 @@ import Remote from 'Remote/User/Fetch';
|
|||
|
||||
import { FileInfo } from 'Common/File';
|
||||
|
||||
import { FolderPopupView } from 'View/Popup/Folder';
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
const
|
||||
// isPosNumeric = value => null != value && /^[0-9]*$/.test(value.toString()),
|
||||
|
||||
|
|
@ -481,7 +484,8 @@ export class FolderModel extends AbstractModel {
|
|||
}
|
||||
|
||||
edit() {
|
||||
this.canBeEdited() && this.editing(true);
|
||||
// this.canBeEdited() && this.editing(true);
|
||||
this.canBeEdited() && showScreenPopup(FolderPopupView, [this]);
|
||||
}
|
||||
|
||||
unedit() {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import Remote from 'Remote/User/Fetch';
|
|||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
//import { FolderPopupView } from 'View/Popup/Folder';
|
||||
import { FolderCreatePopupView } from 'View/Popup/FolderCreate';
|
||||
import { FolderSystemPopupView } from 'View/Popup/FolderSystem';
|
||||
|
||||
|
|
|
|||
44
dev/View/Popup/Folder.js
Normal file
44
dev/View/Popup/Folder.js
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { addObservablesTo } from 'External/ko';
|
||||
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
export class FolderPopupView extends AbstractViewPopup {
|
||||
constructor() {
|
||||
super('Folder');
|
||||
addObservablesTo(this, {
|
||||
folder: null // FolderModel
|
||||
});
|
||||
|
||||
this.ACL = ko.observableArray();
|
||||
}
|
||||
|
||||
onClose() {
|
||||
this.folder().unedit();
|
||||
}
|
||||
|
||||
submitForm(form) {
|
||||
this.folder().rename();
|
||||
console.dir({form});
|
||||
this.close();
|
||||
}
|
||||
|
||||
beforeShow(folder) {
|
||||
this.ACL([]);
|
||||
folder.editing(true);
|
||||
this.folder(folder);
|
||||
Remote.request('FolderACL', (iError, data) => {
|
||||
if (!iError && data.Result) {
|
||||
this.ACL(
|
||||
Object.entries(data.Result).map(([key, value]) => {
|
||||
value.identifier = key;
|
||||
return value;
|
||||
})
|
||||
);
|
||||
}
|
||||
}, {
|
||||
folder: folder.fullName
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue