ui-soxo-bootstrap-core 2.6.31 → 2.6.32-dev.1
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 +2 -11
- package/core/components/landing-api/landing-api.js +165 -5
- package/core/components/license-management/license-alert.js +97 -0
- package/core/lib/components/global-header/global-header.js +18 -77
- package/core/lib/components/index.js +2 -2
- package/core/lib/components/sidemenu/sidemenu.js +13 -8
- package/core/models/core-scripts/core-scripts.js +14 -1
- package/core/models/menus/menus.js +29 -1
- package/core/modules/reporting/components/reporting-dashboard/display-columns/display-cell-renderer.js +202 -5
- package/core/modules/reporting/components/reporting-dashboard/display-columns/display-cell-renderer.test.js +73 -0
- package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.js +143 -527
- package/core/modules/reporting/components/reporting-dashboard/reporting-table.js +519 -0
- package/package.json +1 -1
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 };
|
|
@@ -2,9 +2,20 @@ import { useContext, useEffect, useRef, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { Route, Switch } from 'react-router-dom';
|
|
4
4
|
|
|
5
|
-
import { Skeleton } from 'antd';
|
|
6
|
-
|
|
7
|
-
import {
|
|
5
|
+
import { Skeleton, message, Modal } from 'antd';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
GlobalHeader,
|
|
9
|
+
ChangePassword,
|
|
10
|
+
useTranslation,
|
|
11
|
+
GlobalContext,
|
|
12
|
+
ModuleRoutes,
|
|
13
|
+
SpotlightSearch,
|
|
14
|
+
SettingsUtil,
|
|
15
|
+
Profile,
|
|
16
|
+
Card,
|
|
17
|
+
safeJSON,
|
|
18
|
+
} from '../../lib';
|
|
8
19
|
|
|
9
20
|
import './landing-api.scss';
|
|
10
21
|
|
|
@@ -46,7 +57,6 @@ function getRandomMessage(previousMessage = '') {
|
|
|
46
57
|
*/
|
|
47
58
|
export default function LandingApi({ history, CustomComponents, CustomModels, appSettings, transitionPending = false, onHomeReady, ...props }) {
|
|
48
59
|
const [loader, setLoader] = useState(false);
|
|
49
|
-
|
|
50
60
|
// const [modules, setModules] = useState([]);
|
|
51
61
|
|
|
52
62
|
const [connected] = useState();
|
|
@@ -59,11 +69,31 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
59
69
|
|
|
60
70
|
const [meta, setMeta] = useState({});
|
|
61
71
|
const [loadingMessage, setLoadingMessage] = useState('');
|
|
72
|
+
const [licenseData, setLicenseData] = useState(null);
|
|
73
|
+
|
|
74
|
+
const [licAlert, setLicAlert] = useState(false);
|
|
75
|
+
// License data state
|
|
62
76
|
|
|
63
77
|
// const [reports, setReports] = useState([]);
|
|
64
78
|
|
|
65
79
|
var config = {};
|
|
66
80
|
|
|
81
|
+
//fetch license summary
|
|
82
|
+
// const fetchSummary = async () => {
|
|
83
|
+
// try {
|
|
84
|
+
// const res = await MenusAPI.getSummary();
|
|
85
|
+
// if (res?.data) {
|
|
86
|
+
// setLicenseData(res?.data);
|
|
87
|
+
// setLicAlert(true);
|
|
88
|
+
// } else {
|
|
89
|
+
// setLicenseData(null);
|
|
90
|
+
// setLicAlert(false);
|
|
91
|
+
// }
|
|
92
|
+
// } catch (err) {
|
|
93
|
+
// console.error(err);
|
|
94
|
+
// }
|
|
95
|
+
// };
|
|
96
|
+
|
|
67
97
|
// Variable decides the control of homepage
|
|
68
98
|
// #TODO This is a temporary fix - Homemage
|
|
69
99
|
|
|
@@ -73,6 +103,70 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
73
103
|
disableHomepage = JSON.parse(process.env.REACT_APP_DISABLEHOMEPAGE);
|
|
74
104
|
}
|
|
75
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Normalizes the user's branch access list from `organization_details`.
|
|
108
|
+
*
|
|
109
|
+
* The API can return `organization_details` as a JSON string, so we always
|
|
110
|
+
* parse it through `safeJSON` before reading the branch collection.
|
|
111
|
+
*
|
|
112
|
+
* @returns {Array} List of branches the current user can access.
|
|
113
|
+
*/
|
|
114
|
+
const getAccessibleBranches = () => {
|
|
115
|
+
const orgDetails = safeJSON(user?.organization_details);
|
|
116
|
+
return Array.isArray(orgDetails?.branch) ? orgDetails.branch : [];
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Resolves the currently selected branch record using the persisted db pointer.
|
|
121
|
+
*
|
|
122
|
+
* @param {Array} branches
|
|
123
|
+
* @returns {Object|null}
|
|
124
|
+
*/
|
|
125
|
+
const getCurrentBranchRecord = (branches) => {
|
|
126
|
+
const currentDbPtr = localStorage.getItem('db_ptr');
|
|
127
|
+
return branches.find((branch) => String(branch.dbPtr) === String(currentDbPtr)) || null;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Resolves the target branch from the URL `index` query parameter.
|
|
132
|
+
*
|
|
133
|
+
* @param {Array} branches
|
|
134
|
+
* @param {string|null} branchId
|
|
135
|
+
* @returns {Object|null}
|
|
136
|
+
*/
|
|
137
|
+
const getBranchRecordById = (branches, branchId) => {
|
|
138
|
+
return branches.find((branch) => String(branch.branch_id) === String(branchId)) || null;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Persists branch-specific auth data after a successful switch.
|
|
143
|
+
*
|
|
144
|
+
* @param {Object} tokenBundle
|
|
145
|
+
* @param {string} dbPtr
|
|
146
|
+
*/
|
|
147
|
+
const persistBranchSession = (tokenBundle, dbPtr) => {
|
|
148
|
+
const accessToken = tokenBundle?.access_token;
|
|
149
|
+
const refreshToken = tokenBundle?.refresh_token;
|
|
150
|
+
|
|
151
|
+
if (accessToken) localStorage.setItem('access_token', accessToken);
|
|
152
|
+
if (refreshToken) localStorage.setItem('refresh_token', refreshToken);
|
|
153
|
+
if (dbPtr) localStorage.setItem('db_ptr', dbPtr);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const fetchSummary = async () => {
|
|
157
|
+
try {
|
|
158
|
+
const res = await MenusAPI.getSummary();
|
|
159
|
+
if (res?.data) {
|
|
160
|
+
setLicenseData(res?.data);
|
|
161
|
+
setLicAlert(true);
|
|
162
|
+
} else {
|
|
163
|
+
setLicenseData(null);
|
|
164
|
+
setLicAlert(false);
|
|
165
|
+
}
|
|
166
|
+
} catch (err) {
|
|
167
|
+
console.error(err);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
76
170
|
// useEffect(() => {
|
|
77
171
|
|
|
78
172
|
// // Initialize the menus for the logged in user
|
|
@@ -88,6 +182,67 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
88
182
|
// }
|
|
89
183
|
// }, [loader]);
|
|
90
184
|
|
|
185
|
+
/**
|
|
186
|
+
* Synchronizes the active branch with the `index` query parameter.
|
|
187
|
+
*
|
|
188
|
+
* Flow:
|
|
189
|
+
* 1. Read the target branch id from the URL.
|
|
190
|
+
* 2. Compare it against the branch represented by the current `db_ptr`.
|
|
191
|
+
* 3. Switch branch only when the user has access and the branch actually differs.
|
|
192
|
+
* 4. Refresh auth/profile state and reload menus for the new branch context.
|
|
193
|
+
*/
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
const handleUrlBranchSwitch = async () => {
|
|
196
|
+
const searchParams = new URLSearchParams(history.location.search);
|
|
197
|
+
const urlDbPtr = searchParams.get('index');
|
|
198
|
+
if (!urlDbPtr) return;
|
|
199
|
+
|
|
200
|
+
const accessibleBranches = getAccessibleBranches();
|
|
201
|
+
const currentBranch = getCurrentBranchRecord(accessibleBranches);
|
|
202
|
+
const targetBranch = getBranchRecordById(accessibleBranches, urlDbPtr);
|
|
203
|
+
|
|
204
|
+
if (!targetBranch || String(currentBranch?.branch_id) === String(urlDbPtr)) return;
|
|
205
|
+
|
|
206
|
+
setLoader(true);
|
|
207
|
+
|
|
208
|
+
try {
|
|
209
|
+
const switchResult = await MenusAPI.switchBranch(
|
|
210
|
+
{
|
|
211
|
+
firm_id: targetBranch.firm_ptr,
|
|
212
|
+
branch_id: targetBranch.branch_id,
|
|
213
|
+
},
|
|
214
|
+
targetBranch.dbPtr
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
if (!switchResult?.success) {
|
|
218
|
+
Modal.error({
|
|
219
|
+
title: 'Branch Switch Failed',
|
|
220
|
+
content: switchResult?.message || 'An error occurred while attempting to switch branches.',
|
|
221
|
+
});
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
persistBranchSession(switchResult?.token, targetBranch.dbPtr);
|
|
226
|
+
window.dispatchEvent(new CustomEvent('branchChanged', { detail: targetBranch.dbPtr }));
|
|
227
|
+
|
|
228
|
+
const accessToken = switchResult?.token?.access_token;
|
|
229
|
+
const profileResult = await MenusAPI.getProfile(accessToken);
|
|
230
|
+
const updatedUser = { ...profileResult, loggedCheckDone: true };
|
|
231
|
+
|
|
232
|
+
dispatch({ type: 'user', payload: updatedUser });
|
|
233
|
+
localStorage.setItem('userInfo', JSON.stringify(updatedUser));
|
|
234
|
+
|
|
235
|
+
await initializeUserMenus();
|
|
236
|
+
} catch (error) {
|
|
237
|
+
console.error('Auto branch switch failed:', error);
|
|
238
|
+
} finally {
|
|
239
|
+
setLoader(false);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
if (user?.id && history?.location) handleUrlBranchSwitch();
|
|
244
|
+
}, [history?.location?.search, user?.id]);
|
|
245
|
+
|
|
91
246
|
useEffect(() => {
|
|
92
247
|
// Initialize the menus for the logged in user
|
|
93
248
|
initializeUserMenus();
|
|
@@ -138,9 +293,12 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
138
293
|
*/
|
|
139
294
|
async function initializeUserMenus() {
|
|
140
295
|
// need to find what implement, with a login who has the respective value ("wug_custreportids")
|
|
296
|
+
|
|
141
297
|
const report = await loadScripts(user);
|
|
142
298
|
|
|
143
299
|
await loadMenus(report);
|
|
300
|
+
// fetch license summary
|
|
301
|
+
fetchSummary();
|
|
144
302
|
}
|
|
145
303
|
|
|
146
304
|
// const keyMap = {
|
|
@@ -162,7 +320,7 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
162
320
|
setLoader(true);
|
|
163
321
|
|
|
164
322
|
// setReports(report)
|
|
165
|
-
|
|
323
|
+
fetchSummary();
|
|
166
324
|
const result = await MenusAPI.getMenus(user);
|
|
167
325
|
|
|
168
326
|
// console.log(result);
|
|
@@ -292,6 +450,8 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
292
450
|
modules={allModules}
|
|
293
451
|
user={user}
|
|
294
452
|
history={history}
|
|
453
|
+
licenseData={licenseData}
|
|
454
|
+
licAlert={licAlert}
|
|
295
455
|
>
|
|
296
456
|
{loader ? (
|
|
297
457
|
<Card className="skeleton-card">
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Alert } from 'antd';
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
export default function LicenseAlert({ data }) {
|
|
5
|
+
// setting visibility of alert based on license status
|
|
6
|
+
const [visible, setVisible] = useState(true);
|
|
7
|
+
// resolve alert configuration based on license data
|
|
8
|
+
const alertConfig = resolveLicenseAlert(data);
|
|
9
|
+
// auto-hide alert after 10 seconds or when data changes
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (alertConfig) {
|
|
12
|
+
setVisible(true);
|
|
13
|
+
|
|
14
|
+
const timer = setTimeout(() => {
|
|
15
|
+
setVisible(false);
|
|
16
|
+
}, 10000); // 10 seconds
|
|
17
|
+
|
|
18
|
+
return () => {
|
|
19
|
+
clearTimeout(timer);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}, [data]);
|
|
23
|
+
// if no alert configuration or not visible, render nothing
|
|
24
|
+
if (!alertConfig || !visible) return null;
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
// render the alert with appropriate type, message, and description
|
|
28
|
+
<Alert
|
|
29
|
+
type={alertConfig.type}
|
|
30
|
+
message={alertConfig.message}
|
|
31
|
+
description={alertConfig.description}
|
|
32
|
+
showIcon
|
|
33
|
+
closable
|
|
34
|
+
onClose={() => setVisible(false)}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
// function to determine alert configuration based on license data
|
|
39
|
+
function resolveLicenseAlert(data) {
|
|
40
|
+
if (!data) return null;
|
|
41
|
+
// destructure relevant fields from license data
|
|
42
|
+
const { status, expiresInDays, isExpiringSoon, gracePeriod } = data;
|
|
43
|
+
|
|
44
|
+
// ===== NOT INSTALLED =====
|
|
45
|
+
if (status === 'NOT_INSTALLED') {
|
|
46
|
+
return {
|
|
47
|
+
type: 'error',
|
|
48
|
+
message: 'License not found',
|
|
49
|
+
description: 'Please install a valid license to continue.',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ===== GRACE PERIOD =====
|
|
54
|
+
if (gracePeriod) {
|
|
55
|
+
return {
|
|
56
|
+
type: 'warning',
|
|
57
|
+
message: 'Grace period mode',
|
|
58
|
+
description: 'License expired. Running in read-only mode.',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ===== EXPIRING SOON =====
|
|
63
|
+
if (status === 'ACTIVE' && isExpiringSoon) {
|
|
64
|
+
let descriptionText = '';
|
|
65
|
+
// customize message based on how soon the license is expiring
|
|
66
|
+
if (expiresInDays === 0) {
|
|
67
|
+
descriptionText = 'Your license will expire today. Please renew immediately.';
|
|
68
|
+
} else {
|
|
69
|
+
descriptionText = `Your license will expire in ${expiresInDays} days. Please plan for renewal.`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
type: 'warning',
|
|
74
|
+
message: 'License expiring soon',
|
|
75
|
+
description: descriptionText,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// ===== NOT INSTALLED =====
|
|
80
|
+
if (status === 'NOT_INSTALLED') {
|
|
81
|
+
return {
|
|
82
|
+
type: 'error',
|
|
83
|
+
message: 'License not found',
|
|
84
|
+
description: 'Please install a valid license to continue.',
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
// =====EXPIRED=====
|
|
88
|
+
if (status === 'EXPIRED') {
|
|
89
|
+
return {
|
|
90
|
+
type: 'error',
|
|
91
|
+
message: 'License expired',
|
|
92
|
+
description: 'Your license has expired. Please renew or install a new license.',
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
@@ -2,136 +2,91 @@
|
|
|
2
2
|
*
|
|
3
3
|
* Global header component
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
import { useContext, useEffect, useRef, useState } from 'react';
|
|
7
|
-
|
|
8
6
|
import { motion, useAnimation } from 'framer-motion';
|
|
9
|
-
|
|
10
7
|
import { boxVariants } from './animations';
|
|
11
|
-
|
|
12
8
|
import { GlobalContext, GlobalProvider } from './../../Store';
|
|
13
|
-
|
|
14
9
|
import { Link, useLocation } from 'react-router-dom';
|
|
15
|
-
|
|
16
10
|
import { Avatar, Input, Tooltip, Typography } from 'antd';
|
|
17
|
-
|
|
18
11
|
import ProgressBar from '../progress-bar/progress-bar'; // Adjust the path as needed
|
|
19
|
-
|
|
20
12
|
import { Button } from '../../elements';
|
|
21
|
-
|
|
22
13
|
import GenericHeader from '../header/generic-header';
|
|
23
|
-
|
|
24
|
-
|
|
25
14
|
import { CustomerServiceOutlined, MenuOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
|
|
26
|
-
|
|
27
15
|
import { Drawer } from 'antd';
|
|
28
|
-
|
|
29
16
|
import { ReloadOutlined, SearchOutlined } from '@ant-design/icons';
|
|
30
|
-
|
|
31
17
|
import SideMenu from './../sidemenu/sidemenu';
|
|
32
|
-
|
|
33
18
|
import './global-header.scss';
|
|
34
|
-
|
|
35
19
|
import LanguageSwitcher from '../language-switcher/language-switcher';
|
|
36
|
-
|
|
37
20
|
import { useTranslation } from 'react-i18next';
|
|
38
|
-
|
|
39
21
|
import SettingsUtil from '../../../utils/settings.utils';
|
|
40
22
|
import SpotlightSearch from '../spotlight-search/spotlight-search.component';
|
|
41
|
-
|
|
23
|
+
import { LicenseAlert } from '../../../components';
|
|
42
24
|
const { Title } = Typography;
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
function GlobalHeaderContent({ loading, appSettings, children, isConnected, history, modules = [], sidemenu = [], reload, meta = {}, licAlert,
|
|
26
|
+
licenseData ,...props }) {
|
|
45
27
|
let location = useLocation();
|
|
46
28
|
// let location = {};
|
|
47
|
-
|
|
48
29
|
const { isMobile, user = { locations: [] }, kiosk, state, settings } = useContext(GlobalContext);
|
|
49
|
-
|
|
50
30
|
const [visible, setVisible] = useState(false);
|
|
51
31
|
const helpDeskSetting = settings?.HELPATR || {};
|
|
52
|
-
|
|
53
32
|
// Variable to handle toggling of menu
|
|
54
33
|
const [collapsed, setCollapsed] = useState(false);
|
|
55
34
|
// varibale handle branch switcher
|
|
56
|
-
|
|
57
35
|
// const [searchModalVisible, setSearchModalVisible] = useState(false);
|
|
58
|
-
|
|
59
36
|
const { globalCustomerHeader = () => {} } = appSettings;
|
|
60
|
-
|
|
61
37
|
const { t, i18n } = useTranslation();
|
|
62
|
-
|
|
63
38
|
const spotlightRef = useRef();
|
|
64
|
-
|
|
65
39
|
useEffect(() => {
|
|
66
40
|
setTimeout(() => {
|
|
67
41
|
i18n.changeLanguage(localStorage.selectedLanguage);
|
|
68
42
|
}, 0);
|
|
69
43
|
}, []);
|
|
70
|
-
|
|
71
44
|
/**
|
|
72
45
|
* Function to handle toggling of menu
|
|
73
46
|
*/
|
|
74
|
-
|
|
75
47
|
const toggleCollapsed = () => {
|
|
76
48
|
setVisible(true);
|
|
77
|
-
|
|
78
49
|
collapsed === true ? setCollapsed(false) : setCollapsed(true);
|
|
79
50
|
};
|
|
80
|
-
|
|
81
51
|
const openSearchModal = () => {
|
|
82
52
|
// input to avoid typing
|
|
83
53
|
SettingsUtil.openSpotlightModal();
|
|
84
54
|
};
|
|
85
|
-
|
|
86
55
|
/**
|
|
87
56
|
* Function to remove toggling on mobile view
|
|
88
57
|
*/
|
|
89
58
|
const hideToggle = () => {
|
|
90
59
|
setVisible(true);
|
|
91
|
-
|
|
92
60
|
setCollapsed(false);
|
|
93
61
|
};
|
|
94
|
-
|
|
95
62
|
/**
|
|
96
63
|
* onClose Function
|
|
97
64
|
*/
|
|
98
|
-
|
|
99
65
|
const onClose = () => {
|
|
100
66
|
setVisible(false);
|
|
101
67
|
};
|
|
102
|
-
|
|
103
68
|
// const { model = {} } = menu;
|
|
104
|
-
|
|
105
69
|
const { model: BaseModel = {}, menu = {} } = meta;
|
|
106
|
-
|
|
107
70
|
const { model = {} } = menu;
|
|
108
|
-
|
|
109
71
|
//Animations//
|
|
110
72
|
const boxControls = useAnimation();
|
|
111
|
-
|
|
112
73
|
async function animate() {
|
|
113
74
|
await boxControls.start('entered');
|
|
114
|
-
|
|
115
75
|
//await boxControls.start("show");
|
|
116
76
|
}
|
|
117
|
-
|
|
118
77
|
useEffect(() => {
|
|
119
78
|
animate();
|
|
120
79
|
}, []);
|
|
121
|
-
|
|
122
80
|
useEffect(() => {}, [state.theme]);
|
|
123
|
-
|
|
124
81
|
return (
|
|
125
82
|
<div
|
|
126
83
|
className={`global-header ${process.env.REACT_APP_THEME} ${isConnected && !kiosk ? 'connected' : ''}`}
|
|
127
84
|
style={{
|
|
128
85
|
// background: state.theme.colors.bodyBackground,
|
|
129
|
-
|
|
130
|
-
height: 10,
|
|
86
|
+
height: 'auto',
|
|
131
87
|
}}
|
|
132
88
|
>
|
|
133
89
|
{/* <MenuOutlined style={{left:'1%',top:'1%', fontSize:18, position:'absolute', zIndex:999}} onClick={showSidebar}/> */}
|
|
134
|
-
|
|
135
90
|
<div className="layout-content">
|
|
136
91
|
<div
|
|
137
92
|
//whileHover="hover"
|
|
@@ -174,7 +129,6 @@ function GlobalHeaderContent({ loading, appSettings, children, isConnected, hist
|
|
|
174
129
|
</Drawer>
|
|
175
130
|
)}
|
|
176
131
|
</div>
|
|
177
|
-
|
|
178
132
|
{/* Right Section of the Component Loader */}
|
|
179
133
|
<div
|
|
180
134
|
className={`right-section ${!collapsed ? 'open' : 'close'} ${kiosk ? 'kioskon' : ''}`}
|
|
@@ -189,11 +143,9 @@ function GlobalHeaderContent({ loading, appSettings, children, isConnected, hist
|
|
|
189
143
|
{/* */}
|
|
190
144
|
<div className="page-header-name">
|
|
191
145
|
<ProgressBar isLoading={loading} />
|
|
192
|
-
|
|
193
146
|
<span type onClick={!isMobile ? toggleCollapsed : hideToggle} className="toggle-box toggle-menu">
|
|
194
147
|
<MenuOutlined />
|
|
195
148
|
</span>
|
|
196
|
-
|
|
197
149
|
{/* Back Button */}
|
|
198
150
|
{location.pathname !== '/' ? (
|
|
199
151
|
<span
|
|
@@ -206,39 +158,30 @@ function GlobalHeaderContent({ loading, appSettings, children, isConnected, hist
|
|
|
206
158
|
</span>
|
|
207
159
|
) : null}
|
|
208
160
|
{/* Back Button Ends */}
|
|
209
|
-
|
|
210
161
|
{location.pathname !== '/' ? (
|
|
211
162
|
<h4 className="menu-caption header-caption" style={{ color: state.theme.colors.headerColor }}>
|
|
212
163
|
{menu.caption}
|
|
213
164
|
</h4>
|
|
214
165
|
) : null}
|
|
215
166
|
</div>
|
|
216
|
-
|
|
217
167
|
{/* Page Menu Actions */}
|
|
218
|
-
|
|
219
168
|
{user.role || user.id ? (
|
|
220
169
|
<div className="page-menu">
|
|
221
170
|
{/* Search Input in header start */}
|
|
222
171
|
{!isMobile && (
|
|
223
172
|
<div>
|
|
224
173
|
<Input placeholder="Search (Shift + F)" prefix={<SearchOutlined />} onClick={openSearchModal} readOnly style={{ width: 250 }} />
|
|
225
|
-
|
|
226
174
|
<SpotlightSearch ref={(elem) => SettingsUtil.registerModal(elem)} props={props} />
|
|
227
175
|
</div>
|
|
228
176
|
)}
|
|
229
177
|
{/* Search Input in header start */}
|
|
230
|
-
|
|
231
178
|
{/** branchswitcher Option */}
|
|
232
179
|
{/* branch switcher controlled with env for matria and nura */}
|
|
233
180
|
{!process.env.REACT_APP_SHOW_BRANCH_SWITCHER ? <div className="branch-switcher">{globalCustomerHeader()}</div> : null}
|
|
234
181
|
{/* <div className="branch-switcher">{globalCustomerHeader()}</div> */}
|
|
235
|
-
|
|
236
182
|
{/* Search Option */}
|
|
237
|
-
|
|
238
183
|
{/* <ModalSearch /> */}
|
|
239
|
-
|
|
240
184
|
{/* Search Option Ends */}
|
|
241
|
-
|
|
242
185
|
{/* Configurator Actions */}
|
|
243
186
|
{user.isAdmin ? (
|
|
244
187
|
<>
|
|
@@ -252,13 +195,9 @@ function GlobalHeaderContent({ loading, appSettings, children, isConnected, hist
|
|
|
252
195
|
</>
|
|
253
196
|
) : null}
|
|
254
197
|
{/* Configurator Actions Ends */}
|
|
255
|
-
|
|
256
198
|
{/* Reload Button */}
|
|
257
|
-
|
|
258
199
|
<Button onClick={reload} icon={<ReloadOutlined />} type="default" size={'small'}></Button>
|
|
259
|
-
|
|
260
200
|
{/* Reload Button Ends */}
|
|
261
|
-
|
|
262
201
|
{/* Help-desk-btn */}
|
|
263
202
|
{helpDeskSetting?.showSupportBtn
|
|
264
203
|
? (() => {
|
|
@@ -277,11 +216,9 @@ function GlobalHeaderContent({ loading, appSettings, children, isConnected, hist
|
|
|
277
216
|
);
|
|
278
217
|
})()
|
|
279
218
|
: null}
|
|
280
|
-
|
|
281
219
|
{/** Switch Languages starts */}
|
|
282
220
|
{process.env.REACT_APP_ENABLE_LANGUAGE_SWITCHER ? <LanguageSwitcher /> : null}
|
|
283
221
|
{/** Switch Languages ends */}
|
|
284
|
-
|
|
285
222
|
{/* User Profile */}
|
|
286
223
|
<div style={{ padding: '10px' }}>
|
|
287
224
|
<ProfileAvatar />
|
|
@@ -290,44 +227,49 @@ function GlobalHeaderContent({ loading, appSettings, children, isConnected, hist
|
|
|
290
227
|
{/* User Profile Ends */}
|
|
291
228
|
</div>
|
|
292
229
|
) : null}
|
|
293
|
-
|
|
294
230
|
{/* Page Menu Actions Ends */}
|
|
295
231
|
</div>
|
|
296
232
|
) : null}
|
|
297
|
-
|
|
298
233
|
{/* The children is rendered */}
|
|
299
234
|
{children}
|
|
300
235
|
{/* The children is rendered */}
|
|
301
236
|
</div>
|
|
302
237
|
{/* Right Section of the Component Loader Ends */}
|
|
303
238
|
</div>
|
|
239
|
+
{licAlert && licenseData && (
|
|
240
|
+
<div
|
|
241
|
+
style={{
|
|
242
|
+
top: 0,
|
|
243
|
+
marginTop: '3rem',
|
|
244
|
+
right: '2%',
|
|
245
|
+
position: 'absolute',
|
|
246
|
+
zIndex: 1001,
|
|
247
|
+
}}
|
|
248
|
+
>
|
|
249
|
+
<LicenseAlert data={licenseData} />
|
|
250
|
+
</div>
|
|
251
|
+
)}
|
|
304
252
|
</div>
|
|
305
253
|
);
|
|
306
254
|
}
|
|
307
|
-
|
|
308
255
|
export default function GlobalHeader(props) {
|
|
309
256
|
const context = useContext(GlobalContext);
|
|
310
|
-
|
|
311
257
|
if (context.dispatch) {
|
|
312
258
|
return <GlobalHeaderContent {...props} />;
|
|
313
259
|
}
|
|
314
|
-
|
|
315
260
|
return (
|
|
316
261
|
<GlobalProvider {...props} appSettings={props.appSettings}>
|
|
317
262
|
<GlobalHeaderContent {...props} />
|
|
318
263
|
</GlobalProvider>
|
|
319
264
|
);
|
|
320
265
|
}
|
|
321
|
-
|
|
322
266
|
/**
|
|
323
267
|
*
|
|
324
268
|
* @returns
|
|
325
269
|
*/
|
|
326
270
|
function ProfileAvatar() {
|
|
327
271
|
const { user = { locations: [] } } = useContext(GlobalContext);
|
|
328
|
-
|
|
329
272
|
useEffect(() => {}, []);
|
|
330
|
-
|
|
331
273
|
return (
|
|
332
274
|
<Link className="profile-avatar" to="/profile">
|
|
333
275
|
{user.photograph ? (
|
|
@@ -337,8 +279,7 @@ function ProfileAvatar() {
|
|
|
337
279
|
) : (
|
|
338
280
|
<Avatar shape="square" size="small" icon={<UserOutlined />} />
|
|
339
281
|
)}
|
|
340
|
-
|
|
341
282
|
{/* {user.name} */}
|
|
342
283
|
</Link>
|
|
343
284
|
);
|
|
344
|
-
}
|
|
285
|
+
}
|
|
@@ -109,7 +109,7 @@ import ConsentComponent from './consent/consent'
|
|
|
109
109
|
import TaskOverviewLegacy from './../models/process/components/task-overview-legacy/task-overview-legacy'
|
|
110
110
|
|
|
111
111
|
import ReportingDashboard from '../../modules/reporting/components/reporting-dashboard/reporting-dashboard';
|
|
112
|
-
|
|
112
|
+
import ReportingTable from '../../modules/reporting/components/reporting-dashboard/reporting-table'
|
|
113
113
|
import ProcessStepsPage from '../../modules/steps/steps'
|
|
114
114
|
export {
|
|
115
115
|
|
|
@@ -198,7 +198,7 @@ export {
|
|
|
198
198
|
TaskOverviewLegacy,
|
|
199
199
|
// WebCamera,
|
|
200
200
|
ConsentComponent,
|
|
201
|
-
|
|
201
|
+
ReportingTable,
|
|
202
202
|
ReportingDashboard,
|
|
203
203
|
ProcessStepsPage
|
|
204
204
|
|