mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +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
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
|||
import { StorageResultType } from 'Common/Enums';
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
import DomainStore from 'Stores/Admin/Domain';
|
||||
import { DomainAdminStore } from 'Stores/Admin/Domain';
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
import { DomainPopupView } from 'View/Popup/Domain';
|
||||
|
|
@ -11,9 +11,9 @@ import { DomainAliasPopupView } from 'View/Popup/DomainAlias';
|
|||
|
||||
export class DomainsAdminSettings {
|
||||
constructor() {
|
||||
this.domains = DomainStore.domains;
|
||||
this.domains = DomainAdminStore;
|
||||
|
||||
this.visibility = ko.computed(() => (this.domains.loading() ? 'visible' : 'hidden'));
|
||||
this.visibility = ko.computed(() => (DomainAdminStore.loading() ? 'visible' : 'hidden'));
|
||||
|
||||
this.domainForDeletion = ko.observable(null).deleteAccessHelper();
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ export class DomainsAdminSettings {
|
|||
}
|
||||
|
||||
deleteDomain(domain) {
|
||||
this.domains.remove(domain);
|
||||
DomainAdminStore.remove(domain);
|
||||
Remote.domainDelete(this.onDomainListChangeRequest, domain.name);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ import Remote from 'Remote/Admin/Fetch';
|
|||
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
import { LanguageStore } from 'Stores/Language';
|
||||
import AppAdminStore from 'Stores/Admin/App';
|
||||
import CapaAdminStore from 'Stores/Admin/Capa';
|
||||
import { AppAdminStore } from 'Stores/Admin/App';
|
||||
import { CapaAdminStore } from 'Stores/Admin/Capa';
|
||||
import LanguagesPopupView from 'View/Popup/Languages';
|
||||
|
||||
const settingsGet = rl.settings.get;
|
||||
|
|
@ -31,7 +31,7 @@ export class GeneralAdminSettings {
|
|||
this.languagesAdmin = ko.observableArray(Array.isArray(aLanguagesAdmin) ? aLanguagesAdmin : []);
|
||||
this.languageAdmin = ko
|
||||
.observable(settingsGet('LanguageAdmin'))
|
||||
.extend({ limitedList: this.languagesAdmin, reversible: true });
|
||||
.extend({ limitedList: this.languagesAdmin });
|
||||
|
||||
this.theme = ThemeStore.theme;
|
||||
this.themes = ThemeStore.themes;
|
||||
|
|
|
|||
|
|
@ -3,28 +3,26 @@ import ko from 'ko';
|
|||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
|
||||
import PackageStore from 'Stores/Admin/Package';
|
||||
import { PackageAdminStore } from 'Stores/Admin/Package';
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
export class PackagesAdminSettings {
|
||||
constructor() {
|
||||
this.packagesError = ko.observable('');
|
||||
|
||||
this.packages = PackageStore.packages;
|
||||
this.packagesReal = PackageStore.packagesReal;
|
||||
this.packagesMainUpdatable = PackageStore.packagesMainUpdatable;
|
||||
this.packages = PackageAdminStore;
|
||||
|
||||
this.packagesCurrent = ko.computed(() =>
|
||||
this.packages.filter(item => item && item.installed && !item.compare)
|
||||
PackageAdminStore.filter(item => item && item.installed && !item.compare)
|
||||
);
|
||||
this.packagesAvailableForUpdate = ko.computed(() =>
|
||||
this.packages.filter(item => item && item.installed && !!item.compare)
|
||||
PackageAdminStore.filter(item => item && item.installed && !!item.compare)
|
||||
);
|
||||
this.packagesAvailableForInstallation = ko.computed(() =>
|
||||
this.packages.filter(item => item && !item.installed)
|
||||
PackageAdminStore.filter(item => item && !item.installed)
|
||||
);
|
||||
|
||||
this.visibility = ko.computed(() => (PackageStore.packages.loading() ? 'visible' : 'hidden'));
|
||||
this.visibility = ko.computed(() => (PackageAdminStore.loading() ? 'visible' : 'hidden'));
|
||||
}
|
||||
|
||||
onShow() {
|
||||
|
|
@ -47,7 +45,7 @@ export class PackagesAdminSettings {
|
|||
}
|
||||
}
|
||||
|
||||
this.packages.forEach(item => {
|
||||
PackageAdminStore.forEach(item => {
|
||||
if (item && packageToRequest && item.loading && item.loading() && packageToRequest.file === item.file) {
|
||||
packageToRequest.loading(false);
|
||||
item.loading(false);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { getNotification } from 'Common/Translator';
|
|||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
||||
import PluginStore from 'Stores/Admin/Plugin';
|
||||
import { PluginAdminStore } from 'Stores/Admin/Plugin';
|
||||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
|
|
@ -15,10 +15,10 @@ export class PluginsAdminSettings {
|
|||
constructor() {
|
||||
this.enabledPlugins = ko.observable(!!rl.settings.get('EnabledPlugins'));
|
||||
|
||||
this.plugins = PluginStore.plugins;
|
||||
this.pluginsError = PluginStore.plugins.error;
|
||||
this.plugins = PluginAdminStore;
|
||||
this.pluginsError = PluginAdminStore.error;
|
||||
|
||||
this.visibility = ko.computed(() => (PluginStore.plugins.loading() ? 'visible' : 'hidden'));
|
||||
this.visibility = ko.computed(() => (PluginAdminStore.loading() ? 'visible' : 'hidden'));
|
||||
|
||||
this.onPluginLoadRequest = this.onPluginLoadRequest.bind(this);
|
||||
this.onPluginDisableRequest = this.onPluginDisableRequest.bind(this);
|
||||
|
|
@ -50,7 +50,7 @@ export class PluginsAdminSettings {
|
|||
}
|
||||
|
||||
onShow() {
|
||||
PluginStore.plugins.error('');
|
||||
PluginAdminStore.error('');
|
||||
rl.app.reloadPluginList();
|
||||
}
|
||||
|
||||
|
|
@ -64,9 +64,9 @@ export class PluginsAdminSettings {
|
|||
if (StorageResultType.Success === result && data) {
|
||||
if (!data.Result && data.ErrorCode) {
|
||||
if (Notification.UnsupportedPluginPackage === data.ErrorCode && data.ErrorMessage && data.ErrorMessage) {
|
||||
PluginStore.plugins.error(data.ErrorMessage);
|
||||
PluginAdminStore.error(data.ErrorMessage);
|
||||
} else {
|
||||
PluginStore.plugins.error(getNotification(data.ErrorCode));
|
||||
PluginAdminStore.error(getNotification(data.ErrorCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import ko from 'ko';
|
|||
|
||||
import { StorageResultType } from 'Common/Enums';
|
||||
|
||||
import AppAdminStore from 'Stores/Admin/App';
|
||||
import CapaAdminStore from 'Stores/Admin/Capa';
|
||||
import { AppAdminStore } from 'Stores/Admin/App';
|
||||
import { CapaAdminStore } from 'Stores/Admin/Capa';
|
||||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
|||
import { Capa, StorageResultType } from 'Common/Enums';
|
||||
|
||||
import AccountStore from 'Stores/User/Account';
|
||||
import IdentityStore from 'Stores/User/Identity';
|
||||
import { IdentityUserStore } from 'Stores/User/Identity';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
|
@ -17,7 +17,7 @@ export class AccountsUserSettings {
|
|||
this.allowIdentities = rl.settings.capa(Capa.Identities);
|
||||
|
||||
this.accounts = AccountStore.accounts;
|
||||
this.identities = IdentityStore.identities;
|
||||
this.identities = IdentityUserStore;
|
||||
|
||||
this.accountForDeletion = ko.observable(null).deleteAccessHelper();
|
||||
this.identityForDeletion = ko.observable(null).deleteAccessHelper();
|
||||
|
|
@ -72,14 +72,14 @@ export class AccountsUserSettings {
|
|||
this.identityForDeletion(null);
|
||||
|
||||
if (identityToRemove) {
|
||||
IdentityStore.identities.remove(oIdentity => identityToRemove === oIdentity);
|
||||
IdentityUserStore.remove(oIdentity => identityToRemove === oIdentity);
|
||||
Remote.identityDelete(() => rl.app.accountsAndIdentities(), identityToRemove.id());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
accountsAndIdentitiesAfterMove() {
|
||||
Remote.accountsAndIdentitiesSortOrder(null, AccountStore.getEmailAddresses(), IdentityStore.getIDS());
|
||||
Remote.accountsAndIdentitiesSortOrder(null, AccountStore.getEmailAddresses(), IdentityUserStore.getIDS());
|
||||
}
|
||||
|
||||
onBuild(oDom) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { delegateRunOnDestroy } from 'Common/UtilsUser';
|
|||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
|
||||
import SieveStore from 'Stores/User/Sieve';
|
||||
import { SieveUserStore } from 'Stores/User/Sieve';
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { SieveScriptModel } from 'Model/SieveScript';
|
||||
|
|
@ -15,7 +15,7 @@ import { SieveScriptPopupView } from 'View/Popup/SieveScript';
|
|||
|
||||
export class FiltersUserSettings {
|
||||
constructor() {
|
||||
this.scripts = SieveStore.scripts;
|
||||
this.scripts = SieveUserStore.scripts;
|
||||
this.loading = ko.observable(false).extend({ debounce: 200 });
|
||||
|
||||
ko.addObservablesTo(this, {
|
||||
|
|
@ -41,7 +41,7 @@ export class FiltersUserSettings {
|
|||
this.scripts([]);
|
||||
|
||||
if (StorageResultType.Success === result && data && data.Result) {
|
||||
SieveStore.capa(data.Result.Capa);
|
||||
SieveUserStore.capa(data.Result.Capa);
|
||||
/*
|
||||
this.scripts(
|
||||
data.Result.Scripts.map(aItem => SieveScriptModel.reviveFromJson(aItem)).filter(v => v)
|
||||
|
|
@ -52,7 +52,7 @@ export class FiltersUserSettings {
|
|||
value && this.scripts.push(value)
|
||||
});
|
||||
} else {
|
||||
SieveStore.capa([]);
|
||||
SieveUserStore.capa([]);
|
||||
this.setError(
|
||||
data && data.ErrorCode ? getNotification(data.ErrorCode) : getNotification(Notification.CantGetFilters)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import { showScreenPopup } from 'Knoin/Knoin';
|
|||
import AppStore from 'Stores/User/App';
|
||||
import { LanguageStore } from 'Stores/Language';
|
||||
import SettingsStore from 'Stores/User/Settings';
|
||||
import IdentityStore from 'Stores/User/Identity';
|
||||
import { IdentityUserStore } from 'Stores/User/Identity';
|
||||
import NotificationStore from 'Stores/User/Notification';
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ export class GeneralUserSettings {
|
|||
layoutTrigger: SaveSettingsStep.Idle
|
||||
});
|
||||
|
||||
this.identities = IdentityStore.identities;
|
||||
this.identities = IdentityUserStore;
|
||||
|
||||
this.identityMain = ko.computed(() => {
|
||||
const list = this.identities();
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ export class ThemesUserSettings {
|
|||
this.themesObjects = ko.observableArray();
|
||||
|
||||
this.background = {};
|
||||
this.background.name = ThemeStore.themeBackgroundName;
|
||||
this.background.hash = ThemeStore.themeBackgroundHash;
|
||||
this.background.name = ThemeStore.userBackgroundName;
|
||||
this.background.hash = ThemeStore.userBackgroundHash;
|
||||
this.background.uploaderButton = ko.observable(null);
|
||||
this.background.loading = ko.observable(false);
|
||||
this.background.error = ko.observable('');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue