From 1e38ec5e524c71ae89cd7d4956736494b8c13886 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 8 May 2019 17:02:09 +0200 Subject: fix(Announcements): Fixes issue with rendering announcments in workspaces --- src/components/layout/AppLayout.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/components') diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index d5febfaf4..fa83842a4 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js @@ -83,7 +83,6 @@ class AppLayout extends Component { areRequiredRequestsLoading: PropTypes.bool.isRequired, darkMode: PropTypes.bool.isRequired, isDelayAppScreenVisible: PropTypes.bool.isRequired, - isAnnouncementVisible: PropTypes.bool.isRequired, }; static defaultProps = { @@ -117,7 +116,6 @@ class AppLayout extends Component { areRequiredRequestsLoading, darkMode, isDelayAppScreenVisible, - isAnnouncementVisible, } = this.props; const { intl } = this.context; @@ -197,12 +195,11 @@ class AppLayout extends Component { {isDelayAppScreenVisible && ()} - {isAnnouncementVisible && ()} {services} + {children} - {children} ); -- cgit v1.2.3-70-g09d2 From e8473abae9fc905cbafcfeb1ce281fa2869b6f09 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 8 May 2019 17:04:37 +0200 Subject: fixes eslint issues --- src/components/layout/AppLayout.js | 1 - src/containers/layout/AppLayoutContainer.js | 1 - src/features/announcements/store.js | 1 - .../messages/src/components/layout/AppLayout.json | 24 +++++++++++----------- 4 files changed, 12 insertions(+), 15 deletions(-) (limited to 'src/components') diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index fa83842a4..b31c00f54 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js @@ -14,7 +14,6 @@ import ErrorBoundary from '../util/ErrorBoundary'; // import globalMessages from '../../i18n/globalMessages'; import { isWindows } from '../../environment'; -import AnnouncementScreen from '../../features/announcements/components/AnnouncementScreen'; import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; import { workspaceStore } from '../../features/workspaces'; import { announcementActions } from '../../features/announcements/actions'; diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 83b3c27da..d290a6094 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -23,7 +23,6 @@ import { state as delayAppState } from '../../features/delayApp'; import { workspaceActions } from '../../features/workspaces/actions'; import WorkspaceDrawer from '../../features/workspaces/components/WorkspaceDrawer'; import { workspaceStore } from '../../features/workspaces'; -import { announcementsStore } from '../../features/announcements'; export default @inject('stores', 'actions') @observer class AppLayoutContainer extends Component { static defaultProps = { diff --git a/src/features/announcements/store.js b/src/features/announcements/store.js index 27be86144..2ce33c299 100644 --- a/src/features/announcements/store.js +++ b/src/features/announcements/store.js @@ -2,7 +2,6 @@ import { action, computed, observable, - reaction, } from 'mobx'; import semver from 'semver'; import localStorage from 'mobx-localstorage'; diff --git a/src/i18n/messages/src/components/layout/AppLayout.json b/src/i18n/messages/src/components/layout/AppLayout.json index 26b8ce040..4dd354afc 100644 --- a/src/i18n/messages/src/components/layout/AppLayout.json +++ b/src/i18n/messages/src/components/layout/AppLayout.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!Your services have been updated.", "file": "src/components/layout/AppLayout.js", "start": { - "line": 27, + "line": 26, "column": 19 }, "end": { - "line": 30, + "line": 29, "column": 3 } }, @@ -17,11 +17,11 @@ "defaultMessage": "!!!A new update for Franz is available.", "file": "src/components/layout/AppLayout.js", "start": { - "line": 31, + "line": 30, "column": 19 }, "end": { - "line": 34, + "line": 33, "column": 3 } }, @@ -30,11 +30,11 @@ "defaultMessage": "!!!Reload services", "file": "src/components/layout/AppLayout.js", "start": { - "line": 35, + "line": 34, "column": 24 }, "end": { - "line": 38, + "line": 37, "column": 3 } }, @@ -43,11 +43,11 @@ "defaultMessage": "!!!Changelog", "file": "src/components/layout/AppLayout.js", "start": { - "line": 39, + "line": 38, "column": 13 }, "end": { - "line": 42, + "line": 41, "column": 3 } }, @@ -56,11 +56,11 @@ "defaultMessage": "!!!Restart & install update", "file": "src/components/layout/AppLayout.js", "start": { - "line": 43, + "line": 42, "column": 23 }, "end": { - "line": 46, + "line": 45, "column": 3 } }, @@ -69,11 +69,11 @@ "defaultMessage": "!!!Could not load services and user information", "file": "src/components/layout/AppLayout.js", "start": { - "line": 47, + "line": 46, "column": 26 }, "end": { - "line": 50, + "line": 49, "column": 3 } } -- cgit v1.2.3-70-g09d2 From 70c4494b254688037c8b7033911d2d5f06e600a2 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 5 Jun 2019 17:23:29 +0200 Subject: support app updates also for unauthenticated users --- src/components/AppUpdateInfoBar.js | 66 +++++++++++++++ src/components/auth/AuthLayout.js | 17 ++++ src/components/layout/AppLayout.js | 34 ++------ src/containers/auth/AuthLayoutContainer.js | 3 + src/i18n/locales/defaultMessages.json | 95 ++++++++++++---------- .../messages/src/components/AppUpdateInfoBar.json | 41 ++++++++++ .../messages/src/components/layout/AppLayout.json | 49 ++--------- 7 files changed, 187 insertions(+), 118 deletions(-) create mode 100644 src/components/AppUpdateInfoBar.js create mode 100644 src/i18n/messages/src/components/AppUpdateInfoBar.json (limited to 'src/components') diff --git a/src/components/AppUpdateInfoBar.js b/src/components/AppUpdateInfoBar.js new file mode 100644 index 000000000..4fb3a8b71 --- /dev/null +++ b/src/components/AppUpdateInfoBar.js @@ -0,0 +1,66 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { defineMessages, intlShape } from 'react-intl'; + +import { announcementActions } from '../features/announcements/actions'; +import InfoBar from './ui/InfoBar'; + +const messages = defineMessages({ + updateAvailable: { + id: 'infobar.updateAvailable', + defaultMessage: '!!!A new update for Franz is available.', + }, + changelog: { + id: 'infobar.buttonChangelog', + defaultMessage: '!!!Changelog', + }, + buttonInstallUpdate: { + id: 'infobar.buttonInstallUpdate', + defaultMessage: '!!!Restart & install update', + }, +}); + +class AppUpdateInfoBar extends Component { + static propTypes = { + onInstallUpdate: PropTypes.func.isRequired, + nextAppReleaseVersion: PropTypes.string, + }; + + static defaultProps = { + nextAppReleaseVersion: null, + }; + + static contextTypes = { + intl: intlShape, + }; + + render() { + const { intl } = this.context; + const { + onInstallUpdate, + nextAppReleaseVersion, + } = this.props; + + return ( + + + {intl.formatMessage(messages.updateAvailable)} + {' '} + + + ); + } +} + +export default AppUpdateInfoBar; diff --git a/src/components/auth/AuthLayout.js b/src/components/auth/AuthLayout.js index ac8fdbe5b..9bde58461 100644 --- a/src/components/auth/AuthLayout.js +++ b/src/components/auth/AuthLayout.js @@ -11,6 +11,7 @@ import { oneOrManyChildElements, globalError as globalErrorPropType } from '../. import globalMessages from '../../i18n/globalMessages'; import { isWindows } from '../../environment'; +import AppUpdateInfoBar from '../AppUpdateInfoBar'; export default @observer class AuthLayout extends Component { static propTypes = { @@ -22,6 +23,13 @@ export default @observer class AuthLayout extends Component { isHealthCheckLoading: PropTypes.bool.isRequired, isFullScreen: PropTypes.bool.isRequired, darkMode: PropTypes.bool.isRequired, + nextAppReleaseVersion: PropTypes.string, + installAppUpdate: PropTypes.func.isRequired, + appUpdateIsDownloaded: PropTypes.bool.isRequired, + }; + + static defaultProps = { + nextAppReleaseVersion: null, }; static contextTypes = { @@ -38,6 +46,9 @@ export default @observer class AuthLayout extends Component { isHealthCheckLoading, isFullScreen, darkMode, + nextAppReleaseVersion, + installAppUpdate, + appUpdateIsDownloaded } = this.props; const { intl } = this.context; @@ -53,6 +64,12 @@ export default @observer class AuthLayout extends Component { {intl.formatMessage(globalMessages.notConnectedToTheInternet)} )} + {appUpdateIsDownloaded && ( + + )} {isOnline && !isAPIHealthy && ( )} {appUpdateIsDownloaded && ( - - - {intl.formatMessage(messages.updateAvailable)} - {' '} - - + )} {isDelayAppScreenVisible && ()} diff --git a/src/containers/auth/AuthLayoutContainer.js b/src/containers/auth/AuthLayoutContainer.js index e63f40c06..1f9c1ea61 100644 --- a/src/containers/auth/AuthLayoutContainer.js +++ b/src/containers/auth/AuthLayoutContainer.js @@ -51,6 +51,9 @@ export default @inject('stores', 'actions') @observer class AuthLayoutContainer isHealthCheckLoading={app.healthCheckRequest.isExecuting} isFullScreen={app.isFullScreen} darkMode={app.isSystemDarkModeEnabled} + installAppUpdate={actions.app.installUpdate} + nextAppReleaseVersion={app.nextAppReleaseVersion} + appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED} > {children} diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 5183e9bc3..67ab39fe9 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -1,4 +1,48 @@ [ + { + "descriptors": [ + { + "defaultMessage": "!!!A new update for Franz is available.", + "end": { + "column": 3, + "line": 12 + }, + "file": "src/components/AppUpdateInfoBar.js", + "id": "infobar.updateAvailable", + "start": { + "column": 19, + "line": 9 + } + }, + { + "defaultMessage": "!!!Changelog", + "end": { + "column": 3, + "line": 16 + }, + "file": "src/components/AppUpdateInfoBar.js", + "id": "infobar.buttonChangelog", + "start": { + "column": 13, + "line": 13 + } + }, + { + "defaultMessage": "!!!Restart & install update", + "end": { + "column": 3, + "line": 20 + }, + "file": "src/components/AppUpdateInfoBar.js", + "id": "infobar.buttonInstallUpdate", + "start": { + "column": 23, + "line": 17 + } + } + ], + "path": "src/components/AppUpdateInfoBar.json" + }, { "descriptors": [ { @@ -625,78 +669,39 @@ "defaultMessage": "!!!Your services have been updated.", "end": { "column": 3, - "line": 29 + "line": 30 }, "file": "src/components/layout/AppLayout.js", "id": "infobar.servicesUpdated", "start": { "column": 19, - "line": 26 - } - }, - { - "defaultMessage": "!!!A new update for Franz is available.", - "end": { - "column": 3, - "line": 33 - }, - "file": "src/components/layout/AppLayout.js", - "id": "infobar.updateAvailable", - "start": { - "column": 19, - "line": 30 + "line": 27 } }, { "defaultMessage": "!!!Reload services", "end": { "column": 3, - "line": 37 + "line": 34 }, "file": "src/components/layout/AppLayout.js", "id": "infobar.buttonReloadServices", "start": { "column": 24, - "line": 34 - } - }, - { - "defaultMessage": "!!!Changelog", - "end": { - "column": 3, - "line": 41 - }, - "file": "src/components/layout/AppLayout.js", - "id": "infobar.buttonChangelog", - "start": { - "column": 13, - "line": 38 - } - }, - { - "defaultMessage": "!!!Restart & install update", - "end": { - "column": 3, - "line": 45 - }, - "file": "src/components/layout/AppLayout.js", - "id": "infobar.buttonInstallUpdate", - "start": { - "column": 23, - "line": 42 + "line": 31 } }, { "defaultMessage": "!!!Could not load services and user information", "end": { "column": 3, - "line": 49 + "line": 38 }, "file": "src/components/layout/AppLayout.js", "id": "infobar.requiredRequestsFailed", "start": { "column": 26, - "line": 46 + "line": 35 } } ], diff --git a/src/i18n/messages/src/components/AppUpdateInfoBar.json b/src/i18n/messages/src/components/AppUpdateInfoBar.json new file mode 100644 index 000000000..c4c2d0cae --- /dev/null +++ b/src/i18n/messages/src/components/AppUpdateInfoBar.json @@ -0,0 +1,41 @@ +[ + { + "id": "infobar.updateAvailable", + "defaultMessage": "!!!A new update for Franz is available.", + "file": "src/components/AppUpdateInfoBar.js", + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 12, + "column": 3 + } + }, + { + "id": "infobar.buttonChangelog", + "defaultMessage": "!!!Changelog", + "file": "src/components/AppUpdateInfoBar.js", + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 16, + "column": 3 + } + }, + { + "id": "infobar.buttonInstallUpdate", + "defaultMessage": "!!!Restart & install update", + "file": "src/components/AppUpdateInfoBar.js", + "start": { + "line": 17, + "column": 23 + }, + "end": { + "line": 20, + "column": 3 + } + } +] \ No newline at end of file diff --git a/src/i18n/messages/src/components/layout/AppLayout.json b/src/i18n/messages/src/components/layout/AppLayout.json index 4dd354afc..b71889155 100644 --- a/src/i18n/messages/src/components/layout/AppLayout.json +++ b/src/i18n/messages/src/components/layout/AppLayout.json @@ -4,24 +4,11 @@ "defaultMessage": "!!!Your services have been updated.", "file": "src/components/layout/AppLayout.js", "start": { - "line": 26, + "line": 27, "column": 19 }, "end": { - "line": 29, - "column": 3 - } - }, - { - "id": "infobar.updateAvailable", - "defaultMessage": "!!!A new update for Franz is available.", - "file": "src/components/layout/AppLayout.js", - "start": { "line": 30, - "column": 19 - }, - "end": { - "line": 33, "column": 3 } }, @@ -30,37 +17,11 @@ "defaultMessage": "!!!Reload services", "file": "src/components/layout/AppLayout.js", "start": { - "line": 34, + "line": 31, "column": 24 }, "end": { - "line": 37, - "column": 3 - } - }, - { - "id": "infobar.buttonChangelog", - "defaultMessage": "!!!Changelog", - "file": "src/components/layout/AppLayout.js", - "start": { - "line": 38, - "column": 13 - }, - "end": { - "line": 41, - "column": 3 - } - }, - { - "id": "infobar.buttonInstallUpdate", - "defaultMessage": "!!!Restart & install update", - "file": "src/components/layout/AppLayout.js", - "start": { - "line": 42, - "column": 23 - }, - "end": { - "line": 45, + "line": 34, "column": 3 } }, @@ -69,11 +30,11 @@ "defaultMessage": "!!!Could not load services and user information", "file": "src/components/layout/AppLayout.js", "start": { - "line": 46, + "line": 35, "column": 26 }, "end": { - "line": 49, + "line": 38, "column": 3 } } -- cgit v1.2.3-70-g09d2 From 604d5af907702589c9586af7985958c295385f0f Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 5 Jun 2019 17:26:21 +0200 Subject: fix eslint issues --- src/components/auth/AuthLayout.js | 2 +- src/components/layout/AppLayout.js | 1 - src/i18n/locales/defaultMessages.json | 12 ++++++------ src/i18n/messages/src/components/layout/AppLayout.json | 12 ++++++------ 4 files changed, 13 insertions(+), 14 deletions(-) (limited to 'src/components') diff --git a/src/components/auth/AuthLayout.js b/src/components/auth/AuthLayout.js index 9bde58461..3d43d4e5c 100644 --- a/src/components/auth/AuthLayout.js +++ b/src/components/auth/AuthLayout.js @@ -48,7 +48,7 @@ export default @observer class AuthLayout extends Component { darkMode, nextAppReleaseVersion, installAppUpdate, - appUpdateIsDownloaded + appUpdateIsDownloaded, } = this.props; const { intl } = this.context; diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 321eb8e3a..499bc097a 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js @@ -16,7 +16,6 @@ import ErrorBoundary from '../util/ErrorBoundary'; import { isWindows } from '../../environment'; import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; import { workspaceStore } from '../../features/workspaces'; -import { announcementActions } from '../../features/announcements/actions'; import AppUpdateInfoBar from '../AppUpdateInfoBar'; function createMarkup(HTMLString) { diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 67ab39fe9..aedb0141c 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -669,39 +669,39 @@ "defaultMessage": "!!!Your services have been updated.", "end": { "column": 3, - "line": 30 + "line": 29 }, "file": "src/components/layout/AppLayout.js", "id": "infobar.servicesUpdated", "start": { "column": 19, - "line": 27 + "line": 26 } }, { "defaultMessage": "!!!Reload services", "end": { "column": 3, - "line": 34 + "line": 33 }, "file": "src/components/layout/AppLayout.js", "id": "infobar.buttonReloadServices", "start": { "column": 24, - "line": 31 + "line": 30 } }, { "defaultMessage": "!!!Could not load services and user information", "end": { "column": 3, - "line": 38 + "line": 37 }, "file": "src/components/layout/AppLayout.js", "id": "infobar.requiredRequestsFailed", "start": { "column": 26, - "line": 35 + "line": 34 } } ], diff --git a/src/i18n/messages/src/components/layout/AppLayout.json b/src/i18n/messages/src/components/layout/AppLayout.json index b71889155..190c5dff7 100644 --- a/src/i18n/messages/src/components/layout/AppLayout.json +++ b/src/i18n/messages/src/components/layout/AppLayout.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!Your services have been updated.", "file": "src/components/layout/AppLayout.js", "start": { - "line": 27, + "line": 26, "column": 19 }, "end": { - "line": 30, + "line": 29, "column": 3 } }, @@ -17,11 +17,11 @@ "defaultMessage": "!!!Reload services", "file": "src/components/layout/AppLayout.js", "start": { - "line": 31, + "line": 30, "column": 24 }, "end": { - "line": 34, + "line": 33, "column": 3 } }, @@ -30,11 +30,11 @@ "defaultMessage": "!!!Could not load services and user information", "file": "src/components/layout/AppLayout.js", "start": { - "line": 35, + "line": 34, "column": 26 }, "end": { - "line": 38, + "line": 37, "column": 3 } } -- cgit v1.2.3-70-g09d2