diff options
Diffstat (limited to 'src/components/layout/AppLayout.js')
-rw-r--r-- | src/components/layout/AppLayout.js | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 200777ae6..2b0719f92 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -6,9 +6,9 @@ import { TitleBar } from 'electron-react-titlebar'; | |||
6 | import injectSheet from 'react-jss'; | 6 | import injectSheet from 'react-jss'; |
7 | 7 | ||
8 | import InfoBar from '../ui/InfoBar'; | 8 | import InfoBar from '../ui/InfoBar'; |
9 | import { Component as DelayApp } from '../../features/delayApp'; | ||
10 | import { Component as BasicAuth } from '../../features/basicAuth'; | 9 | import { Component as BasicAuth } from '../../features/basicAuth'; |
11 | import { Component as ShareFranz } from '../../features/shareFranz'; | 10 | import { Component as ShareFranz } from '../../features/shareFranz'; |
11 | import { Component as QuickSwitch } from '../../features/quickSwitch'; | ||
12 | import ErrorBoundary from '../util/ErrorBoundary'; | 12 | import ErrorBoundary from '../util/ErrorBoundary'; |
13 | 13 | ||
14 | // import globalMessages from '../../i18n/globalMessages'; | 14 | // import globalMessages from '../../i18n/globalMessages'; |
@@ -37,6 +37,10 @@ const messages = defineMessages({ | |||
37 | id: 'infobar.requiredRequestsFailed', | 37 | id: 'infobar.requiredRequestsFailed', |
38 | defaultMessage: '!!!Could not load services and user information', | 38 | defaultMessage: '!!!Could not load services and user information', |
39 | }, | 39 | }, |
40 | authRequestFailed: { | ||
41 | id: 'infobar.authRequestFailed', | ||
42 | defaultMessage: '!!!There were errors while trying to perform an authenticated request. Please try logging out and back in if this error persists.', | ||
43 | }, | ||
40 | }); | 44 | }); |
41 | 45 | ||
42 | const styles = theme => ({ | 46 | const styles = theme => ({ |
@@ -63,6 +67,7 @@ class AppLayout extends Component { | |||
63 | showServicesUpdatedInfoBar: PropTypes.bool.isRequired, | 67 | showServicesUpdatedInfoBar: PropTypes.bool.isRequired, |
64 | appUpdateIsDownloaded: PropTypes.bool.isRequired, | 68 | appUpdateIsDownloaded: PropTypes.bool.isRequired, |
65 | nextAppReleaseVersion: PropTypes.string, | 69 | nextAppReleaseVersion: PropTypes.string, |
70 | authRequestFailed: PropTypes.bool.isRequired, | ||
66 | removeNewsItem: PropTypes.func.isRequired, | 71 | removeNewsItem: PropTypes.func.isRequired, |
67 | reloadServicesAfterUpdate: PropTypes.func.isRequired, | 72 | reloadServicesAfterUpdate: PropTypes.func.isRequired, |
68 | installAppUpdate: PropTypes.func.isRequired, | 73 | installAppUpdate: PropTypes.func.isRequired, |
@@ -70,7 +75,6 @@ class AppLayout extends Component { | |||
70 | areRequiredRequestsSuccessful: PropTypes.bool.isRequired, | 75 | areRequiredRequestsSuccessful: PropTypes.bool.isRequired, |
71 | retryRequiredRequests: PropTypes.func.isRequired, | 76 | retryRequiredRequests: PropTypes.func.isRequired, |
72 | areRequiredRequestsLoading: PropTypes.bool.isRequired, | 77 | areRequiredRequestsLoading: PropTypes.bool.isRequired, |
73 | isDelayAppScreenVisible: PropTypes.bool.isRequired, | ||
74 | hasActivatedTrial: PropTypes.bool.isRequired, | 78 | hasActivatedTrial: PropTypes.bool.isRequired, |
75 | }; | 79 | }; |
76 | 80 | ||
@@ -95,6 +99,7 @@ class AppLayout extends Component { | |||
95 | showServicesUpdatedInfoBar, | 99 | showServicesUpdatedInfoBar, |
96 | appUpdateIsDownloaded, | 100 | appUpdateIsDownloaded, |
97 | nextAppReleaseVersion, | 101 | nextAppReleaseVersion, |
102 | authRequestFailed, | ||
98 | removeNewsItem, | 103 | removeNewsItem, |
99 | reloadServicesAfterUpdate, | 104 | reloadServicesAfterUpdate, |
100 | installAppUpdate, | 105 | installAppUpdate, |
@@ -102,7 +107,6 @@ class AppLayout extends Component { | |||
102 | areRequiredRequestsSuccessful, | 107 | areRequiredRequestsSuccessful, |
103 | retryRequiredRequests, | 108 | retryRequiredRequests, |
104 | areRequiredRequestsLoading, | 109 | areRequiredRequestsLoading, |
105 | isDelayAppScreenVisible, | ||
106 | hasActivatedTrial, | 110 | hasActivatedTrial, |
107 | } = this.props; | 111 | } = this.props; |
108 | 112 | ||
@@ -111,7 +115,7 @@ class AppLayout extends Component { | |||
111 | return ( | 115 | return ( |
112 | <ErrorBoundary> | 116 | <ErrorBoundary> |
113 | <div className="app"> | 117 | <div className="app"> |
114 | {isWindows && !isFullScreen && <TitleBar menu={window.franz.menu.template} icon="assets/images/logo.svg" />} | 118 | {isWindows && !isFullScreen && <TitleBar menu={window.ferdi.menu.template} icon="assets/images/logo.svg" />} |
115 | <div className={`app__content ${classes.appContent}`}> | 119 | <div className={`app__content ${classes.appContent}`}> |
116 | {workspacesDrawer} | 120 | {workspacesDrawer} |
117 | {sidebar} | 121 | {sidebar} |
@@ -151,6 +155,18 @@ class AppLayout extends Component { | |||
151 | {intl.formatMessage(messages.requiredRequestsFailed)} | 155 | {intl.formatMessage(messages.requiredRequestsFailed)} |
152 | </InfoBar> | 156 | </InfoBar> |
153 | )} | 157 | )} |
158 | {authRequestFailed && ( | ||
159 | <InfoBar | ||
160 | type="danger" | ||
161 | ctaLabel="Try again" | ||
162 | ctaLoading={areRequiredRequestsLoading} | ||
163 | sticky | ||
164 | onClick={retryRequiredRequests} | ||
165 | > | ||
166 | <span className="mdi mdi-flash" /> | ||
167 | {intl.formatMessage(messages.authRequestFailed)} | ||
168 | </InfoBar> | ||
169 | )} | ||
154 | {showServicesUpdatedInfoBar && ( | 170 | {showServicesUpdatedInfoBar && ( |
155 | <InfoBar | 171 | <InfoBar |
156 | type="primary" | 172 | type="primary" |
@@ -168,9 +184,9 @@ class AppLayout extends Component { | |||
168 | onInstallUpdate={installAppUpdate} | 184 | onInstallUpdate={installAppUpdate} |
169 | /> | 185 | /> |
170 | )} | 186 | )} |
171 | {isDelayAppScreenVisible && (<DelayApp />)} | ||
172 | <BasicAuth /> | 187 | <BasicAuth /> |
173 | <ShareFranz /> | 188 | <ShareFranz /> |
189 | <QuickSwitch /> | ||
174 | {services} | 190 | {services} |
175 | {children} | 191 | {children} |
176 | </div> | 192 | </div> |