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