datastake-daf 0.6.716 → 0.6.717
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/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/dist/components/index.js +8 -5
- package/dist/context/index.js +13 -10
- package/dist/hooks/index.js +4659 -23
- package/dist/layouts/index.js +9 -6
- package/dist/pages/index.js +1 -4
- package/dist/services/index.js +13 -10
- package/dist/style/datastake/datastake.css +2 -2
- package/package.json +1 -1
- package/src/@daf/core/components/AuthForm/index.jsx +7 -1
- package/src/@daf/layouts/AuthLayout/components/Navbar/index.jsx +3 -1
- package/src/@daf/layouts/AuthLayout/index.jsx +1 -1
- package/src/@daf/pages/dashboards/UserDashboard/config.js +27 -0
- package/src/@daf/pages/dashboards/UserDashboard/index.jsx +43 -0
- package/src/@daf/services/AuthenticationService.js +7 -3
- package/src/@daf/services/BaseService.js +1 -1
- package/src/@daf/services/helpers/BaseHTTPService.js +0 -3
- package/src/styles/datastake/datastake.css +2 -2
package/dist/layouts/index.js
CHANGED
|
@@ -6794,7 +6794,7 @@ Timeframe.propTypes = {
|
|
|
6794
6794
|
* @returns storage objects
|
|
6795
6795
|
* @class StorageManager
|
|
6796
6796
|
*/
|
|
6797
|
-
class StorageManager {
|
|
6797
|
+
class StorageManager$1 {
|
|
6798
6798
|
/**
|
|
6799
6799
|
* @description Set or update given value in localStorage
|
|
6800
6800
|
* @static
|
|
@@ -6929,11 +6929,11 @@ class StorageManager {
|
|
|
6929
6929
|
const isProxy = () => {
|
|
6930
6930
|
const pathname = window.location.pathname;
|
|
6931
6931
|
if (pathname.includes('/proxy/pme') || pathname.includes('/proxy/cadd')) {
|
|
6932
|
-
return window.opener || !!StorageManager.get('proxy_token');
|
|
6932
|
+
return window.opener || !!StorageManager$1.get('proxy_token');
|
|
6933
6933
|
}
|
|
6934
6934
|
return false;
|
|
6935
6935
|
};
|
|
6936
|
-
const getToken = () => isProxy() ? StorageManager.get('proxy_token') : StorageManager.get('token');
|
|
6936
|
+
const getToken = () => isProxy() ? StorageManager$1.get('proxy_token') : StorageManager$1.get('token');
|
|
6937
6937
|
|
|
6938
6938
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6939
6939
|
|
|
@@ -8360,7 +8360,7 @@ function AppLayout({
|
|
|
8360
8360
|
color: 'white',
|
|
8361
8361
|
height: '30px'
|
|
8362
8362
|
},
|
|
8363
|
-
defaultValue: StorageManager.get('datastakeLng') || 'en',
|
|
8363
|
+
defaultValue: StorageManager$1.get('datastakeLng') || 'en',
|
|
8364
8364
|
bordered: false,
|
|
8365
8365
|
onChange: lng => updateLanguage?.(lng),
|
|
8366
8366
|
popupClassName: formatClassname(['dark-select-popup language-select', appName, theme.customHeaderColor && 'custom']),
|
|
@@ -9035,9 +9035,12 @@ const AuthNavbar = ({
|
|
|
9035
9035
|
showBack = false,
|
|
9036
9036
|
backLabel = "Back",
|
|
9037
9037
|
onBack,
|
|
9038
|
-
defaultValue =
|
|
9038
|
+
defaultValue = StorageManager$1.get('datastakeLng') || 'en',
|
|
9039
9039
|
onClose
|
|
9040
9040
|
}) => {
|
|
9041
|
+
console.log({
|
|
9042
|
+
navbarDefaultValue: defaultValue
|
|
9043
|
+
});
|
|
9041
9044
|
return /*#__PURE__*/jsxRuntime.jsx(style, {
|
|
9042
9045
|
className: formatClassname([typeof onClose === 'function' && 'bordered']),
|
|
9043
9046
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -9522,7 +9525,7 @@ const AuthLayout = ({
|
|
|
9522
9525
|
showBack = false,
|
|
9523
9526
|
onBack,
|
|
9524
9527
|
backLabel = "Back",
|
|
9525
|
-
defaultValue =
|
|
9528
|
+
defaultValue = StorageManager.get('datastakeLng') || 'en'
|
|
9526
9529
|
}) => {
|
|
9527
9530
|
formatClassname(["auth-layout", appName, containerClassName]);
|
|
9528
9531
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
package/dist/pages/index.js
CHANGED
|
@@ -5986,12 +5986,9 @@ class BaseHTTPService {
|
|
|
5986
5986
|
this._axiosInitialized = false;
|
|
5987
5987
|
}
|
|
5988
5988
|
_ensureAxiosInitialized() {
|
|
5989
|
-
console.log('[BaseHTTPService] Checking axios initialization:', this._axiosInitialized);
|
|
5990
5989
|
if (!this._axiosInitialized) {
|
|
5991
|
-
console.log('[BaseHTTPService] Setting up axios...');
|
|
5992
5990
|
this.setupAxios();
|
|
5993
5991
|
this._axiosInitialized = true;
|
|
5994
|
-
console.log('[BaseHTTPService] Axios setup complete!');
|
|
5995
5992
|
}
|
|
5996
5993
|
}
|
|
5997
5994
|
setupAxios() {
|
|
@@ -6316,7 +6313,7 @@ class BaseService extends BaseHTTPService {
|
|
|
6316
6313
|
getHeaders: () => {
|
|
6317
6314
|
const config = getServicesConfig();
|
|
6318
6315
|
return {
|
|
6319
|
-
Language:
|
|
6316
|
+
Language: StorageManager.get('datastakeLng') || 'en',
|
|
6320
6317
|
'ngrok-skip-browser-warning': true,
|
|
6321
6318
|
Application: config.application
|
|
6322
6319
|
};
|
package/dist/services/index.js
CHANGED
|
@@ -241,12 +241,9 @@ class BaseHTTPService {
|
|
|
241
241
|
this._axiosInitialized = false;
|
|
242
242
|
}
|
|
243
243
|
_ensureAxiosInitialized() {
|
|
244
|
-
console.log('[BaseHTTPService] Checking axios initialization:', this._axiosInitialized);
|
|
245
244
|
if (!this._axiosInitialized) {
|
|
246
|
-
console.log('[BaseHTTPService] Setting up axios...');
|
|
247
245
|
this.setupAxios();
|
|
248
246
|
this._axiosInitialized = true;
|
|
249
|
-
console.log('[BaseHTTPService] Axios setup complete!');
|
|
250
247
|
}
|
|
251
248
|
}
|
|
252
249
|
setupAxios() {
|
|
@@ -662,7 +659,7 @@ class BaseService extends BaseHTTPService {
|
|
|
662
659
|
getHeaders: () => {
|
|
663
660
|
const config = getServicesConfig();
|
|
664
661
|
return {
|
|
665
|
-
Language:
|
|
662
|
+
Language: StorageManager$1.get('datastakeLng') || 'en',
|
|
666
663
|
'ngrok-skip-browser-warning': true,
|
|
667
664
|
Application: config.application
|
|
668
665
|
};
|
|
@@ -765,7 +762,7 @@ var AdminService$1 = createLazyService(AdminService);
|
|
|
765
762
|
class AuthenticationService extends BaseService {
|
|
766
763
|
register(form) {
|
|
767
764
|
return this.apiPost({
|
|
768
|
-
url: '/
|
|
765
|
+
url: '/register',
|
|
769
766
|
data: form
|
|
770
767
|
});
|
|
771
768
|
}
|
|
@@ -818,10 +815,10 @@ class AuthenticationService extends BaseService {
|
|
|
818
815
|
});
|
|
819
816
|
}
|
|
820
817
|
verify(code) {
|
|
821
|
-
return this.
|
|
818
|
+
return this.apiGet({
|
|
822
819
|
url: '/register/confirm',
|
|
823
|
-
|
|
824
|
-
code
|
|
820
|
+
params: {
|
|
821
|
+
token: code
|
|
825
822
|
},
|
|
826
823
|
isDaf: true
|
|
827
824
|
});
|
|
@@ -943,13 +940,19 @@ class AuthenticationService extends BaseService {
|
|
|
943
940
|
});
|
|
944
941
|
}
|
|
945
942
|
getFormOptions({
|
|
946
|
-
references = ['countries', 'categoriesOptions', 'subCategoriesOptions', 'locationCategoriesOptions', 'documentationTypesOptions']
|
|
943
|
+
references = ['countries', 'categoriesOptions', 'subCategoriesOptions', 'locationCategoriesOptions', 'documentationTypesOptions'],
|
|
944
|
+
language,
|
|
945
|
+
...params
|
|
947
946
|
}) {
|
|
947
|
+
console.log({
|
|
948
|
+
language
|
|
949
|
+
});
|
|
948
950
|
return this.apiPost({
|
|
949
951
|
url: '/query/form-options',
|
|
950
952
|
isDaf: true,
|
|
951
953
|
data: {
|
|
952
|
-
references
|
|
954
|
+
references,
|
|
955
|
+
language
|
|
953
956
|
}
|
|
954
957
|
});
|
|
955
958
|
}
|
|
@@ -1541,13 +1541,13 @@ ul.ant-menu.ant-menu-dark.ant-menu-root.ant-menu-vertical::-webkit-scrollbar-thu
|
|
|
1541
1541
|
color: var(--nested-sidenav-text-color, --custom-sidenav-text-color, white) !important;
|
|
1542
1542
|
}
|
|
1543
1543
|
|
|
1544
|
-
.components-layout:not(.nested) .sidenav-sider:not(.custom) .sidenav-cont .menus-cont.not-collapsed .sidemenu-cont .ant-menu.ant-menu-root.ant-menu-inline.ant-menu-dark
|
|
1544
|
+
.components-layout:not(.nested) .sidenav-sider:not(.custom):not(.straatos) .sidenav-cont .menus-cont.not-collapsed .sidemenu-cont .ant-menu.ant-menu-root.ant-menu-inline.ant-menu-dark
|
|
1545
1545
|
.ant-menu-item:not(.ant-menu-item-selected):not(.ant-menu-item-disabled) svg path
|
|
1546
1546
|
{
|
|
1547
1547
|
stroke: #ffffff !important;
|
|
1548
1548
|
}
|
|
1549
1549
|
|
|
1550
|
-
.components-layout:not(.nested) .sidenav-sider:not(.custom) .sidenav-cont .menus-cont.not-collapsed .sidemenu-cont .ant-menu.ant-menu-root.ant-menu-inline.ant-menu-dark
|
|
1550
|
+
.components-layout:not(.nested) .sidenav-sider:not(.custom):not(.straatos) .sidenav-cont .menus-cont.not-collapsed .sidemenu-cont .ant-menu.ant-menu-root.ant-menu-inline.ant-menu-dark
|
|
1551
1551
|
.ant-menu-item:not(.ant-menu-item-selected):not(.ant-menu-item-disabled) .ant-menu-title-content {
|
|
1552
1552
|
color: #ffffff !important;
|
|
1553
1553
|
}
|
package/package.json
CHANGED
|
@@ -55,7 +55,13 @@ function AuthForm ({
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const prev = () =>
|
|
58
|
+
const prev = () => {
|
|
59
|
+
// Save current step's values before going back (without validation)
|
|
60
|
+
const fieldNames = currentFields.map((f) => f.name);
|
|
61
|
+
const currentValues = formInstance.getFieldsValue(fieldNames);
|
|
62
|
+
setAllFormValues((prev) => ({ ...prev, ...currentValues }));
|
|
63
|
+
setCurrentStep((prev) => prev - 1);
|
|
64
|
+
};
|
|
59
65
|
|
|
60
66
|
const handleSubmit = async (values) => {
|
|
61
67
|
try {
|
|
@@ -5,6 +5,7 @@ import Style, { GlobalNavbarStyles } from './style';
|
|
|
5
5
|
import { languages } from "./config";
|
|
6
6
|
import { Select } from "../Select/index.jsx";
|
|
7
7
|
import CustomIcon from "../../../../core/components/Icon/CustomIcon.jsx";
|
|
8
|
+
import { StorageManager } from "../../../../../helpers/StorageManager.js";
|
|
8
9
|
|
|
9
10
|
const AuthNavbar = ({
|
|
10
11
|
logo,
|
|
@@ -19,9 +20,10 @@ const AuthNavbar = ({
|
|
|
19
20
|
showBack = false,
|
|
20
21
|
backLabel = "Back",
|
|
21
22
|
onBack,
|
|
22
|
-
defaultValue =
|
|
23
|
+
defaultValue = StorageManager.get('datastakeLng') || 'en',
|
|
23
24
|
onClose
|
|
24
25
|
}) => {
|
|
26
|
+
console.log({navbarDefaultValue: defaultValue})
|
|
25
27
|
return (
|
|
26
28
|
<Style className={formatClassname([typeof onClose === 'function' && 'bordered'])}>
|
|
27
29
|
<div className="d-navbar flex-c jus-c">
|
|
@@ -23,7 +23,7 @@ const AuthLayout = ({
|
|
|
23
23
|
showBack = false,
|
|
24
24
|
onBack,
|
|
25
25
|
backLabel = "Back",
|
|
26
|
-
defaultValue =
|
|
26
|
+
defaultValue = StorageManager.get('datastakeLng') || 'en',
|
|
27
27
|
}) => {
|
|
28
28
|
const Wrapper = StyleComponent || "div";
|
|
29
29
|
const wrapperClassName = formatClassname([
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const getActionWidgetsConfig = ({ goTo, getRedirectLink, APP, t }) => [
|
|
2
|
+
...(APP === 'nashiriki' ? [{
|
|
3
|
+
icon: "MineSite",
|
|
4
|
+
title: t("nashiriki::create-mine-site"),
|
|
5
|
+
onClick: () => goTo(getRedirectLink("/app/scl?create=true")),
|
|
6
|
+
}] : null),
|
|
7
|
+
{
|
|
8
|
+
icon: "FileEdit",
|
|
9
|
+
title: t("nashiriki::report-activity"),
|
|
10
|
+
onClick: () => goTo(getRedirectLink("/app/corrective-actions?create=true")),
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
icon: "ReportIncidents",
|
|
14
|
+
title: t("nashiriki::report-incident"),
|
|
15
|
+
onClick: () => goTo(getRedirectLink("/app/incident?create=true")),
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
icon: "Search",
|
|
19
|
+
title: t("nashiriki::find-information"),
|
|
20
|
+
onClick: () => goTo(getRedirectLink("/app/find-information")),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
icon: "Share",
|
|
24
|
+
title: t("nashiriki::share-information"),
|
|
25
|
+
onClick: () => goTo(getRedirectLink("/app/partners")),
|
|
26
|
+
},
|
|
27
|
+
];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useMemo } from 'react'
|
|
2
|
+
import { getActionWidgetsConfig } from './config'
|
|
3
|
+
import ActionWidget from '../../../core/components/Dashboard/Widget/ActionWidget/index.jsx'
|
|
4
|
+
import Header from '../../../core/components/Header/index.jsx'
|
|
5
|
+
import DashboardLayout from '../../../core/components/Dashboard/DashboardLayout/index.jsx'
|
|
6
|
+
|
|
7
|
+
function UserDashboard({
|
|
8
|
+
t = () => {},
|
|
9
|
+
goTo = () => {},
|
|
10
|
+
getRedirectLink = () => {},
|
|
11
|
+
APP,
|
|
12
|
+
}) {
|
|
13
|
+
|
|
14
|
+
const actionsWidgetsConfig = useMemo(
|
|
15
|
+
() => getActionWidgetsConfig({ goTo, getRedirectLink, APP, t }),
|
|
16
|
+
[t, getRedirectLink, APP, t],
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<DashboardLayout
|
|
21
|
+
header={
|
|
22
|
+
<Header
|
|
23
|
+
title={t('Dashboard Title')}
|
|
24
|
+
/>
|
|
25
|
+
}
|
|
26
|
+
>
|
|
27
|
+
<section>
|
|
28
|
+
{actionsWidgetsConfig.map((conf) => (
|
|
29
|
+
<ActionWidget
|
|
30
|
+
key={conf.title}
|
|
31
|
+
icon={conf.icon}
|
|
32
|
+
title={t(conf.title)}
|
|
33
|
+
onClick={conf.onClick}
|
|
34
|
+
disabled={conf.disabled}
|
|
35
|
+
/>
|
|
36
|
+
))}
|
|
37
|
+
</section>
|
|
38
|
+
|
|
39
|
+
</DashboardLayout>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default UserDashboard
|
|
@@ -4,7 +4,7 @@ import { createLazyService } from "./helpers/LazyService.js";
|
|
|
4
4
|
class AuthenticationService extends BaseService {
|
|
5
5
|
register(form) {
|
|
6
6
|
return this.apiPost({
|
|
7
|
-
url: '/
|
|
7
|
+
url: '/register',
|
|
8
8
|
data: form,
|
|
9
9
|
});
|
|
10
10
|
}
|
|
@@ -65,9 +65,9 @@ class AuthenticationService extends BaseService {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
verify(code) {
|
|
68
|
-
return this.
|
|
68
|
+
return this.apiGet({
|
|
69
69
|
url: '/register/confirm',
|
|
70
|
-
|
|
70
|
+
params: {token: code},
|
|
71
71
|
isDaf: true,
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -210,12 +210,16 @@ class AuthenticationService extends BaseService {
|
|
|
210
210
|
'locationCategoriesOptions',
|
|
211
211
|
'documentationTypesOptions'
|
|
212
212
|
],
|
|
213
|
+
language,
|
|
214
|
+
...params
|
|
213
215
|
}) {
|
|
216
|
+
console.log({language})
|
|
214
217
|
return this.apiPost({
|
|
215
218
|
url: '/query/form-options',
|
|
216
219
|
isDaf: true,
|
|
217
220
|
data: {
|
|
218
221
|
references,
|
|
222
|
+
language
|
|
219
223
|
},
|
|
220
224
|
});
|
|
221
225
|
}
|
|
@@ -36,7 +36,7 @@ export class BaseService extends BaseHTTPService {
|
|
|
36
36
|
getHeaders: () => {
|
|
37
37
|
const config = getServicesConfig();
|
|
38
38
|
return {
|
|
39
|
-
Language:
|
|
39
|
+
Language: StorageManager.get('datastakeLng') || 'en',
|
|
40
40
|
'ngrok-skip-browser-warning': true,
|
|
41
41
|
Application: config.application,
|
|
42
42
|
};
|
|
@@ -54,12 +54,9 @@ export class BaseHTTPService {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
_ensureAxiosInitialized() {
|
|
57
|
-
console.log('[BaseHTTPService] Checking axios initialization:', this._axiosInitialized);
|
|
58
57
|
if (!this._axiosInitialized) {
|
|
59
|
-
console.log('[BaseHTTPService] Setting up axios...');
|
|
60
58
|
this.setupAxios();
|
|
61
59
|
this._axiosInitialized = true;
|
|
62
|
-
console.log('[BaseHTTPService] Axios setup complete!');
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
62
|
|
|
@@ -1541,13 +1541,13 @@ ul.ant-menu.ant-menu-dark.ant-menu-root.ant-menu-vertical::-webkit-scrollbar-thu
|
|
|
1541
1541
|
color: var(--nested-sidenav-text-color, --custom-sidenav-text-color, white) !important;
|
|
1542
1542
|
}
|
|
1543
1543
|
|
|
1544
|
-
.components-layout:not(.nested) .sidenav-sider:not(.custom) .sidenav-cont .menus-cont.not-collapsed .sidemenu-cont .ant-menu.ant-menu-root.ant-menu-inline.ant-menu-dark
|
|
1544
|
+
.components-layout:not(.nested) .sidenav-sider:not(.custom):not(.straatos) .sidenav-cont .menus-cont.not-collapsed .sidemenu-cont .ant-menu.ant-menu-root.ant-menu-inline.ant-menu-dark
|
|
1545
1545
|
.ant-menu-item:not(.ant-menu-item-selected):not(.ant-menu-item-disabled) svg path
|
|
1546
1546
|
{
|
|
1547
1547
|
stroke: #ffffff !important;
|
|
1548
1548
|
}
|
|
1549
1549
|
|
|
1550
|
-
.components-layout:not(.nested) .sidenav-sider:not(.custom) .sidenav-cont .menus-cont.not-collapsed .sidemenu-cont .ant-menu.ant-menu-root.ant-menu-inline.ant-menu-dark
|
|
1550
|
+
.components-layout:not(.nested) .sidenav-sider:not(.custom):not(.straatos) .sidenav-cont .menus-cont.not-collapsed .sidemenu-cont .ant-menu.ant-menu-root.ant-menu-inline.ant-menu-dark
|
|
1551
1551
|
.ant-menu-item:not(.ant-menu-item-selected):not(.ant-menu-item-disabled) .ant-menu-title-content {
|
|
1552
1552
|
color: #ffffff !important;
|
|
1553
1553
|
}
|