diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/layout/AppLayout.js | 7 | ||||
-rw-r--r-- | src/config.js | 4 | ||||
-rw-r--r-- | src/containers/layout/AppLayoutContainer.js | 4 | ||||
-rw-r--r-- | src/environment.js | 8 | ||||
-rw-r--r-- | src/features/todos/components/TodosWebview.js | 42 | ||||
-rw-r--r-- | src/i18n/locales/defaultMessages.json | 12 | ||||
-rw-r--r-- | src/i18n/messages/src/components/layout/AppLayout.json | 12 | ||||
-rw-r--r-- | src/styles/layout.scss | 7 |
8 files changed, 80 insertions, 16 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index ebb9849ea..7f2f707fb 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -17,6 +17,7 @@ import { isWindows } from '../../environment'; | |||
17 | import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; | 17 | import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; |
18 | import { workspaceStore } from '../../features/workspaces'; | 18 | import { workspaceStore } from '../../features/workspaces'; |
19 | import AppUpdateInfoBar from '../AppUpdateInfoBar'; | 19 | import AppUpdateInfoBar from '../AppUpdateInfoBar'; |
20 | import TodosWebview from '../../features/todos/components/TodosWebview'; | ||
20 | 21 | ||
21 | function createMarkup(HTMLString) { | 22 | function createMarkup(HTMLString) { |
22 | return { __html: HTMLString }; | 23 | return { __html: HTMLString }; |
@@ -39,7 +40,8 @@ const messages = defineMessages({ | |||
39 | 40 | ||
40 | const styles = theme => ({ | 41 | const styles = theme => ({ |
41 | appContent: { | 42 | appContent: { |
42 | width: `calc(100% + ${theme.workspaces.drawer.width}px)`, | 43 | // width: `calc(100% + ${theme.workspaces.drawer.width}px)`, |
44 | width: '100%', | ||
43 | transition: 'transform 0.5s ease', | 45 | transition: 'transform 0.5s ease', |
44 | transform() { | 46 | transform() { |
45 | return workspaceStore.isWorkspaceDrawerOpen ? 'translateX(0)' : `translateX(-${theme.workspaces.drawer.width}px)`; | 47 | return workspaceStore.isWorkspaceDrawerOpen ? 'translateX(0)' : `translateX(-${theme.workspaces.drawer.width}px)`; |
@@ -50,6 +52,7 @@ const styles = theme => ({ | |||
50 | @injectSheet(styles) @observer | 52 | @injectSheet(styles) @observer |
51 | class AppLayout extends Component { | 53 | class AppLayout extends Component { |
52 | static propTypes = { | 54 | static propTypes = { |
55 | authToken: PropTypes.string.isRequired, | ||
53 | classes: PropTypes.object.isRequired, | 56 | classes: PropTypes.object.isRequired, |
54 | isFullScreen: PropTypes.bool.isRequired, | 57 | isFullScreen: PropTypes.bool.isRequired, |
55 | sidebar: PropTypes.element.isRequired, | 58 | sidebar: PropTypes.element.isRequired, |
@@ -82,6 +85,7 @@ class AppLayout extends Component { | |||
82 | 85 | ||
83 | render() { | 86 | render() { |
84 | const { | 87 | const { |
88 | authToken, | ||
85 | classes, | 89 | classes, |
86 | isFullScreen, | 90 | isFullScreen, |
87 | workspacesDrawer, | 91 | workspacesDrawer, |
@@ -169,6 +173,7 @@ class AppLayout extends Component { | |||
169 | {services} | 173 | {services} |
170 | {children} | 174 | {children} |
171 | </div> | 175 | </div> |
176 | <TodosWebview authToken={authToken} /> | ||
172 | </div> | 177 | </div> |
173 | </div> | 178 | </div> |
174 | </ErrorBoundary> | 179 | </ErrorBoundary> |
diff --git a/src/config.js b/src/config.js index 5bc318545..6968f8500 100644 --- a/src/config.js +++ b/src/config.js | |||
@@ -24,6 +24,10 @@ export const LIVE_API_WEBSITE = 'https://meetfranz.com'; | |||
24 | 24 | ||
25 | export const STATS_API = 'https://stats.franzinfra.com'; | 25 | export const STATS_API = 'https://stats.franzinfra.com'; |
26 | 26 | ||
27 | export const LOCAL_TODOS_FRONTEND_URL = 'http://localhost:4000'; | ||
28 | export const PRODUCTION_TODOS_FRONTEND_URL = 'https://franz-todos.netlify.com'; | ||
29 | export const DEVELOPMENT_TODOS_FRONTEND_URL = 'https://development--franz-todos.netlify.com'; | ||
30 | |||
27 | export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12'; | 31 | export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12'; |
28 | 32 | ||
29 | export const DEFAULT_APP_SETTINGS = { | 33 | export const DEFAULT_APP_SETTINGS = { |
diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index cf3da71e8..8a48f4924 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js | |||
@@ -12,6 +12,7 @@ import NewsStore from '../../stores/NewsStore'; | |||
12 | import SettingsStore from '../../stores/SettingsStore'; | 12 | import SettingsStore from '../../stores/SettingsStore'; |
13 | import RequestStore from '../../stores/RequestStore'; | 13 | import RequestStore from '../../stores/RequestStore'; |
14 | import GlobalErrorStore from '../../stores/GlobalErrorStore'; | 14 | import GlobalErrorStore from '../../stores/GlobalErrorStore'; |
15 | import UserStore from '../../stores/UserStore'; | ||
15 | 16 | ||
16 | import { oneOrManyChildElements } from '../../prop-types'; | 17 | import { oneOrManyChildElements } from '../../prop-types'; |
17 | import AppLayout from '../../components/layout/AppLayout'; | 18 | import AppLayout from '../../components/layout/AppLayout'; |
@@ -39,6 +40,7 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e | |||
39 | settings, | 40 | settings, |
40 | globalError, | 41 | globalError, |
41 | requests, | 42 | requests, |
43 | user, | ||
42 | } = this.props.stores; | 44 | } = this.props.stores; |
43 | 45 | ||
44 | const { | 46 | const { |
@@ -131,6 +133,7 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e | |||
131 | return ( | 133 | return ( |
132 | <ThemeProvider theme={ui.theme}> | 134 | <ThemeProvider theme={ui.theme}> |
133 | <AppLayout | 135 | <AppLayout |
136 | authToken={user.authToken} | ||
134 | isFullScreen={app.isFullScreen} | 137 | isFullScreen={app.isFullScreen} |
135 | isOnline={app.isOnline} | 138 | isOnline={app.isOnline} |
136 | showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar} | 139 | showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar} |
@@ -168,6 +171,7 @@ AppLayoutContainer.wrappedComponent.propTypes = { | |||
168 | settings: PropTypes.instanceOf(SettingsStore).isRequired, | 171 | settings: PropTypes.instanceOf(SettingsStore).isRequired, |
169 | requests: PropTypes.instanceOf(RequestStore).isRequired, | 172 | requests: PropTypes.instanceOf(RequestStore).isRequired, |
170 | globalError: PropTypes.instanceOf(GlobalErrorStore).isRequired, | 173 | globalError: PropTypes.instanceOf(GlobalErrorStore).isRequired, |
174 | user: PropTypes.instanceOf(UserStore).isRequired, | ||
171 | }).isRequired, | 175 | }).isRequired, |
172 | actions: PropTypes.shape({ | 176 | actions: PropTypes.shape({ |
173 | service: PropTypes.shape({ | 177 | service: PropTypes.shape({ |
diff --git a/src/environment.js b/src/environment.js index ae7a67e4d..707449e09 100644 --- a/src/environment.js +++ b/src/environment.js | |||
@@ -10,6 +10,9 @@ import { | |||
10 | LIVE_WS_API, | 10 | LIVE_WS_API, |
11 | LOCAL_WS_API, | 11 | LOCAL_WS_API, |
12 | DEV_WS_API, | 12 | DEV_WS_API, |
13 | LOCAL_TODOS_FRONTEND_URL, | ||
14 | PRODUCTION_TODOS_FRONTEND_URL, | ||
15 | DEVELOPMENT_TODOS_FRONTEND_URL, | ||
13 | } from './config'; | 16 | } from './config'; |
14 | 17 | ||
15 | export const isDevMode = isDev; | 18 | export const isDevMode = isDev; |
@@ -31,21 +34,26 @@ export const cmdKey = isMac ? 'Cmd' : 'Ctrl'; | |||
31 | let api; | 34 | let api; |
32 | let wsApi; | 35 | let wsApi; |
33 | let web; | 36 | let web; |
37 | let todos; | ||
34 | if (!isDevMode || (isDevMode && useLiveAPI)) { | 38 | if (!isDevMode || (isDevMode && useLiveAPI)) { |
35 | api = LIVE_API; | 39 | api = LIVE_API; |
36 | wsApi = LIVE_WS_API; | 40 | wsApi = LIVE_WS_API; |
37 | web = LIVE_API_WEBSITE; | 41 | web = LIVE_API_WEBSITE; |
42 | todos = PRODUCTION_TODOS_FRONTEND_URL; | ||
38 | } else if (isDevMode && useLocalAPI) { | 43 | } else if (isDevMode && useLocalAPI) { |
39 | api = LOCAL_API; | 44 | api = LOCAL_API; |
40 | wsApi = LOCAL_WS_API; | 45 | wsApi = LOCAL_WS_API; |
41 | web = LOCAL_API_WEBSITE; | 46 | web = LOCAL_API_WEBSITE; |
47 | todos = LOCAL_TODOS_FRONTEND_URL; | ||
42 | } else { | 48 | } else { |
43 | api = DEV_API; | 49 | api = DEV_API; |
44 | wsApi = DEV_WS_API; | 50 | wsApi = DEV_WS_API; |
45 | web = DEV_API_WEBSITE; | 51 | web = DEV_API_WEBSITE; |
52 | todos = DEVELOPMENT_TODOS_FRONTEND_URL; | ||
46 | } | 53 | } |
47 | 54 | ||
48 | export const API = api; | 55 | export const API = api; |
49 | export const API_VERSION = 'v1'; | 56 | export const API_VERSION = 'v1'; |
50 | export const WS_API = wsApi; | 57 | export const WS_API = wsApi; |
51 | export const WEBSITE = web; | 58 | export const WEBSITE = web; |
59 | export const TODOS_FRONTEND = todos; | ||
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js new file mode 100644 index 000000000..7e97c7f71 --- /dev/null +++ b/src/features/todos/components/TodosWebview.js | |||
@@ -0,0 +1,42 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { observer } from 'mobx-react'; | ||
4 | import injectSheet from 'react-jss'; | ||
5 | import Webview from 'react-electron-web-view'; | ||
6 | import * as environment from '../../../environment'; | ||
7 | |||
8 | const styles = theme => ({ | ||
9 | root: { | ||
10 | background: theme.colorBackground, | ||
11 | height: '100%', | ||
12 | width: 300, | ||
13 | position: 'absolute', | ||
14 | top: 0, | ||
15 | right: 0, | ||
16 | }, | ||
17 | webview: { | ||
18 | height: '100%', | ||
19 | }, | ||
20 | }); | ||
21 | |||
22 | @injectSheet(styles) @observer | ||
23 | class TodosWebview extends Component { | ||
24 | static propTypes = { | ||
25 | classes: PropTypes.object.isRequired, | ||
26 | authToken: PropTypes.string.isRequired, | ||
27 | }; | ||
28 | |||
29 | render() { | ||
30 | const { authToken, classes } = this.props; | ||
31 | return ( | ||
32 | <div className={classes.root}> | ||
33 | <Webview | ||
34 | className={classes.webview} | ||
35 | src={`${environment.TODOS_FRONTEND}?authToken=${authToken}`} | ||
36 | /> | ||
37 | </div> | ||
38 | ); | ||
39 | } | ||
40 | } | ||
41 | |||
42 | export default TodosWebview; | ||
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index d517b456b..1c7f5a7dd 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json | |||
@@ -669,39 +669,39 @@ | |||
669 | "defaultMessage": "!!!Your services have been updated.", | 669 | "defaultMessage": "!!!Your services have been updated.", |
670 | "end": { | 670 | "end": { |
671 | "column": 3, | 671 | "column": 3, |
672 | "line": 29 | 672 | "line": 30 |
673 | }, | 673 | }, |
674 | "file": "src/components/layout/AppLayout.js", | 674 | "file": "src/components/layout/AppLayout.js", |
675 | "id": "infobar.servicesUpdated", | 675 | "id": "infobar.servicesUpdated", |
676 | "start": { | 676 | "start": { |
677 | "column": 19, | 677 | "column": 19, |
678 | "line": 26 | 678 | "line": 27 |
679 | } | 679 | } |
680 | }, | 680 | }, |
681 | { | 681 | { |
682 | "defaultMessage": "!!!Reload services", | 682 | "defaultMessage": "!!!Reload services", |
683 | "end": { | 683 | "end": { |
684 | "column": 3, | 684 | "column": 3, |
685 | "line": 33 | 685 | "line": 34 |
686 | }, | 686 | }, |
687 | "file": "src/components/layout/AppLayout.js", | 687 | "file": "src/components/layout/AppLayout.js", |
688 | "id": "infobar.buttonReloadServices", | 688 | "id": "infobar.buttonReloadServices", |
689 | "start": { | 689 | "start": { |
690 | "column": 24, | 690 | "column": 24, |
691 | "line": 30 | 691 | "line": 31 |
692 | } | 692 | } |
693 | }, | 693 | }, |
694 | { | 694 | { |
695 | "defaultMessage": "!!!Could not load services and user information", | 695 | "defaultMessage": "!!!Could not load services and user information", |
696 | "end": { | 696 | "end": { |
697 | "column": 3, | 697 | "column": 3, |
698 | "line": 37 | 698 | "line": 38 |
699 | }, | 699 | }, |
700 | "file": "src/components/layout/AppLayout.js", | 700 | "file": "src/components/layout/AppLayout.js", |
701 | "id": "infobar.requiredRequestsFailed", | 701 | "id": "infobar.requiredRequestsFailed", |
702 | "start": { | 702 | "start": { |
703 | "column": 26, | 703 | "column": 26, |
704 | "line": 34 | 704 | "line": 35 |
705 | } | 705 | } |
706 | } | 706 | } |
707 | ], | 707 | ], |
diff --git a/src/i18n/messages/src/components/layout/AppLayout.json b/src/i18n/messages/src/components/layout/AppLayout.json index 190c5dff7..b71889155 100644 --- a/src/i18n/messages/src/components/layout/AppLayout.json +++ b/src/i18n/messages/src/components/layout/AppLayout.json | |||
@@ -4,11 +4,11 @@ | |||
4 | "defaultMessage": "!!!Your services have been updated.", | 4 | "defaultMessage": "!!!Your services have been updated.", |
5 | "file": "src/components/layout/AppLayout.js", | 5 | "file": "src/components/layout/AppLayout.js", |
6 | "start": { | 6 | "start": { |
7 | "line": 26, | 7 | "line": 27, |
8 | "column": 19 | 8 | "column": 19 |
9 | }, | 9 | }, |
10 | "end": { | 10 | "end": { |
11 | "line": 29, | 11 | "line": 30, |
12 | "column": 3 | 12 | "column": 3 |
13 | } | 13 | } |
14 | }, | 14 | }, |
@@ -17,11 +17,11 @@ | |||
17 | "defaultMessage": "!!!Reload services", | 17 | "defaultMessage": "!!!Reload services", |
18 | "file": "src/components/layout/AppLayout.js", | 18 | "file": "src/components/layout/AppLayout.js", |
19 | "start": { | 19 | "start": { |
20 | "line": 30, | 20 | "line": 31, |
21 | "column": 24 | 21 | "column": 24 |
22 | }, | 22 | }, |
23 | "end": { | 23 | "end": { |
24 | "line": 33, | 24 | "line": 34, |
25 | "column": 3 | 25 | "column": 3 |
26 | } | 26 | } |
27 | }, | 27 | }, |
@@ -30,11 +30,11 @@ | |||
30 | "defaultMessage": "!!!Could not load services and user information", | 30 | "defaultMessage": "!!!Could not load services and user information", |
31 | "file": "src/components/layout/AppLayout.js", | 31 | "file": "src/components/layout/AppLayout.js", |
32 | "start": { | 32 | "start": { |
33 | "line": 34, | 33 | "line": 35, |
34 | "column": 26 | 34 | "column": 26 |
35 | }, | 35 | }, |
36 | "end": { | 36 | "end": { |
37 | "line": 37, | 37 | "line": 38, |
38 | "column": 3 | 38 | "column": 3 |
39 | } | 39 | } |
40 | } | 40 | } |
diff --git a/src/styles/layout.scss b/src/styles/layout.scss index 9f226b61c..739082445 100644 --- a/src/styles/layout.scss +++ b/src/styles/layout.scss | |||
@@ -33,10 +33,11 @@ html { overflow: hidden; } | |||
33 | } | 33 | } |
34 | 34 | ||
35 | .app { | 35 | .app { |
36 | display: flex; | 36 | //display: flex; |
37 | flex-direction: column; | ||
38 | 37 | ||
39 | .app__content { display: flex; } | 38 | .app__content { |
39 | display: flex; | ||
40 | } | ||
40 | 41 | ||
41 | .app__service { | 42 | .app__service { |
42 | // position: relative; | 43 | // position: relative; |