diff options
author | 2021-06-22 10:56:34 +0530 | |
---|---|---|
committer | 2021-06-22 10:56:34 +0530 | |
commit | a94ed659846f0bc93c05bccf0c96785b91e5c78f (patch) | |
tree | 0a50eeb85e9043708936da9a0c923b32edbe8ab9 | |
parent | Downgraded submodule 'src/internal-server' (diff) | |
download | ferdium-app-a94ed659846f0bc93c05bccf0c96785b91e5c78f.tar.gz ferdium-app-a94ed659846f0bc93c05bccf0c96785b91e5c78f.tar.zst ferdium-app-a94ed659846f0bc93c05bccf0c96785b91e5c78f.zip |
29 files changed, 104 insertions, 94 deletions
diff --git a/src/config.js b/src/config.js index 27ac6be0b..d96a6068b 100644 --- a/src/config.js +++ b/src/config.js | |||
@@ -287,3 +287,11 @@ export const PLANS_MAPPING = { | |||
287 | 287 | ||
288 | 288 | ||
289 | export const DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED = false; | 289 | export const DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED = false; |
290 | |||
291 | export const DEFAULT_SERVICE_LIMIT = 3; | ||
292 | |||
293 | export const DEFAULT_TODOS_WIDTH = 300; | ||
294 | export const TODOS_MIN_WIDTH = 200; | ||
295 | export const DEFAULT_TODOS_VISIBLE = true; | ||
296 | export const DEFAULT_IS_FEATURE_ENABLED_BY_USER = true; | ||
297 | export const TODOS_PARTITION_ID = 'persist:todos'; | ||
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 2b2d7277b..0a8258478 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -11,7 +11,7 @@ import Form from '../../lib/Form'; | |||
11 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; | 11 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; |
12 | import { | 12 | import { |
13 | DEFAULT_APP_SETTINGS, HIBERNATION_STRATEGIES, SIDEBAR_WIDTH, ICON_SIZES, NAVIGATION_BAR_BEHAVIOURS, SEARCH_ENGINE_NAMES, TODO_APPS, | 13 | DEFAULT_APP_SETTINGS, HIBERNATION_STRATEGIES, SIDEBAR_WIDTH, ICON_SIZES, NAVIGATION_BAR_BEHAVIOURS, SEARCH_ENGINE_NAMES, TODO_APPS, |
14 | DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED, | 14 | DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED, DEFAULT_IS_FEATURE_ENABLED_BY_USER, |
15 | } from '../../config'; | 15 | } from '../../config'; |
16 | import { isMac } from '../../environment'; | 16 | import { isMac } from '../../environment'; |
17 | import { config as spellcheckerConfig } from '../../features/spellchecker'; | 17 | import { config as spellcheckerConfig } from '../../features/spellchecker'; |
@@ -24,7 +24,6 @@ import EditSettingsForm from '../../components/settings/settings/EditSettingsFor | |||
24 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 24 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
25 | 25 | ||
26 | import globalMessages from '../../i18n/globalMessages'; | 26 | import globalMessages from '../../i18n/globalMessages'; |
27 | import { DEFAULT_IS_FEATURE_ENABLED_BY_USER } from '../../features/todos'; | ||
28 | import WorkspacesStore from '../../features/workspaces/store'; | 27 | import WorkspacesStore from '../../features/workspaces/store'; |
29 | import ServicesStore from '../../stores/ServicesStore'; | 28 | import ServicesStore from '../../stores/ServicesStore'; |
30 | 29 | ||
diff --git a/src/features/basicAuth/Component.js b/src/features/basicAuth/Component.js index ba9ae2273..14184f80b 100644 --- a/src/features/basicAuth/Component.js +++ b/src/features/basicAuth/Component.js | |||
@@ -13,7 +13,7 @@ import { | |||
13 | resetState, | 13 | resetState, |
14 | sendCredentials, | 14 | sendCredentials, |
15 | cancelLogin, | 15 | cancelLogin, |
16 | } from '.'; | 16 | } from './store'; |
17 | import Form from './Form'; | 17 | import Form from './Form'; |
18 | 18 | ||
19 | import styles from './styles'; | 19 | import styles from './styles'; |
diff --git a/src/features/basicAuth/index.js b/src/features/basicAuth/index.js index 51625ea55..e43d51d15 100644 --- a/src/features/basicAuth/index.js +++ b/src/features/basicAuth/index.js | |||
@@ -1,21 +1,12 @@ | |||
1 | import { ipcRenderer } from 'electron'; | 1 | import { ipcRenderer } from 'electron'; |
2 | import { observable } from 'mobx'; | ||
3 | 2 | ||
4 | import BasicAuthComponent from './Component'; | 3 | import BasicAuthComponent from './Component'; |
5 | 4 | ||
6 | const debug = require('debug')('Ferdi:feature:basicAuth'); | 5 | import { state as ModalState } from './store'; |
7 | |||
8 | const defaultState = { | ||
9 | isModalVisible: true, | ||
10 | service: null, | ||
11 | authInfo: null, | ||
12 | }; | ||
13 | 6 | ||
14 | export const state = observable(defaultState); | 7 | const debug = require('debug')('Ferdi:feature:basicAuth'); |
15 | 8 | ||
16 | export function resetState() { | 9 | const state = ModalState; |
17 | Object.assign(state, defaultState); | ||
18 | } | ||
19 | 10 | ||
20 | export default function initialize() { | 11 | export default function initialize() { |
21 | debug('Initialize basicAuth feature'); | 12 | debug('Initialize basicAuth feature'); |
@@ -40,19 +31,4 @@ export function mainIpcHandler(mainWindow, authInfo) { | |||
40 | }); | 31 | }); |
41 | } | 32 | } |
42 | 33 | ||
43 | export function sendCredentials(user, password) { | ||
44 | debug('Sending credentials to main', user, password); | ||
45 | |||
46 | ipcRenderer.send('feature-basic-auth-credentials', { | ||
47 | user, | ||
48 | password, | ||
49 | }); | ||
50 | } | ||
51 | |||
52 | export function cancelLogin() { | ||
53 | debug('Cancel basic auth event'); | ||
54 | |||
55 | ipcRenderer.send('feature-basic-auth-cancel'); | ||
56 | } | ||
57 | |||
58 | export const Component = BasicAuthComponent; | 34 | export const Component = BasicAuthComponent; |
diff --git a/src/features/basicAuth/store.js b/src/features/basicAuth/store.js new file mode 100644 index 000000000..0713ff572 --- /dev/null +++ b/src/features/basicAuth/store.js | |||
@@ -0,0 +1,30 @@ | |||
1 | import { observable } from 'mobx'; | ||
2 | import { ipcRenderer } from 'electron'; | ||
3 | |||
4 | const debug = require('debug')('Ferdi:feature:basicAuth'); | ||
5 | |||
6 | const defaultState = { | ||
7 | isModalVisible: true, | ||
8 | service: null, | ||
9 | authInfo: null, | ||
10 | }; | ||
11 | |||
12 | export const state = observable(defaultState); | ||
13 | |||
14 | export function resetState() { | ||
15 | Object.assign(state, defaultState); | ||
16 | } | ||
17 | export function sendCredentials(user, password) { | ||
18 | debug('Sending credentials to main', user, password); | ||
19 | |||
20 | ipcRenderer.send('feature-basic-auth-credentials', { | ||
21 | user, | ||
22 | password, | ||
23 | }); | ||
24 | } | ||
25 | |||
26 | export function cancelLogin() { | ||
27 | debug('Cancel basic auth event'); | ||
28 | |||
29 | ipcRenderer.send('feature-basic-auth-cancel'); | ||
30 | } | ||
diff --git a/src/features/communityRecipes/index.js b/src/features/communityRecipes/index.js index 553b423f3..39f7e9cd6 100644 --- a/src/features/communityRecipes/index.js +++ b/src/features/communityRecipes/index.js | |||
@@ -3,8 +3,6 @@ import { CommunityRecipesStore } from './store'; | |||
3 | 3 | ||
4 | const debug = require('debug')('Ferdi:feature:communityRecipes'); | 4 | const debug = require('debug')('Ferdi:feature:communityRecipes'); |
5 | 5 | ||
6 | export const DEFAULT_SERVICE_LIMIT = 3; | ||
7 | |||
8 | export const communityRecipesStore = new CommunityRecipesStore(); | 6 | export const communityRecipesStore = new CommunityRecipesStore(); |
9 | 7 | ||
10 | export default function initCommunityRecipes(stores, actions) { | 8 | export default function initCommunityRecipes(stores, actions) { |
diff --git a/src/features/delayApp/Component.js b/src/features/delayApp/Component.js index 81f89bc52..4ea37f88d 100644 --- a/src/features/delayApp/Component.js +++ b/src/features/delayApp/Component.js | |||
@@ -6,7 +6,7 @@ import injectSheet from 'react-jss'; | |||
6 | 6 | ||
7 | import { Button } from '@meetfranz/forms'; | 7 | import { Button } from '@meetfranz/forms'; |
8 | 8 | ||
9 | import { config } from '.'; | 9 | import { config } from './constants'; |
10 | import styles from './styles'; | 10 | import styles from './styles'; |
11 | import UserStore from '../../stores/UserStore'; | 11 | import UserStore from '../../stores/UserStore'; |
12 | 12 | ||
diff --git a/src/features/delayApp/constants.js b/src/features/delayApp/constants.js new file mode 100644 index 000000000..72cc4246e --- /dev/null +++ b/src/features/delayApp/constants.js | |||
@@ -0,0 +1,6 @@ | |||
1 | import { DEFAULT_FEATURES_CONFIG } from '../../config'; | ||
2 | |||
3 | export const config = { | ||
4 | delayOffset: DEFAULT_FEATURES_CONFIG.needToWaitToProceedConfig.delayOffset, | ||
5 | delayDuration: DEFAULT_FEATURES_CONFIG.needToWaitToProceedConfig.wait, | ||
6 | }; | ||
diff --git a/src/features/delayApp/index.js b/src/features/delayApp/index.js index 51bd887a2..5ef01a47e 100644 --- a/src/features/delayApp/index.js +++ b/src/features/delayApp/index.js | |||
@@ -1,17 +1,12 @@ | |||
1 | import { autorun, observable, reaction } from 'mobx'; | 1 | import { autorun, observable, reaction } from 'mobx'; |
2 | import moment from 'moment'; | 2 | import moment from 'moment'; |
3 | import DelayAppComponent from './Component'; | 3 | import DelayAppComponent from './Component'; |
4 | 4 | import { config } from './constants'; | |
5 | import { DEFAULT_FEATURES_CONFIG } from '../../config'; | 5 | import { DEFAULT_FEATURES_CONFIG } from '../../config'; |
6 | import { getUserWorkspacesRequest } from '../workspaces/api'; | 6 | import { getUserWorkspacesRequest } from '../workspaces/api'; |
7 | 7 | ||
8 | const debug = require('debug')('Ferdi:feature:delayApp'); | 8 | const debug = require('debug')('Ferdi:feature:delayApp'); |
9 | 9 | ||
10 | export const config = { | ||
11 | delayOffset: DEFAULT_FEATURES_CONFIG.needToWaitToProceedConfig.delayOffset, | ||
12 | delayDuration: DEFAULT_FEATURES_CONFIG.needToWaitToProceedConfig.wait, | ||
13 | }; | ||
14 | |||
15 | export const state = observable({ | 10 | export const state = observable({ |
16 | isDelayAppScreenVisible: DEFAULT_FEATURES_CONFIG.needToWaitToProceed, | 11 | isDelayAppScreenVisible: DEFAULT_FEATURES_CONFIG.needToWaitToProceed, |
17 | }); | 12 | }); |
diff --git a/src/features/nightlyBuilds/Component.js b/src/features/nightlyBuilds/Component.js index b340a0a7e..3133672ec 100644 --- a/src/features/nightlyBuilds/Component.js +++ b/src/features/nightlyBuilds/Component.js | |||
@@ -7,7 +7,7 @@ import { H1 } from '@meetfranz/ui'; | |||
7 | 7 | ||
8 | import Modal from '../../components/ui/Modal'; | 8 | import Modal from '../../components/ui/Modal'; |
9 | import Button from '../../components/ui/Button'; | 9 | import Button from '../../components/ui/Button'; |
10 | import { state as ModalState } from '.'; | 10 | import { state as ModalState } from './store'; |
11 | import SettingsStore from '../../stores/SettingsStore'; | 11 | import SettingsStore from '../../stores/SettingsStore'; |
12 | 12 | ||
13 | const messages = defineMessages({ | 13 | const messages = defineMessages({ |
diff --git a/src/features/nightlyBuilds/index.js b/src/features/nightlyBuilds/index.js index 34fe37d4d..89bcb5cb3 100644 --- a/src/features/nightlyBuilds/index.js +++ b/src/features/nightlyBuilds/index.js | |||
@@ -1,14 +1,10 @@ | |||
1 | import { observable } from 'mobx'; | 1 | import { state as ModalState } from './store'; |
2 | 2 | ||
3 | export { default as Component } from './Component'; | 3 | export { default as Component } from './Component'; |
4 | 4 | ||
5 | const debug = require('debug')('Ferdi:feature:nightlyBuilds'); | 5 | const debug = require('debug')('Ferdi:feature:nightlyBuilds'); |
6 | 6 | ||
7 | const defaultState = { | 7 | const state = ModalState; |
8 | isModalVisible: false, | ||
9 | }; | ||
10 | |||
11 | export const state = observable(defaultState); | ||
12 | 8 | ||
13 | export default function initialize() { | 9 | export default function initialize() { |
14 | debug('Initialize nightlyBuilds feature'); | 10 | debug('Initialize nightlyBuilds feature'); |
diff --git a/src/features/nightlyBuilds/store.js b/src/features/nightlyBuilds/store.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/features/nightlyBuilds/store.js | |||
diff --git a/src/features/publishDebugInfo/Component.js b/src/features/publishDebugInfo/Component.js index 1f1b0ed45..63f15fe7b 100644 --- a/src/features/publishDebugInfo/Component.js +++ b/src/features/publishDebugInfo/Component.js | |||
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; | |||
4 | import React, { Component } from 'react'; | 4 | import React, { Component } from 'react'; |
5 | import { defineMessages, intlShape } from 'react-intl'; | 5 | import { defineMessages, intlShape } from 'react-intl'; |
6 | import injectSheet from 'react-jss'; | 6 | import injectSheet from 'react-jss'; |
7 | import { state as ModalState } from '.'; | 7 | import { state as ModalState } from './store'; |
8 | import { sendAuthRequest } from '../../api/utils/auth'; | 8 | import { sendAuthRequest } from '../../api/utils/auth'; |
9 | import Button from '../../components/ui/Button'; | 9 | import Button from '../../components/ui/Button'; |
10 | import Input from '../../components/ui/Input'; | 10 | import Input from '../../components/ui/Input'; |
diff --git a/src/features/publishDebugInfo/index.js b/src/features/publishDebugInfo/index.js index 7d0d310c2..51780a34e 100644 --- a/src/features/publishDebugInfo/index.js +++ b/src/features/publishDebugInfo/index.js | |||
@@ -1,15 +1,10 @@ | |||
1 | import { observable } from 'mobx'; | 1 | import { state as ModalState } from './store'; |
2 | 2 | ||
3 | export { default as Component } from './Component'; | 3 | export { default as Component } from './Component'; |
4 | 4 | ||
5 | const state = ModalState; | ||
5 | const debug = require('debug')('Ferdi:feature:publishDebugInfo'); | 6 | const debug = require('debug')('Ferdi:feature:publishDebugInfo'); |
6 | 7 | ||
7 | const defaultState = { | ||
8 | isModalVisible: false, | ||
9 | }; | ||
10 | |||
11 | export const state = observable(defaultState); | ||
12 | |||
13 | export default function initialize() { | 8 | export default function initialize() { |
14 | debug('Initialize publishDebugInfo feature'); | 9 | debug('Initialize publishDebugInfo feature'); |
15 | 10 | ||
diff --git a/src/features/publishDebugInfo/store.js b/src/features/publishDebugInfo/store.js new file mode 100644 index 000000000..ed06e5a7d --- /dev/null +++ b/src/features/publishDebugInfo/store.js | |||
@@ -0,0 +1,7 @@ | |||
1 | import { observable } from 'mobx'; | ||
2 | |||
3 | const defaultState = { | ||
4 | isModalVisible: false, | ||
5 | }; | ||
6 | |||
7 | export const state = observable(defaultState); | ||
diff --git a/src/features/quickSwitch/Component.js b/src/features/quickSwitch/Component.js index c5c320f52..01cd3b09b 100644 --- a/src/features/quickSwitch/Component.js +++ b/src/features/quickSwitch/Component.js | |||
@@ -10,7 +10,7 @@ import { H1 } from '@meetfranz/ui'; | |||
10 | 10 | ||
11 | import { compact, invoke } from 'lodash'; | 11 | import { compact, invoke } from 'lodash'; |
12 | import Modal from '../../components/ui/Modal'; | 12 | import Modal from '../../components/ui/Modal'; |
13 | import { state as ModalState } from '.'; | 13 | import { state as ModalState } from './store'; |
14 | import ServicesStore from '../../stores/ServicesStore'; | 14 | import ServicesStore from '../../stores/ServicesStore'; |
15 | 15 | ||
16 | const messages = defineMessages({ | 16 | const messages = defineMessages({ |
diff --git a/src/features/quickSwitch/index.js b/src/features/quickSwitch/index.js index c57fad366..a16017219 100644 --- a/src/features/quickSwitch/index.js +++ b/src/features/quickSwitch/index.js | |||
@@ -1,15 +1,10 @@ | |||
1 | import { observable } from 'mobx'; | 1 | import { state as ModalState } from './store'; |
2 | 2 | ||
3 | export { default as Component } from './Component'; | 3 | export { default as Component } from './Component'; |
4 | const state = ModalState; | ||
4 | 5 | ||
5 | const debug = require('debug')('Ferdi:feature:quickSwitch'); | 6 | const debug = require('debug')('Ferdi:feature:quickSwitch'); |
6 | 7 | ||
7 | const defaultState = { | ||
8 | isModalVisible: false, | ||
9 | }; | ||
10 | |||
11 | export const state = observable(defaultState); | ||
12 | |||
13 | export default function initialize() { | 8 | export default function initialize() { |
14 | debug('Initialize quickSwitch feature'); | 9 | debug('Initialize quickSwitch feature'); |
15 | 10 | ||
diff --git a/src/features/quickSwitch/store.js b/src/features/quickSwitch/store.js new file mode 100644 index 000000000..ed06e5a7d --- /dev/null +++ b/src/features/quickSwitch/store.js | |||
@@ -0,0 +1,7 @@ | |||
1 | import { observable } from 'mobx'; | ||
2 | |||
3 | const defaultState = { | ||
4 | isModalVisible: false, | ||
5 | }; | ||
6 | |||
7 | export const state = observable(defaultState); | ||
diff --git a/src/features/serviceLimit/index.js b/src/features/serviceLimit/index.js index fa93bb615..f867e3d87 100644 --- a/src/features/serviceLimit/index.js +++ b/src/features/serviceLimit/index.js | |||
@@ -3,8 +3,6 @@ import { ServiceLimitStore } from './store'; | |||
3 | 3 | ||
4 | const debug = require('debug')('Ferdi:feature:serviceLimit'); | 4 | const debug = require('debug')('Ferdi:feature:serviceLimit'); |
5 | 5 | ||
6 | export const DEFAULT_SERVICE_LIMIT = 3; | ||
7 | |||
8 | let store = null; | 6 | let store = null; |
9 | 7 | ||
10 | export const serviceLimitStore = new ServiceLimitStore(); | 8 | export const serviceLimitStore = new ServiceLimitStore(); |
diff --git a/src/features/serviceLimit/store.js b/src/features/serviceLimit/store.js index 6510e2872..b1e55a1fc 100644 --- a/src/features/serviceLimit/store.js +++ b/src/features/serviceLimit/store.js | |||
@@ -1,6 +1,6 @@ | |||
1 | import { computed, observable } from 'mobx'; | 1 | import { computed, observable } from 'mobx'; |
2 | import { FeatureStore } from '../utils/FeatureStore'; | 2 | import { FeatureStore } from '../utils/FeatureStore'; |
3 | import { DEFAULT_SERVICE_LIMIT } from '.'; | 3 | import { DEFAULT_SERVICE_LIMIT } from '../../config'; |
4 | 4 | ||
5 | const debug = require('debug')('Ferdi:feature:serviceLimit:store'); | 5 | const debug = require('debug')('Ferdi:feature:serviceLimit:store'); |
6 | 6 | ||
diff --git a/src/features/shareFranz/Component.js b/src/features/shareFranz/Component.js index 405fb0ab5..f7f8dc41c 100644 --- a/src/features/shareFranz/Component.js +++ b/src/features/shareFranz/Component.js | |||
@@ -10,7 +10,7 @@ import { | |||
10 | mdiHeart, mdiEmail, mdiFacebookBox, mdiTwitter, | 10 | mdiHeart, mdiEmail, mdiFacebookBox, mdiTwitter, |
11 | } from '@mdi/js'; | 11 | } from '@mdi/js'; |
12 | import Modal from '../../components/ui/Modal'; | 12 | import Modal from '../../components/ui/Modal'; |
13 | import { state } from '.'; | 13 | import { state } from './store'; |
14 | import ServicesStore from '../../stores/ServicesStore'; | 14 | import ServicesStore from '../../stores/ServicesStore'; |
15 | 15 | ||
16 | const messages = defineMessages({ | 16 | const messages = defineMessages({ |
diff --git a/src/features/shareFranz/index.js b/src/features/shareFranz/index.js index 04e3684ae..34475f674 100644 --- a/src/features/shareFranz/index.js +++ b/src/features/shareFranz/index.js | |||
@@ -1,6 +1,6 @@ | |||
1 | import { observable, reaction } from 'mobx'; | 1 | import { reaction } from 'mobx'; |
2 | import ms from 'ms'; | 2 | import ms from 'ms'; |
3 | 3 | import { state as ModalState } from './store'; | |
4 | import { state as delayAppState } from '../delayApp'; | 4 | import { state as delayAppState } from '../delayApp'; |
5 | import { planSelectionStore } from '../planSelection'; | 5 | import { planSelectionStore } from '../planSelection'; |
6 | 6 | ||
@@ -8,12 +8,7 @@ export { default as Component } from './Component'; | |||
8 | 8 | ||
9 | const debug = require('debug')('Ferdi:feature:shareFranz'); | 9 | const debug = require('debug')('Ferdi:feature:shareFranz'); |
10 | 10 | ||
11 | const defaultState = { | 11 | const state = ModalState; |
12 | isModalVisible: false, | ||
13 | lastShown: null, | ||
14 | }; | ||
15 | |||
16 | export const state = observable(defaultState); | ||
17 | 12 | ||
18 | export default function initialize(stores) { | 13 | export default function initialize(stores) { |
19 | debug('Initialize shareFerdi feature'); | 14 | debug('Initialize shareFerdi feature'); |
diff --git a/src/features/shareFranz/store.js b/src/features/shareFranz/store.js new file mode 100644 index 000000000..c637e9eff --- /dev/null +++ b/src/features/shareFranz/store.js | |||
@@ -0,0 +1,8 @@ | |||
1 | import { observable } from 'mobx'; | ||
2 | |||
3 | const defaultState = { | ||
4 | isModalVisible: false, | ||
5 | lastShown: null, | ||
6 | }; | ||
7 | |||
8 | export const state = observable(defaultState); | ||
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js index 03bb5efe8..dccb818a6 100644 --- a/src/features/todos/components/TodosWebview.js +++ b/src/features/todos/components/TodosWebview.js | |||
@@ -5,7 +5,7 @@ import injectSheet from 'react-jss'; | |||
5 | import Webview from 'react-electron-web-view'; | 5 | import Webview from 'react-electron-web-view'; |
6 | import classnames from 'classnames'; | 6 | import classnames from 'classnames'; |
7 | 7 | ||
8 | import { TODOS_PARTITION_ID } from '..'; | 8 | import { TODOS_PARTITION_ID } from '../../../config'; |
9 | 9 | ||
10 | const styles = theme => ({ | 10 | const styles = theme => ({ |
11 | root: { | 11 | root: { |
diff --git a/src/features/todos/constants.js b/src/features/todos/constants.js index 2e8a431cc..303a7a16e 100644 --- a/src/features/todos/constants.js +++ b/src/features/todos/constants.js | |||
@@ -2,3 +2,7 @@ export const IPC = { | |||
2 | TODOS_HOST_CHANNEL: 'TODOS_HOST_CHANNEL', | 2 | TODOS_HOST_CHANNEL: 'TODOS_HOST_CHANNEL', |
3 | TODOS_CLIENT_CHANNEL: 'TODOS_CLIENT_CHANNEL', | 3 | TODOS_CLIENT_CHANNEL: 'TODOS_CLIENT_CHANNEL', |
4 | }; | 4 | }; |
5 | |||
6 | export const TODOS_ROUTES = { | ||
7 | TARGET: '/todos', | ||
8 | }; | ||
diff --git a/src/features/todos/containers/TodosScreen.js b/src/features/todos/containers/TodosScreen.js index 96147d5ab..6425746e6 100644 --- a/src/features/todos/containers/TodosScreen.js +++ b/src/features/todos/containers/TodosScreen.js | |||
@@ -5,7 +5,8 @@ import PropTypes from 'prop-types'; | |||
5 | import FeaturesStore from '../../../stores/FeaturesStore'; | 5 | import FeaturesStore from '../../../stores/FeaturesStore'; |
6 | import TodosWebview from '../components/TodosWebview'; | 6 | import TodosWebview from '../components/TodosWebview'; |
7 | import ErrorBoundary from '../../../components/util/ErrorBoundary'; | 7 | import ErrorBoundary from '../../../components/util/ErrorBoundary'; |
8 | import { TODOS_MIN_WIDTH, todosStore } from '..'; | 8 | import { todosStore } from '..'; |
9 | import { TODOS_MIN_WIDTH } from '../../../config'; | ||
9 | import { todoActions } from '../actions'; | 10 | import { todoActions } from '../actions'; |
10 | import ServicesStore from '../../../stores/ServicesStore'; | 11 | import ServicesStore from '../../../stores/ServicesStore'; |
11 | 12 | ||
diff --git a/src/features/todos/index.js b/src/features/todos/index.js index b6d13e5e1..1c6c9179a 100644 --- a/src/features/todos/index.js +++ b/src/features/todos/index.js | |||
@@ -5,16 +5,6 @@ const debug = require('debug')('Ferdi:feature:todos'); | |||
5 | 5 | ||
6 | export const GA_CATEGORY_TODOS = 'Todos'; | 6 | export const GA_CATEGORY_TODOS = 'Todos'; |
7 | 7 | ||
8 | export const DEFAULT_TODOS_WIDTH = 300; | ||
9 | export const TODOS_MIN_WIDTH = 200; | ||
10 | export const DEFAULT_TODOS_VISIBLE = true; | ||
11 | export const DEFAULT_IS_FEATURE_ENABLED_BY_USER = true; | ||
12 | export const TODOS_PARTITION_ID = 'persist:todos'; | ||
13 | |||
14 | export const TODOS_ROUTES = { | ||
15 | TARGET: '/todos', | ||
16 | }; | ||
17 | |||
18 | export const todosStore = new TodoStore(); | 8 | export const todosStore = new TodoStore(); |
19 | 9 | ||
20 | export default function initTodos(stores, actions) { | 10 | export default function initTodos(stores, actions) { |
diff --git a/src/features/todos/store.js b/src/features/todos/store.js index 4febd7bb1..429507927 100644 --- a/src/features/todos/store.js +++ b/src/features/todos/store.js | |||
@@ -7,17 +7,20 @@ import { | |||
7 | import localStorage from 'mobx-localstorage'; | 7 | import localStorage from 'mobx-localstorage'; |
8 | 8 | ||
9 | import { todoActions } from './actions'; | 9 | import { todoActions } from './actions'; |
10 | import { CUSTOM_TODO_SERVICE, TODO_SERVICE_RECIPE_IDS } from '../../config'; | 10 | import { |
11 | CUSTOM_TODO_SERVICE, | ||
12 | TODO_SERVICE_RECIPE_IDS, | ||
13 | DEFAULT_TODOS_WIDTH, | ||
14 | TODOS_MIN_WIDTH, | ||
15 | DEFAULT_TODOS_VISIBLE, | ||
16 | DEFAULT_IS_FEATURE_ENABLED_BY_USER, | ||
17 | } from '../../config'; | ||
11 | import { isValidExternalURL } from '../../helpers/url-helpers'; | 18 | import { isValidExternalURL } from '../../helpers/url-helpers'; |
12 | import { FeatureStore } from '../utils/FeatureStore'; | 19 | import { FeatureStore } from '../utils/FeatureStore'; |
13 | import { createReactions } from '../../stores/lib/Reaction'; | 20 | import { createReactions } from '../../stores/lib/Reaction'; |
14 | import { createActionBindings } from '../utils/ActionBinding'; | 21 | import { createActionBindings } from '../utils/ActionBinding'; |
15 | import { | 22 | import { IPC, TODOS_ROUTES } from './constants'; |
16 | DEFAULT_TODOS_WIDTH, TODOS_MIN_WIDTH, DEFAULT_TODOS_VISIBLE, TODOS_ROUTES, DEFAULT_IS_FEATURE_ENABLED_BY_USER, | ||
17 | } from '.'; | ||
18 | import { IPC } from './constants'; | ||
19 | import { state as delayAppState } from '../delayApp'; | 23 | import { state as delayAppState } from '../delayApp'; |
20 | |||
21 | import UserAgent from '../../models/UserAgent'; | 24 | import UserAgent from '../../models/UserAgent'; |
22 | 25 | ||
23 | const debug = require('debug')('Ferdi:feature:todos:store'); | 26 | const debug = require('debug')('Ferdi:feature:todos:store'); |
diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js index 2cb6affa8..7947e5a27 100644 --- a/src/stores/UserStore.js +++ b/src/stores/UserStore.js | |||
@@ -11,8 +11,7 @@ import Request from './lib/Request'; | |||
11 | import CachedRequest from './lib/CachedRequest'; | 11 | import CachedRequest from './lib/CachedRequest'; |
12 | import { sleep } from '../helpers/async-helpers'; | 12 | import { sleep } from '../helpers/async-helpers'; |
13 | import { getPlan } from '../helpers/plan-helpers'; | 13 | import { getPlan } from '../helpers/plan-helpers'; |
14 | import { PLANS } from '../config'; | 14 | import { PLANS, TODOS_PARTITION_ID } from '../config'; |
15 | import { TODOS_PARTITION_ID } from '../features/todos'; | ||
16 | 15 | ||
17 | const debug = require('debug')('Ferdi:UserStore'); | 16 | const debug = require('debug')('Ferdi:UserStore'); |
18 | 17 | ||