diff options
Diffstat (limited to 'src/containers/settings')
-rw-r--r-- | src/containers/settings/AccountScreen.js | 9 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 67 | ||||
-rw-r--r-- | src/containers/settings/RecipesScreen.js | 3 |
3 files changed, 70 insertions, 9 deletions
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js index 9c74cf2ab..41cdeb79a 100644 --- a/src/containers/settings/AccountScreen.js +++ b/src/containers/settings/AccountScreen.js | |||
@@ -26,7 +26,14 @@ export default @inject('stores', 'actions') @observer class AccountScreen extend | |||
26 | handleWebsiteLink(route) { | 26 | handleWebsiteLink(route) { |
27 | const { actions, stores } = this.props; | 27 | const { actions, stores } = this.props; |
28 | 28 | ||
29 | const url = stores.user.getAuthURL(`${WEBSITE}${route}?utm_source=app&utm_medium=account_dashboard`); | 29 | const api = stores.settings.all.app.server; |
30 | |||
31 | let url; | ||
32 | if (api === 'https://api.franzinfra.com') { | ||
33 | url = stores.user.getAuthURL(`${WEBSITE}${route}?utm_source=app&utm_medium=account_dashboard`); | ||
34 | } else { | ||
35 | url = `${api}${route}`; | ||
36 | } | ||
30 | 37 | ||
31 | actions.app.openExternalUrl({ url }); | 38 | actions.app.openExternalUrl({ url }); |
32 | } | 39 | } |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 9aba212be..4d85d4f12 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -9,7 +9,7 @@ import UserStore from '../../stores/UserStore'; | |||
9 | import TodosStore from '../../features/todos/store'; | 9 | import TodosStore from '../../features/todos/store'; |
10 | import Form from '../../lib/Form'; | 10 | 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 { DEFAULT_APP_SETTINGS } from '../../config'; | 12 | import { DEFAULT_APP_SETTINGS, DEFAULT_LOCK_PASSWORD } from '../../config'; |
13 | import { config as spellcheckerConfig } from '../../features/spellchecker'; | 13 | import { config as spellcheckerConfig } from '../../features/spellchecker'; |
14 | 14 | ||
15 | import { getSelectOptions } from '../../helpers/i18n-helpers'; | 15 | import { getSelectOptions } from '../../helpers/i18n-helpers'; |
@@ -17,6 +17,8 @@ import { getSelectOptions } from '../../helpers/i18n-helpers'; | |||
17 | import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; | 17 | import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; |
18 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 18 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
19 | 19 | ||
20 | import { API, TODOS_FRONTEND } from '../../environment'; | ||
21 | |||
20 | import globalMessages from '../../i18n/globalMessages'; | 22 | import globalMessages from '../../i18n/globalMessages'; |
21 | import { DEFAULT_IS_FEATURE_ENABLED_BY_USER } from '../../features/todos'; | 23 | import { DEFAULT_IS_FEATURE_ENABLED_BY_USER } from '../../features/todos'; |
22 | import WorkspacesStore from '../../features/workspaces/store'; | 24 | import WorkspacesStore from '../../features/workspaces/store'; |
@@ -25,7 +27,7 @@ import { DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED } from '../../features/works | |||
25 | const messages = defineMessages({ | 27 | const messages = defineMessages({ |
26 | autoLaunchOnStart: { | 28 | autoLaunchOnStart: { |
27 | id: 'settings.app.form.autoLaunchOnStart', | 29 | id: 'settings.app.form.autoLaunchOnStart', |
28 | defaultMessage: '!!!Launch Franz on start', | 30 | defaultMessage: '!!!Launch Ferdi on start', |
29 | }, | 31 | }, |
30 | autoLaunchInBackground: { | 32 | autoLaunchInBackground: { |
31 | id: 'settings.app.form.autoLaunchInBackground', | 33 | id: 'settings.app.form.autoLaunchInBackground', |
@@ -33,15 +35,35 @@ const messages = defineMessages({ | |||
33 | }, | 35 | }, |
34 | runInBackground: { | 36 | runInBackground: { |
35 | id: 'settings.app.form.runInBackground', | 37 | id: 'settings.app.form.runInBackground', |
36 | defaultMessage: '!!!Keep Franz in background when closing the window', | 38 | defaultMessage: '!!!Keep Ferdi in background when closing the window', |
37 | }, | 39 | }, |
38 | enableSystemTray: { | 40 | enableSystemTray: { |
39 | id: 'settings.app.form.enableSystemTray', | 41 | id: 'settings.app.form.enableSystemTray', |
40 | defaultMessage: '!!!Show Franz in system tray', | 42 | defaultMessage: '!!!Show Ferdi in system tray', |
41 | }, | 43 | }, |
42 | minimizeToSystemTray: { | 44 | minimizeToSystemTray: { |
43 | id: 'settings.app.form.minimizeToSystemTray', | 45 | id: 'settings.app.form.minimizeToSystemTray', |
44 | defaultMessage: '!!!Minimize Franz to system tray', | 46 | defaultMessage: '!!!Minimize Ferdi to system tray', |
47 | }, | ||
48 | privateNotifications: { | ||
49 | id: 'settings.app.form.privateNotifications', | ||
50 | defaultMessage: '!!!Don\'t show message content in notifications', | ||
51 | }, | ||
52 | server: { | ||
53 | id: 'settings.app.form.server', | ||
54 | defaultMessage: '!!!Server', | ||
55 | }, | ||
56 | todoServer: { | ||
57 | id: 'settings.app.form.todoServer', | ||
58 | defaultMessage: '!!!Todo Server', | ||
59 | }, | ||
60 | enableLock: { | ||
61 | id: 'settings.app.form.enableLock', | ||
62 | defaultMessage: '!!!Enable Ferdi password lock', | ||
63 | }, | ||
64 | lockPassword: { | ||
65 | id: 'settings.app.form.lockPassword', | ||
66 | defaultMessage: '!!!Ferdi Lock password', | ||
45 | }, | 67 | }, |
46 | language: { | 68 | language: { |
47 | id: 'settings.app.form.language', | 69 | id: 'settings.app.form.language', |
@@ -107,6 +129,11 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
107 | runInBackground: settingsData.runInBackground, | 129 | runInBackground: settingsData.runInBackground, |
108 | enableSystemTray: settingsData.enableSystemTray, | 130 | enableSystemTray: settingsData.enableSystemTray, |
109 | minimizeToSystemTray: settingsData.minimizeToSystemTray, | 131 | minimizeToSystemTray: settingsData.minimizeToSystemTray, |
132 | privateNotifications: settingsData.privateNotifications, | ||
133 | server: settingsData.server, | ||
134 | todoServer: settingsData.todoServer, | ||
135 | lockingFeatureEnabled: settingsData.lockingFeatureEnabled, | ||
136 | lockedPassword: settingsData.lockedPassword, | ||
110 | enableGPUAcceleration: settingsData.enableGPUAcceleration, | 137 | enableGPUAcceleration: settingsData.enableGPUAcceleration, |
111 | showDisabledServices: settingsData.showDisabledServices, | 138 | showDisabledServices: settingsData.showDisabledServices, |
112 | darkMode: settingsData.darkMode, | 139 | darkMode: settingsData.darkMode, |
@@ -182,6 +209,32 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
182 | value: settings.all.app.minimizeToSystemTray, | 209 | value: settings.all.app.minimizeToSystemTray, |
183 | default: DEFAULT_APP_SETTINGS.minimizeToSystemTray, | 210 | default: DEFAULT_APP_SETTINGS.minimizeToSystemTray, |
184 | }, | 211 | }, |
212 | privateNotifications: { | ||
213 | label: intl.formatMessage(messages.privateNotifications), | ||
214 | value: settings.all.app.privateNotifications, | ||
215 | default: DEFAULT_APP_SETTINGS.privateNotifications, | ||
216 | }, | ||
217 | server: { | ||
218 | label: intl.formatMessage(messages.server), | ||
219 | value: settings.all.app.server || API, | ||
220 | default: API, | ||
221 | }, | ||
222 | todoServer: { | ||
223 | label: intl.formatMessage(messages.todoServer), | ||
224 | value: settings.all.app.todoServer, | ||
225 | default: TODOS_FRONTEND, | ||
226 | }, | ||
227 | lockingFeatureEnabled: { | ||
228 | label: intl.formatMessage(messages.enableLock), | ||
229 | value: settings.all.app.lockingFeatureEnabled || false, | ||
230 | default: false, | ||
231 | }, | ||
232 | lockedPassword: { | ||
233 | label: intl.formatMessage(messages.lockPassword), | ||
234 | value: settings.all.app.lockedPassword, | ||
235 | default: DEFAULT_LOCK_PASSWORD, | ||
236 | type: 'password', | ||
237 | }, | ||
185 | showDisabledServices: { | 238 | showDisabledServices: { |
186 | label: intl.formatMessage(messages.showDisabledServices), | 239 | label: intl.formatMessage(messages.showDisabledServices), |
187 | value: settings.all.app.showDisabledServices, | 240 | value: settings.all.app.showDisabledServices, |
@@ -257,6 +310,8 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
257 | cacheSize, | 310 | cacheSize, |
258 | updateStatusTypes, | 311 | updateStatusTypes, |
259 | isClearingAllCache, | 312 | isClearingAllCache, |
313 | server, | ||
314 | lockingFeatureEnabled, | ||
260 | } = app; | 315 | } = app; |
261 | const { | 316 | const { |
262 | checkForUpdates, | 317 | checkForUpdates, |
@@ -282,6 +337,8 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
282 | isSpellcheckerIncludedInCurrentPlan={spellcheckerConfig.isIncludedInCurrentPlan} | 337 | isSpellcheckerIncludedInCurrentPlan={spellcheckerConfig.isIncludedInCurrentPlan} |
283 | isTodosEnabled={todos.isFeatureActive} | 338 | isTodosEnabled={todos.isFeatureActive} |
284 | isWorkspaceEnabled={workspaces.isFeatureActive} | 339 | isWorkspaceEnabled={workspaces.isFeatureActive} |
340 | server={server || 'https://api.franzinfra.com'} | ||
341 | lockingFeatureEnabled={lockingFeatureEnabled} | ||
285 | /> | 342 | /> |
286 | </ErrorBoundary> | 343 | </ErrorBoundary> |
287 | ); | 344 | ); |
diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js index 132820b6f..692dc26f1 100644 --- a/src/containers/settings/RecipesScreen.js +++ b/src/containers/settings/RecipesScreen.js | |||
@@ -13,7 +13,6 @@ import UserStore from '../../stores/UserStore'; | |||
13 | import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard'; | 13 | import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard'; |
14 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 14 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
15 | import { FRANZ_DEV_DOCS } from '../../config'; | 15 | import { FRANZ_DEV_DOCS } from '../../config'; |
16 | import { gaEvent } from '../../lib/analytics'; | ||
17 | import { communityRecipesStore } from '../../features/communityRecipes'; | 16 | import { communityRecipesStore } from '../../features/communityRecipes'; |
18 | 17 | ||
19 | const { app } = remote; | 18 | const { app } = remote; |
@@ -122,11 +121,9 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend | |||
122 | recipeDirectory={recipeDirectory} | 121 | recipeDirectory={recipeDirectory} |
123 | openRecipeDirectory={() => { | 122 | openRecipeDirectory={() => { |
124 | shell.openItem(recipeDirectory); | 123 | shell.openItem(recipeDirectory); |
125 | gaEvent('Recipe', 'open-recipe-folder', 'Open Folder'); | ||
126 | }} | 124 | }} |
127 | openDevDocs={() => { | 125 | openDevDocs={() => { |
128 | appActions.openExternalUrl({ url: FRANZ_DEV_DOCS }); | 126 | appActions.openExternalUrl({ url: FRANZ_DEV_DOCS }); |
129 | gaEvent('Recipe', 'open-dev-docs', 'Developer Documentation'); | ||
130 | }} | 127 | }} |
131 | isCommunityRecipesIncludedInCurrentPlan={communityRecipesStore.isCommunityRecipesIncludedInCurrentPlan} | 128 | isCommunityRecipesIncludedInCurrentPlan={communityRecipesStore.isCommunityRecipesIncludedInCurrentPlan} |
132 | isUserPremiumUser={user.isPremium} | 129 | isUserPremiumUser={user.isPremium} |