datastake-daf 0.6.716 → 0.6.718

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.716",
3
+ "version": "0.6.718",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -55,7 +55,13 @@ function AuthForm ({
55
55
  }
56
56
  };
57
57
 
58
- const prev = () => setCurrentStep((prev) => prev - 1);
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 {
@@ -214,6 +214,8 @@ import ArcGis from "./ArcGis";
214
214
  import AppAdmin from "./AppAdmin";
215
215
  import Onboarding from "./Onboarding";
216
216
  import UnderDev from "./UnderDev";
217
+ import userIcon from "./userIcon";
218
+ import partnerIcon from "./partnerIcon";
217
219
 
218
220
  const config = {
219
221
  AppAdmin,
@@ -432,6 +434,8 @@ const config = {
432
434
  Straatos,
433
435
  ArcGis,
434
436
  UnderDev,
437
+ userIcon,
438
+ partnerIcon,
435
439
  };
436
440
 
437
441
  export default config;
@@ -0,0 +1,8 @@
1
+ const config = {
2
+ viewBox: "0 0 18 14",
3
+ children: (
4
+ <path d="M5.08333 2.53462H0.75V8.75H1.50141C2.09639 8.75 2.67622 8.93763 3.15841 9.2862L7.44192 12.3827C7.74723 12.6034 8.15773 12.6105 8.47051 12.4006C8.95317 12.0765 9.00645 11.3867 8.5793 10.9924L6.81667 9.36538L9.68494 11.9601C9.95925 12.2082 10.366 12.2412 10.6767 12.0404C11.0996 11.7672 11.1772 11.1801 10.8398 10.8064L9.15 8.93462L11.4946 11.4923C11.828 11.8561 12.3838 11.9055 12.7762 11.6063C13.2258 11.2635 13.2802 10.607 12.8932 10.1948L11.0167 8.19615L13.3903 10.686C13.711 11.0223 14.2308 11.0702 14.6075 10.7981C15.0685 10.4651 15.1251 9.79991 14.727 9.39379L14.2167 8.87308M16.75 8.57952V2.79983M16.75 8.57952C16.75 8.57952 16.75 5.25112 16.75 2.79983M16.75 8.57952C16.75 8.72136 16.662 8.85066 16.5235 8.91219L15.2216 9.49081C15.0608 9.56228 14.8682 9.52676 14.7494 9.40375L8.66241 3.09692C8.52364 2.95315 8.28848 2.93195 8.1222 3.04823L7.31667 3.61154C6.63455 4.08854 5.73081 4.19895 4.93775 3.90217L4.14065 3.60388C3.96864 3.53951 3.93837 3.32657 4.08656 3.22341L6.64053 1.44562C7.4038 0.914316 8.33376 0.75 9.28973 0.75H9.89529C10.373 0.75 10.8476 0.821816 11.3003 0.962629L16.4777 2.44993C16.6404 2.50054 16.75 2.64134 16.75 2.79983" stroke="#722ED1" strokeWidth="1.5" strokeLinejoin="round"/>
5
+ ),
6
+ };
7
+
8
+ export default config;
@@ -0,0 +1,8 @@
1
+ const config = {
2
+ viewBox: "0 0 19 19",
3
+ children: (
4
+ <path d="M2.41669 17.2645C2.91883 17.4167 3.59708 17.4167 4.75 17.4167H13.4167C14.5696 17.4167 15.2478 17.4167 15.75 17.2645M2.41669 17.2645C2.30902 17.2319 2.20944 17.1923 2.11502 17.1442C1.64462 16.9045 1.26217 16.522 1.02248 16.0516C0.75 15.5169 0.75 14.8168 0.75 13.4167V4.75C0.75 3.34987 0.75 2.6498 1.02248 2.11502C1.26217 1.64462 1.64462 1.26217 2.11502 1.02248C2.6498 0.75 3.34987 0.75 4.75 0.75H13.4167C14.8168 0.75 15.5169 0.75 16.0516 1.02248C16.522 1.26217 16.9045 1.64462 17.1442 2.11502C17.4167 2.6498 17.4167 3.34987 17.4167 4.75V13.4167C17.4167 14.8168 17.4167 15.5169 17.1442 16.0516C16.9045 16.522 16.522 16.9045 16.0516 17.1442C15.9572 17.1923 15.8576 17.2319 15.75 17.2645M2.41669 17.2645C2.41696 16.5901 2.42101 16.2332 2.48072 15.933C2.74374 14.6107 3.7774 13.5771 5.0997 13.314C5.4217 13.25 5.80891 13.25 6.58333 13.25H11.5833C12.3578 13.25 12.745 13.25 13.067 13.314C14.3893 13.5771 15.4229 14.6107 15.686 15.933C15.7457 16.2332 15.7497 16.5901 15.75 17.2645M12.4167 7C12.4167 8.84095 10.9243 10.3333 9.08333 10.3333C7.24238 10.3333 5.75 8.84095 5.75 7C5.75 5.15905 7.24238 3.66667 9.08333 3.66667C10.9243 3.66667 12.4167 5.15905 12.4167 7Z" stroke="#08979C" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
5
+ ),
6
+ };
7
+
8
+ export default config;
@@ -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 = "en",
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 = "en",
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: '/auth/sign-up',
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.apiPost({
68
+ return this.apiGet({
69
69
  url: '/register/confirm',
70
- data: { code },
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: config.language || StorageManager.get('datastakeLng') || 'en',
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
  }