datastake-daf 0.6.321 → 0.6.322
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/.env +8 -0
- package/.vscode/settings.json +13 -0
- package/dist/components/index.js +7 -1
- package/package.json +1 -1
- package/src/@daf/core/components/Dashboard/Map/index.jsx +2 -2
- package/src/@daf/core/components/DynamicForm/DynamicForm.stories.js +63 -63
- package/src/@daf/core/components/DynamicForm/storyConfig.js +70 -90
- package/src/@daf/core/components/EditForm/form.jsx +2 -0
- package/src/@daf/core/components/Header/hook.js +2 -0
package/.env
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cSpell.words": ["cukura"],
|
|
3
|
+
"files.autoSave": "afterDelay",
|
|
4
|
+
"editor.wordWrap": "on",
|
|
5
|
+
"editor.autoClosingBrackets": "always",
|
|
6
|
+
"editor.autoClosingComments": "always",
|
|
7
|
+
"editor.autoClosingQuotes": "always",
|
|
8
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
9
|
+
"editor.formatOnPaste": true,
|
|
10
|
+
"editor.formatOnSave": true,
|
|
11
|
+
"notebook.defaultFormatter": "esbenp.prettier-vscode",
|
|
12
|
+
"javascript.format.semicolons": "insert"
|
|
13
|
+
}
|
package/dist/components/index.js
CHANGED
|
@@ -12771,6 +12771,7 @@ const useHeader = _ref => {
|
|
|
12771
12771
|
};
|
|
12772
12772
|
}, []);
|
|
12773
12773
|
const maxWidth = React.useMemo(() => mainContWidth - buttonContWidth - 24, [mainContWidth, buttonContWidth]);
|
|
12774
|
+
console.log(buttonContWidth, mainContWidth, maxWidth);
|
|
12774
12775
|
const renderMainCont = () => /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12775
12776
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12776
12777
|
className: formatClassname(["main-cont flex", className]),
|
|
@@ -19093,7 +19094,11 @@ function Map$3(_ref) {
|
|
|
19093
19094
|
siderTitle = "Mine Description",
|
|
19094
19095
|
renderTooltip = () => [],
|
|
19095
19096
|
renderTooltipTags = () => {},
|
|
19096
|
-
mapConfig = {
|
|
19097
|
+
mapConfig = {
|
|
19098
|
+
maxZoom: 18,
|
|
19099
|
+
center: [13, -15],
|
|
19100
|
+
zoom: 5
|
|
19101
|
+
},
|
|
19097
19102
|
emptyDescriptionText = "No description provided",
|
|
19098
19103
|
tooltipAsText = false,
|
|
19099
19104
|
primaryLink = false,
|
|
@@ -34533,6 +34538,7 @@ const EditForm = _ref => {
|
|
|
34533
34538
|
}, id);
|
|
34534
34539
|
}
|
|
34535
34540
|
};
|
|
34541
|
+
console.log("values", values);
|
|
34536
34542
|
return /*#__PURE__*/jsxRuntime.jsxs(EditProvider, {
|
|
34537
34543
|
t: t,
|
|
34538
34544
|
isReview: isReview,
|
package/package.json
CHANGED
|
@@ -103,7 +103,7 @@ function Map({
|
|
|
103
103
|
siderTitle = "Mine Description",
|
|
104
104
|
renderTooltip = () => [],
|
|
105
105
|
renderTooltipTags = () => {},
|
|
106
|
-
mapConfig = {},
|
|
106
|
+
mapConfig = { maxZoom: 18, center: [13, -15], zoom: 5 },
|
|
107
107
|
emptyDescriptionText = "No description provided",
|
|
108
108
|
tooltipAsText = false,
|
|
109
109
|
primaryLink = false,
|
|
@@ -134,7 +134,7 @@ function Map({
|
|
|
134
134
|
t,
|
|
135
135
|
app,
|
|
136
136
|
renderTooltip,
|
|
137
|
-
|
|
137
|
+
renderTooltipTags,
|
|
138
138
|
onClickLink,
|
|
139
139
|
link,
|
|
140
140
|
mapConfig,
|
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-filename-extension */
|
|
2
|
-
import
|
|
3
|
-
import DynamicForm from
|
|
4
|
-
import ThemeLayout from
|
|
5
|
-
import { Form } from
|
|
6
|
-
import { useCallback, useState } from
|
|
7
|
-
import { storyData } from
|
|
2
|
+
import "./_index.scss";
|
|
3
|
+
import DynamicForm from "./index.jsx";
|
|
4
|
+
import ThemeLayout from "../ThemeLayout";
|
|
5
|
+
import { Form } from "antd";
|
|
6
|
+
import { useCallback, useState } from "react";
|
|
7
|
+
import { storyData } from "./storyConfig.js";
|
|
8
8
|
// import Modal from '../Modal/index';
|
|
9
9
|
// import { Drawer } from 'antd';
|
|
10
10
|
|
|
11
11
|
const EForm = () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const [MainForm] = Form.useForm();
|
|
13
|
+
const [ajaxForms, setAjaxForms] = useState({});
|
|
14
|
+
const [ajaxOptions, setAjaxOptions] = useState({});
|
|
15
|
+
const [open, setOpen] = useState(true);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const changeAjaxForms = useCallback((key, value) => {
|
|
18
|
+
setAjaxForms((prev) => ({ ...prev, [key]: value }));
|
|
19
|
+
}, []);
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const changeAjaxOptions = useCallback((key, value) => {
|
|
22
|
+
setAjaxOptions((prev) => ({ ...prev, [key]: value }));
|
|
23
|
+
}, []);
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
25
|
+
return (
|
|
26
|
+
<div>
|
|
27
|
+
<DynamicForm
|
|
28
|
+
alertErrorsConfig={{
|
|
29
|
+
country: {
|
|
30
|
+
message: "Error Test",
|
|
31
|
+
onClose: () => alert(1),
|
|
32
|
+
},
|
|
33
|
+
}}
|
|
34
|
+
goTo={() => {}}
|
|
35
|
+
ajaxForms={ajaxForms}
|
|
36
|
+
changeAjaxForms={changeAjaxForms}
|
|
37
|
+
ajaxOptions={ajaxOptions}
|
|
38
|
+
user={{ language: "en" }}
|
|
39
|
+
changeAjaxOptions={changeAjaxOptions}
|
|
40
|
+
app="sbg"
|
|
41
|
+
query={null}
|
|
42
|
+
MainForm={MainForm}
|
|
43
|
+
form={storyData.form}
|
|
44
|
+
data={storyData.data}
|
|
45
|
+
getAppHeader={storyData.getAppHeader}
|
|
46
|
+
getApiBaseUrl={storyData.getApiBaseUrl}
|
|
47
|
+
submit={(payload) => {
|
|
48
|
+
console.log("submit", payload);
|
|
49
|
+
setOpen(false);
|
|
50
|
+
}}
|
|
51
|
+
staticWidth="720px"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
56
|
|
|
57
57
|
export default {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
58
|
+
title: "Form/DynamicForm",
|
|
59
|
+
component: DynamicForm,
|
|
60
|
+
tags: ["autodocs"],
|
|
61
|
+
decorators: [
|
|
62
|
+
() => (
|
|
63
|
+
<div style={{ margin: "3em" }}>
|
|
64
|
+
<ThemeLayout>
|
|
65
|
+
<EForm />
|
|
66
|
+
</ThemeLayout>
|
|
67
|
+
</div>
|
|
68
|
+
),
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
71
|
|
|
72
72
|
export const Primary = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
73
|
+
name: "Edit Form",
|
|
74
|
+
args: {},
|
|
75
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const getApiBaseUrl = () => "http://192.168.4.
|
|
1
|
+
const getApiBaseUrl = () => "http://192.168.4.252:3022";
|
|
2
2
|
|
|
3
3
|
const getAppHeader = () => ({
|
|
4
|
-
Application: "
|
|
4
|
+
Application: "nashiriki",
|
|
5
5
|
Language: "en",
|
|
6
6
|
});
|
|
7
7
|
|
|
@@ -12,115 +12,95 @@ export const storyData = {
|
|
|
12
12
|
form: {
|
|
13
13
|
id: "identification",
|
|
14
14
|
position: 1,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
|
|
16
|
+
areaOfInfluence: {
|
|
17
|
+
_id: "68d699bcab72f002b8f04a9e",
|
|
18
|
+
id: "d9db4b4d-a7bb-43d7-bdeb-e64bb38d41d1",
|
|
19
|
+
dataId: "areaOfInfluence",
|
|
19
20
|
section: "identification",
|
|
20
|
-
type: "
|
|
21
|
+
type: "drawTerritory",
|
|
21
22
|
meta: {
|
|
22
|
-
|
|
23
|
+
comment: true,
|
|
23
24
|
notApplicable: false,
|
|
24
25
|
notAvailable: false,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
mandatory: true,
|
|
28
|
-
disableEdit: {
|
|
29
|
-
create: false,
|
|
30
|
-
edit: true,
|
|
31
|
-
},
|
|
26
|
+
mandatory: false,
|
|
27
|
+
group: "identification",
|
|
32
28
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
|
|
30
|
+
position: 6,
|
|
31
|
+
description:
|
|
32
|
+
"The area of influence is the area where actions of this armed group are happening",
|
|
33
|
+
scope: ["armedGroups", "location", "conflictArea"],
|
|
34
|
+
label: "Perimeter",
|
|
35
|
+
createdAt: "2025-09-26T13:48:44.363Z",
|
|
36
|
+
updatedAt: "2025-09-26T13:48:44.363Z",
|
|
38
37
|
__v: 0,
|
|
39
38
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
|
|
40
|
+
locationId: {
|
|
41
|
+
_id: "68d699bcab72f002b8f04ab8",
|
|
42
|
+
id: "956303f0-7a0f-40e1-ba9d-21df5079a833",
|
|
43
|
+
dataId: "locationId",
|
|
44
44
|
section: "identification",
|
|
45
|
-
type: "
|
|
45
|
+
type: "ajaxSelect",
|
|
46
46
|
meta: {
|
|
47
|
-
entity: "Location",
|
|
48
|
-
namespace: "location",
|
|
49
|
-
formScope: "activityMine",
|
|
50
|
-
path: "associatedMine",
|
|
51
|
-
maxRepeat: 1,
|
|
52
47
|
comment: false,
|
|
53
|
-
createUserVersion: false,
|
|
54
|
-
linkOptions: {
|
|
55
|
-
global: true,
|
|
56
|
-
},
|
|
57
48
|
notApplicable: false,
|
|
58
|
-
notAvailable:
|
|
59
|
-
|
|
60
|
-
path: "associatedSubjects",
|
|
61
|
-
nature: "activity",
|
|
62
|
-
},
|
|
63
|
-
ajaxOptionsKey: "id",
|
|
64
|
-
mandatory: true,
|
|
65
|
-
versioning: true,
|
|
66
|
-
disableEdit: {
|
|
67
|
-
create: false,
|
|
68
|
-
edit: true,
|
|
69
|
-
},
|
|
70
|
-
tableKeys: ["datastakeId", "locationId"],
|
|
71
|
-
optionsView: {
|
|
72
|
-
editInputType: "ajaxSelect",
|
|
73
|
-
editInputKey: "locationId",
|
|
74
|
-
onViewInputType: "table",
|
|
75
|
-
},
|
|
76
|
-
application: "sbg",
|
|
77
|
-
noAddNew: true,
|
|
78
|
-
call: 'LOCATION::getOptions({\n "ownAccount": "true",\n "category": "mineSite"\n })::{\n "label": "name",\n "name": "name",\n "value": "_id",\n "datastakeId": "datastakeId",\n "gps": "gps",\n "_id": "_id",\n "id": "id",\n "parent": "parent",\n "administrativeLevel1": "administrativeLevel1",\n "administrativeLevel2": "administrativeLevel2",\n "category":"category",\n "users": "users",\n "country": "country"\n }::["datastakeId", "gps", "administrativeLevel1", "administrativeLevel2", "category","parent", "_id"]',
|
|
79
|
-
},
|
|
80
|
-
position: 2,
|
|
81
|
-
scope: ["modalActivity", "activityInfo", "modalFromMineSection"],
|
|
82
|
-
label: {
|
|
83
|
-
"scope is modalActivity": "Mine",
|
|
84
|
-
"scope not modalActivity": "Associated Mine",
|
|
85
|
-
},
|
|
86
|
-
createdAt: "2025-08-08T15:54:02.839Z",
|
|
87
|
-
updatedAt: "2025-08-08T15:54:02.839Z",
|
|
88
|
-
__v: 0,
|
|
89
|
-
},
|
|
90
|
-
type: {
|
|
91
|
-
_id: "68961d98fb2b209b19efa495",
|
|
92
|
-
id: "8e421077-c542-46c0-a515-151cf2741f7d",
|
|
93
|
-
dataId: "type",
|
|
94
|
-
section: "identification",
|
|
95
|
-
type: "select",
|
|
96
|
-
meta: {
|
|
49
|
+
notAvailable: true,
|
|
50
|
+
application: "nashiriki",
|
|
97
51
|
group: "identification",
|
|
98
|
-
notApplicable: false,
|
|
99
|
-
notAvailable: false,
|
|
100
|
-
comment: false,
|
|
101
|
-
versioning: true,
|
|
102
52
|
mandatory: true,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
53
|
+
onNewSetValueKey: "name",
|
|
54
|
+
store: {
|
|
55
|
+
location: {
|
|
56
|
+
path: "name",
|
|
57
|
+
global: true,
|
|
58
|
+
},
|
|
107
59
|
},
|
|
60
|
+
call: 'LOCATION::getOptions({\n "country": "country",\n "category": "category",\n "administrativeLevel1": "administrativeLevel1",\n "administrativeLevel2": "administrativeLevel2"\n })::{\n "label": "name",\n "value": "_id",\n "datastakeId": "datastakeId",\n "gps": "gps",\n "_id": "_id",\n "parent": "parent",\n "administrativeLevel1": "administrativeLevel1",\n "administrativeLevel2": "administrativeLevel2",\n "category":"category",\n "users": "users",\n "country": "country"\n }::["datastakeId", "gps", "administrativeLevel1", "administrativeLevel2", "category", "parent", "country", "_id"]',
|
|
108
61
|
},
|
|
109
|
-
position:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
62
|
+
position: 5,
|
|
63
|
+
dataLink: {
|
|
64
|
+
entity: "Location",
|
|
65
|
+
createUserVersion: true,
|
|
66
|
+
createNew: true,
|
|
67
|
+
collection: "nashiriki.global_location",
|
|
68
|
+
formNamespace: "location",
|
|
69
|
+
keys: [
|
|
70
|
+
"name",
|
|
71
|
+
"country",
|
|
72
|
+
"category",
|
|
73
|
+
"administrativeLevel1",
|
|
74
|
+
"administrativeLevel2",
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
rules: [
|
|
113
78
|
{
|
|
114
|
-
|
|
115
|
-
|
|
79
|
+
required: true,
|
|
80
|
+
message: "errors::field is required",
|
|
116
81
|
},
|
|
117
82
|
],
|
|
118
|
-
|
|
119
|
-
|
|
83
|
+
scope: [
|
|
84
|
+
"nashirikiOperatorLocation",
|
|
85
|
+
"nashirikiWorkerLocation",
|
|
86
|
+
"modalNashiriki",
|
|
87
|
+
"locationAssociatedVillage",
|
|
88
|
+
"locationAssociatedExportTown",
|
|
89
|
+
"workerPlaceOfBirth",
|
|
90
|
+
"armedGroups",
|
|
91
|
+
"locationSupplierTrade",
|
|
92
|
+
"modal",
|
|
93
|
+
"location",
|
|
94
|
+
"conflictArea",
|
|
95
|
+
],
|
|
96
|
+
label: "Name of the location",
|
|
97
|
+
tableLabel: "Name",
|
|
98
|
+
createdAt: "2025-09-26T13:48:44.502Z",
|
|
99
|
+
updatedAt: "2025-09-26T13:48:44.502Z",
|
|
120
100
|
__v: 0,
|
|
121
101
|
},
|
|
122
102
|
label: "Identification",
|
|
123
|
-
subTitle: "
|
|
103
|
+
subTitle: "Identification",
|
|
124
104
|
},
|
|
125
105
|
},
|
|
126
106
|
data: {
|
|
@@ -150,6 +150,8 @@ export const useHeader = ({
|
|
|
150
150
|
[mainContWidth, buttonContWidth],
|
|
151
151
|
);
|
|
152
152
|
|
|
153
|
+
console.log(buttonContWidth, mainContWidth, maxWidth);
|
|
154
|
+
|
|
153
155
|
const renderMainCont = () => (
|
|
154
156
|
<div>
|
|
155
157
|
<div className={formatClassname(["main-cont flex", className])} ref={mainCont}>
|