ui-soxo-bootstrap-core 2.6.1-dev.19 → 2.6.1-dev.20
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.
|
@@ -17,6 +17,7 @@ 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';
|
|
20
21
|
|
|
21
22
|
const motivatingMessages = [
|
|
22
23
|
'Setting things up for a great start...',
|
|
@@ -59,6 +60,9 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
59
60
|
|
|
60
61
|
const [meta, setMeta] = useState({});
|
|
61
62
|
const [loadingMessage, setLoadingMessage] = useState('');
|
|
63
|
+
const [licenseData, setLicenseData] = useState(null);
|
|
64
|
+
|
|
65
|
+
const [licAlert, setLicAlert] = useState(false);
|
|
62
66
|
// License data state
|
|
63
67
|
|
|
64
68
|
// const [reports, setReports] = useState([]);
|
|
@@ -74,7 +78,20 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
74
78
|
if (process.env.REACT_APP_DISABLEHOMEPAGE) {
|
|
75
79
|
disableHomepage = JSON.parse(process.env.REACT_APP_DISABLEHOMEPAGE);
|
|
76
80
|
}
|
|
77
|
-
|
|
81
|
+
const fetchSummary = async () => {
|
|
82
|
+
try {
|
|
83
|
+
const res = await MenusAPI.getSummary();
|
|
84
|
+
if (res?.data) {
|
|
85
|
+
setLicenseData(res?.data);
|
|
86
|
+
setLicAlert(true);
|
|
87
|
+
} else {
|
|
88
|
+
setLicenseData(null);
|
|
89
|
+
setLicAlert(false);
|
|
90
|
+
}
|
|
91
|
+
} catch (err) {
|
|
92
|
+
console.error(err);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
78
95
|
// useEffect(() => {
|
|
79
96
|
|
|
80
97
|
// // Initialize the menus for the logged in user
|
|
@@ -166,7 +183,7 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
166
183
|
setLoader(true);
|
|
167
184
|
|
|
168
185
|
// setReports(report)
|
|
169
|
-
|
|
186
|
+
fetchSummary();
|
|
170
187
|
const result = await MenusAPI.getMenus(user);
|
|
171
188
|
|
|
172
189
|
// console.log(result);
|
|
@@ -296,6 +313,8 @@ export default function LandingApi({ history, CustomComponents, CustomModels, ap
|
|
|
296
313
|
modules={allModules}
|
|
297
314
|
user={user}
|
|
298
315
|
history={history}
|
|
316
|
+
licenseData={licenseData}
|
|
317
|
+
licAlert={licAlert}
|
|
299
318
|
>
|
|
300
319
|
{loader ? (
|
|
301
320
|
<Card className="skeleton-card">
|
|
@@ -47,7 +47,7 @@ import BorderStyle from 'pdf-lib/cjs/core/annotation/BorderStyle';
|
|
|
47
47
|
import SettingsUtil from '../../../utils/settings.utils';
|
|
48
48
|
import SpotlightSearch from '../spotlight-search/spotlight-search.component';
|
|
49
49
|
import { LicenseAlert } from '../../../components';
|
|
50
|
-
import { MenusAPI } from '../../../models';
|
|
50
|
+
// import { MenusAPI } from '../../../models';
|
|
51
51
|
|
|
52
52
|
const { Title } = Typography;
|
|
53
53
|
|
|
@@ -61,6 +61,8 @@ export default function GlobalHeader({
|
|
|
61
61
|
sidemenu = [],
|
|
62
62
|
reload,
|
|
63
63
|
meta = {},
|
|
64
|
+
licenseData,
|
|
65
|
+
licAlert,
|
|
64
66
|
...props
|
|
65
67
|
}) {
|
|
66
68
|
let location = useLocation();
|
|
@@ -81,26 +83,14 @@ export default function GlobalHeader({
|
|
|
81
83
|
const { t, i18n } = useTranslation();
|
|
82
84
|
const reduceMotion = useReducedMotion();
|
|
83
85
|
const shouldAnimate = !reduceMotion;
|
|
84
|
-
|
|
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
|
-
};
|
|
86
|
+
|
|
97
87
|
const spotlightRef = useRef();
|
|
98
88
|
|
|
99
89
|
useEffect(() => {
|
|
100
90
|
setTimeout(() => {
|
|
101
91
|
i18n.changeLanguage(localStorage.selectedLanguage);
|
|
102
92
|
}, 0);
|
|
103
|
-
fetchSummary();
|
|
93
|
+
// fetchSummary();
|
|
104
94
|
}, []);
|
|
105
95
|
|
|
106
96
|
/**
|
|
@@ -351,7 +341,7 @@ export default function GlobalHeader({
|
|
|
351
341
|
{/* Right Section of the Component Loader Ends */}
|
|
352
342
|
</div>
|
|
353
343
|
</div>
|
|
354
|
-
{licenseData && (
|
|
344
|
+
{licAlert && licenseData && (
|
|
355
345
|
<div
|
|
356
346
|
style={{
|
|
357
347
|
marginTop: '3rem',
|