mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +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
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