aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/layout
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2022-07-19 12:52:31 +0100
committerLibravatar GitHub <noreply@github.com>2022-07-19 12:52:31 +0100
commit3bb1ca7825a0381ddd8dbe7f44f7dcf4a788b165 (patch)
tree6b414b9ef3be7656da1717b0d6def62e95d1fb90 /src/components/layout
parentfix: remove autoHibernate (diff)
downloadferdium-app-3bb1ca7825a0381ddd8dbe7f44f7dcf4a788b165.tar.gz
ferdium-app-3bb1ca7825a0381ddd8dbe7f44f7dcf4a788b165.tar.zst
ferdium-app-3bb1ca7825a0381ddd8dbe7f44f7dcf4a788b165.zip
Feature: Add Release Notes (#491)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com> Co-authored-by: Ricardo Cino <ricardo@cino.io>
Diffstat (limited to 'src/components/layout')
-rw-r--r--src/components/layout/AppLayout.jsx (renamed from src/components/layout/AppLayout.js)166
1 files changed, 88 insertions, 78 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.jsx
index f7860afc6..685839c0a 100644
--- a/src/components/layout/AppLayout.js
+++ b/src/components/layout/AppLayout.jsx
@@ -13,6 +13,7 @@ import { Component as BasicAuth } from '../../features/basicAuth';
13import { Component as QuickSwitch } from '../../features/quickSwitch'; 13import { Component as QuickSwitch } from '../../features/quickSwitch';
14import { Component as PublishDebugInfo } from '../../features/publishDebugInfo'; 14import { Component as PublishDebugInfo } from '../../features/publishDebugInfo';
15import ErrorBoundary from '../util/ErrorBoundary'; 15import ErrorBoundary from '../util/ErrorBoundary';
16import { updateVersionParse } from '../../helpers/update-helpers';
16 17
17// import globalMessages from '../../i18n/globalMessages'; 18// import globalMessages from '../../i18n/globalMessages';
18 19
@@ -94,10 +95,14 @@ class AppLayout extends Component {
94 areRequiredRequestsLoading: PropTypes.bool.isRequired, 95 areRequiredRequestsLoading: PropTypes.bool.isRequired,
95 }; 96 };
96 97
97 state = { 98 constructor(props) {
98 shouldShowAppUpdateInfoBar: true, 99 super(props);
99 shouldShowServicesUpdatedInfoBar: true, 100
100 }; 101 this.state = {
102 shouldShowAppUpdateInfoBar: true,
103 shouldShowServicesUpdatedInfoBar: true,
104 };
105 }
101 106
102 render() { 107 render() {
103 const { 108 const {
@@ -115,6 +120,7 @@ class AppLayout extends Component {
115 areRequiredRequestsSuccessful, 120 areRequiredRequestsSuccessful,
116 retryRequiredRequests, 121 retryRequiredRequests,
117 areRequiredRequestsLoading, 122 areRequiredRequestsLoading,
123 updateVersion,
118 } = this.props; 124 } = this.props;
119 125
120 const { intl } = this.props; 126 const { intl } = this.props;
@@ -126,86 +132,90 @@ class AppLayout extends Component {
126 132
127 return ( 133 return (
128 <> 134 <>
129 {isMac && !isFullScreen && ( 135 {isMac && !isFullScreen && <div className="window-draggable" />}
130 <div className="window-draggable" /> 136 <ErrorBoundary>
131 )} 137 <div className="app">
132 <ErrorBoundary> 138 {isWindows && !isFullScreen && (
133 <div className="app"> 139 <TitleBar
134 {isWindows && !isFullScreen && ( 140 menu={window['ferdium'].menu.template}
135 <TitleBar 141 icon="assets/images/logo.svg"
136 menu={window['ferdium'].menu.template} 142 />
137 icon="assets/images/logo.svg" 143 )}
138 /> 144 {isMac && !isFullScreen && (
139 )} 145 <span
140 {isMac && !isFullScreen && ( 146 onDoubleClick={toggleFullScreen}
141 <span 147 className={classes.titleBar}
142 onDoubleClick={toggleFullScreen} 148 />
143 className={classes.titleBar} 149 )}
144 /> 150 <div className={`app__content ${classes.appContent}`}>
145 )} 151 {workspacesDrawer}
146 <div className={`app__content ${classes.appContent}`}> 152 {sidebar}
147 {workspacesDrawer} 153 <div className="app__service">
148 {sidebar} 154 <WorkspaceSwitchingIndicator />
149 <div className="app__service"> 155 {!areRequiredRequestsSuccessful && showRequiredRequestsError && (
150 <WorkspaceSwitchingIndicator /> 156 <InfoBar
151 {!areRequiredRequestsSuccessful && showRequiredRequestsError && ( 157 type="danger"
152 <InfoBar 158 ctaLabel="Try again"
153 type="danger" 159 ctaLoading={areRequiredRequestsLoading}
154 ctaLabel="Try again" 160 sticky
155 ctaLoading={areRequiredRequestsLoading} 161 onClick={retryRequiredRequests}
156 sticky 162 >
157 onClick={retryRequiredRequests} 163 <Icon icon={mdiFlash} />
158 > 164 {intl.formatMessage(messages.requiredRequestsFailed)}
159 <Icon icon={mdiFlash} /> 165 </InfoBar>
160 {intl.formatMessage(messages.requiredRequestsFailed)} 166 )}
161 </InfoBar> 167 {authRequestFailed && (
162 )}
163 {authRequestFailed && (
164 <InfoBar
165 type="danger"
166 ctaLabel="Try again"
167 ctaLoading={areRequiredRequestsLoading}
168 sticky
169 onClick={retryRequiredRequests}
170 >
171 <Icon icon={mdiFlash} />
172 {intl.formatMessage(messages.authRequestFailed)}
173 </InfoBar>
174 )}
175 {automaticUpdates && showServicesUpdatedInfoBar &&
176 this.state.shouldShowServicesUpdatedInfoBar && (
177 <InfoBar 168 <InfoBar
178 type="primary" 169 type="danger"
179 ctaLabel={intl.formatMessage(messages.buttonReloadServices)} 170 ctaLabel="Try again"
180 onClick={() => window.location.reload()} 171 ctaLoading={areRequiredRequestsLoading}
181 onHide={() => { 172 sticky
182 this.setState({ 173 onClick={retryRequiredRequests}
183 shouldShowServicesUpdatedInfoBar: false,
184 });
185 }}
186 > 174 >
187 <Icon icon={mdiPowerPlug} /> 175 <Icon icon={mdiFlash} />
188 {intl.formatMessage(messages.servicesUpdated)} 176 {intl.formatMessage(messages.authRequestFailed)}
189 </InfoBar> 177 </InfoBar>
190 )} 178 )}
191 {automaticUpdates && appUpdateIsDownloaded && this.state.shouldShowAppUpdateInfoBar && ( 179 {automaticUpdates &&
192 <AppUpdateInfoBar 180 showServicesUpdatedInfoBar &&
193 onInstallUpdate={installAppUpdate} 181 this.state.shouldShowServicesUpdatedInfoBar && (
194 onHide={() => { 182 <InfoBar
195 this.setState({ shouldShowAppUpdateInfoBar: false }); 183 type="primary"
196 }} 184 ctaLabel={intl.formatMessage(
197 /> 185 messages.buttonReloadServices,
198 )} 186 )}
199 <BasicAuth /> 187 onClick={() => window.location.reload()}
200 <QuickSwitch /> 188 onHide={() => {
201 <PublishDebugInfo /> 189 this.setState({
202 {services} 190 shouldShowServicesUpdatedInfoBar: false,
203 <Outlet /> 191 });
192 }}
193 >
194 <Icon icon={mdiPowerPlug} />
195 {intl.formatMessage(messages.servicesUpdated)}
196 </InfoBar>
197 )}
198 {automaticUpdates &&
199 appUpdateIsDownloaded &&
200 this.state.shouldShowAppUpdateInfoBar && (
201 <AppUpdateInfoBar
202 onInstallUpdate={installAppUpdate}
203 updateVersionParsed={updateVersionParse(updateVersion)}
204 onHide={() => {
205 this.setState({ shouldShowAppUpdateInfoBar: false });
206 }}
207 />
208 )}
209 <BasicAuth />
210 <QuickSwitch />
211 <PublishDebugInfo />
212 {services}
213 <Outlet />
214 </div>
215 <Todos />
204 </div> 216 </div>
205 <Todos />
206 </div> 217 </div>
207 </div> 218 </ErrorBoundary>
208 </ErrorBoundary>
209 </> 219 </>
210 ); 220 );
211 } 221 }