mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29: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';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue