diff options
m--------- | recipes | 0 | ||||
-rw-r--r-- | src/components/services/content/ServiceView.js | 6 | ||||
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 2 | ||||
-rw-r--r-- | src/config.js | 7 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 24 | ||||
-rw-r--r-- | src/i18n/locales/defaultMessages.json | 6 | ||||
-rw-r--r-- | src/i18n/locales/en-US.json | 2 | ||||
-rw-r--r-- | src/i18n/messages/src/containers/settings/EditSettingsScreen.json | 6 |
8 files changed, 34 insertions, 19 deletions
diff --git a/recipes b/recipes | |||
Subproject 9b8accefa82ade6edd24b4ee9f073f728c9a387 | Subproject a71833cd1e0764d1626d886baed756efe1fa4ba | ||
diff --git a/src/components/services/content/ServiceView.js b/src/components/services/content/ServiceView.js index 860863d26..f6832038a 100644 --- a/src/components/services/content/ServiceView.js +++ b/src/components/services/content/ServiceView.js | |||
@@ -135,9 +135,11 @@ export default @inject('stores', 'actions') @observer class ServiceView extends | |||
135 | } = this.props; | 135 | } = this.props; |
136 | 136 | ||
137 | const { | 137 | const { |
138 | showServiceNavigationBar, | 138 | navigationBarBehaviour, |
139 | } = stores.settings.app; | 139 | } = stores.settings.app; |
140 | 140 | ||
141 | const showNavBar = navigationBarBehaviour === 'always' || (navigationBarBehaviour === 'custom' && service.recipe.id === CUSTOM_WEBSITE_ID); | ||
142 | |||
141 | const webviewClasses = classnames({ | 143 | const webviewClasses = classnames({ |
142 | services__webview: true, | 144 | services__webview: true, |
143 | 'services__webview-wrapper': true, | 145 | 'services__webview-wrapper': true, |
@@ -193,7 +195,7 @@ export default @inject('stores', 'actions') @observer class ServiceView extends | |||
193 | <> | 195 | <> |
194 | {!service.isHibernating ? ( | 196 | {!service.isHibernating ? ( |
195 | <> | 197 | <> |
196 | {(service.recipe.id === CUSTOM_WEBSITE_ID || showServiceNavigationBar) && ( | 198 | {showNavBar && ( |
197 | <WebControlsScreen service={service} /> | 199 | <WebControlsScreen service={service} /> |
198 | )} | 200 | )} |
199 | <ServiceWebview | 201 | <ServiceWebview |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 6017252bc..6db27a26a 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -256,7 +256,7 @@ export default @observer class EditSettingsForm extends Component { | |||
256 | <Toggle field={form.$('minimizeToSystemTray')} /> | 256 | <Toggle field={form.$('minimizeToSystemTray')} /> |
257 | )} | 257 | )} |
258 | <Toggle field={form.$('privateNotifications')} /> | 258 | <Toggle field={form.$('privateNotifications')} /> |
259 | <Toggle field={form.$('showServiceNavigationBar')} /> | 259 | <Select field={form.$('navigationBarBehaviour')} /> |
260 | 260 | ||
261 | <Hr /> | 261 | <Hr /> |
262 | 262 | ||
diff --git a/src/config.js b/src/config.js index 895852ed8..83b79b689 100644 --- a/src/config.js +++ b/src/config.js | |||
@@ -45,6 +45,12 @@ export const HIBERNATION_STRATEGIES = { | |||
45 | 3600: 'Extemely Slow Hibernation (1hour)', | 45 | 3600: 'Extemely Slow Hibernation (1hour)', |
46 | }; | 46 | }; |
47 | 47 | ||
48 | export const NAVIGATION_BAR_BEHAVIOURS = { | ||
49 | custom: 'Show navigation bar on custom websites only', | ||
50 | always: 'Show navigation bar on all services', | ||
51 | never: 'Never show navigation bar', | ||
52 | }; | ||
53 | |||
48 | export const DEFAULT_APP_SETTINGS = { | 54 | export const DEFAULT_APP_SETTINGS = { |
49 | autoLaunchInBackground: false, | 55 | autoLaunchInBackground: false, |
50 | runInBackground: true, | 56 | runInBackground: true, |
@@ -84,6 +90,7 @@ export const DEFAULT_APP_SETTINGS = { | |||
84 | accentColor: '#7367f0', | 90 | accentColor: '#7367f0', |
85 | serviceRibbonWidth: 68, | 91 | serviceRibbonWidth: 68, |
86 | sentry: false, | 92 | sentry: false, |
93 | navigationBarBehaviour: 'custom', | ||
87 | }; | 94 | }; |
88 | 95 | ||
89 | export const DEFAULT_FEATURES_CONFIG = { | 96 | export const DEFAULT_FEATURES_CONFIG = { |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 8eb7c3b82..07fad5430 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -10,7 +10,7 @@ import UserStore from '../../stores/UserStore'; | |||
10 | import TodosStore from '../../features/todos/store'; | 10 | import TodosStore from '../../features/todos/store'; |
11 | import Form from '../../lib/Form'; | 11 | import Form from '../../lib/Form'; |
12 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; | 12 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; |
13 | import { DEFAULT_APP_SETTINGS, HIBERNATION_STRATEGIES } from '../../config'; | 13 | import { DEFAULT_APP_SETTINGS, HIBERNATION_STRATEGIES, NAVIGATION_BAR_BEHAVIOURS } from '../../config'; |
14 | import { config as spellcheckerConfig } from '../../features/spellchecker'; | 14 | import { config as spellcheckerConfig } from '../../features/spellchecker'; |
15 | 15 | ||
16 | import { getSelectOptions } from '../../helpers/i18n-helpers'; | 16 | import { getSelectOptions } from '../../helpers/i18n-helpers'; |
@@ -54,9 +54,9 @@ const messages = defineMessages({ | |||
54 | id: 'settings.app.form.privateNotifications', | 54 | id: 'settings.app.form.privateNotifications', |
55 | defaultMessage: '!!!Don\'t show message content in notifications', | 55 | defaultMessage: '!!!Don\'t show message content in notifications', |
56 | }, | 56 | }, |
57 | showServiceNavigationBar: { | 57 | navigationBarBehaviour: { |
58 | id: 'settings.app.form.showServiceNavigationBar', | 58 | id: 'settings.app.form.navigationBarBehaviour', |
59 | defaultMessage: '!!!Always show service navigation bar', | 59 | defaultMessage: '!!!Navigation bar behaviour', |
60 | }, | 60 | }, |
61 | sentry: { | 61 | sentry: { |
62 | id: 'settings.app.form.sentry', | 62 | id: 'settings.app.form.sentry', |
@@ -184,7 +184,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
184 | startMinimized: settingsData.startMinimized, | 184 | startMinimized: settingsData.startMinimized, |
185 | minimizeToSystemTray: settingsData.minimizeToSystemTray, | 185 | minimizeToSystemTray: settingsData.minimizeToSystemTray, |
186 | privateNotifications: settingsData.privateNotifications, | 186 | privateNotifications: settingsData.privateNotifications, |
187 | showServiceNavigationBar: settingsData.showServiceNavigationBar, | 187 | navigationBarBehaviour: settingsData.navigationBarBehaviour, |
188 | sentry: settingsData.sentry, | 188 | sentry: settingsData.sentry, |
189 | hibernate: settingsData.hibernate, | 189 | hibernate: settingsData.hibernate, |
190 | hibernationStrategy: settingsData.hibernationStrategy, | 190 | hibernationStrategy: settingsData.hibernationStrategy, |
@@ -248,6 +248,11 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
248 | locales: APP_LOCALES, | 248 | locales: APP_LOCALES, |
249 | }); | 249 | }); |
250 | 250 | ||
251 | const navigationBarBehaviours = getSelectOptions({ | ||
252 | locales: NAVIGATION_BAR_BEHAVIOURS, | ||
253 | sort: false, | ||
254 | }); | ||
255 | |||
251 | const hibernationStrategies = getSelectOptions({ | 256 | const hibernationStrategies = getSelectOptions({ |
252 | locales: HIBERNATION_STRATEGIES, | 257 | locales: HIBERNATION_STRATEGIES, |
253 | sort: false, | 258 | sort: false, |
@@ -295,10 +300,11 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
295 | value: settings.all.app.privateNotifications, | 300 | value: settings.all.app.privateNotifications, |
296 | default: DEFAULT_APP_SETTINGS.privateNotifications, | 301 | default: DEFAULT_APP_SETTINGS.privateNotifications, |
297 | }, | 302 | }, |
298 | showServiceNavigationBar: { | 303 | navigationBarBehaviour: { |
299 | label: intl.formatMessage(messages.showServiceNavigationBar), | 304 | label: intl.formatMessage(messages.navigationBarBehaviour), |
300 | value: settings.all.app.showServiceNavigationBar, | 305 | value: settings.all.app.navigationBarBehaviour, |
301 | default: DEFAULT_APP_SETTINGS.showServiceNavigationBar, | 306 | default: DEFAULT_APP_SETTINGS.navigationBarBehaviour, |
307 | options: navigationBarBehaviours, | ||
302 | }, | 308 | }, |
303 | sentry: { | 309 | sentry: { |
304 | label: intl.formatMessage(messages.sentry), | 310 | label: intl.formatMessage(messages.sentry), |
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 17f77b609..0d09cea9c 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json | |||
@@ -4175,15 +4175,15 @@ | |||
4175 | } | 4175 | } |
4176 | }, | 4176 | }, |
4177 | { | 4177 | { |
4178 | "defaultMessage": "!!!Always show service navigation bar", | 4178 | "defaultMessage": "!!!Navigation bar behaviour", |
4179 | "end": { | 4179 | "end": { |
4180 | "column": 3, | 4180 | "column": 3, |
4181 | "line": 60 | 4181 | "line": 60 |
4182 | }, | 4182 | }, |
4183 | "file": "src/containers/settings/EditSettingsScreen.js", | 4183 | "file": "src/containers/settings/EditSettingsScreen.js", |
4184 | "id": "settings.app.form.showServiceNavigationBar", | 4184 | "id": "settings.app.form.navigationBarBehaviour", |
4185 | "start": { | 4185 | "start": { |
4186 | "column": 28, | 4186 | "column": 26, |
4187 | "line": 57 | 4187 | "line": 57 |
4188 | } | 4188 | } |
4189 | }, | 4189 | }, |
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index ce41bb9ce..319fef21d 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json | |||
@@ -283,6 +283,7 @@ | |||
283 | "settings.app.form.language": "Language", | 283 | "settings.app.form.language": "Language", |
284 | "settings.app.form.lockPassword": "Password", | 284 | "settings.app.form.lockPassword": "Password", |
285 | "settings.app.form.minimizeToSystemTray": "Minimize Ferdi to system tray", | 285 | "settings.app.form.minimizeToSystemTray": "Minimize Ferdi to system tray", |
286 | "settings.app.form.navigationBarBehaviour": "Navigation bar behaviour", | ||
286 | "settings.app.form.noUpdates": "Disable updates", | 287 | "settings.app.form.noUpdates": "Disable updates", |
287 | "settings.app.form.privateNotifications": "Don't show message content in notifications", | 288 | "settings.app.form.privateNotifications": "Don't show message content in notifications", |
288 | "settings.app.form.runInBackground": "Keep Ferdi in background when closing the window", | 289 | "settings.app.form.runInBackground": "Keep Ferdi in background when closing the window", |
@@ -293,7 +294,6 @@ | |||
293 | "settings.app.form.server": "Server", | 294 | "settings.app.form.server": "Server", |
294 | "settings.app.form.showDisabledServices": "Display disabled services tabs", | 295 | "settings.app.form.showDisabledServices": "Display disabled services tabs", |
295 | "settings.app.form.showMessagesBadgesWhenMuted": "Show unread message badge when notifications are disabled", | 296 | "settings.app.form.showMessagesBadgesWhenMuted": "Show unread message badge when notifications are disabled", |
296 | "settings.app.form.showServiceNavigationBar": "Always show service navigation bar", | ||
297 | "settings.app.form.startMinimized": "Start minimized in tray", | 297 | "settings.app.form.startMinimized": "Start minimized in tray", |
298 | "settings.app.form.todoServer": "Todo Server", | 298 | "settings.app.form.todoServer": "Todo Server", |
299 | "settings.app.form.universalDarkMode": "Enable universal Dark Mode", | 299 | "settings.app.form.universalDarkMode": "Enable universal Dark Mode", |
diff --git a/src/i18n/messages/src/containers/settings/EditSettingsScreen.json b/src/i18n/messages/src/containers/settings/EditSettingsScreen.json index d2e53d625..da4bf7379 100644 --- a/src/i18n/messages/src/containers/settings/EditSettingsScreen.json +++ b/src/i18n/messages/src/containers/settings/EditSettingsScreen.json | |||
@@ -91,12 +91,12 @@ | |||
91 | } | 91 | } |
92 | }, | 92 | }, |
93 | { | 93 | { |
94 | "id": "settings.app.form.showServiceNavigationBar", | 94 | "id": "settings.app.form.navigationBarBehaviour", |
95 | "defaultMessage": "!!!Always show service navigation bar", | 95 | "defaultMessage": "!!!Navigation bar behaviour", |
96 | "file": "src/containers/settings/EditSettingsScreen.js", | 96 | "file": "src/containers/settings/EditSettingsScreen.js", |
97 | "start": { | 97 | "start": { |
98 | "line": 57, | 98 | "line": 57, |
99 | "column": 28 | 99 | "column": 26 |
100 | }, | 100 | }, |
101 | "end": { | 101 | "end": { |
102 | "line": 60, | 102 | "line": 60, |