datastake-daf 0.6.733 → 0.6.735
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/dist/components/index.js +6 -6
- package/dist/hooks/index.js +20 -4659
- package/dist/layouts/index.js +6 -6
- package/dist/pages/index.js +66 -40
- package/dist/style/datastake/mapbox-gl.css +330 -0
- package/package.json +1 -1
- package/src/@daf/core/components/DynamicForm/storyConfig.js +192 -264
- package/src/@daf/core/components/Sidenav/Menu.jsx +265 -265
- package/src/@daf/hooks/useWidgetFetch.js +1 -1
- package/src/@daf/pages/dashboards/AllInformation/Locations/columns.js +15 -9
- package/src/@daf/pages/dashboards/AllInformation/Locations/create.jsx +1 -0
- package/src/@daf/pages/dashboards/AllInformation/Locations/index.jsx +6 -5
- package/src/@daf/pages/dashboards/AllInformation/Stakeholders/create.jsx +2 -0
- package/src/@daf/pages/dashboards/AllInformation/Stakeholders/index.jsx +2 -2
- package/src/@daf/pages/dashboards/SupplyChain/components/ChartsContainer/components/Identification/index.js +2 -0
- package/src/@daf/pages/dashboards/SupplyChain/components/TradeRelationships/index.js +1 -1
- package/src/@daf/pages/dashboards/UserDashboard/components/MineSites/index.jsx +3 -0
- package/src/@daf/pages/dashboards/helper.js +6 -5
|
@@ -32,10 +32,10 @@ const LocationsTable = ({
|
|
|
32
32
|
formData = {},
|
|
33
33
|
formValue = {},
|
|
34
34
|
form = {},
|
|
35
|
-
dataOptions = {},
|
|
36
35
|
}) => {
|
|
37
36
|
const [selectOptions, setSelectOptions] = useState();
|
|
38
37
|
const [activeTab, setActiveTab] = useState();
|
|
38
|
+
|
|
39
39
|
const columns = useMemo(() => getColumns({
|
|
40
40
|
t,
|
|
41
41
|
goTo,
|
|
@@ -44,10 +44,9 @@ const LocationsTable = ({
|
|
|
44
44
|
activeTab,
|
|
45
45
|
getRedirectLink,
|
|
46
46
|
theme,
|
|
47
|
-
subject: '
|
|
47
|
+
subject: 'locations',
|
|
48
48
|
data,
|
|
49
|
-
|
|
50
|
-
}), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, dataOptions]);
|
|
49
|
+
}), [t, goTo, user, options, activeTab, getRedirectLink, theme, data]);
|
|
51
50
|
|
|
52
51
|
const breadCrumbs = [];
|
|
53
52
|
|
|
@@ -62,6 +61,8 @@ const LocationsTable = ({
|
|
|
62
61
|
}, 'locations')
|
|
63
62
|
}, [paginationQuery, otherParams, searchParams, activeTab]);
|
|
64
63
|
|
|
64
|
+
console.log({data})
|
|
65
|
+
|
|
65
66
|
const selectFiltersConfig = useMemo(() => {
|
|
66
67
|
return getFiltersConfig({t});
|
|
67
68
|
}, [t]);
|
|
@@ -121,7 +122,7 @@ const LocationsTable = ({
|
|
|
121
122
|
t("affirmations::subject-created-successfully") || m,
|
|
122
123
|
);
|
|
123
124
|
// goTo(`/app/edit/stakeholders/${data.datastakeId}`);
|
|
124
|
-
|
|
125
|
+
goTo('/app/locations')
|
|
125
126
|
}
|
|
126
127
|
}}
|
|
127
128
|
onCancel={onDrawerClose}
|
|
@@ -43,7 +43,7 @@ const StakeholdersTable = ({
|
|
|
43
43
|
activeTab,
|
|
44
44
|
getRedirectLink,
|
|
45
45
|
theme,
|
|
46
|
-
subject: '
|
|
46
|
+
subject: 'stakeholders'
|
|
47
47
|
}), [t, goTo, user, options, activeTab, getRedirectLink, theme]);
|
|
48
48
|
|
|
49
49
|
const breadCrumbs = [];
|
|
@@ -117,7 +117,7 @@ const StakeholdersTable = ({
|
|
|
117
117
|
type,
|
|
118
118
|
t("affirmations::subject-created-successfully") || m,
|
|
119
119
|
);
|
|
120
|
-
goTo(`/app/
|
|
120
|
+
goTo(`/app/stakeholders`);
|
|
121
121
|
}
|
|
122
122
|
}}
|
|
123
123
|
onCancel={onDrawerClose}
|
|
@@ -24,7 +24,7 @@ function TradeRelationships({goTo, t = () => {}, options = {}, hardcodedData = [
|
|
|
24
24
|
|
|
25
25
|
const { data, loading } = useWidgetFetch({config: fetchConfig});
|
|
26
26
|
|
|
27
|
-
const mappedData = mapDataForChainOfCustody(Object.keys(data)?.length > 0 ? data : hardcodedData, options
|
|
27
|
+
const mappedData = mapDataForChainOfCustody(Object.keys(data)?.length > 0 ? data : hardcodedData, options, goTo);
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<Widget
|
|
@@ -64,6 +64,9 @@ function MineSites({
|
|
|
64
64
|
[activeTab, selectedPartners],
|
|
65
65
|
);
|
|
66
66
|
|
|
67
|
+
console.log({activeTab})
|
|
68
|
+
console.log({dataFetchConfig})
|
|
69
|
+
|
|
67
70
|
const { data, loading, setData } = useWidgetFetch({config: dataFetchConfig});
|
|
68
71
|
|
|
69
72
|
const tabs = useMemo(() => getTabs(t), [t]);
|
|
@@ -45,14 +45,15 @@ const mapIcon = (category) => {
|
|
|
45
45
|
const leftBackground = theme.colorPrimary3;
|
|
46
46
|
const rightBackground = theme.colorPrimary6;
|
|
47
47
|
|
|
48
|
-
export const mapDataForChainOfCustody = (data = {}, options =
|
|
48
|
+
export const mapDataForChainOfCustody = (data = {}, options = {}, goTo = () => {}) => {
|
|
49
49
|
const mapChildren = (items, type, parentId, isDirect = true) => {
|
|
50
|
-
return (items ?? []).map((item) =>
|
|
50
|
+
return (items ?? []).map((item) => {
|
|
51
|
+
return {
|
|
51
52
|
id: item.id,
|
|
52
53
|
number: 0,
|
|
53
54
|
name: item.name,
|
|
54
55
|
sources: parentId ? [parentId] : [],
|
|
55
|
-
subTitle: findOptions(item
|
|
56
|
+
subTitle: findOptions(item?.category, options?.categoriesOptions),
|
|
56
57
|
leftIcon: type === "client" ? rightIcon : leftIcon,
|
|
57
58
|
leftBackground: type === "client" ? rightBackground : leftBackground,
|
|
58
59
|
topIcon: mapIcon(item.category),
|
|
@@ -62,14 +63,14 @@ export const mapDataForChainOfCustody = (data = {}, options = [], goTo = () => {
|
|
|
62
63
|
goTo(`/app/partners?datastakeId=${item.id}`);
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
|
-
})
|
|
66
|
+
}});
|
|
66
67
|
};
|
|
67
68
|
|
|
68
69
|
return {
|
|
69
70
|
id: data.id,
|
|
70
71
|
number: 0,
|
|
71
72
|
name: data.name,
|
|
72
|
-
subTitle: findOptions(data
|
|
73
|
+
subTitle: findOptions(data?.category, options?.categoriesOptions),
|
|
73
74
|
leftIcon: middleIcon,
|
|
74
75
|
leftBackground: theme.colorPrimary10,
|
|
75
76
|
topIcon: mapIcon(data.category),
|