diff options
Diffstat (limited to 'src/features/todos')
-rw-r--r-- | src/features/todos/components/TodosWebview.js | 12 | ||||
-rw-r--r-- | src/features/todos/containers/TodosScreen.js | 2 | ||||
-rw-r--r-- | src/features/todos/index.js | 2 | ||||
-rw-r--r-- | src/features/todos/preload.js | 4 | ||||
-rw-r--r-- | src/features/todos/store.js | 2 |
5 files changed, 14 insertions, 8 deletions
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js index f24c0b044..35c102220 100644 --- a/src/features/todos/components/TodosWebview.js +++ b/src/features/todos/components/TodosWebview.js | |||
@@ -1,12 +1,14 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer, inject } from 'mobx-react'; |
4 | import injectSheet from 'react-jss'; | 4 | import injectSheet from 'react-jss'; |
5 | import Webview from 'react-electron-web-view'; | 5 | import Webview from 'react-electron-web-view'; |
6 | import { Icon } from '@meetfranz/ui'; | 6 | import { Icon } from '@meetfranz/ui'; |
7 | import { defineMessages, intlShape } from 'react-intl'; | 7 | import { defineMessages, intlShape } from 'react-intl'; |
8 | 8 | ||
9 | import { mdiCheckAll } from '@mdi/js'; | 9 | import { mdiCheckAll } from '@mdi/js'; |
10 | import SettingsStore from '../../../stores/SettingsStore'; | ||
11 | |||
10 | import * as environment from '../../../environment'; | 12 | import * as environment from '../../../environment'; |
11 | import Appear from '../../../components/ui/effects/Appear'; | 13 | import Appear from '../../../components/ui/effects/Appear'; |
12 | import UpgradeButton from '../../../components/ui/UpgradeButton'; | 14 | import UpgradeButton from '../../../components/ui/UpgradeButton'; |
@@ -77,7 +79,7 @@ const styles = theme => ({ | |||
77 | }, | 79 | }, |
78 | }); | 80 | }); |
79 | 81 | ||
80 | @injectSheet(styles) @observer | 82 | @injectSheet(styles) @observer @inject('stores') |
81 | class TodosWebview extends Component { | 83 | class TodosWebview extends Component { |
82 | static propTypes = { | 84 | static propTypes = { |
83 | classes: PropTypes.object.isRequired, | 85 | classes: PropTypes.object.isRequired, |
@@ -88,6 +90,9 @@ class TodosWebview extends Component { | |||
88 | width: PropTypes.number.isRequired, | 90 | width: PropTypes.number.isRequired, |
89 | minWidth: PropTypes.number.isRequired, | 91 | minWidth: PropTypes.number.isRequired, |
90 | isTodosIncludedInCurrentPlan: PropTypes.bool.isRequired, | 92 | isTodosIncludedInCurrentPlan: PropTypes.bool.isRequired, |
93 | stores: PropTypes.shape({ | ||
94 | settings: PropTypes.instanceOf(SettingsStore).isRequired, | ||
95 | }).isRequired, | ||
91 | }; | 96 | }; |
92 | 97 | ||
93 | state = { | 98 | state = { |
@@ -178,6 +183,7 @@ class TodosWebview extends Component { | |||
178 | classes, | 183 | classes, |
179 | isVisible, | 184 | isVisible, |
180 | isTodosIncludedInCurrentPlan, | 185 | isTodosIncludedInCurrentPlan, |
186 | stores, | ||
181 | } = this.props; | 187 | } = this.props; |
182 | 188 | ||
183 | const { | 189 | const { |
@@ -217,7 +223,7 @@ class TodosWebview extends Component { | |||
217 | partition="persist:todos" | 223 | partition="persist:todos" |
218 | preload="./features/todos/preload.js" | 224 | preload="./features/todos/preload.js" |
219 | ref={(webview) => { this.webview = webview ? webview.view : null; }} | 225 | ref={(webview) => { this.webview = webview ? webview.view : null; }} |
220 | src={environment.TODOS_FRONTEND} | 226 | src={stores.settings.all.app.todoServer || environment.TODOS_FRONTEND} |
221 | /> | 227 | /> |
222 | ) : ( | 228 | ) : ( |
223 | <Appear> | 229 | <Appear> |
diff --git a/src/features/todos/containers/TodosScreen.js b/src/features/todos/containers/TodosScreen.js index a5da0b014..bc05a587d 100644 --- a/src/features/todos/containers/TodosScreen.js +++ b/src/features/todos/containers/TodosScreen.js | |||
@@ -25,7 +25,7 @@ class TodosScreen extends Component { | |||
25 | width={todosStore.width} | 25 | width={todosStore.width} |
26 | minWidth={TODOS_MIN_WIDTH} | 26 | minWidth={TODOS_MIN_WIDTH} |
27 | resize={width => todoActions.resize({ width })} | 27 | resize={width => todoActions.resize({ width })} |
28 | isTodosIncludedInCurrentPlan={this.props.stores.features.features.isTodosIncludedInCurrentPlan || false} | 28 | isTodosIncludedInCurrentPlan |
29 | /> | 29 | /> |
30 | </ErrorBoundary> | 30 | </ErrorBoundary> |
31 | ); | 31 | ); |
diff --git a/src/features/todos/index.js b/src/features/todos/index.js index 7388aebaf..9f355e9ba 100644 --- a/src/features/todos/index.js +++ b/src/features/todos/index.js | |||
@@ -1,7 +1,7 @@ | |||
1 | import { reaction } from 'mobx'; | 1 | import { reaction } from 'mobx'; |
2 | import TodoStore from './store'; | 2 | import TodoStore from './store'; |
3 | 3 | ||
4 | const debug = require('debug')('Franz:feature:todos'); | 4 | 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 | ||
diff --git a/src/features/todos/preload.js b/src/features/todos/preload.js index 6e38a2ef3..d1838e0d6 100644 --- a/src/features/todos/preload.js +++ b/src/features/todos/preload.js | |||
@@ -1,13 +1,13 @@ | |||
1 | import { ipcRenderer } from 'electron'; | 1 | import { ipcRenderer } from 'electron'; |
2 | import { IPC } from './constants'; | 2 | import { IPC } from './constants'; |
3 | 3 | ||
4 | const debug = require('debug')('Franz:feature:todos:preload'); | 4 | const debug = require('debug')('Ferdi:feature:todos:preload'); |
5 | 5 | ||
6 | debug('Preloading Todos Webview'); | 6 | debug('Preloading Todos Webview'); |
7 | 7 | ||
8 | let hostMessageListener = () => {}; | 8 | let hostMessageListener = () => {}; |
9 | 9 | ||
10 | window.franz = { | 10 | window.ferdi = { |
11 | onInitialize(ipcHostMessageListener) { | 11 | onInitialize(ipcHostMessageListener) { |
12 | hostMessageListener = ipcHostMessageListener; | 12 | hostMessageListener = ipcHostMessageListener; |
13 | ipcRenderer.sendToHost(IPC.TODOS_CLIENT_CHANNEL, { action: 'todos:initialized' }); | 13 | ipcRenderer.sendToHost(IPC.TODOS_CLIENT_CHANNEL, { action: 'todos:initialized' }); |
diff --git a/src/features/todos/store.js b/src/features/todos/store.js index 4480b2545..a05203a04 100644 --- a/src/features/todos/store.js +++ b/src/features/todos/store.js | |||
@@ -16,7 +16,7 @@ import { | |||
16 | import { IPC } from './constants'; | 16 | import { IPC } from './constants'; |
17 | import { state as delayAppState } from '../delayApp'; | 17 | import { state as delayAppState } from '../delayApp'; |
18 | 18 | ||
19 | const debug = require('debug')('Franz:feature:todos:store'); | 19 | const debug = require('debug')('Ferdi:feature:todos:store'); |
20 | 20 | ||
21 | export default class TodoStore extends FeatureStore { | 21 | export default class TodoStore extends FeatureStore { |
22 | @observable isFeatureEnabled = false; | 22 | @observable isFeatureEnabled = false; |