From 9a64b4322adadbe18929c2da114eb0813426c4f9 Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Wed, 20 Oct 2021 10:49:47 +0530 Subject: chore: use 'window['ferdi']' (split out from pr #2092) (#2104) Co-authored-by: Markus Hatvan --- src/lib/Menu.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/lib/Menu.js') diff --git a/src/lib/Menu.js b/src/lib/Menu.js index b1cbaf992..1495fc80e 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -313,7 +313,7 @@ const menuItems = defineMessages({ }); function getActiveService() { - return window.ferdi.stores.services.active; + return window['ferdi'].stores.services.active; } const _titleBarTemplateFactory = (intl, locked) => [ @@ -375,7 +375,7 @@ const _titleBarTemplateFactory = (intl, locked) => [ label: intl.formatMessage(menuItems.openQuickSwitch), accelerator: `${cmdOrCtrlShortcutKey()}+S`, click() { - window.ferdi.features.quickSwitch.state.isModalVisible = true; + window['ferdi'].features.quickSwitch.state.isModalVisible = true; }, }, { @@ -391,7 +391,7 @@ const _titleBarTemplateFactory = (intl, locked) => [ // Focus webview so find in page popup gets focused service.webview.focus(); - window.ferdi.actions.service.sendIPCMessage({ + window['ferdi'].actions.service.sendIPCMessage({ serviceId: service.id, channel: 'find-in-page', args: {}, @@ -457,12 +457,12 @@ const _titleBarTemplateFactory = (intl, locked) => [ label: intl.formatMessage(menuItems.toggleDarkMode), type: 'checkbox', accelerator: `${cmdOrCtrlShortcutKey()}+${shiftKey()}+D`, - checked: window.ferdi.stores.settings.app.darkMode, + checked: window['ferdi'].stores.settings.app.darkMode, click: () => { - window.ferdi.actions.settings.update({ + window['ferdi'].actions.settings.update({ type: 'app', data: { - darkMode: !window.ferdi.stores.settings.app.darkMode, + darkMode: !window['ferdi'].stores.settings.app.darkMode, }, }); }, @@ -579,13 +579,13 @@ class FranzMenu { // need to clone object so we don't modify computed (cached) object const serviceTpl = Object.assign([], this.serviceTpl()); - // Don't initialize when window.ferdi is undefined - if (window.ferdi === undefined) { + // Don't initialize when window['ferdi'] is undefined + if (window['ferdi'] === undefined) { console.log('skipping menu init'); return; } - const { intl } = window.ferdi; + const { intl } = window['ferdi']; const tpl = _titleBarTemplateFactory(intl, this.stores.settings.app.locked); const { actions } = this; @@ -593,13 +593,13 @@ class FranzMenu { tpl[1].submenu.push({ label: intl.formatMessage(menuItems.autohideMenuBar), type: 'checkbox', - checked: window.ferdi.stores.settings.app.autohideMenuBar, + checked: window['ferdi'].stores.settings.app.autohideMenuBar, click: () => { - window.ferdi.actions.settings.update({ + window['ferdi'].actions.settings.update({ type: 'app', data: { autohideMenuBar: - !window.ferdi.stores.settings.app.autohideMenuBar, + !window['ferdi'].stores.settings.app.autohideMenuBar, }, }); }, @@ -893,7 +893,7 @@ class FranzMenu { } serviceTpl() { - const { intl } = window.ferdi; + const { intl } = window['ferdi']; const { user, services, settings } = this.stores; if (!user.isLoggedIn) return []; const menu = []; @@ -988,7 +988,7 @@ class FranzMenu { workspacesMenu() { const { workspaces, activeWorkspace, isWorkspaceDrawerOpen } = workspaceStore; - const { intl } = window.ferdi; + const { intl } = window['ferdi']; const menu = []; // Add new workspace item: @@ -1050,7 +1050,7 @@ class FranzMenu { todosMenu() { const { isTodosPanelVisible, isFeatureEnabledByUser } = this.stores.todos; - const { intl } = window.ferdi; + const { intl } = window['ferdi']; const menu = []; const drawerLabel = isTodosPanelVisible @@ -1084,7 +1084,7 @@ class FranzMenu { } debugMenu() { - const { intl } = window.ferdi; + const { intl } = window['ferdi']; return [ { @@ -1107,7 +1107,7 @@ class FranzMenu { { label: intl.formatMessage(menuItems.publishDebugInfo), click: () => { - window.ferdi.features.publishDebugInfo.state.isModalVisible = true; + window['ferdi'].features.publishDebugInfo.state.isModalVisible = true; }, }, ]; -- cgit v1.2.3-70-g09d2 From 91c69428ed0dc2dd26b00c6dd5a6684f25515a34 Mon Sep 17 00:00:00 2001 From: Abin Mn Date: Tue, 26 Oct 2021 21:18:20 +0530 Subject: Cleanup/remove feature toggle for todo, workspace, service proxy (#2134) * Remove DEFAULT_FEATURES_CONFIG from config * Remove static controller Co-authored-by: Madhuri B --- src/components/layout/Sidebar.js | 36 +++--- .../settings/navigation/SettingsNavigation.js | 21 ++-- .../settings/settings/EditSettingsForm.js | 16 +-- src/config.ts | 9 +- src/containers/settings/EditServiceScreen.js | 2 - src/containers/settings/EditSettingsScreen.js | 18 ++- src/features/settingsWS/actions.ts | 13 -- src/features/settingsWS/index.ts | 28 ----- src/features/settingsWS/state.ts | 13 -- src/features/settingsWS/store.js | 132 --------------------- src/features/todos/index.ts | 25 +--- src/features/todos/store.js | 9 -- src/features/workspaces/index.ts | 22 +--- src/features/workspaces/store.js | 8 -- .../app/Controllers/Http/StaticController.js | 20 ---- src/internal-server/start/routes.js | 5 - src/lib/Menu.js | 21 +--- src/stores.types.ts | 4 - src/stores/FeaturesStore.js | 10 +- 19 files changed, 50 insertions(+), 362 deletions(-) delete mode 100755 src/features/settingsWS/actions.ts delete mode 100755 src/features/settingsWS/index.ts delete mode 100755 src/features/settingsWS/state.ts delete mode 100755 src/features/settingsWS/store.js delete mode 100644 src/internal-server/app/Controllers/Http/StaticController.js (limited to 'src/lib/Menu.js') diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index 2bae57648..18492be80 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js @@ -14,7 +14,6 @@ import { addNewServiceShortcutKey, muteFerdiShortcutKey, } from '../../environment'; -import { workspaceStore } from '../../features/workspaces'; import { todosStore } from '../../features/todos'; import { todoActions } from '../../features/todos/actions'; import AppStore from '../../stores/AppStore'; @@ -160,8 +159,7 @@ class Sidebar extends Component { ) : null} - {todosStore.isFeatureEnabled && - todosStore.isFeatureEnabledByUser ? ( + {todosStore.isFeatureEnabledByUser ? ( ) : null} - {workspaceStore.isFeatureEnabled ? ( - - ) : null} +