mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 03:29:20 +03:00
Bugfix: conflicting File object with native JS
Cleanup: Stores and tooltips
This commit is contained in:
parent
1df2e00862
commit
db0d03db83
43 changed files with 204 additions and 295 deletions
|
|
@ -2,9 +2,9 @@ import ko from 'ko';
|
|||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
import DomainStore from 'Stores/Admin/Domain';
|
||||
import PluginStore from 'Stores/Admin/Plugin';
|
||||
import PackageStore from 'Stores/Admin/Package';
|
||||
import { DomainAdminStore } from 'Stores/Admin/Domain';
|
||||
import { PluginAdminStore } from 'Stores/Admin/Plugin';
|
||||
import { PackageAdminStore } from 'Stores/Admin/Package';
|
||||
|
||||
import { AbstractViewRight } from 'Knoin/AbstractViews';
|
||||
|
||||
|
|
@ -19,9 +19,9 @@ class PaneSettingsAdminView extends AbstractViewRight {
|
|||
this.leftPanelDisabled = leftPanelDisabled;
|
||||
|
||||
this.adminManLoadingVisibility = ko
|
||||
.computed(() => (DomainStore.domains.loading()
|
||||
|| PluginStore.plugins.loading()
|
||||
|| PackageStore.packages.loading()) ? 'visible' : 'hidden')
|
||||
.computed(() => (DomainAdminStore.loading()
|
||||
|| PluginAdminStore.loading()
|
||||
|| PackageAdminStore.loading()) ? 'visible' : 'hidden')
|
||||
.extend({ rateLimit: 300 });
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import { Settings } from 'Common/Globals';
|
|||
|
||||
import AppStore from 'Stores/User/App';
|
||||
import SettingsStore from 'Stores/User/Settings';
|
||||
import IdentityStore from 'Stores/User/Identity';
|
||||
import { IdentityUserStore } from 'Stores/User/Identity';
|
||||
import AccountStore from 'Stores/User/Account';
|
||||
import FolderStore from 'Stores/User/Folder';
|
||||
import PgpStore from 'Stores/User/Pgp';
|
||||
|
|
@ -136,7 +136,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
this.capaOpenPGP = PgpStore.capaOpenPGP;
|
||||
|
||||
this.identities = IdentityStore.identities;
|
||||
this.identities = IdentityUserStore;
|
||||
|
||||
this.addObservables({
|
||||
identitiesDropdownTrigger: false,
|
||||
|
|
@ -258,7 +258,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
isDraftFolderMessage: () => this.draftFolder() && this.draftUid(),
|
||||
|
||||
identitiesOptions: () =>
|
||||
IdentityStore.identities.map(item => ({
|
||||
IdentityUserStore.map(item => ({
|
||||
'item': item,
|
||||
'optValue': item.id(),
|
||||
'optText': item.formattedName()
|
||||
|
|
@ -553,7 +553,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
findIdentityByMessage(composeType, message) {
|
||||
let resultIndex = 1000,
|
||||
resultIdentity = null;
|
||||
const identities = IdentityStore.identities(),
|
||||
const identities = IdentityUserStore(),
|
||||
identitiesCache = {},
|
||||
fEachHelper = (item) => {
|
||||
if (item && item.email && identitiesCache[item.email]) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { StorageResultType, Notification } from 'Common/Enums';
|
|||
import { pInt, pString } from 'Common/Utils';
|
||||
import { i18n } from 'Common/Translator';
|
||||
|
||||
import CapaAdminStore from 'Stores/Admin/Capa';
|
||||
import { CapaAdminStore } from 'Stores/Admin/Capa';
|
||||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
|||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { i18n } from 'Common/Translator';
|
||||
|
||||
import DomainStore from 'Stores/Admin/Domain';
|
||||
import { DomainAdminStore } from 'Stores/Admin/Domain';
|
||||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ class DomainAliasPopupView extends AbstractViewPopup {
|
|||
alias: ''
|
||||
});
|
||||
|
||||
this.domains = DomainStore.domainsWithoutAliases;
|
||||
this.domains = ko.computed(() => DomainAdminStore.filter(item => item && !item.alias));
|
||||
|
||||
this.domainsOptions = ko.computed(() => this.domains().map(item => ({ optValue: item.name, optText: item.name })));
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { defaultOptionsAfterRender } from 'Common/Utils';
|
|||
import { i18n, initOnStartOrLangChange } from 'Common/Translator';
|
||||
|
||||
import FolderStore from 'Stores/User/Folder';
|
||||
import SieveStore from 'Stores/User/Sieve';
|
||||
import { SieveUserStore } from 'Stores/User/Sieve';
|
||||
|
||||
import { command } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
|
@ -35,7 +35,7 @@ class FilterPopupView extends AbstractViewPopup {
|
|||
|
||||
initOnStartOrLangChange(this.populateOptions.bind(this));
|
||||
|
||||
SieveStore.capa.subscribe(this.populateOptions, this);
|
||||
SieveUserStore.capa.subscribe(this.populateOptions, this);
|
||||
}
|
||||
|
||||
@command()
|
||||
|
|
@ -79,7 +79,7 @@ class FilterPopupView extends AbstractViewPopup {
|
|||
|
||||
// this.actionTypeOptions.push({'id': FilterAction.None,
|
||||
// 'name': i18n('GLOBAL/NONE')});
|
||||
const modules = SieveStore.capa;
|
||||
const modules = SieveUserStore.capa;
|
||||
if (modules) {
|
||||
if (modules.includes('imap4flags')) {
|
||||
this.allowMarkAsRead(true);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { i18nToNodes } from 'Common/Translator';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
import { FilterModel } from 'Model/Filter';
|
||||
import SieveStore from 'Stores/User/Sieve';
|
||||
import { SieveUserStore } from 'Stores/User/Sieve';
|
||||
|
||||
import { showScreenPopup/*, command*/ } from 'Knoin/Knoin';
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
|
@ -26,7 +26,7 @@ class SieveScriptPopupView extends AbstractViewPopup {
|
|||
script: null
|
||||
});
|
||||
|
||||
this.sieveCapabilities = SieveStore.capa.join(' ');
|
||||
this.sieveCapabilities = SieveUserStore.capa.join(' ');
|
||||
this.saving = false;
|
||||
|
||||
this.filterForDeletion = ko.observable(null).deleteAccessHelper();
|
||||
|
|
@ -41,7 +41,7 @@ class SieveScriptPopupView extends AbstractViewPopup {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!script.exists() && SieveStore.scripts.find(item => item.name() === script.name())) {
|
||||
if (!script.exists() && SieveUserStore.scripts.find(item => item.name() === script.name())) {
|
||||
script.nameError(true);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ class SieveScriptPopupView extends AbstractViewPopup {
|
|||
self.saving = false;
|
||||
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
script.exists() || SieveStore.scripts.push(script);
|
||||
script.exists() || SieveUserStore.scripts.push(script);
|
||||
script.exists(true);
|
||||
script.hasChanges(false);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
|||
import { doc, leftPanelDisabled, moveAction, Settings } from 'Common/Globals';
|
||||
|
||||
import { computedPaginatorHelper } from 'Common/UtilsUser';
|
||||
import { File } from 'Common/File';
|
||||
import { FileInfo } from 'Common/File';
|
||||
|
||||
import { mailBox, serverRequest } from 'Common/Links';
|
||||
import { Selector } from 'Common/Selector';
|
||||
|
|
@ -882,9 +882,9 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
|||
|
||||
quotaTooltip() {
|
||||
return i18n('MESSAGE_LIST/QUOTA_SIZE', {
|
||||
'SIZE': File.friendlySize(this.userUsageSize()),
|
||||
'SIZE': FileInfo.friendlySize(this.userUsageSize()),
|
||||
'PROC': this.userUsageProc(),
|
||||
'LIMIT': File.friendlySize(this.userQuota())
|
||||
'LIMIT': FileInfo.friendlySize(this.userQuota())
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue