mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Improved Kolab AddressBook/Contacts
This commit is contained in:
parent
5c9b7d7000
commit
824311937a
42 changed files with 299 additions and 54 deletions
|
|
@ -4,6 +4,7 @@ import { koComputable } from 'External/ko';
|
|||
import { SettingsGet } from 'Common/Globals';
|
||||
import { i18n, trigger as translatorTrigger } from 'Common/Translator';
|
||||
import { ContactUserStore } from 'Stores/User/Contact';
|
||||
import { FolderUserStore } from 'Stores/User/Folder';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
export class UserSettingsContacts /*extends AbstractViewSettings*/ {
|
||||
|
|
@ -48,5 +49,33 @@ export class UserSettingsContacts /*extends AbstractViewSettings*/ {
|
|||
Password: ContactUserStore.syncPass()
|
||||
})
|
||||
);
|
||||
|
||||
this.kolabContactFolder = ko.observable(SettingsGet('KolabContactFolder'));
|
||||
this.kolabContactFolder.subscribe(value =>
|
||||
Remote.saveSettings(null, { KolabContactFolder: value })
|
||||
);
|
||||
this.showKolab = FolderUserStore.allowKolab();
|
||||
this.folderSelectList = koComputable(() => {
|
||||
const
|
||||
aResult = [{
|
||||
id: '',
|
||||
name: '',
|
||||
}],
|
||||
foldersWalk = folders => {
|
||||
folders.forEach(oItem => {
|
||||
if ('contact' === oItem.kolabType()) {
|
||||
aResult.push({
|
||||
id: oItem.fullName,
|
||||
name: oItem.fullName
|
||||
});
|
||||
}
|
||||
if (oItem.subFolders.length) {
|
||||
foldersWalk(oItem.subFolders());
|
||||
}
|
||||
});
|
||||
};
|
||||
foldersWalk(FolderUserStore.folderList());
|
||||
return aResult;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue