datastake-daf 0.6.715 → 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 +84 -32
- package/dist/context/index.js +13 -10
- package/dist/hooks/index.js +4659 -23
- package/dist/layouts/index.js +75 -29
- package/dist/pages/index.js +67 -27
- package/dist/services/index.js +13 -10
- package/dist/style/datastake/datastake.css +2 -2
- package/dist/utils/index.js +66 -23
- package/package.json +1 -1
- package/public/assets/images/underDev.svg +7 -0
- package/src/@daf/core/components/AuthForm/index.jsx +7 -1
- package/src/@daf/core/components/Icon/configs/UnderDev.js +26 -11
- package/src/@daf/core/components/Screens/InformationUnavailable/InformationUnavailable.stories.js +0 -1
- package/src/@daf/core/components/Screens/InformationUnavailable/index.jsx +7 -3
- package/src/@daf/core/components/Screens/InformationUnavailable/style.js +2 -2
- 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
|
@@ -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
|
}
|