diff options
-rw-r--r-- | .vscode/launch.json | 14 | ||||
-rw-r--r-- | package.json | 4 | ||||
-rw-r--r-- | src/api/apiBase.js | 7 | ||||
-rw-r--r-- | src/components/auth/Signup.js | 3 | ||||
-rw-r--r-- | src/environment.js | 12 | ||||
-rw-r--r-- | src/lib/Menu.js | 3 |
6 files changed, 23 insertions, 20 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json index f6c7458bf..96fc456fd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json | |||
@@ -19,9 +19,9 @@ | |||
19 | "name": "Ferdi – Live API", | 19 | "name": "Ferdi – Live API", |
20 | "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", | 20 | "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", |
21 | "program": "${workspaceFolder}/build/index.js", | 21 | "program": "${workspaceFolder}/build/index.js", |
22 | "protocol": "inspector", | 22 | "protocol": "inspector", |
23 | "env": { | 23 | "env": { |
24 | "LIVE_API": "1", | 24 | "USE_LIVE_API": "1", |
25 | "DEBUG": "*,-engine.io*,-socket.io*" | 25 | "DEBUG": "*,-engine.io*,-socket.io*" |
26 | } | 26 | } |
27 | }, | 27 | }, |
@@ -33,7 +33,7 @@ | |||
33 | "program": "${workspaceFolder}/build/index.js", | 33 | "program": "${workspaceFolder}/build/index.js", |
34 | "protocol": "inspector", | 34 | "protocol": "inspector", |
35 | "env": { | 35 | "env": { |
36 | "LOCAL_API": "1", | 36 | "USE_LOCAL_API": "1", |
37 | "DEBUG": "*,-engine.io*,-socket.io*" | 37 | "DEBUG": "*,-engine.io*,-socket.io*" |
38 | } | 38 | } |
39 | }, | 39 | }, |
@@ -56,9 +56,9 @@ | |||
56 | "name": "(Win Sim) Ferdi – Live API", | 56 | "name": "(Win Sim) Ferdi – Live API", |
57 | "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", | 57 | "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", |
58 | "program": "${workspaceFolder}/build/index.js", | 58 | "program": "${workspaceFolder}/build/index.js", |
59 | "protocol": "inspector", | 59 | "protocol": "inspector", |
60 | "env": { | 60 | "env": { |
61 | "LIVE_API": "1", | 61 | "USE_LIVE_API": "1", |
62 | "OS_PLATFORM": "win32", | 62 | "OS_PLATFORM": "win32", |
63 | "DEBUG": "*,-engine.io*,-socket.io*" | 63 | "DEBUG": "*,-engine.io*,-socket.io*" |
64 | } | 64 | } |
@@ -71,10 +71,10 @@ | |||
71 | "program": "${workspaceFolder}/build/index.js", | 71 | "program": "${workspaceFolder}/build/index.js", |
72 | "protocol": "inspector", | 72 | "protocol": "inspector", |
73 | "env": { | 73 | "env": { |
74 | "LOCAL_API": "1", | 74 | "USE_LOCAL_API": "1", |
75 | "OS_PLATFORM": "win32", | 75 | "OS_PLATFORM": "win32", |
76 | "DEBUG": "*,-engine.io*,-socket.io*" | 76 | "DEBUG": "*,-engine.io*,-socket.io*" |
77 | } | 77 | } |
78 | } | 78 | } |
79 | ] | 79 | ] |
80 | } \ No newline at end of file | 80 | } |
diff --git a/package.json b/package.json index 878e7834d..a209bc661 100644 --- a/package.json +++ b/package.json | |||
@@ -20,8 +20,8 @@ | |||
20 | "prepare": "husky install", | 20 | "prepare": "husky install", |
21 | "prestart": "npm run rebuild", | 21 | "prestart": "npm run rebuild", |
22 | "start": "electron ./build", | 22 | "start": "electron ./build", |
23 | "start:local": "cross-env LOCAL_API=1 npm start", | 23 | "start:local": "cross-env USE_LOCAL_API=1 npm start", |
24 | "start:live": "cross-env LIVE_API=1 npm start", | 24 | "start:live": "cross-env USE_LIVE_API=1 npm start", |
25 | "dev": "cross-env NODE_ENV=development gulp dev", | 25 | "dev": "cross-env NODE_ENV=development gulp dev", |
26 | "test": "jest", | 26 | "test": "jest", |
27 | "test:watch": "jest --watch", | 27 | "test:watch": "jest --watch", |
diff --git a/src/api/apiBase.js b/src/api/apiBase.js index 842c85e56..3278dc454 100644 --- a/src/api/apiBase.js +++ b/src/api/apiBase.js | |||
@@ -5,6 +5,8 @@ import { | |||
5 | API_VERSION, | 5 | API_VERSION, |
6 | } from '../environment'; | 6 | } from '../environment'; |
7 | import { | 7 | import { |
8 | DEV_API_FRANZ_WEBSITE, | ||
9 | LIVE_FRANZ_API, | ||
8 | LOCAL_SERVER, | 10 | LOCAL_SERVER, |
9 | SERVER_NOT_LOADED, | 11 | SERVER_NOT_LOADED, |
10 | } from '../config'; | 12 | } from '../config'; |
@@ -34,3 +36,8 @@ const apiBase = (withVersion = true) => { | |||
34 | }; | 36 | }; |
35 | 37 | ||
36 | export default apiBase; | 38 | export default apiBase; |
39 | |||
40 | export function termsBase() { | ||
41 | // TODO: This needs to handle local vs ferdi vs franz servers | ||
42 | return window.ferdi.stores.settings.all.app.server !== LIVE_FRANZ_API ? window.ferdi.stores.settings.all.app.server : DEV_API_FRANZ_WEBSITE; | ||
43 | } | ||
diff --git a/src/components/auth/Signup.js b/src/components/auth/Signup.js index 411b6697b..6fb41a164 100644 --- a/src/components/auth/Signup.js +++ b/src/components/auth/Signup.js | |||
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; | |||
4 | import { observer, inject } from 'mobx-react'; | 4 | import { observer, inject } from 'mobx-react'; |
5 | import { defineMessages, intlShape } from 'react-intl'; | 5 | import { defineMessages, intlShape } from 'react-intl'; |
6 | 6 | ||
7 | import { isDevMode, termsBase, useLiveAPI } from '../../environment'; | 7 | import { isDevMode, useLiveAPI } from '../../environment'; |
8 | import Form from '../../lib/Form'; | 8 | import Form from '../../lib/Form'; |
9 | import { required, email, minLength } from '../../helpers/validation-helpers'; | 9 | import { required, email, minLength } from '../../helpers/validation-helpers'; |
10 | import serverlessLogin from '../../helpers/serverless-helpers'; | 10 | import serverlessLogin from '../../helpers/serverless-helpers'; |
@@ -14,6 +14,7 @@ import Link from '../ui/Link'; | |||
14 | import Infobox from '../ui/Infobox'; | 14 | import Infobox from '../ui/Infobox'; |
15 | 15 | ||
16 | import { globalError as globalErrorPropType } from '../../prop-types'; | 16 | import { globalError as globalErrorPropType } from '../../prop-types'; |
17 | import { termsBase } from '../../api/apiBase'; | ||
17 | 18 | ||
18 | const messages = defineMessages({ | 19 | const messages = defineMessages({ |
19 | headline: { | 20 | headline: { |
diff --git a/src/environment.js b/src/environment.js index a6ad75820..7b560acb6 100644 --- a/src/environment.js +++ b/src/environment.js | |||
@@ -17,7 +17,6 @@ import { | |||
17 | DEV_WS_API, | 17 | DEV_WS_API, |
18 | LOCAL_TODOS_FRONTEND_URL, | 18 | LOCAL_TODOS_FRONTEND_URL, |
19 | PRODUCTION_TODOS_FRONTEND_URL, | 19 | PRODUCTION_TODOS_FRONTEND_URL, |
20 | LIVE_FRANZ_API, | ||
21 | DEFAULT_TODO_SERVICE, | 20 | DEFAULT_TODO_SERVICE, |
22 | SEARCH_ENGINE_DDG, | 21 | SEARCH_ENGINE_DDG, |
23 | iconSizeBias, | 22 | iconSizeBias, |
@@ -56,7 +55,8 @@ export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); | |||
56 | // Replacing app.asar is not beautiful but unfortunately necessary | 55 | // Replacing app.asar is not beautiful but unfortunately necessary |
57 | export const RECIPES_PATH = asarPath(path.join(__dirname, 'recipes')); | 56 | export const RECIPES_PATH = asarPath(path.join(__dirname, 'recipes')); |
58 | 57 | ||
59 | export const useLiveAPI = process.env.LIVE_API; | 58 | export const useLiveAPI = process.env.USE_LIVE_API; |
59 | const useLocalAPI = process.env.USE_LOCAL_API; | ||
60 | 60 | ||
61 | export const isMac = is.macos; | 61 | export const isMac = is.macos; |
62 | export const isWindows = is.windows; | 62 | export const isWindows = is.windows; |
@@ -75,12 +75,10 @@ let web; | |||
75 | let todos; | 75 | let todos; |
76 | if (!isDevMode || (isDevMode && useLiveAPI)) { | 76 | if (!isDevMode || (isDevMode && useLiveAPI)) { |
77 | api = LIVE_FERDI_API; | 77 | api = LIVE_FERDI_API; |
78 | // api = DEV_FRANZ_API; | ||
79 | wsApi = LIVE_WS_API; | 78 | wsApi = LIVE_WS_API; |
80 | web = LIVE_API_FERDI_WEBSITE; | 79 | web = LIVE_API_FERDI_WEBSITE; |
81 | // web = DEV_API_FRANZ_WEBSITE; | ||
82 | todos = PRODUCTION_TODOS_FRONTEND_URL; | 80 | todos = PRODUCTION_TODOS_FRONTEND_URL; |
83 | } else if (isDevMode && process.env.LOCAL_API) { | 81 | } else if (isDevMode && useLocalAPI) { |
84 | api = LOCAL_API; | 82 | api = LOCAL_API; |
85 | wsApi = LOCAL_WS_API; | 83 | wsApi = LOCAL_WS_API; |
86 | web = LOCAL_API_WEBSITE; | 84 | web = LOCAL_API_WEBSITE; |
@@ -152,10 +150,6 @@ export const DEFAULT_APP_SETTINGS = { | |||
152 | alwaysShowWorkspaces: false, | 150 | alwaysShowWorkspaces: false, |
153 | }; | 151 | }; |
154 | 152 | ||
155 | export function termsBase() { | ||
156 | return window.ferdi.stores.settings.all.app.server !== LIVE_FRANZ_API ? window.ferdi.stores.settings.all.app.server : DEV_API_FRANZ_WEBSITE; | ||
157 | } | ||
158 | |||
159 | export function aboutAppDetails() { | 153 | export function aboutAppDetails() { |
160 | return [ | 154 | return [ |
161 | `Version: ${ferdiVersion}`, | 155 | `Version: ${ferdiVersion}`, |
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 89e6e0e0b..2f918dcb0 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -6,7 +6,7 @@ import { autorun, observable } from 'mobx'; | |||
6 | import { defineMessages } from 'react-intl'; | 6 | import { defineMessages } from 'react-intl'; |
7 | import { CUSTOM_WEBSITE_RECIPE_ID, GITHUB_FERDI_URL, LIVE_API_FERDI_WEBSITE } from '../config'; | 7 | import { CUSTOM_WEBSITE_RECIPE_ID, GITHUB_FERDI_URL, LIVE_API_FERDI_WEBSITE } from '../config'; |
8 | import { | 8 | import { |
9 | cmdKey, isLinux, isMac, aboutAppDetails, termsBase, | 9 | cmdKey, isLinux, isMac, aboutAppDetails, |
10 | } from '../environment'; | 10 | } from '../environment'; |
11 | import { announcementsStore } from '../features/announcements'; | 11 | import { announcementsStore } from '../features/announcements'; |
12 | import { announcementActions } from '../features/announcements/actions'; | 12 | import { announcementActions } from '../features/announcements/actions'; |
@@ -14,6 +14,7 @@ import { todosStore } from '../features/todos'; | |||
14 | import { todoActions } from '../features/todos/actions'; | 14 | import { todoActions } from '../features/todos/actions'; |
15 | import { workspaceActions } from '../features/workspaces/actions'; | 15 | import { workspaceActions } from '../features/workspaces/actions'; |
16 | import { workspaceStore } from '../features/workspaces/index'; | 16 | import { workspaceStore } from '../features/workspaces/index'; |
17 | import { termsBase } from '../api/apiBase'; | ||
17 | 18 | ||
18 | const menuItems = defineMessages({ | 19 | const menuItems = defineMessages({ |
19 | edit: { | 20 | edit: { |