ui-soxo-bootstrap-core 2.6.20 → 2.6.21
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/lib/Store.js
CHANGED
|
@@ -72,12 +72,16 @@ const initialTheme = () => {
|
|
|
72
72
|
const initialState = {
|
|
73
73
|
defaultBranch: {},
|
|
74
74
|
theme: initialTheme(), // Set the initial theme from themes.json
|
|
75
|
+
settings: {},
|
|
75
76
|
};
|
|
76
77
|
|
|
77
78
|
/**
|
|
78
79
|
* Context for sharing state accross app
|
|
79
80
|
*/
|
|
80
|
-
export const GlobalContext = createContext(
|
|
81
|
+
export const GlobalContext = createContext({
|
|
82
|
+
...initialState,
|
|
83
|
+
state: initialState,
|
|
84
|
+
});
|
|
81
85
|
|
|
82
86
|
let app = {};
|
|
83
87
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Global header component
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React, { useState, useEffect, useContext,useRef } from "react";
|
|
6
|
+
import React, { useState, useEffect, useContext, useRef } from "react";
|
|
7
7
|
|
|
8
8
|
import { animationControls, motion, useAnimation } from "framer-motion";
|
|
9
9
|
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
boxVariants,
|
|
12
12
|
} from "./animations"
|
|
13
13
|
|
|
14
|
-
import { GlobalContext } from "./../../Store";
|
|
14
|
+
import { GlobalContext, GlobalProvider } from "./../../Store";
|
|
15
15
|
|
|
16
16
|
import { Link, useLocation } from "react-router-dom";
|
|
17
17
|
|
|
18
|
-
import { Typography, Avatar ,
|
|
18
|
+
import { Typography, Avatar, Input, Tooltip } from "antd";
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
MenuOutlined,
|
|
32
32
|
UserOutlined,
|
|
33
33
|
SettingOutlined,
|
|
34
|
+
QuestionOutlined,
|
|
34
35
|
} from "@ant-design/icons";
|
|
35
36
|
|
|
36
37
|
import { Drawer } from "antd";
|
|
@@ -58,7 +59,7 @@ const { Title } = Typography;
|
|
|
58
59
|
|
|
59
60
|
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
function GlobalHeaderContent({
|
|
62
63
|
loading,
|
|
63
64
|
appSettings,
|
|
64
65
|
children,
|
|
@@ -76,17 +77,18 @@ export default function GlobalHeader({
|
|
|
76
77
|
|
|
77
78
|
|
|
78
79
|
|
|
79
|
-
const { isMobile, user = { locations: [] }, kiosk, state } = useContext(GlobalContext);
|
|
80
|
+
const { isMobile, user = { locations: [] }, kiosk, state, settings } = useContext(GlobalContext);
|
|
80
81
|
|
|
81
82
|
|
|
82
83
|
|
|
83
84
|
const [visible, setVisible] = useState(false);
|
|
85
|
+
const helpDeskSetting = settings?.HELPATR || {}
|
|
84
86
|
|
|
85
87
|
// Variable to handle toggling of menu
|
|
86
88
|
const [collapsed, setCollapsed] = useState(false);
|
|
87
89
|
// varibale handle branch switcher
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
|
|
90
92
|
|
|
91
93
|
// const [searchModalVisible, setSearchModalVisible] = useState(false);
|
|
92
94
|
|
|
@@ -107,8 +109,8 @@ export default function GlobalHeader({
|
|
|
107
109
|
|
|
108
110
|
|
|
109
111
|
}, []);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
|
|
113
|
+
|
|
112
114
|
|
|
113
115
|
|
|
114
116
|
/**
|
|
@@ -125,9 +127,9 @@ export default function GlobalHeader({
|
|
|
125
127
|
// input to avoid typing
|
|
126
128
|
SettingsUtil.openSpotlightModal();
|
|
127
129
|
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
131
133
|
|
|
132
134
|
/**
|
|
133
135
|
* Function to remove toggling on mobile view
|
|
@@ -170,10 +172,10 @@ export default function GlobalHeader({
|
|
|
170
172
|
|
|
171
173
|
}, [state.theme]);
|
|
172
174
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
177
179
|
|
|
178
180
|
|
|
179
181
|
return (
|
|
@@ -196,7 +198,7 @@ export default function GlobalHeader({
|
|
|
196
198
|
//whileHover="hover"
|
|
197
199
|
//whileTap="tap"
|
|
198
200
|
className={`left-bar ${!isConnected && !isMobile ? "" : "hide"}${!collapsed ? "open" : "close"}${kiosk && !isConnected ? "kioskon" : ""}`}
|
|
199
|
-
|
|
201
|
+
// style={{ background: state.theme.colors.leftSectionBackground }}
|
|
200
202
|
>
|
|
201
203
|
|
|
202
204
|
{!isMobile && !isConnected ? (
|
|
@@ -288,34 +290,34 @@ export default function GlobalHeader({
|
|
|
288
290
|
</div>
|
|
289
291
|
|
|
290
292
|
{/* Page Menu Actions */}
|
|
291
|
-
|
|
293
|
+
|
|
292
294
|
{user.role || user.id ? (
|
|
293
295
|
<div className="page-menu">
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
296
|
+
{/* Search Input in header start */}
|
|
297
|
+
{!isMobile && (
|
|
298
|
+
|
|
297
299
|
<div>
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
<SpotlightSearch ref={(elem) => SettingsUtil.registerModal(elem)}
|
|
309
|
-
|
|
300
|
+
<Input
|
|
301
|
+
placeholder="Search (Shift + F)"
|
|
302
|
+
prefix={<SearchOutlined />}
|
|
303
|
+
onClick={openSearchModal}
|
|
304
|
+
|
|
305
|
+
readOnly
|
|
306
|
+
style={{ width: 250 }}
|
|
307
|
+
/>
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
<SpotlightSearch ref={(elem) => SettingsUtil.registerModal(elem)} props={props} />
|
|
311
|
+
|
|
310
312
|
</div>
|
|
311
|
-
|
|
312
|
-
|
|
313
|
+
)}
|
|
314
|
+
{/* Search Input in header start */}
|
|
313
315
|
|
|
314
316
|
{/** branchswitcher Option */}
|
|
315
317
|
{/* branch switcher controlled with env for matria and nura */}
|
|
316
318
|
{!process.env.REACT_APP_SHOW_BRANCH_SWITCHER ? (
|
|
317
|
-
|
|
318
|
-
):null}
|
|
319
|
+
<div className="branch-switcher">{globalCustomerHeader()}</div>
|
|
320
|
+
) : null}
|
|
319
321
|
{/* <div className="branch-switcher">{globalCustomerHeader()}</div> */}
|
|
320
322
|
|
|
321
323
|
|
|
@@ -342,7 +344,7 @@ export default function GlobalHeader({
|
|
|
342
344
|
) : null}
|
|
343
345
|
{/* Configurator Actions Ends */}
|
|
344
346
|
|
|
345
|
-
|
|
347
|
+
|
|
346
348
|
|
|
347
349
|
|
|
348
350
|
|
|
@@ -355,6 +357,18 @@ export default function GlobalHeader({
|
|
|
355
357
|
|
|
356
358
|
{/* Reload Button Ends */}
|
|
357
359
|
|
|
360
|
+
{/* Help-desk-btn */}
|
|
361
|
+
{helpDeskSetting?.showSupportBtn ? <Tooltip title={helpDeskSetting?.toolTipText}>
|
|
362
|
+
<span>
|
|
363
|
+
<Button
|
|
364
|
+
onClick={() => window.open(helpDeskSetting?.helpDeskLink ?? '', '_blank')}
|
|
365
|
+
icon={<QuestionOutlined />}
|
|
366
|
+
type="default"
|
|
367
|
+
size="small"
|
|
368
|
+
/>
|
|
369
|
+
</span>
|
|
370
|
+
</Tooltip> : null}
|
|
371
|
+
|
|
358
372
|
{/** Switch Languages starts */}
|
|
359
373
|
{process.env.REACT_APP_ENABLE_LANGUAGE_SWITCHER ? <LanguageSwitcher /> : null}
|
|
360
374
|
{/** Switch Languages ends */}
|
|
@@ -383,6 +397,22 @@ export default function GlobalHeader({
|
|
|
383
397
|
}
|
|
384
398
|
|
|
385
399
|
|
|
400
|
+
export default function GlobalHeader(props) {
|
|
401
|
+
const context = useContext(GlobalContext);
|
|
402
|
+
|
|
403
|
+
if (context.dispatch) {
|
|
404
|
+
return <GlobalHeaderContent {...props} />;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
return (
|
|
408
|
+
<GlobalProvider {...props} appSettings={props.appSettings}>
|
|
409
|
+
<GlobalHeaderContent {...props} />
|
|
410
|
+
</GlobalProvider>
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
386
416
|
/**
|
|
387
417
|
*
|
|
388
418
|
* @returns
|