Cleanup and split Enums

This commit is contained in:
djmaze 2021-01-24 22:58:06 +01:00
parent 864da66b5f
commit f3bfa0e8c1
31 changed files with 315 additions and 344 deletions

View file

@ -3,14 +3,17 @@ import ko from 'ko';
import {
Capa,
KeyState,
ComposeType,
StorageResultType,
EditorDefaultType,
Notification,
SetSystemFoldersNotification,
UploadErrorCode
} from 'Common/Enums';
import {
ComposeType,
EditorDefaultType,
SetSystemFoldersNotification
} from 'Common/EnumsUser';
import { inFocus, pInt } from 'Common/Utils';
import { encodeHtml, delegateRunOnDestroy } from 'Common/UtilsUser';

View file

@ -2,14 +2,14 @@ import ko from 'ko';
import {
SaveSettingsStep,
ContactPropertyType,
ComposeType,
Capa,
StorageResultType,
Notification,
KeyState
} from 'Common/Enums';
import { ComposeType } from 'Common/EnumsUser';
import { pInt } from 'Common/Utils';
import { delegateRunOnDestroy, computedPaginatorHelper } from 'Common/UtilsUser';
@ -24,7 +24,7 @@ import Remote from 'Remote/User/Fetch';
import { EmailModel } from 'Model/Email';
import { ContactModel } from 'Model/Contact';
import { ContactPropertyModel } from 'Model/ContactProperty';
import { ContactPropertyModel, ContactPropertyType } from 'Model/ContactProperty';
import { command, showScreenPopup, hideScreenPopup } from 'Knoin/Knoin';
import { AbstractViewPopup } from 'Knoin/AbstractViews';

View file

@ -1,4 +1,4 @@
import { StorageResultType, ServerSecure, Notification } from 'Common/Enums';
import { StorageResultType, Notification } from 'Common/Enums';
import { pInt, pString } from 'Common/Utils';
import { i18n } from 'Common/Translator';
@ -37,15 +37,15 @@ class DomainPopupView extends AbstractViewPopup {
imapServer: '',
imapPort: '143',
imapSecure: ServerSecure.None,
imapSecure: 0,
imapShortLogin: false,
useSieve: false,
sieveServer: '',
sievePort: '4190',
sieveSecure: ServerSecure.None,
sieveSecure: 0,
smtpServer: '',
smtpPort: '25',
smtpSecure: ServerSecure.None,
smtpSecure: 0,
smtpShortLogin: false,
smtpAuth: true,
smtpPhpMail: false,
@ -325,17 +325,17 @@ class DomainPopupView extends AbstractViewPopup {
this.imapServer('');
this.imapPort('143');
this.imapSecure(ServerSecure.None);
this.imapSecure(0);
this.imapShortLogin(false);
this.useSieve(false);
this.sieveServer('');
this.sievePort('4190');
this.sieveSecure(ServerSecure.None);
this.sieveSecure(0);
this.smtpServer('');
this.smtpPort('25');
this.smtpSecure(ServerSecure.None);
this.smtpSecure(0);
this.smtpShortLogin(false);
this.smtpAuth(true);
this.smtpPhpMail(false);

View file

@ -1,6 +1,7 @@
import ko from 'ko';
import { FiltersAction, FilterConditionField, FilterConditionType } from 'Common/Enums';
import { FilterAction } from 'Model/Filter';
import { FilterConditionField, FilterConditionType } from 'Model/FilterCondition';
import { defaultOptionsAfterRender } from 'Common/Utils';
import { i18n, initOnStartOrLangChange } from 'Common/Translator';
@ -40,7 +41,7 @@ class FilterPopupView extends AbstractViewPopup {
@command()
saveFilterCommand() {
if (this.filter()) {
if (FiltersAction.MoveTo === this.filter().actionType()) {
if (FilterAction.MoveTo === this.filter().actionType()) {
this.filter().actionValue(this.selectedFolderValue());
}
@ -74,7 +75,7 @@ class FilterPopupView extends AbstractViewPopup {
{ 'id': FilterConditionType.NotEqualTo, 'name': i18n('POPUPS_FILTER/SELECT_TYPE_NOT_EQUAL_TO') }
]);
// this.actionTypeOptions.push({'id': FiltersAction.None,
// this.actionTypeOptions.push({'id': FilterAction.None,
// 'name': i18n('GLOBAL/NONE')});
const modules = SieveStore.capa;
if (modules) {
@ -84,22 +85,22 @@ class FilterPopupView extends AbstractViewPopup {
if (modules.includes('fileinto')) {
this.actionTypeOptions.push({
'id': FiltersAction.MoveTo,
'id': FilterAction.MoveTo,
'name': i18n('POPUPS_FILTER/SELECT_ACTION_MOVE_TO')
});
this.actionTypeOptions.push({
'id': FiltersAction.Forward,
'id': FilterAction.Forward,
'name': i18n('POPUPS_FILTER/SELECT_ACTION_FORWARD_TO')
});
}
if (modules.includes('reject')) {
this.actionTypeOptions.push({ 'id': FiltersAction.Reject, 'name': i18n('POPUPS_FILTER/SELECT_ACTION_REJECT') });
this.actionTypeOptions.push({ 'id': FilterAction.Reject, 'name': i18n('POPUPS_FILTER/SELECT_ACTION_REJECT') });
}
if (modules.includes('vacation')) {
this.actionTypeOptions.push({
'id': FiltersAction.Vacation,
'id': FilterAction.Vacation,
'name': i18n('POPUPS_FILTER/SELECT_ACTION_VACATION_MESSAGE')
});
}
@ -113,7 +114,7 @@ class FilterPopupView extends AbstractViewPopup {
}
}
this.actionTypeOptions.push({ 'id': FiltersAction.Discard, 'name': i18n('POPUPS_FILTER/SELECT_ACTION_DISCARD') });
this.actionTypeOptions.push({ 'id': FilterAction.Discard, 'name': i18n('POPUPS_FILTER/SELECT_ACTION_DISCARD') });
this.typeOptionsSize([
{ 'id': FilterConditionType.Over, 'name': i18n('POPUPS_FILTER/SELECT_TYPE_OVER') },

View file

@ -1,6 +1,6 @@
import ko from 'ko';
import { SetSystemFoldersNotification } from 'Common/Enums';
import { SetSystemFoldersNotification } from 'Common/EnumsUser';
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
import { defaultOptionsAfterRender } from 'Common/Utils';
import { folderListOptionsBuilder } from 'Common/UtilsUser';

View file

@ -1,13 +1,12 @@
import ko from 'ko';
import {
LoginSignMeType,
LoginSignMeTypeAsString,
ClientSideKeyName,
StorageResultType,
Notification
} from 'Common/Enums';
import { ClientSideKeyName } from 'Common/EnumsUser';
import { convertLangName } from 'Common/Utils';
import { getNotification, getNotificationFromResponse, reload as translatorReload } from 'Common/Translator';
@ -24,7 +23,20 @@ import { AbstractViewCenter } from 'Knoin/AbstractViews';
import { rootAdmin } from 'Common/Links';
const Settings = rl.settings;
const Settings = rl.settings,
LoginSignMeType = {
DefaultOff: 0,
DefaultOn: 1,
Unused: 2
},
LoginSignMeTypeAsString = {
DefaultOff: 'defaultoff',
DefaultOn: 'defaulton',
Unused: 'unused'
};
class LoginUserView extends AbstractViewCenter {
constructor() {

View file

@ -1,6 +1,7 @@
import ko from 'ko';
import { Capa, Focused, Layout, KeyState } from 'Common/Enums';
import { Capa, KeyState } from 'Common/Enums';
import { Focused, Layout } from 'Common/EnumsUser';
import { leftPanelDisabled, moveAction } from 'Common/Globals';
import { mailBox, settings } from 'Common/Links';
import { setFolderHash } from 'Common/Cache';

View file

@ -2,14 +2,17 @@ import ko from 'ko';
import {
Capa,
KeyState,
StorageResultType
} from 'Common/Enums';
import {
Layout,
Focused,
ComposeType,
FolderType,
MessageSetAction,
KeyState,
StorageResultType
} from 'Common/Enums';
MessageSetAction
} from 'Common/EnumsUser';
import { UNUSED_OPTION_VALUE } from 'Common/Consts';

View file

@ -4,14 +4,17 @@ import { UNUSED_OPTION_VALUE } from 'Common/Consts';
import {
Capa,
KeyState
} from 'Common/Enums';
import {
ComposeType,
ClientSideKeyName,
KeyState,
FolderType,
Focused,
Layout,
MessageSetAction
} from 'Common/Enums';
} from 'Common/EnumsUser';
import { $htmlCL, leftPanelDisabled, keyScopeReal, moveAction } from 'Common/Globals';