aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/todos
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/todos')
-rw-r--r--src/features/todos/components/TodosWebview.js12
-rw-r--r--src/features/todos/containers/TodosScreen.js2
-rw-r--r--src/features/todos/index.js2
-rw-r--r--src/features/todos/preload.js4
-rw-r--r--src/features/todos/store.js2
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 @@
1import React, { Component } from 'react'; 1import React, { Component } from 'react';
2import PropTypes from 'prop-types'; 2import PropTypes from 'prop-types';
3import { observer } from 'mobx-react'; 3import { observer, inject } from 'mobx-react';
4import injectSheet from 'react-jss'; 4import injectSheet from 'react-jss';
5import Webview from 'react-electron-web-view'; 5import Webview from 'react-electron-web-view';
6import { Icon } from '@meetfranz/ui'; 6import { Icon } from '@meetfranz/ui';
7import { defineMessages, intlShape } from 'react-intl'; 7import { defineMessages, intlShape } from 'react-intl';
8 8
9import { mdiCheckAll } from '@mdi/js'; 9import { mdiCheckAll } from '@mdi/js';
10import SettingsStore from '../../../stores/SettingsStore';
11
10import * as environment from '../../../environment'; 12import * as environment from '../../../environment';
11import Appear from '../../../components/ui/effects/Appear'; 13import Appear from '../../../components/ui/effects/Appear';
12import UpgradeButton from '../../../components/ui/UpgradeButton'; 14import 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')
81class TodosWebview extends Component { 83class 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 @@
1import { reaction } from 'mobx'; 1import { reaction } from 'mobx';
2import TodoStore from './store'; 2import TodoStore from './store';
3 3
4const debug = require('debug')('Franz:feature:todos'); 4const debug = require('debug')('Ferdi:feature:todos');
5 5
6export const GA_CATEGORY_TODOS = 'Todos'; 6export 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 @@
1import { ipcRenderer } from 'electron'; 1import { ipcRenderer } from 'electron';
2import { IPC } from './constants'; 2import { IPC } from './constants';
3 3
4const debug = require('debug')('Franz:feature:todos:preload'); 4const debug = require('debug')('Ferdi:feature:todos:preload');
5 5
6debug('Preloading Todos Webview'); 6debug('Preloading Todos Webview');
7 7
8let hostMessageListener = () => {}; 8let hostMessageListener = () => {};
9 9
10window.franz = { 10window.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 {
16import { IPC } from './constants'; 16import { IPC } from './constants';
17import { state as delayAppState } from '../delayApp'; 17import { state as delayAppState } from '../delayApp';
18 18
19const debug = require('debug')('Franz:feature:todos:store'); 19const debug = require('debug')('Ferdi:feature:todos:store');
20 20
21export default class TodoStore extends FeatureStore { 21export default class TodoStore extends FeatureStore {
22 @observable isFeatureEnabled = false; 22 @observable isFeatureEnabled = false;