diff options
author | 2022-11-08 07:40:02 +0530 | |
---|---|---|
committer | 2022-11-08 17:25:27 +0530 | |
commit | 570d26baf9e4ad87a8c0752b5edfb5c441bf9d80 (patch) | |
tree | ee0a0e6bec7d10ec438b5269537905fee80c377b /src/containers/settings | |
parent | refactor: remove toggle component's duplicate (diff) | |
download | ferdium-app-570d26baf9e4ad87a8c0752b5edfb5c441bf9d80.tar.gz ferdium-app-570d26baf9e4ad87a8c0752b5edfb5c441bf9d80.tar.zst ferdium-app-570d26baf9e4ad87a8c0752b5edfb5c441bf9d80.zip |
fix: slack issue caused by input TS conversion
Diffstat (limited to 'src/containers/settings')
-rw-r--r-- | src/containers/settings/EditServiceScreen.tsx | 93 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.tsx | 44 |
2 files changed, 97 insertions, 40 deletions
diff --git a/src/containers/settings/EditServiceScreen.tsx b/src/containers/settings/EditServiceScreen.tsx index d0f0c779d..09dd19925 100644 --- a/src/containers/settings/EditServiceScreen.tsx +++ b/src/containers/settings/EditServiceScreen.tsx | |||
@@ -1,25 +1,19 @@ | |||
1 | import { Component, ReactElement } from 'react'; | 1 | import { Component, ReactElement } from 'react'; |
2 | import { inject, observer } from 'mobx-react'; | 2 | import { inject, observer } from 'mobx-react'; |
3 | import { defineMessages, injectIntl } from 'react-intl'; | 3 | import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl'; |
4 | |||
5 | import { Params } from 'react-router-dom'; | 4 | import { Params } from 'react-router-dom'; |
6 | import { StoresProps } from '../../@types/ferdium-components.types'; | 5 | import { StoresProps } from '../../@types/ferdium-components.types'; |
7 | import { IRecipe } from '../../models/Recipe'; | 6 | import { IRecipe } from '../../models/Recipe'; |
8 | import Service from '../../models/Service'; | 7 | import Service from '../../models/Service'; |
9 | import { FormFields } from '../../@types/mobx-form.types'; | 8 | import { FormFields } from '../../@types/mobx-form.types'; |
10 | import Form from '../../lib/Form'; | 9 | import Form from '../../lib/Form'; |
11 | |||
12 | import ServiceError from '../../components/settings/services/ServiceError'; | 10 | import ServiceError from '../../components/settings/services/ServiceError'; |
13 | import EditServiceForm from '../../components/settings/services/EditServiceForm'; | 11 | import EditServiceForm from '../../components/settings/services/EditServiceForm'; |
14 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 12 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
15 | |||
16 | import { required, url, oneRequired } from '../../helpers/validation-helpers'; | 13 | import { required, url, oneRequired } from '../../helpers/validation-helpers'; |
17 | import { getSelectOptions } from '../../helpers/i18n-helpers'; | 14 | import { getSelectOptions } from '../../helpers/i18n-helpers'; |
18 | |||
19 | import { config as proxyFeature } from '../../features/serviceProxy'; | 15 | import { config as proxyFeature } from '../../features/serviceProxy'; |
20 | |||
21 | import { SPELLCHECKER_LOCALES } from '../../i18n/languages'; | 16 | import { SPELLCHECKER_LOCALES } from '../../i18n/languages'; |
22 | |||
23 | import globalMessages from '../../i18n/globalMessages'; | 17 | import globalMessages from '../../i18n/globalMessages'; |
24 | import { DEFAULT_APP_SETTINGS, DEFAULT_SERVICE_SETTINGS } from '../../config'; | 18 | import { DEFAULT_APP_SETTINGS, DEFAULT_SERVICE_SETTINGS } from '../../config'; |
25 | import withParams from '../../components/util/WithParams'; | 19 | import withParams from '../../components/util/WithParams'; |
@@ -123,13 +117,22 @@ const messages = defineMessages({ | |||
123 | }, | 117 | }, |
124 | }); | 118 | }); |
125 | 119 | ||
126 | interface EditServicesScreenProps extends StoresProps { | 120 | interface IProxyConfig { |
127 | intl: any; | 121 | isEnabled?: boolean; |
122 | host?: string; | ||
123 | port?: number; | ||
124 | user?: string; | ||
125 | password?: string; | ||
126 | } | ||
127 | |||
128 | interface IProps extends StoresProps, WrappedComponentProps { | ||
128 | params: Params; | 129 | params: Params; |
129 | } | 130 | } |
130 | 131 | ||
131 | class EditServiceScreen extends Component<EditServicesScreenProps> { | 132 | @inject('stores', 'actions') |
132 | onSubmit(data: any) { | 133 | @observer |
134 | class EditServiceScreen extends Component<IProps> { | ||
135 | onSubmit(data: any): void { | ||
133 | const { action } = this.props.params; | 136 | const { action } = this.props.params; |
134 | const { recipes, services } = this.props.stores; | 137 | const { recipes, services } = this.props.stores; |
135 | const { createService, updateService } = this.props.actions.service; | 138 | const { createService, updateService } = this.props.actions.service; |
@@ -153,9 +156,7 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
153 | } | 156 | } |
154 | 157 | ||
155 | prepareForm(recipe: IRecipe, service: Service | null, proxy: any): Form { | 158 | prepareForm(recipe: IRecipe, service: Service | null, proxy: any): Form { |
156 | const { intl } = this.props; | 159 | const { stores, intl } = this.props; |
157 | |||
158 | const { stores } = this.props; | ||
159 | 160 | ||
160 | let defaultSpellcheckerLanguage = | 161 | let defaultSpellcheckerLanguage = |
161 | SPELLCHECKER_LOCALES[stores.settings.app.spellcheckerLanguage]; | 162 | SPELLCHECKER_LOCALES[stores.settings.app.spellcheckerLanguage]; |
@@ -189,41 +190,49 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
189 | label: intl.formatMessage(messages.enableService), | 190 | label: intl.formatMessage(messages.enableService), |
190 | value: service?.isEnabled, | 191 | value: service?.isEnabled, |
191 | default: DEFAULT_SERVICE_SETTINGS.isEnabled, | 192 | default: DEFAULT_SERVICE_SETTINGS.isEnabled, |
193 | type: 'checkbox', | ||
192 | }, | 194 | }, |
193 | isHibernationEnabled: { | 195 | isHibernationEnabled: { |
194 | label: intl.formatMessage(messages.enableHibernation), | 196 | label: intl.formatMessage(messages.enableHibernation), |
195 | value: service?.isHibernationEnabled, | 197 | value: service?.isHibernationEnabled, |
196 | default: DEFAULT_SERVICE_SETTINGS.isHibernationEnabled, | 198 | default: DEFAULT_SERVICE_SETTINGS.isHibernationEnabled, |
199 | type: 'checkbox', | ||
197 | }, | 200 | }, |
198 | isWakeUpEnabled: { | 201 | isWakeUpEnabled: { |
199 | label: intl.formatMessage(messages.enableWakeUp), | 202 | label: intl.formatMessage(messages.enableWakeUp), |
200 | value: service?.isWakeUpEnabled, | 203 | value: service?.isWakeUpEnabled, |
201 | default: DEFAULT_SERVICE_SETTINGS.isWakeUpEnabled, | 204 | default: DEFAULT_SERVICE_SETTINGS.isWakeUpEnabled, |
205 | type: 'checkbox', | ||
202 | }, | 206 | }, |
203 | isNotificationEnabled: { | 207 | isNotificationEnabled: { |
204 | label: intl.formatMessage(messages.enableNotification), | 208 | label: intl.formatMessage(messages.enableNotification), |
205 | value: service?.isNotificationEnabled, | 209 | value: service?.isNotificationEnabled, |
206 | default: DEFAULT_SERVICE_SETTINGS.isNotificationEnabled, | 210 | default: DEFAULT_SERVICE_SETTINGS.isNotificationEnabled, |
211 | type: 'checkbox', | ||
207 | }, | 212 | }, |
208 | isBadgeEnabled: { | 213 | isBadgeEnabled: { |
209 | label: intl.formatMessage(messages.enableBadge), | 214 | label: intl.formatMessage(messages.enableBadge), |
210 | value: service?.isBadgeEnabled, | 215 | value: service?.isBadgeEnabled, |
211 | default: DEFAULT_SERVICE_SETTINGS.isBadgeEnabled, | 216 | default: DEFAULT_SERVICE_SETTINGS.isBadgeEnabled, |
217 | type: 'checkbox', | ||
212 | }, | 218 | }, |
213 | isMediaBadgeEnabled: { | 219 | isMediaBadgeEnabled: { |
214 | label: intl.formatMessage(messages.enableMediaBadge), | 220 | label: intl.formatMessage(messages.enableMediaBadge), |
215 | value: service?.isMediaBadgeEnabled, | 221 | value: service?.isMediaBadgeEnabled, |
216 | default: DEFAULT_SERVICE_SETTINGS.isMediaBadgeEnabled, | 222 | default: DEFAULT_SERVICE_SETTINGS.isMediaBadgeEnabled, |
223 | type: 'checkbox', | ||
217 | }, | 224 | }, |
218 | trapLinkClicks: { | 225 | trapLinkClicks: { |
219 | label: intl.formatMessage(messages.trapLinkClicks), | 226 | label: intl.formatMessage(messages.trapLinkClicks), |
220 | value: service?.trapLinkClicks, | 227 | value: service?.trapLinkClicks, |
221 | default: DEFAULT_SERVICE_SETTINGS.trapLinkClicks, | 228 | default: DEFAULT_SERVICE_SETTINGS.trapLinkClicks, |
229 | type: 'checkbox', | ||
222 | }, | 230 | }, |
223 | isMuted: { | 231 | isMuted: { |
224 | label: intl.formatMessage(messages.enableAudio), | 232 | label: intl.formatMessage(messages.enableAudio), |
225 | value: !service?.isMuted, | 233 | value: !service?.isMuted, |
226 | default: DEFAULT_SERVICE_SETTINGS.isMuted, | 234 | default: DEFAULT_SERVICE_SETTINGS.isMuted, |
235 | type: 'checkbox', | ||
227 | }, | 236 | }, |
228 | customIcon: { | 237 | customIcon: { |
229 | label: intl.formatMessage(messages.icon), | 238 | label: intl.formatMessage(messages.icon), |
@@ -235,6 +244,7 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
235 | label: intl.formatMessage(messages.enableDarkMode), | 244 | label: intl.formatMessage(messages.enableDarkMode), |
236 | value: service?.isDarkModeEnabled, | 245 | value: service?.isDarkModeEnabled, |
237 | default: stores.settings.app.darkMode, | 246 | default: stores.settings.app.darkMode, |
247 | type: 'checkbox', | ||
238 | }, | 248 | }, |
239 | darkReaderBrightness: { | 249 | darkReaderBrightness: { |
240 | label: intl.formatMessage(messages.darkReaderBrightness), | 250 | label: intl.formatMessage(messages.darkReaderBrightness), |
@@ -261,6 +271,7 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
261 | label: intl.formatMessage(messages.enableProgressbar), | 271 | label: intl.formatMessage(messages.enableProgressbar), |
262 | value: service?.isProgressbarEnabled, | 272 | value: service?.isProgressbarEnabled, |
263 | default: DEFAULT_SERVICE_SETTINGS.isProgressbarEnabled, | 273 | default: DEFAULT_SERVICE_SETTINGS.isProgressbarEnabled, |
274 | type: 'checkbox', | ||
264 | }, | 275 | }, |
265 | spellcheckerLanguage: { | 276 | spellcheckerLanguage: { |
266 | label: intl.formatMessage(globalMessages.spellcheckerLanguage), | 277 | label: intl.formatMessage(globalMessages.spellcheckerLanguage), |
@@ -277,25 +288,28 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
277 | }; | 288 | }; |
278 | 289 | ||
279 | if (recipe.hasTeamId) { | 290 | if (recipe.hasTeamId) { |
280 | Object.assign(config.fields, { | 291 | config.fields = { |
292 | ...config.fields, | ||
293 | |||
281 | team: { | 294 | team: { |
282 | label: intl.formatMessage(messages.team), | 295 | label: intl.formatMessage(messages.team), |
283 | placeholder: intl.formatMessage(messages.team), | 296 | placeholder: intl.formatMessage(messages.team), |
284 | value: service?.team, | 297 | value: service?.team, |
285 | validators: [required], | 298 | validators: [required], |
286 | }, | 299 | }, |
287 | }); | 300 | }; |
288 | } | 301 | } |
289 | 302 | ||
290 | if (recipe.hasCustomUrl) { | 303 | if (recipe.hasCustomUrl) { |
291 | Object.assign(config.fields, { | 304 | config.fields = { |
305 | ...config.fields, | ||
292 | customUrl: { | 306 | customUrl: { |
293 | label: intl.formatMessage(messages.customUrl), | 307 | label: intl.formatMessage(messages.customUrl), |
294 | placeholder: "'http://' or 'https://' or 'file:///'", | 308 | placeholder: "'http://' or 'https://' or 'file:///'", |
295 | value: service?.customUrl || recipe.serviceURL, | 309 | value: service?.customUrl || recipe.serviceURL, |
296 | validators: [required, url], | 310 | validators: [required, url], |
297 | }, | 311 | }, |
298 | }); | 312 | }; |
299 | } | 313 | } |
300 | 314 | ||
301 | // More fine grained and use case specific validation rules | 315 | // More fine grained and use case specific validation rules |
@@ -318,38 +332,37 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
318 | } | 332 | } |
319 | 333 | ||
320 | if (recipe.hasIndirectMessages) { | 334 | if (recipe.hasIndirectMessages) { |
321 | Object.assign(config.fields, { | 335 | config.fields = { |
336 | ...config.fields, | ||
322 | isIndirectMessageBadgeEnabled: { | 337 | isIndirectMessageBadgeEnabled: { |
323 | label: intl.formatMessage(messages.indirectMessages), | 338 | label: intl.formatMessage(messages.indirectMessages), |
324 | value: service?.isIndirectMessageBadgeEnabled, | 339 | value: service?.isIndirectMessageBadgeEnabled, |
325 | default: DEFAULT_SERVICE_SETTINGS.hasIndirectMessages, | 340 | default: DEFAULT_SERVICE_SETTINGS.hasIndirectMessages, |
341 | type: 'checkbox', | ||
326 | }, | 342 | }, |
327 | }); | 343 | }; |
328 | } | 344 | } |
329 | 345 | ||
330 | if (recipe.allowFavoritesDelineationInUnreadCount) { | 346 | if (recipe.allowFavoritesDelineationInUnreadCount) { |
331 | Object.assign(config.fields, { | 347 | config.fields = { |
348 | ...config.fields, | ||
332 | onlyShowFavoritesInUnreadCount: { | 349 | onlyShowFavoritesInUnreadCount: { |
333 | label: intl.formatMessage(messages.onlyShowFavoritesInUnreadCount), | 350 | label: intl.formatMessage(messages.onlyShowFavoritesInUnreadCount), |
334 | value: service?.onlyShowFavoritesInUnreadCount, | 351 | value: service?.onlyShowFavoritesInUnreadCount, |
335 | default: DEFAULT_APP_SETTINGS.onlyShowFavoritesInUnreadCount, | 352 | default: DEFAULT_APP_SETTINGS.onlyShowFavoritesInUnreadCount, |
353 | type: 'checkbox', | ||
336 | }, | 354 | }, |
337 | }); | 355 | }; |
338 | } | 356 | } |
339 | 357 | ||
340 | if (proxy.isEnabled) { | 358 | if (proxy.isEnabled) { |
341 | let serviceProxyConfig: { | 359 | let serviceProxyConfig: IProxyConfig = {}; |
342 | isEnabled?: boolean; | ||
343 | host?: string; | ||
344 | port?: number; | ||
345 | user?: string; | ||
346 | password?: string; | ||
347 | } = {}; | ||
348 | if (service) { | 360 | if (service) { |
349 | serviceProxyConfig = stores.settings.proxy[service.id] || {}; | 361 | serviceProxyConfig = stores.settings.proxy[service.id] || {}; |
350 | } | 362 | } |
351 | 363 | ||
352 | Object.assign(config.fields, { | 364 | config.fields = { |
365 | ...config.fields, | ||
353 | proxy: { | 366 | proxy: { |
354 | name: 'proxy', | 367 | name: 'proxy', |
355 | label: 'proxy', | 368 | label: 'proxy', |
@@ -358,6 +371,7 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
358 | label: intl.formatMessage(messages.enableProxy), | 371 | label: intl.formatMessage(messages.enableProxy), |
359 | value: serviceProxyConfig.isEnabled, | 372 | value: serviceProxyConfig.isEnabled, |
360 | default: DEFAULT_APP_SETTINGS.proxyFeatureEnabled, | 373 | default: DEFAULT_APP_SETTINGS.proxyFeatureEnabled, |
374 | type: 'checkbox', | ||
361 | }, | 375 | }, |
362 | host: { | 376 | host: { |
363 | label: intl.formatMessage(messages.proxyHost), | 377 | label: intl.formatMessage(messages.proxyHost), |
@@ -382,11 +396,10 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
382 | }, | 396 | }, |
383 | }, | 397 | }, |
384 | }, | 398 | }, |
385 | }); | 399 | }; |
386 | } | 400 | } |
387 | 401 | ||
388 | // @ts-ignore: Remove this ignore once mobx-react-form v4 with typescript | 402 | // @ts-ignore: Remove this ignore once mobx-react-form v4 with typescript |
389 | // support has been released. | ||
390 | return new Form(config); | 403 | return new Form(config); |
391 | } | 404 | } |
392 | 405 | ||
@@ -417,7 +430,11 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
417 | } | 430 | } |
418 | 431 | ||
419 | render(): ReactElement { | 432 | render(): ReactElement { |
420 | const { recipes, services, user } = this.props.stores; | 433 | const { |
434 | recipes, | ||
435 | services, | ||
436 | // user | ||
437 | } = this.props.stores; | ||
421 | const { action } = this.props.params; | 438 | const { action } = this.props.params; |
422 | 439 | ||
423 | let recipe: null | IRecipe = null; | 440 | let recipe: null | IRecipe = null; |
@@ -455,9 +472,9 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
455 | action={action} | 472 | action={action} |
456 | recipe={recipe} | 473 | recipe={recipe} |
457 | service={service} | 474 | service={service} |
458 | user={user.data} | 475 | // user={user.data} // TODO - [TS DEBT] Need to check why its passed as its not used inside EditServiceForm |
459 | form={form} | 476 | form={form} |
460 | status={services.actionStatus} | 477 | // status={services.actionStatus} // TODO - [TS DEBT] Need to check why its passed as its not used inside EditServiceForm |
461 | isSaving={ | 478 | isSaving={ |
462 | services.updateServiceRequest.isExecuting || | 479 | services.updateServiceRequest.isExecuting || |
463 | services.createServiceRequest.isExecuting | 480 | services.createServiceRequest.isExecuting |
@@ -473,8 +490,4 @@ class EditServiceScreen extends Component<EditServicesScreenProps> { | |||
473 | } | 490 | } |
474 | } | 491 | } |
475 | 492 | ||
476 | export default withParams( | 493 | export default withParams(injectIntl(EditServiceScreen)); |
477 | injectIntl<'intl', EditServicesScreenProps>( | ||
478 | inject('stores', 'actions')(observer(EditServiceScreen)), | ||
479 | ), | ||
480 | ); | ||
diff --git a/src/containers/settings/EditSettingsScreen.tsx b/src/containers/settings/EditSettingsScreen.tsx index 91752ad43..f18eb24a7 100644 --- a/src/containers/settings/EditSettingsScreen.tsx +++ b/src/containers/settings/EditSettingsScreen.tsx | |||
@@ -544,26 +544,31 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
544 | label: intl.formatMessage(messages.autoLaunchOnStart), | 544 | label: intl.formatMessage(messages.autoLaunchOnStart), |
545 | value: app.autoLaunchOnStart, | 545 | value: app.autoLaunchOnStart, |
546 | default: DEFAULT_APP_SETTINGS.autoLaunchOnStart, | 546 | default: DEFAULT_APP_SETTINGS.autoLaunchOnStart, |
547 | type: 'checkbox', | ||
547 | }, | 548 | }, |
548 | autoLaunchInBackground: { | 549 | autoLaunchInBackground: { |
549 | label: intl.formatMessage(messages.autoLaunchInBackground), | 550 | label: intl.formatMessage(messages.autoLaunchInBackground), |
550 | value: app.launchInBackground, | 551 | value: app.launchInBackground, |
551 | default: DEFAULT_APP_SETTINGS.autoLaunchInBackground, | 552 | default: DEFAULT_APP_SETTINGS.autoLaunchInBackground, |
553 | type: 'checkbox', | ||
552 | }, | 554 | }, |
553 | runInBackground: { | 555 | runInBackground: { |
554 | label: intl.formatMessage(messages.runInBackground), | 556 | label: intl.formatMessage(messages.runInBackground), |
555 | value: settings.all.app.runInBackground, | 557 | value: settings.all.app.runInBackground, |
556 | default: DEFAULT_APP_SETTINGS.runInBackground, | 558 | default: DEFAULT_APP_SETTINGS.runInBackground, |
559 | type: 'checkbox', | ||
557 | }, | 560 | }, |
558 | startMinimized: { | 561 | startMinimized: { |
559 | label: intl.formatMessage(messages.startMinimized), | 562 | label: intl.formatMessage(messages.startMinimized), |
560 | value: settings.all.app.startMinimized, | 563 | value: settings.all.app.startMinimized, |
561 | default: DEFAULT_APP_SETTINGS.startMinimized, | 564 | default: DEFAULT_APP_SETTINGS.startMinimized, |
565 | type: 'checkbox', | ||
562 | }, | 566 | }, |
563 | confirmOnQuit: { | 567 | confirmOnQuit: { |
564 | label: intl.formatMessage(messages.confirmOnQuit), | 568 | label: intl.formatMessage(messages.confirmOnQuit), |
565 | value: settings.all.app.confirmOnQuit, | 569 | value: settings.all.app.confirmOnQuit, |
566 | default: DEFAULT_APP_SETTINGS.confirmOnQuit, | 570 | default: DEFAULT_APP_SETTINGS.confirmOnQuit, |
571 | type: 'checkbox', | ||
567 | }, | 572 | }, |
568 | enableSystemTray: { | 573 | enableSystemTray: { |
569 | label: intl.formatMessage( | 574 | label: intl.formatMessage( |
@@ -571,11 +576,13 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
571 | ), | 576 | ), |
572 | value: settings.all.app.enableSystemTray, | 577 | value: settings.all.app.enableSystemTray, |
573 | default: DEFAULT_APP_SETTINGS.enableSystemTray, | 578 | default: DEFAULT_APP_SETTINGS.enableSystemTray, |
579 | type: 'checkbox', | ||
574 | }, | 580 | }, |
575 | reloadAfterResume: { | 581 | reloadAfterResume: { |
576 | label: intl.formatMessage(messages.reloadAfterResume), | 582 | label: intl.formatMessage(messages.reloadAfterResume), |
577 | value: settings.all.app.reloadAfterResume, | 583 | value: settings.all.app.reloadAfterResume, |
578 | default: DEFAULT_APP_SETTINGS.reloadAfterResume, | 584 | default: DEFAULT_APP_SETTINGS.reloadAfterResume, |
585 | type: 'checkbox', | ||
579 | }, | 586 | }, |
580 | reloadAfterResumeTime: { | 587 | reloadAfterResumeTime: { |
581 | label: intl.formatMessage(messages.reloadAfterResumeTime), | 588 | label: intl.formatMessage(messages.reloadAfterResumeTime), |
@@ -586,26 +593,31 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
586 | label: intl.formatMessage(messages.minimizeToSystemTray), | 593 | label: intl.formatMessage(messages.minimizeToSystemTray), |
587 | value: settings.all.app.minimizeToSystemTray, | 594 | value: settings.all.app.minimizeToSystemTray, |
588 | default: DEFAULT_APP_SETTINGS.minimizeToSystemTray, | 595 | default: DEFAULT_APP_SETTINGS.minimizeToSystemTray, |
596 | type: 'checkbox', | ||
589 | }, | 597 | }, |
590 | closeToSystemTray: { | 598 | closeToSystemTray: { |
591 | label: intl.formatMessage(messages.closeToSystemTray), | 599 | label: intl.formatMessage(messages.closeToSystemTray), |
592 | value: settings.all.app.closeToSystemTray, | 600 | value: settings.all.app.closeToSystemTray, |
593 | default: DEFAULT_APP_SETTINGS.closeToSystemTray, | 601 | default: DEFAULT_APP_SETTINGS.closeToSystemTray, |
602 | type: 'checkbox', | ||
594 | }, | 603 | }, |
595 | privateNotifications: { | 604 | privateNotifications: { |
596 | label: intl.formatMessage(messages.privateNotifications), | 605 | label: intl.formatMessage(messages.privateNotifications), |
597 | value: settings.all.app.privateNotifications, | 606 | value: settings.all.app.privateNotifications, |
598 | default: DEFAULT_APP_SETTINGS.privateNotifications, | 607 | default: DEFAULT_APP_SETTINGS.privateNotifications, |
608 | type: 'checkbox', | ||
599 | }, | 609 | }, |
600 | clipboardNotifications: { | 610 | clipboardNotifications: { |
601 | label: intl.formatMessage(messages.clipboardNotifications), | 611 | label: intl.formatMessage(messages.clipboardNotifications), |
602 | value: settings.all.app.clipboardNotifications, | 612 | value: settings.all.app.clipboardNotifications, |
603 | default: DEFAULT_APP_SETTINGS.clipboardNotifications, | 613 | default: DEFAULT_APP_SETTINGS.clipboardNotifications, |
614 | type: 'checkbox', | ||
604 | }, | 615 | }, |
605 | notifyTaskBarOnMessage: { | 616 | notifyTaskBarOnMessage: { |
606 | label: intl.formatMessage(messages.notifyTaskBarOnMessage), | 617 | label: intl.formatMessage(messages.notifyTaskBarOnMessage), |
607 | value: settings.all.app.notifyTaskBarOnMessage, | 618 | value: settings.all.app.notifyTaskBarOnMessage, |
608 | default: DEFAULT_APP_SETTINGS.notifyTaskBarOnMessage, | 619 | default: DEFAULT_APP_SETTINGS.notifyTaskBarOnMessage, |
620 | type: 'checkbox', | ||
609 | }, | 621 | }, |
610 | navigationBarBehaviour: { | 622 | navigationBarBehaviour: { |
611 | label: intl.formatMessage(messages.navigationBarBehaviour), | 623 | label: intl.formatMessage(messages.navigationBarBehaviour), |
@@ -618,6 +630,7 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
618 | value: settings.all.app.webRTCIPHandlingPolicy, | 630 | value: settings.all.app.webRTCIPHandlingPolicy, |
619 | default: DEFAULT_APP_SETTINGS.webRTCIPHandlingPolicy, | 631 | default: DEFAULT_APP_SETTINGS.webRTCIPHandlingPolicy, |
620 | options: webRTCIPHandlingPolicies, | 632 | options: webRTCIPHandlingPolicies, |
633 | type: 'checkbox', | ||
621 | }, | 634 | }, |
622 | searchEngine: { | 635 | searchEngine: { |
623 | label: intl.formatMessage(messages.searchEngine), | 636 | label: intl.formatMessage(messages.searchEngine), |
@@ -641,11 +654,13 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
641 | label: intl.formatMessage(messages.sentry), | 654 | label: intl.formatMessage(messages.sentry), |
642 | value: settings.all.app.sentry, | 655 | value: settings.all.app.sentry, |
643 | default: DEFAULT_APP_SETTINGS.sentry, | 656 | default: DEFAULT_APP_SETTINGS.sentry, |
657 | type: 'checkbox', | ||
644 | }, | 658 | }, |
645 | hibernateOnStartup: { | 659 | hibernateOnStartup: { |
646 | label: intl.formatMessage(messages.hibernateOnStartup), | 660 | label: intl.formatMessage(messages.hibernateOnStartup), |
647 | value: settings.all.app.hibernateOnStartup, | 661 | value: settings.all.app.hibernateOnStartup, |
648 | default: DEFAULT_APP_SETTINGS.hibernateOnStartup, | 662 | default: DEFAULT_APP_SETTINGS.hibernateOnStartup, |
663 | type: 'checkbox', | ||
649 | }, | 664 | }, |
650 | hibernationStrategy: { | 665 | hibernationStrategy: { |
651 | label: intl.formatMessage(messages.hibernationStrategy), | 666 | label: intl.formatMessage(messages.hibernationStrategy), |
@@ -669,6 +684,7 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
669 | label: intl.formatMessage(messages.wakeUpHibernationSplay), | 684 | label: intl.formatMessage(messages.wakeUpHibernationSplay), |
670 | value: settings.all.app.wakeUpHibernationSplay, | 685 | value: settings.all.app.wakeUpHibernationSplay, |
671 | default: DEFAULT_APP_SETTINGS.wakeUpHibernationSplay, | 686 | default: DEFAULT_APP_SETTINGS.wakeUpHibernationSplay, |
687 | type: 'checkbox', | ||
672 | }, | 688 | }, |
673 | predefinedTodoServer: { | 689 | predefinedTodoServer: { |
674 | label: intl.formatMessage(messages.predefinedTodoServer), | 690 | label: intl.formatMessage(messages.predefinedTodoServer), |
@@ -685,6 +701,7 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
685 | label: intl.formatMessage(messages.enableLock), | 701 | label: intl.formatMessage(messages.enableLock), |
686 | value: settings.all.app.lockingFeatureEnabled || false, | 702 | value: settings.all.app.lockingFeatureEnabled || false, |
687 | default: DEFAULT_APP_SETTINGS.lockingFeatureEnabled, | 703 | default: DEFAULT_APP_SETTINGS.lockingFeatureEnabled, |
704 | type: 'checkbox', | ||
688 | }, | 705 | }, |
689 | lockedPassword: { | 706 | lockedPassword: { |
690 | label: intl.formatMessage(messages.lockPassword), | 707 | label: intl.formatMessage(messages.lockPassword), |
@@ -696,6 +713,7 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
696 | label: intl.formatMessage(messages.useTouchIdToUnlock), | 713 | label: intl.formatMessage(messages.useTouchIdToUnlock), |
697 | value: settings.all.app.useTouchIdToUnlock, | 714 | value: settings.all.app.useTouchIdToUnlock, |
698 | default: DEFAULT_APP_SETTINGS.useTouchIdToUnlock, | 715 | default: DEFAULT_APP_SETTINGS.useTouchIdToUnlock, |
716 | type: 'checkbox', | ||
699 | }, | 717 | }, |
700 | inactivityLock: { | 718 | inactivityLock: { |
701 | label: intl.formatMessage(messages.inactivityLock), | 719 | label: intl.formatMessage(messages.inactivityLock), |
@@ -707,6 +725,7 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
707 | label: intl.formatMessage(messages.scheduledDNDEnabled), | 725 | label: intl.formatMessage(messages.scheduledDNDEnabled), |
708 | value: settings.all.app.scheduledDNDEnabled || false, | 726 | value: settings.all.app.scheduledDNDEnabled || false, |
709 | default: DEFAULT_APP_SETTINGS.scheduledDNDEnabled, | 727 | default: DEFAULT_APP_SETTINGS.scheduledDNDEnabled, |
728 | type: 'checkbox', | ||
710 | }, | 729 | }, |
711 | scheduledDNDStart: { | 730 | scheduledDNDStart: { |
712 | label: intl.formatMessage(messages.scheduledDNDStart), | 731 | label: intl.formatMessage(messages.scheduledDNDStart), |
@@ -724,31 +743,37 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
724 | label: intl.formatMessage(messages.showDisabledServices), | 743 | label: intl.formatMessage(messages.showDisabledServices), |
725 | value: settings.all.app.showDisabledServices, | 744 | value: settings.all.app.showDisabledServices, |
726 | default: DEFAULT_APP_SETTINGS.showDisabledServices, | 745 | default: DEFAULT_APP_SETTINGS.showDisabledServices, |
746 | type: 'checkbox', | ||
727 | }, | 747 | }, |
728 | showServiceName: { | 748 | showServiceName: { |
729 | label: intl.formatMessage(messages.showServiceName), | 749 | label: intl.formatMessage(messages.showServiceName), |
730 | value: settings.all.app.showServiceName, | 750 | value: settings.all.app.showServiceName, |
731 | default: DEFAULT_APP_SETTINGS.showServiceName, | 751 | default: DEFAULT_APP_SETTINGS.showServiceName, |
752 | type: 'checkbox', | ||
732 | }, | 753 | }, |
733 | showMessageBadgeWhenMuted: { | 754 | showMessageBadgeWhenMuted: { |
734 | label: intl.formatMessage(messages.showMessageBadgeWhenMuted), | 755 | label: intl.formatMessage(messages.showMessageBadgeWhenMuted), |
735 | value: settings.all.app.showMessageBadgeWhenMuted, | 756 | value: settings.all.app.showMessageBadgeWhenMuted, |
736 | default: DEFAULT_APP_SETTINGS.showMessageBadgeWhenMuted, | 757 | default: DEFAULT_APP_SETTINGS.showMessageBadgeWhenMuted, |
758 | type: 'checkbox', | ||
737 | }, | 759 | }, |
738 | showDragArea: { | 760 | showDragArea: { |
739 | label: intl.formatMessage(messages.showDragArea), | 761 | label: intl.formatMessage(messages.showDragArea), |
740 | value: settings.all.app.showDragArea, | 762 | value: settings.all.app.showDragArea, |
741 | default: DEFAULT_APP_SETTINGS.showDragArea, | 763 | default: DEFAULT_APP_SETTINGS.showDragArea, |
764 | type: 'checkbox', | ||
742 | }, | 765 | }, |
743 | enableSpellchecking: { | 766 | enableSpellchecking: { |
744 | label: intl.formatMessage(messages.enableSpellchecking), | 767 | label: intl.formatMessage(messages.enableSpellchecking), |
745 | value: settings.all.app.enableSpellchecking, | 768 | value: settings.all.app.enableSpellchecking, |
746 | default: DEFAULT_APP_SETTINGS.enableSpellchecking, | 769 | default: DEFAULT_APP_SETTINGS.enableSpellchecking, |
770 | type: 'checkbox', | ||
747 | }, | 771 | }, |
748 | enableTranslator: { | 772 | enableTranslator: { |
749 | label: intl.formatMessage(messages.enableTranslator), | 773 | label: intl.formatMessage(messages.enableTranslator), |
750 | value: settings.all.app.enableTranslator, | 774 | value: settings.all.app.enableTranslator, |
751 | default: DEFAULT_APP_SETTINGS.enableTranslator, | 775 | default: DEFAULT_APP_SETTINGS.enableTranslator, |
776 | type: 'checkbox', | ||
752 | }, | 777 | }, |
753 | spellcheckerLanguage: { | 778 | spellcheckerLanguage: { |
754 | label: intl.formatMessage(globalMessages.spellcheckerLanguage), | 779 | label: intl.formatMessage(globalMessages.spellcheckerLanguage), |
@@ -766,21 +791,25 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
766 | label: intl.formatMessage(messages.darkMode), | 791 | label: intl.formatMessage(messages.darkMode), |
767 | value: settings.all.app.darkMode, | 792 | value: settings.all.app.darkMode, |
768 | default: DEFAULT_APP_SETTINGS.darkMode, | 793 | default: DEFAULT_APP_SETTINGS.darkMode, |
794 | type: 'checkbox', | ||
769 | }, | 795 | }, |
770 | adaptableDarkMode: { | 796 | adaptableDarkMode: { |
771 | label: intl.formatMessage(messages.adaptableDarkMode), | 797 | label: intl.formatMessage(messages.adaptableDarkMode), |
772 | value: settings.all.app.adaptableDarkMode, | 798 | value: settings.all.app.adaptableDarkMode, |
773 | default: DEFAULT_APP_SETTINGS.adaptableDarkMode, | 799 | default: DEFAULT_APP_SETTINGS.adaptableDarkMode, |
800 | type: 'checkbox', | ||
774 | }, | 801 | }, |
775 | universalDarkMode: { | 802 | universalDarkMode: { |
776 | label: intl.formatMessage(messages.universalDarkMode), | 803 | label: intl.formatMessage(messages.universalDarkMode), |
777 | value: settings.all.app.universalDarkMode, | 804 | value: settings.all.app.universalDarkMode, |
778 | default: DEFAULT_APP_SETTINGS.universalDarkMode, | 805 | default: DEFAULT_APP_SETTINGS.universalDarkMode, |
806 | type: 'checkbox', | ||
779 | }, | 807 | }, |
780 | splitMode: { | 808 | splitMode: { |
781 | label: intl.formatMessage(messages.splitMode), | 809 | label: intl.formatMessage(messages.splitMode), |
782 | value: settings.all.app.splitMode, | 810 | value: settings.all.app.splitMode, |
783 | default: DEFAULT_APP_SETTINGS.splitMode, | 811 | default: DEFAULT_APP_SETTINGS.splitMode, |
812 | type: 'checkbox', | ||
784 | }, | 813 | }, |
785 | splitColumns: { | 814 | splitColumns: { |
786 | label: `${intl.formatMessage( | 815 | label: `${intl.formatMessage( |
@@ -811,31 +840,37 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
811 | label: intl.formatMessage(messages.enableLongPressServiceHint), | 840 | label: intl.formatMessage(messages.enableLongPressServiceHint), |
812 | value: settings.all.app.enableLongPressServiceHint, | 841 | value: settings.all.app.enableLongPressServiceHint, |
813 | default: DEFAULT_APP_SETTINGS.enableLongPressServiceHint, | 842 | default: DEFAULT_APP_SETTINGS.enableLongPressServiceHint, |
843 | type: 'checkbox', | ||
814 | }, | 844 | }, |
815 | useHorizontalStyle: { | 845 | useHorizontalStyle: { |
816 | label: intl.formatMessage(messages.useHorizontalStyle), | 846 | label: intl.formatMessage(messages.useHorizontalStyle), |
817 | value: settings.all.app.useHorizontalStyle, | 847 | value: settings.all.app.useHorizontalStyle, |
818 | default: DEFAULT_APP_SETTINGS.useHorizontalStyle, | 848 | default: DEFAULT_APP_SETTINGS.useHorizontalStyle, |
849 | type: 'checkbox', | ||
819 | }, | 850 | }, |
820 | hideCollapseButton: { | 851 | hideCollapseButton: { |
821 | label: intl.formatMessage(messages.hideCollapseButton), | 852 | label: intl.formatMessage(messages.hideCollapseButton), |
822 | value: settings.all.app.hideCollapseButton, | 853 | value: settings.all.app.hideCollapseButton, |
823 | default: DEFAULT_APP_SETTINGS.hideCollapseButton, | 854 | default: DEFAULT_APP_SETTINGS.hideCollapseButton, |
855 | type: 'checkbox', | ||
824 | }, | 856 | }, |
825 | hideRecipesButton: { | 857 | hideRecipesButton: { |
826 | label: intl.formatMessage(messages.hideRecipesButton), | 858 | label: intl.formatMessage(messages.hideRecipesButton), |
827 | value: settings.all.app.hideRecipesButton, | 859 | value: settings.all.app.hideRecipesButton, |
828 | default: DEFAULT_APP_SETTINGS.hideRecipesButton, | 860 | default: DEFAULT_APP_SETTINGS.hideRecipesButton, |
861 | type: 'checkbox', | ||
829 | }, | 862 | }, |
830 | hideSplitModeButton: { | 863 | hideSplitModeButton: { |
831 | label: intl.formatMessage(messages.hideSplitModeButton), | 864 | label: intl.formatMessage(messages.hideSplitModeButton), |
832 | value: settings.all.app.hideSplitModeButton, | 865 | value: settings.all.app.hideSplitModeButton, |
833 | default: DEFAULT_APP_SETTINGS.hideSplitModeButton, | 866 | default: DEFAULT_APP_SETTINGS.hideSplitModeButton, |
867 | type: 'checkbox', | ||
834 | }, | 868 | }, |
835 | useGrayscaleServices: { | 869 | useGrayscaleServices: { |
836 | label: intl.formatMessage(messages.useGrayscaleServices), | 870 | label: intl.formatMessage(messages.useGrayscaleServices), |
837 | value: settings.all.app.useGrayscaleServices, | 871 | value: settings.all.app.useGrayscaleServices, |
838 | default: DEFAULT_APP_SETTINGS.useGrayscaleServices, | 872 | default: DEFAULT_APP_SETTINGS.useGrayscaleServices, |
873 | type: 'checkbox', | ||
839 | }, | 874 | }, |
840 | grayscaleServicesDim: { | 875 | grayscaleServicesDim: { |
841 | label: intl.formatMessage(messages.grayscaleServicesDim), | 876 | label: intl.formatMessage(messages.grayscaleServicesDim), |
@@ -846,21 +881,25 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
846 | label: intl.formatMessage(messages.hideWorkspacesButton), | 881 | label: intl.formatMessage(messages.hideWorkspacesButton), |
847 | value: settings.all.app.hideWorkspacesButton, | 882 | value: settings.all.app.hideWorkspacesButton, |
848 | default: DEFAULT_APP_SETTINGS.hideWorkspacesButton, | 883 | default: DEFAULT_APP_SETTINGS.hideWorkspacesButton, |
884 | type: 'checkbox', | ||
849 | }, | 885 | }, |
850 | hideNotificationsButton: { | 886 | hideNotificationsButton: { |
851 | label: intl.formatMessage(messages.hideNotificationsButton), | 887 | label: intl.formatMessage(messages.hideNotificationsButton), |
852 | value: settings.all.app.hideNotificationsButton, | 888 | value: settings.all.app.hideNotificationsButton, |
853 | default: DEFAULT_APP_SETTINGS.hideNotificationsButton, | 889 | default: DEFAULT_APP_SETTINGS.hideNotificationsButton, |
890 | type: 'checkbox', | ||
854 | }, | 891 | }, |
855 | hideSettingsButton: { | 892 | hideSettingsButton: { |
856 | label: intl.formatMessage(messages.hideSettingsButton), | 893 | label: intl.formatMessage(messages.hideSettingsButton), |
857 | value: settings.all.app.hideSettingsButton, | 894 | value: settings.all.app.hideSettingsButton, |
858 | default: DEFAULT_APP_SETTINGS.hideSettingsButton, | 895 | default: DEFAULT_APP_SETTINGS.hideSettingsButton, |
896 | type: 'checkbox', | ||
859 | }, | 897 | }, |
860 | alwaysShowWorkspaces: { | 898 | alwaysShowWorkspaces: { |
861 | label: intl.formatMessage(messages.alwaysShowWorkspaces), | 899 | label: intl.formatMessage(messages.alwaysShowWorkspaces), |
862 | value: settings.all.app.alwaysShowWorkspaces, | 900 | value: settings.all.app.alwaysShowWorkspaces, |
863 | default: DEFAULT_APP_SETTINGS.alwaysShowWorkspaces, | 901 | default: DEFAULT_APP_SETTINGS.alwaysShowWorkspaces, |
902 | type: 'checkbox', | ||
864 | }, | 903 | }, |
865 | accentColor: { | 904 | accentColor: { |
866 | label: intl.formatMessage(messages.accentColor), | 905 | label: intl.formatMessage(messages.accentColor), |
@@ -876,11 +915,13 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
876 | label: intl.formatMessage(messages.enableGPUAcceleration), | 915 | label: intl.formatMessage(messages.enableGPUAcceleration), |
877 | value: settings.all.app.enableGPUAcceleration, | 916 | value: settings.all.app.enableGPUAcceleration, |
878 | default: DEFAULT_APP_SETTINGS.enableGPUAcceleration, | 917 | default: DEFAULT_APP_SETTINGS.enableGPUAcceleration, |
918 | type: 'checkbox', | ||
879 | }, | 919 | }, |
880 | enableGlobalHideShortcut: { | 920 | enableGlobalHideShortcut: { |
881 | label: intl.formatMessage(messages.enableGlobalHideShortcut), | 921 | label: intl.formatMessage(messages.enableGlobalHideShortcut), |
882 | value: settings.all.app.enableGlobalHideShortcut, | 922 | value: settings.all.app.enableGlobalHideShortcut, |
883 | default: DEFAULT_APP_SETTINGS.enableGlobalHideShortcut, | 923 | default: DEFAULT_APP_SETTINGS.enableGlobalHideShortcut, |
924 | type: 'checkbox', | ||
884 | }, | 925 | }, |
885 | locale: { | 926 | locale: { |
886 | label: intl.formatMessage(messages.language), | 927 | label: intl.formatMessage(messages.language), |
@@ -897,6 +938,7 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
897 | label: intl.formatMessage(messages.automaticUpdates), | 938 | label: intl.formatMessage(messages.automaticUpdates), |
898 | value: settings.app.automaticUpdates, | 939 | value: settings.app.automaticUpdates, |
899 | default: DEFAULT_APP_SETTINGS.automaticUpdates, | 940 | default: DEFAULT_APP_SETTINGS.automaticUpdates, |
941 | type: 'checkbox', | ||
900 | }, | 942 | }, |
901 | }, | 943 | }, |
902 | }; | 944 | }; |
@@ -914,6 +956,7 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
914 | label: intl.formatMessage(messages.keepAllWorkspacesLoaded), | 956 | label: intl.formatMessage(messages.keepAllWorkspacesLoaded), |
915 | value: workspaces.settings.keepAllWorkspacesLoaded, | 957 | value: workspaces.settings.keepAllWorkspacesLoaded, |
916 | default: DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED, | 958 | default: DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED, |
959 | type: 'checkbox', | ||
917 | }; | 960 | }; |
918 | } | 961 | } |
919 | 962 | ||
@@ -922,6 +965,7 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
922 | label: intl.formatMessage(messages.enableTodos), | 965 | label: intl.formatMessage(messages.enableTodos), |
923 | value: todos.settings.isFeatureEnabledByUser, | 966 | value: todos.settings.isFeatureEnabledByUser, |
924 | default: DEFAULT_IS_FEATURE_ENABLED_BY_USER, | 967 | default: DEFAULT_IS_FEATURE_ENABLED_BY_USER, |
968 | type: 'checkbox', | ||
925 | }; | 969 | }; |
926 | } | 970 | } |
927 | 971 | ||