ui-soxo-bootstrap-core 2.6.1-dev.18 → 2.6.1-dev.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/components/index.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
1
|
import LandingAPI from './landing-api/landing-api';
|
|
6
2
|
|
|
7
3
|
import ExtraInfoDetail from './extra-info/extra-info-details';
|
|
@@ -11,11 +7,6 @@ import RootApplicationAPI from './root-application-api/root-application-api';
|
|
|
11
7
|
import { HomePageAPI } from '../modules';
|
|
12
8
|
|
|
13
9
|
import { ExternalWindow } from './external-window/external-window';
|
|
10
|
+
import LicenseAlert from './license-management/license-alert';
|
|
14
11
|
|
|
15
|
-
export {
|
|
16
|
-
LandingAPI,
|
|
17
|
-
RootApplicationAPI,
|
|
18
|
-
ExtraInfoDetail,
|
|
19
|
-
HomePageAPI,
|
|
20
|
-
ExternalWindow
|
|
21
|
-
}
|
|
12
|
+
export { LandingAPI, RootApplicationAPI, ExtraInfoDetail, HomePageAPI, ExternalWindow, LicenseAlert };
|
|
@@ -17,7 +17,6 @@ import ReportingDashboard from '../../modules/reporting/components/reporting-das
|
|
|
17
17
|
import PropTypes from 'prop-types';
|
|
18
18
|
|
|
19
19
|
import { MenusAPI, CoreScripts } from '../../models';
|
|
20
|
-
import LicenseAlert from '../license-management/license-alert';
|
|
21
20
|
|
|
22
21
|
const motivatingMessages = [
|
|
23
22
|
'Setting things up for a great start...',
|
|
@@ -61,22 +60,12 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
61
60
|
const [meta, setMeta] = useState({});
|
|
62
61
|
const [loadingMessage, setLoadingMessage] = useState('');
|
|
63
62
|
// License data state
|
|
64
|
-
const [licenseData, setLicenseData] = useState({});
|
|
65
63
|
|
|
66
64
|
// const [reports, setReports] = useState([]);
|
|
67
65
|
|
|
68
66
|
var config = {};
|
|
69
67
|
//fetch license summary
|
|
70
|
-
|
|
71
|
-
try {
|
|
72
|
-
const res = await MenusAPI.getSummary();
|
|
73
|
-
if (res?.data) {
|
|
74
|
-
setLicenseData(res?.data);
|
|
75
|
-
}
|
|
76
|
-
} catch (err) {
|
|
77
|
-
console.error(err);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
68
|
+
|
|
80
69
|
// Variable decides the control of homepage
|
|
81
70
|
// #TODO This is a temporary fix - Homemage
|
|
82
71
|
|
|
@@ -156,7 +145,6 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
156
145
|
|
|
157
146
|
await loadMenus(report);
|
|
158
147
|
// fetch license summary
|
|
159
|
-
fetchSummary();
|
|
160
148
|
}
|
|
161
149
|
|
|
162
150
|
// const keyMap = {
|
|
@@ -318,18 +306,6 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
318
306
|
</Card>
|
|
319
307
|
) : (
|
|
320
308
|
<>
|
|
321
|
-
{licenseData && (
|
|
322
|
-
<div
|
|
323
|
-
style={{
|
|
324
|
-
marginTop: '4rem',
|
|
325
|
-
right: '2%',
|
|
326
|
-
position: 'fixed',
|
|
327
|
-
zIndex: 999,
|
|
328
|
-
}}
|
|
329
|
-
>
|
|
330
|
-
<LicenseAlert data={licenseData} />
|
|
331
|
-
</div>
|
|
332
|
-
)}
|
|
333
309
|
{/* <Switch> */}
|
|
334
310
|
|
|
335
311
|
{/* Homepage */}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Global header component
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React, { useState, useEffect, useContext,useRef } from
|
|
6
|
+
import React, { useState, useEffect, useContext, useRef } from 'react';
|
|
7
7
|
|
|
8
|
-
import { motion, useAnimation, useReducedMotion } from
|
|
8
|
+
import { motion, useAnimation, useReducedMotion } from 'framer-motion';
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
boxVariants,
|
|
@@ -14,55 +14,43 @@ import {
|
|
|
14
14
|
headerActionsVariants,
|
|
15
15
|
headerClusterVariants,
|
|
16
16
|
headerShellVariants,
|
|
17
|
-
} from
|
|
17
|
+
} from './animations';
|
|
18
18
|
|
|
19
|
-
import { GlobalContext } from
|
|
19
|
+
import { GlobalContext } from './../../Store';
|
|
20
20
|
|
|
21
|
-
import { Link, useLocation } from
|
|
21
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
22
22
|
|
|
23
|
-
import { Typography, Avatar
|
|
23
|
+
import { Typography, Avatar, Input } from 'antd';
|
|
24
24
|
|
|
25
|
+
import ProgressBar from '../progress-bar/progress-bar'; // Adjust the path as needed
|
|
25
26
|
|
|
27
|
+
import { Button } from '../../elements';
|
|
26
28
|
|
|
27
|
-
import
|
|
29
|
+
import GenericHeader from '../header/generic-header';
|
|
28
30
|
|
|
29
|
-
import {
|
|
31
|
+
import { MenuOutlined, UserOutlined, SettingOutlined } from '@ant-design/icons';
|
|
30
32
|
|
|
33
|
+
import { Drawer } from 'antd';
|
|
31
34
|
|
|
35
|
+
import { ReloadOutlined, SearchOutlined } from '@ant-design/icons';
|
|
32
36
|
|
|
33
|
-
import
|
|
37
|
+
import SideMenu from './../sidemenu/sidemenu';
|
|
34
38
|
|
|
35
|
-
import
|
|
36
|
-
MenuOutlined,
|
|
37
|
-
UserOutlined,
|
|
38
|
-
SettingOutlined,
|
|
39
|
-
} from "@ant-design/icons";
|
|
40
|
-
|
|
41
|
-
import { Drawer } from "antd";
|
|
42
|
-
|
|
43
|
-
import { ReloadOutlined, SearchOutlined } from "@ant-design/icons";
|
|
44
|
-
|
|
45
|
-
import SideMenu from "./../sidemenu/sidemenu";
|
|
46
|
-
|
|
47
|
-
import "./global-header.scss";
|
|
48
|
-
|
|
49
|
-
import LanguageSwitcher from "../language-switcher/language-switcher";
|
|
39
|
+
import './global-header.scss';
|
|
50
40
|
|
|
51
|
-
import
|
|
41
|
+
import LanguageSwitcher from '../language-switcher/language-switcher';
|
|
52
42
|
|
|
43
|
+
import { useTranslation } from 'react-i18next';
|
|
53
44
|
|
|
54
|
-
import BorderStyle from
|
|
55
|
-
|
|
56
|
-
import SettingsUtil from "../../../utils/settings.utils";
|
|
57
|
-
import SpotlightSearch from "../spotlight-search/spotlight-search.component";
|
|
58
|
-
|
|
45
|
+
import BorderStyle from 'pdf-lib/cjs/core/annotation/BorderStyle';
|
|
59
46
|
|
|
47
|
+
import SettingsUtil from '../../../utils/settings.utils';
|
|
48
|
+
import SpotlightSearch from '../spotlight-search/spotlight-search.component';
|
|
49
|
+
import { LicenseAlert } from '../../../components';
|
|
50
|
+
import { MenusAPI } from '../../../models';
|
|
60
51
|
|
|
61
52
|
const { Title } = Typography;
|
|
62
53
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
54
|
export default function GlobalHeader({
|
|
67
55
|
loading,
|
|
68
56
|
appSettings,
|
|
@@ -75,48 +63,45 @@ export default function GlobalHeader({
|
|
|
75
63
|
meta = {},
|
|
76
64
|
...props
|
|
77
65
|
}) {
|
|
78
|
-
|
|
79
66
|
let location = useLocation();
|
|
80
67
|
// let location = {};
|
|
81
68
|
|
|
82
|
-
|
|
83
|
-
|
|
84
69
|
const { isMobile, user = { locations: [] }, kiosk, state } = useContext(GlobalContext);
|
|
85
70
|
|
|
86
|
-
|
|
87
|
-
|
|
88
71
|
const [visible, setVisible] = useState(false);
|
|
89
72
|
|
|
90
73
|
// Variable to handle toggling of menu
|
|
91
74
|
const [collapsed, setCollapsed] = useState(false);
|
|
92
75
|
// varibale handle branch switcher
|
|
93
76
|
|
|
94
|
-
|
|
95
|
-
|
|
96
77
|
// const [searchModalVisible, setSearchModalVisible] = useState(false);
|
|
97
78
|
|
|
98
|
-
|
|
99
|
-
const { globalCustomerHeader = () => { } } = appSettings;
|
|
79
|
+
const { globalCustomerHeader = () => {} } = appSettings;
|
|
100
80
|
|
|
101
81
|
const { t, i18n } = useTranslation();
|
|
102
82
|
const reduceMotion = useReducedMotion();
|
|
103
83
|
const shouldAnimate = !reduceMotion;
|
|
104
|
-
|
|
84
|
+
const [licenseData, setLicenseData] = useState({});
|
|
85
|
+
|
|
86
|
+
const fetchSummary = async () => {
|
|
87
|
+
console.log('fetching summary');
|
|
88
|
+
try {
|
|
89
|
+
const res = await MenusAPI.getSummary();
|
|
90
|
+
if (res?.data) {
|
|
91
|
+
setLicenseData(res?.data);
|
|
92
|
+
}
|
|
93
|
+
} catch (err) {
|
|
94
|
+
console.error(err);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
105
97
|
const spotlightRef = useRef();
|
|
106
98
|
|
|
107
99
|
useEffect(() => {
|
|
108
|
-
|
|
109
100
|
setTimeout(() => {
|
|
110
|
-
|
|
111
101
|
i18n.changeLanguage(localStorage.selectedLanguage);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
}, 0);
|
|
103
|
+
fetchSummary();
|
|
116
104
|
}, []);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
105
|
|
|
121
106
|
/**
|
|
122
107
|
* Function to handle toggling of menu
|
|
@@ -132,9 +117,6 @@ export default function GlobalHeader({
|
|
|
132
117
|
// input to avoid typing
|
|
133
118
|
SettingsUtil.openSpotlightModal();
|
|
134
119
|
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
120
|
|
|
139
121
|
/**
|
|
140
122
|
* Function to remove toggling on mobile view
|
|
@@ -164,85 +146,48 @@ export default function GlobalHeader({
|
|
|
164
146
|
|
|
165
147
|
async function animate() {
|
|
166
148
|
if (!shouldAnimate) {
|
|
167
|
-
boxControls.set(
|
|
149
|
+
boxControls.set('entered');
|
|
168
150
|
return;
|
|
169
151
|
}
|
|
170
152
|
|
|
171
|
-
await boxControls.start(
|
|
153
|
+
await boxControls.start('entered');
|
|
172
154
|
|
|
173
155
|
//await boxControls.start("show");
|
|
174
156
|
}
|
|
175
157
|
|
|
176
158
|
useEffect(() => {
|
|
177
|
-
|
|
178
159
|
animate();
|
|
179
|
-
}, [shouldAnimate])
|
|
180
|
-
|
|
181
|
-
useEffect(() => {
|
|
182
|
-
|
|
183
|
-
}, [state.theme]);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
160
|
+
}, [shouldAnimate]);
|
|
189
161
|
|
|
162
|
+
useEffect(() => {}, [state.theme]);
|
|
190
163
|
|
|
191
|
-
const motionProps = shouldAnimate ? { initial:
|
|
164
|
+
const motionProps = shouldAnimate ? { initial: 'hidden', animate: 'visible' } : { initial: false, animate: false };
|
|
192
165
|
|
|
193
166
|
return (
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}`}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
variants={boxVariants}
|
|
219
|
-
initial={["entering"]}
|
|
220
|
-
animate={boxControls}
|
|
221
|
-
className={`sidebar-container ${!collapsed ? "open" : "close"}${kiosk ? "" : "kioskon"}`}
|
|
222
|
-
|
|
223
|
-
>
|
|
224
|
-
|
|
225
|
-
<SideMenu
|
|
226
|
-
// isOpen={isOpen}
|
|
227
|
-
collapsed={collapsed}
|
|
228
|
-
setCollapsed={setCollapsed}
|
|
229
|
-
loading={loading}
|
|
230
|
-
appSettings={appSettings}
|
|
231
|
-
callback={onClose}
|
|
232
|
-
modules={modules}
|
|
233
|
-
history={history}
|
|
234
|
-
/>
|
|
235
|
-
|
|
236
|
-
</motion.div>
|
|
237
|
-
) : (
|
|
238
|
-
<Drawer
|
|
239
|
-
placement="left"
|
|
240
|
-
onClose={onClose}
|
|
241
|
-
visible={visible}
|
|
242
|
-
className="side-drawer-content"
|
|
243
|
-
>
|
|
244
|
-
<div
|
|
245
|
-
className={`sidebar-container ${!collapsed ? "open" : "close"}`}
|
|
167
|
+
<>
|
|
168
|
+
<div
|
|
169
|
+
className={`global-header ${process.env.REACT_APP_THEME} ${isConnected && !kiosk ? 'connected' : ''}`}
|
|
170
|
+
style={{
|
|
171
|
+
// background: state.theme.colors.bodyBackground,
|
|
172
|
+
|
|
173
|
+
height: 10,
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
{/* <MenuOutlined style={{left:'1%',top:'1%', fontSize:18, position:'absolute', zIndex:999}} onClick={showSidebar}/> */}
|
|
177
|
+
|
|
178
|
+
<div className="layout-content">
|
|
179
|
+
<div
|
|
180
|
+
//whileHover="hover"
|
|
181
|
+
//whileTap="tap"
|
|
182
|
+
className={`left-bar ${!isConnected && !isMobile ? '' : 'hide'}${!collapsed ? 'open' : 'close'}${kiosk && !isConnected ? 'kioskon' : ''}`}
|
|
183
|
+
// style={{ background: state.theme.colors.leftSectionBackground }}
|
|
184
|
+
>
|
|
185
|
+
{!isMobile && !isConnected ? (
|
|
186
|
+
<motion.div
|
|
187
|
+
variants={boxVariants}
|
|
188
|
+
initial={['entering']}
|
|
189
|
+
animate={boxControls}
|
|
190
|
+
className={`sidebar-container ${!collapsed ? 'open' : 'close'}${kiosk ? '' : 'kioskon'}`}
|
|
246
191
|
>
|
|
247
192
|
<SideMenu
|
|
248
193
|
// isOpen={isOpen}
|
|
@@ -254,180 +199,188 @@ export default function GlobalHeader({
|
|
|
254
199
|
modules={modules}
|
|
255
200
|
history={history}
|
|
256
201
|
/>
|
|
257
|
-
</div>
|
|
258
|
-
</Drawer>
|
|
259
|
-
)}
|
|
260
|
-
</div>
|
|
261
|
-
|
|
262
|
-
{/* Right Section of the Component Loader */}
|
|
263
|
-
<div className={`right-section ${!collapsed ? "open" : "close"} ${kiosk ? "kioskon" : ""}`} style={{ background: state.theme.colors.bodyBackground }}>
|
|
264
|
-
{/* For not connected section */}
|
|
265
|
-
{!isConnected && !kiosk ? (
|
|
266
|
-
|
|
267
|
-
<motion.div
|
|
268
|
-
variants={headerShellVariants}
|
|
269
|
-
{...motionProps}
|
|
270
|
-
className={`page-wrapper ${!collapsed ? "open" : "close"}`}
|
|
271
|
-
// style={{ background: state.theme.colors.headerBg }}
|
|
272
|
-
>
|
|
273
|
-
{/* */}
|
|
274
|
-
<motion.div className="page-header-name" variants={headerClusterVariants}>
|
|
275
|
-
|
|
276
|
-
<ProgressBar isLoading={loading} />
|
|
277
|
-
|
|
278
|
-
<span type
|
|
279
|
-
onClick={!isMobile ? toggleCollapsed : hideToggle}
|
|
280
|
-
className="toggle-box toggle-menu"
|
|
281
|
-
>
|
|
282
|
-
<MenuOutlined />
|
|
283
|
-
|
|
284
|
-
</span>
|
|
285
|
-
|
|
286
|
-
{/* Back Button */}
|
|
287
|
-
{location.pathname !== "/" ? (
|
|
288
|
-
<span
|
|
289
|
-
className="toggle-box"
|
|
290
|
-
onClick={() => {
|
|
291
|
-
history && history.goBack();
|
|
292
|
-
}}
|
|
293
|
-
>
|
|
294
|
-
<GenericHeader />
|
|
295
|
-
</span>
|
|
296
|
-
) : null}
|
|
297
|
-
{/* Back Button Ends */}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
{location.pathname !== "/" ? (
|
|
301
|
-
<h4 className="menu-caption header-caption" style={{ color: state.theme.colors.headerColor }}>
|
|
302
|
-
{menu.caption}
|
|
303
|
-
</h4>
|
|
304
|
-
) : null}
|
|
305
202
|
</motion.div>
|
|
203
|
+
) : (
|
|
204
|
+
<Drawer placement="left" onClose={onClose} visible={visible} className="side-drawer-content">
|
|
205
|
+
<div className={`sidebar-container ${!collapsed ? 'open' : 'close'}`}>
|
|
206
|
+
<SideMenu
|
|
207
|
+
// isOpen={isOpen}
|
|
208
|
+
collapsed={collapsed}
|
|
209
|
+
setCollapsed={setCollapsed}
|
|
210
|
+
loading={loading}
|
|
211
|
+
appSettings={appSettings}
|
|
212
|
+
callback={onClose}
|
|
213
|
+
modules={modules}
|
|
214
|
+
history={history}
|
|
215
|
+
/>
|
|
216
|
+
</div>
|
|
217
|
+
</Drawer>
|
|
218
|
+
)}
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
{/* Right Section of the Component Loader */}
|
|
222
|
+
<div
|
|
223
|
+
className={`right-section ${!collapsed ? 'open' : 'close'} ${kiosk ? 'kioskon' : ''}`}
|
|
224
|
+
style={{ background: state.theme.colors.bodyBackground }}
|
|
225
|
+
>
|
|
226
|
+
{/* For not connected section */}
|
|
227
|
+
{!isConnected && !kiosk ? (
|
|
228
|
+
<motion.div
|
|
229
|
+
variants={headerShellVariants}
|
|
230
|
+
{...motionProps}
|
|
231
|
+
className={`page-wrapper ${!collapsed ? 'open' : 'close'}`}
|
|
232
|
+
// style={{ background: state.theme.colors.headerBg }}
|
|
233
|
+
>
|
|
234
|
+
{/* */}
|
|
235
|
+
<motion.div className="page-header-name" variants={headerClusterVariants}>
|
|
236
|
+
<ProgressBar isLoading={loading} />
|
|
306
237
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
<motion.div className="page-menu" variants={headerActionsVariants}>
|
|
311
|
-
{/* Search Input in header start */}
|
|
312
|
-
{ !isMobile && (
|
|
313
|
-
<motion.div className="header-action header-action-search" variants={headerActionItemVariants}>
|
|
314
|
-
<Input
|
|
315
|
-
placeholder="Search (Shift + F)"
|
|
316
|
-
prefix={<SearchOutlined />}
|
|
317
|
-
onClick={openSearchModal}
|
|
318
|
-
|
|
319
|
-
readOnly
|
|
320
|
-
style={{ width: 250 }}
|
|
321
|
-
/>
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
<SpotlightSearch ref={(elem) => SettingsUtil.registerModal(elem)} props={props}/>
|
|
325
|
-
|
|
326
|
-
</motion.div>
|
|
327
|
-
)}
|
|
328
|
-
{/* Search Input in header start */}
|
|
329
|
-
|
|
330
|
-
{/** branchswitcher Option */}
|
|
331
|
-
{/* branch switcher controlled with env for matria and nura */}
|
|
332
|
-
{!process.env.REACT_APP_SHOW_BRANCH_SWITCHER ? (
|
|
333
|
-
<motion.div className="branch-switcher header-action" variants={headerActionItemVariants}>{globalCustomerHeader()}</motion.div>
|
|
334
|
-
):null}
|
|
335
|
-
{/* <div className="branch-switcher">{globalCustomerHeader()}</div> */}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
{/* Search Option */}
|
|
339
|
-
|
|
340
|
-
{/* <ModalSearch /> */}
|
|
341
|
-
|
|
342
|
-
{/* Search Option Ends */}
|
|
343
|
-
|
|
344
|
-
{/* Configurator Actions */}
|
|
345
|
-
{user.isAdmin ? (
|
|
346
|
-
<>
|
|
347
|
-
{/* Models */}
|
|
348
|
-
{menu && menu.id ? (
|
|
349
|
-
<motion.div className="header-action" variants={headerActionItemVariants}>
|
|
350
|
-
<Link to={`/menus/${menu.id}`}>
|
|
351
|
-
|
|
352
|
-
<Button type="default" size={"small"} icon={<SettingOutlined />}>
|
|
238
|
+
<span type onClick={!isMobile ? toggleCollapsed : hideToggle} className="toggle-box toggle-menu">
|
|
239
|
+
<MenuOutlined />
|
|
240
|
+
</span>
|
|
353
241
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
{
|
|
359
|
-
|
|
242
|
+
{/* Back Button */}
|
|
243
|
+
{location.pathname !== '/' ? (
|
|
244
|
+
<span
|
|
245
|
+
className="toggle-box"
|
|
246
|
+
onClick={() => {
|
|
247
|
+
history && history.goBack();
|
|
248
|
+
}}
|
|
249
|
+
>
|
|
250
|
+
<GenericHeader />
|
|
251
|
+
</span>
|
|
360
252
|
) : null}
|
|
361
|
-
{/*
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
253
|
+
{/* Back Button Ends */}
|
|
366
254
|
|
|
255
|
+
{location.pathname !== '/' ? (
|
|
256
|
+
<h4 className="menu-caption header-caption" style={{ color: state.theme.colors.headerColor }}>
|
|
257
|
+
{menu.caption}
|
|
258
|
+
</h4>
|
|
259
|
+
) : null}
|
|
260
|
+
</motion.div>
|
|
367
261
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
<motion.div className="header-action" variants={headerActionItemVariants}>
|
|
371
|
-
<Button onClick={reload} icon={<ReloadOutlined />} type="default" size={"small"} >
|
|
262
|
+
{/* Page Menu Actions */}
|
|
372
263
|
|
|
373
|
-
|
|
374
|
-
|
|
264
|
+
{user.role || user.id ? (
|
|
265
|
+
<motion.div className="page-menu" variants={headerActionsVariants}>
|
|
266
|
+
{/* Search Input in header start */}
|
|
267
|
+
{!isMobile && (
|
|
268
|
+
<motion.div className="header-action header-action-search" variants={headerActionItemVariants}>
|
|
269
|
+
<Input
|
|
270
|
+
placeholder="Search (Shift + F)"
|
|
271
|
+
prefix={<SearchOutlined />}
|
|
272
|
+
onClick={openSearchModal}
|
|
273
|
+
readOnly
|
|
274
|
+
style={{ width: 250 }}
|
|
275
|
+
/>
|
|
276
|
+
|
|
277
|
+
<SpotlightSearch ref={(elem) => SettingsUtil.registerModal(elem)} props={props} />
|
|
278
|
+
</motion.div>
|
|
279
|
+
)}
|
|
280
|
+
{/* Search Input in header start */}
|
|
375
281
|
|
|
376
|
-
|
|
282
|
+
{/** branchswitcher Option */}
|
|
283
|
+
{/* branch switcher controlled with env for matria and nura */}
|
|
284
|
+
{!process.env.REACT_APP_SHOW_BRANCH_SWITCHER ? (
|
|
285
|
+
<motion.div className="branch-switcher header-action" variants={headerActionItemVariants}>
|
|
286
|
+
{globalCustomerHeader()}
|
|
287
|
+
</motion.div>
|
|
288
|
+
) : null}
|
|
289
|
+
{/* <div className="branch-switcher">{globalCustomerHeader()}</div> */}
|
|
290
|
+
|
|
291
|
+
{/* Search Option */}
|
|
292
|
+
|
|
293
|
+
{/* <ModalSearch /> */}
|
|
294
|
+
|
|
295
|
+
{/* Search Option Ends */}
|
|
296
|
+
|
|
297
|
+
{/* Configurator Actions */}
|
|
298
|
+
{user.isAdmin ? (
|
|
299
|
+
<>
|
|
300
|
+
{/* Models */}
|
|
301
|
+
{menu && menu.id ? (
|
|
302
|
+
<motion.div className="header-action" variants={headerActionItemVariants}>
|
|
303
|
+
<Link to={`/menus/${menu.id}`}>
|
|
304
|
+
<Button type="default" size={'small'} icon={<SettingOutlined />}></Button>
|
|
305
|
+
</Link>
|
|
306
|
+
</motion.div>
|
|
307
|
+
) : null}
|
|
308
|
+
{/* Models Ends */}
|
|
309
|
+
</>
|
|
310
|
+
) : null}
|
|
311
|
+
{/* Configurator Actions Ends */}
|
|
312
|
+
|
|
313
|
+
{/* Reload Button */}
|
|
377
314
|
|
|
378
|
-
{/** Switch Languages starts */}
|
|
379
|
-
{process.env.REACT_APP_ENABLE_LANGUAGE_SWITCHER ? (
|
|
380
315
|
<motion.div className="header-action" variants={headerActionItemVariants}>
|
|
381
|
-
<
|
|
316
|
+
<Button onClick={reload} icon={<ReloadOutlined />} type="default" size={'small'}></Button>
|
|
382
317
|
</motion.div>
|
|
383
|
-
) : null}
|
|
384
|
-
{/** Switch Languages ends */}
|
|
385
318
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
319
|
+
{/* Reload Button Ends */}
|
|
320
|
+
|
|
321
|
+
{/** Switch Languages starts */}
|
|
322
|
+
{process.env.REACT_APP_ENABLE_LANGUAGE_SWITCHER ? (
|
|
323
|
+
<motion.div className="header-action" variants={headerActionItemVariants}>
|
|
324
|
+
<LanguageSwitcher />
|
|
325
|
+
</motion.div>
|
|
326
|
+
) : null}
|
|
327
|
+
{/** Switch Languages ends */}
|
|
328
|
+
|
|
329
|
+
{/* User Profile */}
|
|
330
|
+
<motion.div className="header-profile-wrap header-action" variants={headerActionItemVariants}>
|
|
331
|
+
<ProfileAvatar />
|
|
332
|
+
<span className="header-profile-name" style={{ color: state.theme.colors.colorText }}>
|
|
333
|
+
{' '}
|
|
334
|
+
{user.name}{' '}
|
|
335
|
+
</span>
|
|
336
|
+
</motion.div>
|
|
337
|
+
{/* User Profile Ends */}
|
|
390
338
|
</motion.div>
|
|
391
|
-
|
|
392
|
-
</motion.div>
|
|
393
|
-
) : null}
|
|
339
|
+
) : null}
|
|
394
340
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
341
|
+
{/* Page Menu Actions Ends */}
|
|
342
|
+
</motion.div>
|
|
343
|
+
) : null}
|
|
398
344
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
345
|
+
{/* The children is rendered */}
|
|
346
|
+
<motion.div className="page-content-stage" variants={contentRevealVariants} {...motionProps}>
|
|
347
|
+
{children}
|
|
348
|
+
</motion.div>
|
|
349
|
+
{/* The children is rendered */}
|
|
350
|
+
</div>
|
|
351
|
+
{/* Right Section of the Component Loader Ends */}
|
|
404
352
|
</div>
|
|
405
|
-
{/* Right Section of the Component Loader Ends */}
|
|
406
353
|
</div>
|
|
407
|
-
|
|
354
|
+
{licenseData && (
|
|
355
|
+
<div
|
|
356
|
+
style={{
|
|
357
|
+
marginTop: '3rem',
|
|
358
|
+
right: '2%',
|
|
359
|
+
position: 'absolute',
|
|
360
|
+
zIndex: 999,
|
|
361
|
+
}}
|
|
362
|
+
>
|
|
363
|
+
<LicenseAlert data={licenseData} />
|
|
364
|
+
</div>
|
|
365
|
+
)}
|
|
366
|
+
</>
|
|
408
367
|
);
|
|
409
368
|
}
|
|
410
369
|
|
|
411
|
-
|
|
412
370
|
/**
|
|
413
|
-
*
|
|
414
|
-
* @returns
|
|
371
|
+
*
|
|
372
|
+
* @returns
|
|
415
373
|
*/
|
|
416
374
|
function ProfileAvatar() {
|
|
417
|
-
|
|
418
375
|
const { user = { locations: [] } } = useContext(GlobalContext);
|
|
419
376
|
|
|
420
|
-
useEffect(() => {
|
|
377
|
+
useEffect(() => {}, []);
|
|
421
378
|
|
|
422
379
|
return (
|
|
423
380
|
<Link className="profile-avatar" to="/profile">
|
|
424
381
|
{user.photograph ? (
|
|
425
382
|
<>
|
|
426
|
-
<img
|
|
427
|
-
className="profile-picture"
|
|
428
|
-
src={user.photograph}
|
|
429
|
-
alt={"user photograph"}
|
|
430
|
-
/>
|
|
383
|
+
<img className="profile-picture" src={user.photograph} alt={'user photograph'} />
|
|
431
384
|
</>
|
|
432
385
|
) : (
|
|
433
386
|
<Avatar shape="square" size="small" icon={<UserOutlined />} />
|