ui-soxo-bootstrap-core 2.6.46 → 2.6.48

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.
@@ -7,6 +7,8 @@ import RootApplicationAPI from './root-application-api/root-application-api';
7
7
  import { HomePageAPI } from '../modules';
8
8
 
9
9
  import { ExternalWindow } from './external-window/external-window';
10
- import LicenseAlert from './license-management/license-alert';
10
+ // import LicenseAlert from './license-management/license-alert';
11
11
 
12
- export { LandingAPI, RootApplicationAPI, ExtraInfoDetail, HomePageAPI, ExternalWindow, LicenseAlert };
12
+ export { LandingAPI, RootApplicationAPI, ExtraInfoDetail, HomePageAPI, ExternalWindow,
13
+ // LicenseAlert
14
+ };
@@ -58,14 +58,28 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
58
58
 
59
59
  const [meta, setMeta] = useState({});
60
60
  const [loadingMessage, setLoadingMessage] = useState('');
61
- const [licenseData, setLicenseData] = useState(null);
62
- const [licAlert, setLicAlert] = useState(false);
61
+ // const [licenseData, setLicenseData] = useState(null);
62
+ // const [licAlert, setLicAlert] = useState(false);
63
63
 
64
64
  // const [reports, setReports] = useState([]);
65
65
 
66
66
  var config = {};
67
67
 
68
-
68
+ // //fetch license summary
69
+ // const fetchSummary = async () => {
70
+ // try {
71
+ // const res = await MenusAPI.getSummary();
72
+ // if (res?.data) {
73
+ // setLicenseData(res?.data);
74
+ // setLicAlert(true);
75
+ // } else {
76
+ // setLicenseData(null);
77
+ // setLicAlert(false);
78
+ // }
79
+ // } catch (err) {
80
+ // console.error(err);
81
+ // }
82
+ // };
69
83
 
70
84
  // Variable decides the control of homepage
71
85
  // #TODO This is a temporary fix - Homemage
@@ -126,20 +140,20 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
126
140
  if (dbPtr) localStorage.setItem('db_ptr', dbPtr);
127
141
  };
128
142
 
129
- const fetchSummary = async () => {
130
- try {
131
- const res = await MenusAPI.getSummary();
132
- if (res?.data) {
133
- setLicenseData(res?.data);
134
- setLicAlert(true);
135
- } else {
136
- setLicenseData(null);
137
- setLicAlert(false);
138
- }
139
- } catch (err) {
140
- console.error(err);
141
- }
142
- };
143
+ // const fetchSummary = async () => {
144
+ // try {
145
+ // const res = await MenusAPI.getSummary();
146
+ // if (res?.data) {
147
+ // setLicenseData(res?.data);
148
+ // setLicAlert(true);
149
+ // } else {
150
+ // setLicenseData(null);
151
+ // setLicAlert(false);
152
+ // }
153
+ // } catch (err) {
154
+ // console.error(err);
155
+ // }
156
+ // };
143
157
  // useEffect(() => {
144
158
 
145
159
  // // Initialize the menus for the logged in user
@@ -271,7 +285,7 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
271
285
 
272
286
  await loadMenus(report);
273
287
  // fetch license summary
274
- fetchSummary();
288
+ // fetchSummary();
275
289
  }
276
290
 
277
291
  // const keyMap = {
@@ -293,7 +307,7 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
293
307
  setLoader(true);
294
308
 
295
309
  // setReports(report)
296
- fetchSummary();
310
+ // fetchSummary();
297
311
  const result = await MenusAPI.getMenus(user);
298
312
 
299
313
  // console.log(result);
@@ -423,8 +437,8 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
423
437
  modules={allModules}
424
438
  user={user}
425
439
  history={history}
426
- licenseData={licenseData}
427
- licAlert={licAlert}
440
+ // licenseData={licenseData}
441
+ // licAlert={licAlert}
428
442
  >
429
443
  {loader ? (
430
444
  <Card className="skeleton-card">
@@ -1,97 +1,97 @@
1
- import { Alert } from 'antd';
2
- import React, { useState, useEffect } from 'react';
1
+ // import { Alert } from 'antd';
2
+ // import React, { useState, useEffect } from 'react';
3
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);
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
13
 
14
- const timer = setTimeout(() => {
15
- setVisible(false);
16
- }, 10000); // 10 seconds
14
+ // const timer = setTimeout(() => {
15
+ // setVisible(false);
16
+ // }, 10000); // 10 seconds
17
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;
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
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;
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
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
- }
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
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
- }
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
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
- }
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
71
 
72
- return {
73
- type: 'warning',
74
- message: 'License expiring soon',
75
- description: descriptionText,
76
- };
77
- }
72
+ // return {
73
+ // type: 'warning',
74
+ // message: 'License expiring soon',
75
+ // description: descriptionText,
76
+ // };
77
+ // }
78
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
- }
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
95
 
96
- return null;
97
- }
96
+ // return null;
97
+ // }
@@ -20,11 +20,13 @@ import LanguageSwitcher from '../language-switcher/language-switcher';
20
20
  import { useTranslation } from 'react-i18next';
21
21
  import SettingsUtil from '../../../utils/settings.utils';
22
22
  import SpotlightSearch from '../spotlight-search/spotlight-search.component';
23
- import LicenseAlert from '../../../components/license-management/license-alert';
23
+ // import LicenseAlert from '../../../components/license-management/license-alert';
24
24
 
25
25
  const { Title } = Typography;
26
- function GlobalHeaderContent({ loading, appSettings, children, isConnected, history, modules = [], sidemenu = [], reload, meta = {}, licAlert,
27
- licenseData,...props }) {
26
+ function GlobalHeaderContent({ loading, appSettings, children, isConnected, history, modules = [], sidemenu = [], reload, meta = {},
27
+ // licAlert,
28
+ // licenseData,
29
+ ...props }) {
28
30
  let location = useLocation();
29
31
  // let location = {};
30
32
  const { isMobile, user = { locations: [] }, kiosk, state, settings } = useContext(GlobalContext);
@@ -239,19 +241,22 @@ function GlobalHeaderContent({ loading, appSettings, children, isConnected, hist
239
241
  {/* Right Section of the Component Loader Ends */}
240
242
  </div>
241
243
  </div>
242
- {licAlert && licenseData && (
243
- <div
244
- style={{
245
- top: 0,
246
- marginTop: '3rem',
247
- right: '2%',
248
- position: 'absolute',
249
- zIndex: 1008,
250
- }}
251
- >
252
- <LicenseAlert data={licenseData} />
253
- </div>
254
- )}
244
+
245
+
246
+
247
+ {/* {licAlert && licenseData && ( */}
248
+ {/* // <div
249
+ // style={{
250
+ // top: 0,
251
+ // marginTop: '3rem',
252
+ // right: '2%',
253
+ // position: 'absolute',
254
+ // zIndex: 1008,
255
+ // }}
256
+ // >
257
+ // <LicenseAlert data={licenseData} />
258
+ // </div>
259
+ )} */}
255
260
  </>
256
261
  );
257
262
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-soxo-bootstrap-core",
3
- "version": "2.6.46",
3
+ "version": "2.6.48",
4
4
  "description": "All the Core Components for you to start",
5
5
  "keywords": [
6
6
  "all in one"