diff options
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/settings/EditServiceScreen.js | 26 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 24 |
2 files changed, 21 insertions, 29 deletions
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index 99c40b086..a7d33a3ea 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js | |||
@@ -92,10 +92,6 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
92 | intl: intlShape, | 92 | intl: intlShape, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | state = { | ||
96 | isOpeningDarkModeCss: false, | ||
97 | } | ||
98 | |||
99 | onSubmit(data) { | 95 | onSubmit(data) { |
100 | const { action } = this.props.router.params; | 96 | const { action } = this.props.router.params; |
101 | const { recipes, services } = this.props.stores; | 97 | const { recipes, services } = this.props.stores; |
@@ -282,25 +278,16 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
282 | } | 278 | } |
283 | } | 279 | } |
284 | 280 | ||
285 | openDarkmodeCss() { | 281 | openRecipeFile(file) { |
286 | const { openDarkmodeCss } = this.props.actions.service; | 282 | const { openRecipeFile } = this.props.actions.service; |
287 | const { action } = this.props.router.params; | 283 | const { action } = this.props.router.params; |
288 | 284 | ||
289 | if (action === 'edit') { | 285 | if (action === 'edit') { |
290 | this.setState({ | ||
291 | isOpeningDarkModeCss: true, | ||
292 | }); | ||
293 | |||
294 | const { activeSettings: service } = this.props.stores.services; | 286 | const { activeSettings: service } = this.props.stores.services; |
295 | openDarkmodeCss({ | 287 | openRecipeFile({ |
296 | recipe: service.recipe.id, | 288 | recipe: service.recipe.id, |
289 | file, | ||
297 | }); | 290 | }); |
298 | |||
299 | setTimeout(() => { | ||
300 | this.setState({ | ||
301 | isOpeningDarkModeCss: false, | ||
302 | }); | ||
303 | }, 2500); | ||
304 | } | 291 | } |
305 | } | 292 | } |
306 | 293 | ||
@@ -355,8 +342,7 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
355 | isDeleting={services.deleteServiceRequest.isExecuting} | 342 | isDeleting={services.deleteServiceRequest.isExecuting} |
356 | onSubmit={d => this.onSubmit(d)} | 343 | onSubmit={d => this.onSubmit(d)} |
357 | onDelete={() => this.deleteService()} | 344 | onDelete={() => this.deleteService()} |
358 | openDarkmodeCss={() => this.openDarkmodeCss()} | 345 | openRecipeFile={file => this.openRecipeFile(file)} |
359 | isOpeningDarkModeCss={this.state.isOpeningDarkModeCss} | ||
360 | isProxyFeatureEnabled={proxyFeature.isEnabled} | 346 | isProxyFeatureEnabled={proxyFeature.isEnabled} |
361 | isServiceProxyIncludedInCurrentPlan={proxyFeature.isIncludedInCurrentPlan} | 347 | isServiceProxyIncludedInCurrentPlan={proxyFeature.isIncludedInCurrentPlan} |
362 | isSpellcheckerIncludedInCurrentPlan={spellcheckerFeature.isIncludedInCurrentPlan} | 348 | isSpellcheckerIncludedInCurrentPlan={spellcheckerFeature.isIncludedInCurrentPlan} |
@@ -384,7 +370,7 @@ EditServiceScreen.wrappedComponent.propTypes = { | |||
384 | createService: PropTypes.func.isRequired, | 370 | createService: PropTypes.func.isRequired, |
385 | updateService: PropTypes.func.isRequired, | 371 | updateService: PropTypes.func.isRequired, |
386 | deleteService: PropTypes.func.isRequired, | 372 | deleteService: PropTypes.func.isRequired, |
387 | openDarkmodeCss: PropTypes.func.isRequired, | 373 | openRecipeFile: PropTypes.func.isRequired, |
388 | }).isRequired, | 374 | }).isRequired, |
389 | // settings: PropTypes.shape({ | 375 | // settings: PropTypes.shape({ |
390 | // update: PropTypes.func.isRequred, | 376 | // update: PropTypes.func.isRequred, |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index ee5e3615c..6dd21f961 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -11,7 +11,7 @@ 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 { | 13 | import { |
14 | DEFAULT_APP_SETTINGS, HIBERNATION_STRATEGIES, SIDEBAR_WIDTH, ICON_SIZES, | 14 | DEFAULT_APP_SETTINGS, HIBERNATION_STRATEGIES, SIDEBAR_WIDTH, ICON_SIZES, NAVIGATION_BAR_BEHAVIOURS, |
15 | } from '../../config'; | 15 | } from '../../config'; |
16 | import { config as spellcheckerConfig } from '../../features/spellchecker'; | 16 | import { config as spellcheckerConfig } from '../../features/spellchecker'; |
17 | 17 | ||
@@ -56,9 +56,9 @@ const messages = defineMessages({ | |||
56 | id: 'settings.app.form.privateNotifications', | 56 | id: 'settings.app.form.privateNotifications', |
57 | defaultMessage: '!!!Don\'t show message content in notifications', | 57 | defaultMessage: '!!!Don\'t show message content in notifications', |
58 | }, | 58 | }, |
59 | showServiceNavigationBar: { | 59 | navigationBarBehaviour: { |
60 | id: 'settings.app.form.showServiceNavigationBar', | 60 | id: 'settings.app.form.navigationBarBehaviour', |
61 | defaultMessage: '!!!Always show service navigation bar', | 61 | defaultMessage: '!!!Navigation bar behaviour', |
62 | }, | 62 | }, |
63 | sentry: { | 63 | sentry: { |
64 | id: 'settings.app.form.sentry', | 64 | id: 'settings.app.form.sentry', |
@@ -194,7 +194,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
194 | startMinimized: settingsData.startMinimized, | 194 | startMinimized: settingsData.startMinimized, |
195 | minimizeToSystemTray: settingsData.minimizeToSystemTray, | 195 | minimizeToSystemTray: settingsData.minimizeToSystemTray, |
196 | privateNotifications: settingsData.privateNotifications, | 196 | privateNotifications: settingsData.privateNotifications, |
197 | showServiceNavigationBar: settingsData.showServiceNavigationBar, | 197 | navigationBarBehaviour: settingsData.navigationBarBehaviour, |
198 | sentry: settingsData.sentry, | 198 | sentry: settingsData.sentry, |
199 | hibernate: settingsData.hibernate, | 199 | hibernate: settingsData.hibernate, |
200 | hibernationStrategy: settingsData.hibernationStrategy, | 200 | hibernationStrategy: settingsData.hibernationStrategy, |
@@ -260,6 +260,11 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
260 | locales: APP_LOCALES, | 260 | locales: APP_LOCALES, |
261 | }); | 261 | }); |
262 | 262 | ||
263 | const navigationBarBehaviours = getSelectOptions({ | ||
264 | locales: NAVIGATION_BAR_BEHAVIOURS, | ||
265 | sort: false, | ||
266 | }); | ||
267 | |||
263 | const hibernationStrategies = getSelectOptions({ | 268 | const hibernationStrategies = getSelectOptions({ |
264 | locales: HIBERNATION_STRATEGIES, | 269 | locales: HIBERNATION_STRATEGIES, |
265 | sort: false, | 270 | sort: false, |
@@ -317,10 +322,11 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
317 | value: settings.all.app.privateNotifications, | 322 | value: settings.all.app.privateNotifications, |
318 | default: DEFAULT_APP_SETTINGS.privateNotifications, | 323 | default: DEFAULT_APP_SETTINGS.privateNotifications, |
319 | }, | 324 | }, |
320 | showServiceNavigationBar: { | 325 | navigationBarBehaviour: { |
321 | label: intl.formatMessage(messages.showServiceNavigationBar), | 326 | label: intl.formatMessage(messages.navigationBarBehaviour), |
322 | value: settings.all.app.showServiceNavigationBar, | 327 | value: settings.all.app.navigationBarBehaviour, |
323 | default: DEFAULT_APP_SETTINGS.showServiceNavigationBar, | 328 | default: DEFAULT_APP_SETTINGS.navigationBarBehaviour, |
329 | options: navigationBarBehaviours, | ||
324 | }, | 330 | }, |
325 | sentry: { | 331 | sentry: { |
326 | label: intl.formatMessage(messages.sentry), | 332 | label: intl.formatMessage(messages.sentry), |