diff options
author | kytwb <kytwb@pm.me> | 2022-01-08 13:51:46 +0100 |
---|---|---|
committer | kytwb <kytwb@pm.me> | 2022-01-08 13:51:46 +0100 |
commit | 3f8e9a9144a2c1f353d40acc7bd006489a649c03 (patch) | |
tree | 23a681f887936d412ea35bc0a6e4f54a778956ab /src/components | |
parent | Merge branch 'develop' into release (diff) | |
parent | Merge branch 'develop' into nightly (diff) | |
download | ferdium-app-3f8e9a9144a2c1f353d40acc7bd006489a649c03.tar.gz ferdium-app-3f8e9a9144a2c1f353d40acc7bd006489a649c03.tar.zst ferdium-app-3f8e9a9144a2c1f353d40acc7bd006489a649c03.zip |
Merge branch 'nightly' into release
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/layout/AppLayout.js | 6 | ||||
-rw-r--r-- | src/components/layout/Sidebar.js | 7 | ||||
-rw-r--r-- | src/components/settings/navigation/SettingsNavigation.js | 4 | ||||
-rw-r--r-- | src/components/settings/recipes/RecipesDashboard.js | 2 | ||||
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 109 |
5 files changed, 79 insertions, 49 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 4474fe0f4..5d7b6b85c 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -87,7 +87,6 @@ class AppLayout extends Component { | |||
87 | showServicesUpdatedInfoBar: PropTypes.bool.isRequired, | 87 | showServicesUpdatedInfoBar: PropTypes.bool.isRequired, |
88 | appUpdateIsDownloaded: PropTypes.bool.isRequired, | 88 | appUpdateIsDownloaded: PropTypes.bool.isRequired, |
89 | authRequestFailed: PropTypes.bool.isRequired, | 89 | authRequestFailed: PropTypes.bool.isRequired, |
90 | reloadServicesAfterUpdate: PropTypes.func.isRequired, | ||
91 | installAppUpdate: PropTypes.func.isRequired, | 90 | installAppUpdate: PropTypes.func.isRequired, |
92 | showRequiredRequestsError: PropTypes.bool.isRequired, | 91 | showRequiredRequestsError: PropTypes.bool.isRequired, |
93 | areRequiredRequestsSuccessful: PropTypes.bool.isRequired, | 92 | areRequiredRequestsSuccessful: PropTypes.bool.isRequired, |
@@ -115,7 +114,6 @@ class AppLayout extends Component { | |||
115 | showServicesUpdatedInfoBar, | 114 | showServicesUpdatedInfoBar, |
116 | appUpdateIsDownloaded, | 115 | appUpdateIsDownloaded, |
117 | authRequestFailed, | 116 | authRequestFailed, |
118 | reloadServicesAfterUpdate, | ||
119 | installAppUpdate, | 117 | installAppUpdate, |
120 | settings, | 118 | settings, |
121 | showRequiredRequestsError, | 119 | showRequiredRequestsError, |
@@ -175,12 +173,12 @@ class AppLayout extends Component { | |||
175 | {intl.formatMessage(messages.authRequestFailed)} | 173 | {intl.formatMessage(messages.authRequestFailed)} |
176 | </InfoBar> | 174 | </InfoBar> |
177 | )} | 175 | )} |
178 | {showServicesUpdatedInfoBar && | 176 | {automaticUpdates && showServicesUpdatedInfoBar && |
179 | this.state.shouldShowServicesUpdatedInfoBar && ( | 177 | this.state.shouldShowServicesUpdatedInfoBar && ( |
180 | <InfoBar | 178 | <InfoBar |
181 | type="primary" | 179 | type="primary" |
182 | ctaLabel={intl.formatMessage(messages.buttonReloadServices)} | 180 | ctaLabel={intl.formatMessage(messages.buttonReloadServices)} |
183 | onClick={reloadServicesAfterUpdate} | 181 | onClick={() => window.location.reload()} |
184 | onHide={() => { | 182 | onHide={() => { |
185 | this.setState({ | 183 | this.setState({ |
186 | shouldShowServicesUpdatedInfoBar: false, | 184 | shouldShowServicesUpdatedInfoBar: false, |
diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index 1cbdcfe46..3e24c9230 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js | |||
@@ -74,6 +74,7 @@ class Sidebar extends Component { | |||
74 | toggleNotifications: PropTypes.func.isRequired, | 74 | toggleNotifications: PropTypes.func.isRequired, |
75 | toggleAudio: PropTypes.func.isRequired, | 75 | toggleAudio: PropTypes.func.isRequired, |
76 | toggleDarkMode: PropTypes.func.isRequired, | 76 | toggleDarkMode: PropTypes.func.isRequired, |
77 | showServicesUpdatedInfoBar: PropTypes.bool.isRequired, | ||
77 | showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, | 78 | showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, |
78 | showServiceNameSetting: PropTypes.bool.isRequired, | 79 | showServiceNameSetting: PropTypes.bool.isRequired, |
79 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, | 80 | showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, |
@@ -234,10 +235,10 @@ class Sidebar extends Component { | |||
234 | > | 235 | > |
235 | <Icon icon={mdiCog} size={1.5} /> | 236 | <Icon icon={mdiCog} size={1.5} /> |
236 | { | 237 | { |
237 | (this.props.stores.settings.app.automaticUpdates && | 238 | this.props.stores.settings.app.automaticUpdates && |
238 | (this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.AVAILABLE || | 239 | (this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.AVAILABLE || |
239 | this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.DOWNLOADED) | 240 | this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.DOWNLOADED || |
240 | ) && ( | 241 | this.props.showServicesUpdatedInfoBar) && ( |
241 | <span className="update-available">•</span> | 242 | <span className="update-available">•</span> |
242 | ) | 243 | ) |
243 | } | 244 | } |
diff --git a/src/components/settings/navigation/SettingsNavigation.js b/src/components/settings/navigation/SettingsNavigation.js index b58956f51..763f4e8a7 100644 --- a/src/components/settings/navigation/SettingsNavigation.js +++ b/src/components/settings/navigation/SettingsNavigation.js | |||
@@ -137,9 +137,9 @@ class SettingsNavigation extends Component { | |||
137 | activeClassName="is-active" | 137 | activeClassName="is-active" |
138 | > | 138 | > |
139 | {intl.formatMessage(globalMessages.settings)} | 139 | {intl.formatMessage(globalMessages.settings)} |
140 | {stores.settings.app.automaticUpdates && | 140 | {stores.settings.app.automaticUpdates && (stores.ui.showServicesUpdatedInfoBar || |
141 | (stores.app.updateStatus === stores.app.updateStatusTypes.AVAILABLE || | 141 | (stores.app.updateStatus === stores.app.updateStatusTypes.AVAILABLE || |
142 | stores.app.updateStatus === stores.app.updateStatusTypes.DOWNLOADED) && ( | 142 | stores.app.updateStatus === stores.app.updateStatusTypes.DOWNLOADED)) && ( |
143 | <span className="update-available">•</span> | 143 | <span className="update-available">•</span> |
144 | )} | 144 | )} |
145 | </Link> | 145 | </Link> |
diff --git a/src/components/settings/recipes/RecipesDashboard.js b/src/components/settings/recipes/RecipesDashboard.js index 96207445c..47983bc88 100644 --- a/src/components/settings/recipes/RecipesDashboard.js +++ b/src/components/settings/recipes/RecipesDashboard.js | |||
@@ -30,7 +30,7 @@ const messages = defineMessages({ | |||
30 | }, | 30 | }, |
31 | mostPopularRecipes: { | 31 | mostPopularRecipes: { |
32 | id: 'settings.recipes.mostPopular', | 32 | id: 'settings.recipes.mostPopular', |
33 | defaultMessage: '!!!Most popular', | 33 | defaultMessage: 'Most popular', |
34 | }, | 34 | }, |
35 | allRecipes: { | 35 | allRecipes: { |
36 | id: 'settings.recipes.all', | 36 | id: 'settings.recipes.all', |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index b358a395f..bdb8484d4 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -5,7 +5,8 @@ import { observer } from 'mobx-react'; | |||
5 | import prettyBytes from 'pretty-bytes'; | 5 | import prettyBytes from 'pretty-bytes'; |
6 | import { defineMessages, injectIntl } from 'react-intl'; | 6 | import { defineMessages, injectIntl } from 'react-intl'; |
7 | 7 | ||
8 | import { mdiGithub, mdiOpenInNew } from '@mdi/js'; | 8 | import { mdiGithub, mdiOpenInNew, mdiPowerPlug } from '@mdi/js'; |
9 | |||
9 | import Form from '../../../lib/Form'; | 10 | import Form from '../../../lib/Form'; |
10 | import Button from '../../ui/Button'; | 11 | import Button from '../../ui/Button'; |
11 | import Toggle from '../../ui/Toggle'; | 12 | import Toggle from '../../ui/Toggle'; |
@@ -175,6 +176,14 @@ const messages = defineMessages({ | |||
175 | id: 'settings.app.restartRequired', | 176 | id: 'settings.app.restartRequired', |
176 | defaultMessage: 'Changes require restart', | 177 | defaultMessage: 'Changes require restart', |
177 | }, | 178 | }, |
179 | servicesUpdated: { | ||
180 | id: 'infobar.servicesUpdated', | ||
181 | defaultMessage: 'Your services have been updated.', | ||
182 | }, | ||
183 | buttonReloadServices: { | ||
184 | id: 'infobar.buttonReloadServices', | ||
185 | defaultMessage: 'Reload services', | ||
186 | }, | ||
178 | numberOfColumns: { | 187 | numberOfColumns: { |
179 | id: 'settings.app.form.splitColumns', | 188 | id: 'settings.app.form.splitColumns', |
180 | defaultMessage: 'Number of columns', | 189 | defaultMessage: 'Number of columns', |
@@ -243,6 +252,7 @@ class EditSettingsForm extends Component { | |||
243 | noUpdateAvailable, | 252 | noUpdateAvailable, |
244 | updateIsReadyToInstall, | 253 | updateIsReadyToInstall, |
245 | updateFailed, | 254 | updateFailed, |
255 | showServicesUpdatedInfoBar, | ||
246 | isClearingAllCache, | 256 | isClearingAllCache, |
247 | onClearAllCache, | 257 | onClearAllCache, |
248 | getCacheSize, | 258 | getCacheSize, |
@@ -366,7 +376,7 @@ class EditSettingsForm extends Component { | |||
366 | > | 376 | > |
367 | {intl.formatMessage(messages.headlineAdvanced)} | 377 | {intl.formatMessage(messages.headlineAdvanced)} |
368 | </h2> | 378 | </h2> |
369 | {(isMac || isWindows || process.env.APPIMAGE) && <h2 | 379 | <h2 |
370 | id="updates" | 380 | id="updates" |
371 | className={ | 381 | className={ |
372 | this.state.activeSetttingsTab === 'updates' | 382 | this.state.activeSetttingsTab === 'updates' |
@@ -378,10 +388,10 @@ class EditSettingsForm extends Component { | |||
378 | }} | 388 | }} |
379 | > | 389 | > |
380 | {intl.formatMessage(messages.headlineUpdates)} | 390 | {intl.formatMessage(messages.headlineUpdates)} |
381 | {automaticUpdates && (updateIsReadyToInstall || isUpdateAvailable) && ( | 391 | {automaticUpdates && (updateIsReadyToInstall || isUpdateAvailable || showServicesUpdatedInfoBar) && ( |
382 | <span className="update-available">•</span> | 392 | <span className="update-available">•</span> |
383 | )} | 393 | )} |
384 | </h2>} | 394 | </h2> |
385 | </div> | 395 | </div> |
386 | 396 | ||
387 | {/* General */} | 397 | {/* General */} |
@@ -768,45 +778,66 @@ class EditSettingsForm extends Component { | |||
768 | <div> | 778 | <div> |
769 | <Toggle field={form.$('automaticUpdates')} /> | 779 | <Toggle field={form.$('automaticUpdates')} /> |
770 | {automaticUpdates && ( | 780 | {automaticUpdates && ( |
771 | <div> | 781 | <> |
772 | <Toggle field={form.$('beta')} /> | 782 | {(isMac || isWindows || process.env.APPIMAGE) && ( |
773 | {updateIsReadyToInstall ? ( | 783 | <> |
774 | <Button | 784 | <div> |
775 | label={intl.formatMessage(messages.buttonInstallUpdate)} | 785 | <Toggle field={form.$('beta')} /> |
776 | onClick={installUpdate} | 786 | {updateIsReadyToInstall ? ( |
777 | /> | 787 | <Button |
788 | label={intl.formatMessage(messages.buttonInstallUpdate)} | ||
789 | onClick={installUpdate} | ||
790 | /> | ||
791 | ) : ( | ||
792 | <Button | ||
793 | buttonType="secondary" | ||
794 | label={intl.formatMessage(updateButtonLabelMessage)} | ||
795 | onClick={checkForUpdates} | ||
796 | disabled={ | ||
797 | !automaticUpdates || | ||
798 | isCheckingForUpdates || | ||
799 | isUpdateAvailable || | ||
800 | !isOnline | ||
801 | } | ||
802 | loaded={!isCheckingForUpdates || !isUpdateAvailable} | ||
803 | /> | ||
804 | )} | ||
805 | <br /> | ||
806 | </div> | ||
807 | <p> | ||
808 | {intl.formatMessage(messages.currentVersion)} {ferdiVersion} | ||
809 | </p> | ||
810 | {noUpdateAvailable && ( | ||
811 | <p> | ||
812 | {intl.formatMessage(messages.updateStatusUpToDate)}. | ||
813 | </p> | ||
814 | )} | ||
815 | {updateFailed && ( | ||
816 | <Infobox type="danger" icon="alert"> | ||
817 | An error occured (check the console for more details) | ||
818 | </Infobox> | ||
819 | )} | ||
820 | </> | ||
821 | )} | ||
822 | {showServicesUpdatedInfoBar ? ( | ||
823 | <> | ||
824 | <p> | ||
825 | <Icon icon={mdiPowerPlug} /> | ||
826 | {intl.formatMessage(messages.servicesUpdated)} | ||
827 | </p> | ||
828 | <Button | ||
829 | label={intl.formatMessage(messages.buttonReloadServices)} | ||
830 | onClick={() => window.location.reload()} | ||
831 | /> | ||
832 | </> | ||
778 | ) : ( | 833 | ) : ( |
779 | <Button | 834 | <p> |
780 | buttonType="secondary" | 835 | <Icon icon={mdiPowerPlug} /> |
781 | label={intl.formatMessage(updateButtonLabelMessage)} | 836 | Your services are up-to-date. |
782 | onClick={checkForUpdates} | 837 | </p> |
783 | disabled={ | ||
784 | !automaticUpdates || | ||
785 | isCheckingForUpdates || | ||
786 | isUpdateAvailable || | ||
787 | !isOnline | ||
788 | } | ||
789 | loaded={!isCheckingForUpdates || !isUpdateAvailable} | ||
790 | /> | ||
791 | )} | 838 | )} |
792 | <br /> | ||
793 | </div> | ||
794 | )} | ||
795 | <p> | ||
796 | {intl.formatMessage(messages.currentVersion)} {ferdiVersion} | ||
797 | </p> | ||
798 | {noUpdateAvailable && ( | ||
799 | <> | ||
800 | <br /> | ||
801 | <br /> | ||
802 | {intl.formatMessage(messages.updateStatusUpToDate)}. | ||
803 | </> | 839 | </> |
804 | )} | 840 | )} |
805 | {updateFailed && ( | ||
806 | <Infobox type="danger" icon="alert"> | ||
807 | An error occured (check the console for more details) | ||
808 | </Infobox> | ||
809 | )} | ||
810 | <p className="settings__message"> | 841 | <p className="settings__message"> |
811 | <Icon icon={mdiGithub} /> | 842 | <Icon icon={mdiGithub} /> |
812 | Ferdi is based on{' '} | 843 | Ferdi is based on{' '} |