diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/layout/Sidebar.tsx | 2 | ||||
-rw-r--r-- | src/components/settings/account/AccountDashboard.tsx | 8 | ||||
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.tsx | 100 | ||||
-rw-r--r-- | src/components/settings/team/TeamDashboard.tsx | 4 | ||||
-rw-r--r-- | src/components/ui/InfoBar.tsx | 7 | ||||
-rw-r--r-- | src/components/ui/Infobox.tsx | 7 | ||||
-rw-r--r-- | src/components/ui/button/index.tsx | 3 | ||||
-rw-r--r-- | src/components/ui/loader/index.tsx | 5 |
8 files changed, 119 insertions, 17 deletions
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index e423e408b..1106113f0 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx | |||
@@ -318,7 +318,7 @@ class Sidebar extends Component<IProps, IState> { | |||
318 | <Icon icon={mdiCheckAll} size={1.5} /> | 318 | <Icon icon={mdiCheckAll} size={1.5} /> |
319 | </button> | 319 | </button> |
320 | ) : null} | 320 | ) : null} |
321 | {stores!.settings.all.app.lockingFeatureEnabled ? ( | 321 | {stores!.settings.all.app.isLockingFeatureEnabled ? ( |
322 | <button | 322 | <button |
323 | type="button" | 323 | type="button" |
324 | className="sidebar__button" | 324 | className="sidebar__button" |
diff --git a/src/components/settings/account/AccountDashboard.tsx b/src/components/settings/account/AccountDashboard.tsx index ffa684458..eab019084 100644 --- a/src/components/settings/account/AccountDashboard.tsx +++ b/src/components/settings/account/AccountDashboard.tsx | |||
@@ -7,7 +7,11 @@ import { H1, H2 } from '../../ui/headline'; | |||
7 | import Loader from '../../ui/loader'; | 7 | import Loader from '../../ui/loader'; |
8 | import Button from '../../ui/button'; | 8 | import Button from '../../ui/button'; |
9 | import Infobox from '../../ui/infobox/index'; | 9 | import Infobox from '../../ui/infobox/index'; |
10 | import { LOCAL_SERVER, LIVE_FRANZ_API } from '../../../config'; | 10 | import { |
11 | DEFAULT_LOADER_COLOR, | ||
12 | LOCAL_SERVER, | ||
13 | LIVE_FRANZ_API, | ||
14 | } from '../../../config'; | ||
11 | import User from '../../../models/User'; | 15 | import User from '../../../models/User'; |
12 | 16 | ||
13 | const messages = defineMessages({ | 17 | const messages = defineMessages({ |
@@ -123,7 +127,7 @@ class AccountDashboard extends Component<IProp> { | |||
123 | )} | 127 | )} |
124 | {!isUsingWithoutAccount && ( | 128 | {!isUsingWithoutAccount && ( |
125 | <> | 129 | <> |
126 | {isLoading && <Loader color="#FFFFFF" />} | 130 | {isLoading && <Loader color={DEFAULT_LOADER_COLOR} />} |
127 | 131 | ||
128 | {!isLoading && userInfoRequestFailed && ( | 132 | {!isLoading && userInfoRequestFailed && ( |
129 | <Infobox | 133 | <Infobox |
diff --git a/src/components/settings/settings/EditSettingsForm.tsx b/src/components/settings/settings/EditSettingsForm.tsx index 1672a1411..81cfe8b12 100644 --- a/src/components/settings/settings/EditSettingsForm.tsx +++ b/src/components/settings/settings/EditSettingsForm.tsx | |||
@@ -15,6 +15,7 @@ import Infobox from '../../ui/Infobox'; | |||
15 | import { H1, H2, H3, H5 } from '../../ui/headline'; | 15 | import { H1, H2, H3, H5 } from '../../ui/headline'; |
16 | import { | 16 | import { |
17 | ferdiumVersion, | 17 | ferdiumVersion, |
18 | userDataCertsPath, | ||
18 | userDataPath, | 19 | userDataPath, |
19 | userDataRecipesPath, | 20 | userDataRecipesPath, |
20 | } from '../../../environment-remote'; | 21 | } from '../../../environment-remote'; |
@@ -238,6 +239,10 @@ const messages = defineMessages({ | |||
238 | id: 'settings.app.updateStatusUpToDate', | 239 | id: 'settings.app.updateStatusUpToDate', |
239 | defaultMessage: 'You are using the latest version of Ferdium', | 240 | defaultMessage: 'You are using the latest version of Ferdium', |
240 | }, | 241 | }, |
242 | servicesUpdateStatusUpToDate: { | ||
243 | id: 'settings.app.servicesUpdateStatusUpToDate', | ||
244 | defaultMessage: 'Your services are up-to-date', | ||
245 | }, | ||
241 | currentVersion: { | 246 | currentVersion: { |
242 | id: 'settings.app.currentVersion', | 247 | id: 'settings.app.currentVersion', |
243 | defaultMessage: 'Current version:', | 248 | defaultMessage: 'Current version:', |
@@ -258,6 +263,20 @@ const messages = defineMessages({ | |||
258 | id: 'settings.app.form.splitColumns', | 263 | id: 'settings.app.form.splitColumns', |
259 | defaultMessage: 'Number of columns', | 264 | defaultMessage: 'Number of columns', |
260 | }, | 265 | }, |
266 | warningSelfSignedCertificates: { | ||
267 | id: 'settings.app.warningSelfSignedCertificates', | ||
268 | defaultMessage: | ||
269 | 'WARNING: Only enable this feature if you know what you are doing. Enabling this is a security risk and should only be used for testing purposes.', | ||
270 | }, | ||
271 | infoOpenCertificatesFolder: { | ||
272 | id: 'settings.app.infoOpenCertificatesFolder', | ||
273 | defaultMessage: | ||
274 | 'To install a certificate, click the button below to open the certificates folder and copy it into the folder. After that you can refresh the service (CTRL/CMD + R). To remove/uninstall, simply delete the certificate file and restart Ferdium.', | ||
275 | }, | ||
276 | buttonOpenFerdiumCertsFolder: { | ||
277 | id: 'settings.app.buttonOpenFerdiumCertsFolder', | ||
278 | defaultMessage: 'Open certificates folder', | ||
279 | }, | ||
261 | }); | 280 | }); |
262 | 281 | ||
263 | const Hr = (): ReactElement => ( | 282 | const Hr = (): ReactElement => ( |
@@ -284,10 +303,12 @@ interface IProps extends WrappedComponentProps { | |||
284 | isClearingAllCache: boolean; | 303 | isClearingAllCache: boolean; |
285 | isTodosActivated: boolean; | 304 | isTodosActivated: boolean; |
286 | automaticUpdates: boolean; | 305 | automaticUpdates: boolean; |
306 | isTwoFactorAutoCatcherEnabled: boolean; | ||
307 | twoFactorAutoCatcherMatcher: string; | ||
287 | isDarkmodeEnabled: boolean; | 308 | isDarkmodeEnabled: boolean; |
288 | isAdaptableDarkModeEnabled: boolean; | 309 | isAdaptableDarkModeEnabled: boolean; |
289 | isUseGrayscaleServicesEnabled: boolean; | 310 | isUseGrayscaleServicesEnabled: boolean; |
290 | lockingFeatureEnabled: boolean; | 311 | isLockingFeatureEnabled: boolean; |
291 | isSplitModeEnabled: boolean; | 312 | isSplitModeEnabled: boolean; |
292 | isOnline: boolean; | 313 | isOnline: boolean; |
293 | showServicesUpdatedInfoBar: boolean; | 314 | showServicesUpdatedInfoBar: boolean; |
@@ -335,7 +356,8 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
335 | this.props.form.submit({ | 356 | this.props.form.submit({ |
336 | onSuccess: (form: Form) => { | 357 | onSuccess: (form: Form) => { |
337 | const values = form.values(); | 358 | const values = form.values(); |
338 | const { accentColor } = values; | 359 | const { accentColor, isTwoFactorAutoCatcherEnabled } = values; |
360 | |||
339 | if (accentColor.trim().length === 0) { | 361 | if (accentColor.trim().length === 0) { |
340 | values.accentColor = DEFAULT_ACCENT_COLOR; | 362 | values.accentColor = DEFAULT_ACCENT_COLOR; |
341 | } | 363 | } |
@@ -343,6 +365,15 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
343 | if (progressbarAccentColor.trim().length === 0) { | 365 | if (progressbarAccentColor.trim().length === 0) { |
344 | values.progressbarAccentColor = DEFAULT_ACCENT_COLOR; | 366 | values.progressbarAccentColor = DEFAULT_ACCENT_COLOR; |
345 | } | 367 | } |
368 | |||
369 | // set twoFactorAutoCatcherMatcher to the default value, if its get enabled the input is prefilled | ||
370 | if ( | ||
371 | !isTwoFactorAutoCatcherEnabled && | ||
372 | values.twoFactorAutoCatcherMatcher.length === 0 | ||
373 | ) { | ||
374 | values.twoFactorAutoCatcherMatcher = | ||
375 | DEFAULT_APP_SETTINGS.twoFactorAutoCatcherMatcher; | ||
376 | } | ||
346 | this.props.onSubmit(values); | 377 | this.props.onSubmit(values); |
347 | }, | 378 | }, |
348 | onError: noop, | 379 | onError: noop, |
@@ -367,6 +398,7 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
367 | onClearAllCache, | 398 | onClearAllCache, |
368 | getCacheSize, | 399 | getCacheSize, |
369 | automaticUpdates, | 400 | automaticUpdates, |
401 | isTwoFactorAutoCatcherEnabled, | ||
370 | isDarkmodeEnabled, | 402 | isDarkmodeEnabled, |
371 | isSplitModeEnabled, | 403 | isSplitModeEnabled, |
372 | openProcessManager, | 404 | openProcessManager, |
@@ -383,8 +415,12 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
383 | updateButtonLabelMessage = messages.updateStatusAvailable; | 415 | updateButtonLabelMessage = messages.updateStatusAvailable; |
384 | } | 416 | } |
385 | 417 | ||
386 | const { lockingFeatureEnabled, scheduledDNDEnabled, reloadAfterResume } = | 418 | const { |
387 | window['ferdium'].stores.settings.all.app; | 419 | isLockingFeatureEnabled, |
420 | scheduledDNDEnabled, | ||
421 | reloadAfterResume, | ||
422 | useSelfSignedCertificates, | ||
423 | } = window['ferdium'].stores.settings.all.app; | ||
388 | 424 | ||
389 | let cacheSize; | 425 | let cacheSize; |
390 | let notCleared; | 426 | let notCleared; |
@@ -407,6 +443,7 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
407 | 443 | ||
408 | const profileFolder = userDataPath(); | 444 | const profileFolder = userDataPath(); |
409 | const recipeFolder = userDataRecipesPath(); | 445 | const recipeFolder = userDataRecipesPath(); |
446 | const certsFolder = userDataCertsPath(); | ||
410 | 447 | ||
411 | return ( | 448 | return ( |
412 | <div className="settings__main"> | 449 | <div className="settings__main"> |
@@ -813,6 +850,15 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
813 | <Toggle {...form.$('notifyTaskBarOnMessage').bind()} /> | 850 | <Toggle {...form.$('notifyTaskBarOnMessage').bind()} /> |
814 | )} | 851 | )} |
815 | 852 | ||
853 | <Toggle {...form.$('isTwoFactorAutoCatcherEnabled').bind()} /> | ||
854 | |||
855 | {isTwoFactorAutoCatcherEnabled && ( | ||
856 | <Input | ||
857 | onChange={e => this.submit(e)} | ||
858 | {...form.$('twoFactorAutoCatcherMatcher').bind()} | ||
859 | /> | ||
860 | )} | ||
861 | |||
816 | <Hr /> | 862 | <Hr /> |
817 | 863 | ||
818 | <Select field={form.$('webRTCIPHandlingPolicy')} /> | 864 | <Select field={form.$('webRTCIPHandlingPolicy')} /> |
@@ -836,8 +882,8 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
836 | 882 | ||
837 | <Hr /> | 883 | <Hr /> |
838 | 884 | ||
839 | <Toggle {...form.$('lockingFeatureEnabled').bind()} /> | 885 | <Toggle {...form.$('isLockingFeatureEnabled').bind()} /> |
840 | {lockingFeatureEnabled && ( | 886 | {isLockingFeatureEnabled && ( |
841 | <> | 887 | <> |
842 | {isMac && systemPreferences.canPromptTouchID() && ( | 888 | {isMac && systemPreferences.canPromptTouchID() && ( |
843 | <Toggle {...form.$('useTouchIdToUnlock').bind()} /> | 889 | <Toggle {...form.$('useTouchIdToUnlock').bind()} /> |
@@ -943,6 +989,43 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
943 | {intl.formatMessage(messages.appRestartRequired)} | 989 | {intl.formatMessage(messages.appRestartRequired)} |
944 | </p> | 990 | </p> |
945 | 991 | ||
992 | <Toggle {...form.$('useSelfSignedCertificates').bind()} /> | ||
993 | |||
994 | {useSelfSignedCertificates && ( | ||
995 | <div className="settings__settings-group"> | ||
996 | <p | ||
997 | style={{ | ||
998 | padding: '0rem 0rem 1rem 0rem', | ||
999 | textAlign: 'justify', | ||
1000 | fontSize: '1.1rem', | ||
1001 | }} | ||
1002 | > | ||
1003 | {intl.formatMessage(messages.infoOpenCertificatesFolder)} | ||
1004 | </p> | ||
1005 | <div className="settings__open-settings-cache-container"> | ||
1006 | <Button | ||
1007 | buttonType="secondary" | ||
1008 | label={intl.formatMessage( | ||
1009 | messages.buttonOpenFerdiumCertsFolder, | ||
1010 | )} | ||
1011 | className="settings__open-settings-file-button" | ||
1012 | onClick={() => openPath(certsFolder)} | ||
1013 | /> | ||
1014 | </div> | ||
1015 | </div> | ||
1016 | )} | ||
1017 | |||
1018 | <p | ||
1019 | className="settings__help" | ||
1020 | style={{ | ||
1021 | padding: useSelfSignedCertificates | ||
1022 | ? '1rem 0rem 0rem 0rem' | ||
1023 | : undefined, | ||
1024 | }} | ||
1025 | > | ||
1026 | {intl.formatMessage(messages.warningSelfSignedCertificates)} | ||
1027 | </p> | ||
1028 | |||
946 | <Hr /> | 1029 | <Hr /> |
947 | 1030 | ||
948 | <Input | 1031 | <Input |
@@ -1117,7 +1200,10 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
1117 | ) : ( | 1200 | ) : ( |
1118 | <p> | 1201 | <p> |
1119 | <Icon icon={mdiPowerPlug} /> | 1202 | <Icon icon={mdiPowerPlug} /> |
1120 | Your services are up-to-date. | 1203 | |
1204 | {intl.formatMessage( | ||
1205 | messages.servicesUpdateStatusUpToDate, | ||
1206 | )} | ||
1121 | </p> | 1207 | </p> |
1122 | )} | 1208 | )} |
1123 | </> | 1209 | </> |
diff --git a/src/components/settings/team/TeamDashboard.tsx b/src/components/settings/team/TeamDashboard.tsx index 406656160..96613373e 100644 --- a/src/components/settings/team/TeamDashboard.tsx +++ b/src/components/settings/team/TeamDashboard.tsx | |||
@@ -10,7 +10,7 @@ import Loader from '../../ui/loader'; | |||
10 | import Button from '../../ui/button'; | 10 | import Button from '../../ui/button'; |
11 | import Infobox from '../../ui/Infobox'; | 11 | import Infobox from '../../ui/Infobox'; |
12 | import { H1 } from '../../ui/headline'; | 12 | import { H1 } from '../../ui/headline'; |
13 | import { LIVE_FRANZ_API } from '../../../config'; | 13 | import { DEFAULT_LOADER_COLOR, LIVE_FRANZ_API } from '../../../config'; |
14 | 14 | ||
15 | const messages = defineMessages({ | 15 | const messages = defineMessages({ |
16 | headline: { | 16 | headline: { |
@@ -128,7 +128,7 @@ class TeamDashboard extends Component<IProps> { | |||
128 | </span> | 128 | </span> |
129 | </div> | 129 | </div> |
130 | <div className="settings__body"> | 130 | <div className="settings__body"> |
131 | {isLoading && <Loader color="#FFFFFF" />} | 131 | {isLoading && <Loader color={DEFAULT_LOADER_COLOR} />} |
132 | 132 | ||
133 | {!isLoading && userInfoRequestFailed && ( | 133 | {!isLoading && userInfoRequestFailed && ( |
134 | <Infobox | 134 | <Infobox |
diff --git a/src/components/ui/InfoBar.tsx b/src/components/ui/InfoBar.tsx index ae37546df..f3f1adbe7 100644 --- a/src/components/ui/InfoBar.tsx +++ b/src/components/ui/InfoBar.tsx | |||
@@ -8,6 +8,7 @@ import { noop } from 'lodash'; | |||
8 | import Loader from './loader/index'; | 8 | import Loader from './loader/index'; |
9 | import Appear from './effects/Appear'; | 9 | import Appear from './effects/Appear'; |
10 | import Icon from './icon'; | 10 | import Icon from './icon'; |
11 | import { DEFAULT_LOADER_COLOR } from '../../config'; | ||
11 | 12 | ||
12 | const messages = defineMessages({ | 13 | const messages = defineMessages({ |
13 | hide: { | 14 | hide: { |
@@ -71,7 +72,11 @@ class InfoBar extends Component<IProps> { | |||
71 | className="contentWrapper" | 72 | className="contentWrapper" |
72 | style={{ display: 'flex', gap: '8px' }} | 73 | style={{ display: 'flex', gap: '8px' }} |
73 | > | 74 | > |
74 | <Loader size={18} loaded={!ctaLoading} color="#FFFFFF" /> | 75 | <Loader |
76 | size={18} | ||
77 | loaded={!ctaLoading} | ||
78 | color={DEFAULT_LOADER_COLOR} | ||
79 | /> | ||
75 | {ctaLabel} | 80 | {ctaLabel} |
76 | </div> | 81 | </div> |
77 | </button> | 82 | </button> |
diff --git a/src/components/ui/Infobox.tsx b/src/components/ui/Infobox.tsx index 742717ed7..14e1a581c 100644 --- a/src/components/ui/Infobox.tsx +++ b/src/components/ui/Infobox.tsx | |||
@@ -6,6 +6,7 @@ import { noop } from 'lodash'; | |||
6 | import { observer } from 'mobx-react'; | 6 | import { observer } from 'mobx-react'; |
7 | import Loader from './loader/index'; | 7 | import Loader from './loader/index'; |
8 | import Icon from './icon'; | 8 | import Icon from './icon'; |
9 | import { DEFAULT_LOADER_COLOR } from '../../config'; | ||
9 | 10 | ||
10 | const icons = { | 11 | const icons = { |
11 | 'checkbox-marked-circle-outline': mdiCheckboxMarkedCircleOutline, | 12 | 'checkbox-marked-circle-outline': mdiCheckboxMarkedCircleOutline, |
@@ -84,7 +85,11 @@ class Infobox extends Component<IProps, IState> { | |||
84 | className="contentWrapper" | 85 | className="contentWrapper" |
85 | style={{ display: 'flex', gap: '8px' }} | 86 | style={{ display: 'flex', gap: '8px' }} |
86 | > | 87 | > |
87 | <Loader size={18} loaded={!ctaLoading} color="#FFFFFF" /> | 88 | <Loader |
89 | size={18} | ||
90 | loaded={!ctaLoading} | ||
91 | color={DEFAULT_LOADER_COLOR} | ||
92 | /> | ||
88 | {ctaLabel} | 93 | {ctaLabel} |
89 | </div> | 94 | </div> |
90 | </button> | 95 | </button> |
diff --git a/src/components/ui/button/index.tsx b/src/components/ui/button/index.tsx index a2194e34d..3247072a9 100644 --- a/src/components/ui/button/index.tsx +++ b/src/components/ui/button/index.tsx | |||
@@ -8,6 +8,7 @@ import withStyles, { WithStylesProps } from 'react-jss'; | |||
8 | import Loader from '../loader/index'; | 8 | import Loader from '../loader/index'; |
9 | import { Theme } from '../../../themes'; | 9 | import { Theme } from '../../../themes'; |
10 | import { IFormField } from '../typings/generic'; | 10 | import { IFormField } from '../typings/generic'; |
11 | import { DEFAULT_LOADER_COLOR } from '../../../config'; | ||
11 | 12 | ||
12 | type ButtonType = | 13 | type ButtonType = |
13 | | 'primary' | 14 | | 'primary' |
@@ -194,7 +195,7 @@ class ButtonComponent extends Component<IProps, IState> { | |||
194 | <> | 195 | <> |
195 | {showLoader && ( | 196 | {showLoader && ( |
196 | <div className={classes.loaderContainer}> | 197 | <div className={classes.loaderContainer}> |
197 | <Loader size={18} color="#FFFFFF" /> | 198 | <Loader size={18} color={DEFAULT_LOADER_COLOR} /> |
198 | </div> | 199 | </div> |
199 | )} | 200 | )} |
200 | <div className={classes.label}> | 201 | <div className={classes.label}> |
diff --git a/src/components/ui/loader/index.tsx b/src/components/ui/loader/index.tsx index 2cee00d96..c0ae15028 100644 --- a/src/components/ui/loader/index.tsx +++ b/src/components/ui/loader/index.tsx | |||
@@ -4,6 +4,7 @@ import injectStyle, { WithStylesProps } from 'react-jss'; | |||
4 | import { Oval } from 'react-loader-spinner'; | 4 | import { Oval } from 'react-loader-spinner'; |
5 | import { inject } from 'mobx-react'; | 5 | import { inject } from 'mobx-react'; |
6 | import { FerdiumStores } from '../../../@types/stores.types'; | 6 | import { FerdiumStores } from '../../../@types/stores.types'; |
7 | import { DEFAULT_LOADER_COLOR } from '../../../config'; | ||
7 | 8 | ||
8 | const styles = () => ({ | 9 | const styles = () => ({ |
9 | container: { | 10 | container: { |
@@ -29,11 +30,11 @@ class LoaderComponent extends Component<IProps> { | |||
29 | const { | 30 | const { |
30 | classes, | 31 | classes, |
31 | className, | 32 | className, |
32 | size = 36, | 33 | size = 100, |
33 | color = this.props.stores?.settings.app.accentColor, | 34 | color = this.props.stores?.settings.app.accentColor, |
34 | loaded = false, | 35 | loaded = false, |
35 | } = this.props; | 36 | } = this.props; |
36 | const loaderColor = color || '#FFFFFF'; | 37 | const loaderColor = color ?? DEFAULT_LOADER_COLOR; |
37 | 38 | ||
38 | return ( | 39 | return ( |
39 | <div | 40 | <div |