datastake-daf 0.6.793 → 0.6.795
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 +56 -36
- package/dist/pages/index.js +2045 -3246
- package/dist/utils/index.js +3 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Dashboard/Map/hook.js +25 -1
- package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/index.jsx +1 -1
- package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/columns.js +0 -1
- package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/columns.js +3 -2
- package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/index.jsx +13 -4
- package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +22 -20
- package/src/@daf/pages/Events/Activities/columns.js +1 -1
- package/src/@daf/pages/Events/Activities/config.js +23 -30
- package/src/@daf/pages/Events/Incidents/columns.js +1 -1
- package/src/@daf/pages/Events/Incidents/config.js +23 -30
- package/src/@daf/pages/Events/config.js +7 -7
- package/src/@daf/pages/Locations/MineSite/columns.js +3 -3
- package/src/@daf/pages/Locations/MineSite/config.js +20 -14
- package/src/@daf/pages/Locations/config.js +3 -3
- package/src/@daf/pages/Stakeholders/Operators/columns.js +2 -2
- package/src/@daf/pages/Stakeholders/Operators/config.js +9 -16
- package/src/@daf/pages/Stakeholders/Workers/columns.js +1 -1
- package/src/@daf/pages/Stakeholders/Workers/config.js +23 -29
- package/src/@daf/pages/Stakeholders/config.js +3 -3
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/helper.js +1 -1
- package/src/@daf/pages/TablePage/helper.js +17 -1
- package/src/@daf/pages/TablePage/hook.js +3 -1
- package/src/@daf/pages/TablePage/index.jsx +8 -6
- package/src/@daf/pages/View/index.jsx +4 -2
- package/src/@daf/utils/filters.js +13 -0
- package/src/constants/locales/en/translation.js +1 -0
- package/src/constants/locales/fr/translation.js +1 -0
- package/src/constants/locales/sp/translation.js +1 -0
- package/src/pages.js +1 -10
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getStatusOptions } from '../../../utils/filters';
|
|
2
|
+
|
|
1
3
|
export const getFiltersConfig = ({t}) => {
|
|
2
4
|
return {
|
|
3
5
|
country: {
|
|
@@ -81,15 +83,15 @@ export const getFiltersConfig = ({t}) => {
|
|
|
81
83
|
getLabel: (option) => option.label,
|
|
82
84
|
getValue: (option) => option.value,
|
|
83
85
|
},
|
|
84
|
-
positionInTheMineralSupplyChain: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
86
|
+
// positionInTheMineralSupplyChain: {
|
|
87
|
+
// type: 'select',
|
|
88
|
+
// label: 'Position',
|
|
89
|
+
// placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
|
|
90
|
+
// style: { flex: 1 },
|
|
91
|
+
// labelStyle: { flex: 1 },
|
|
92
|
+
// getLabel: (option) => option.label,
|
|
93
|
+
// getValue: (option) => option.value,
|
|
94
|
+
// },
|
|
93
95
|
status: {
|
|
94
96
|
type: "select",
|
|
95
97
|
label: "Status",
|
|
@@ -104,37 +106,29 @@ export const getFiltersConfig = ({t}) => {
|
|
|
104
106
|
|
|
105
107
|
export const getFilterOptions = (options, t) => {
|
|
106
108
|
const {
|
|
107
|
-
statusOptions
|
|
108
|
-
categoryOptions
|
|
109
|
-
countries
|
|
110
|
-
subCategory
|
|
111
|
-
activityAtSiteOptions
|
|
109
|
+
statusOptions,
|
|
110
|
+
categoryOptions,
|
|
111
|
+
countries,
|
|
112
|
+
subCategory,
|
|
113
|
+
activityAtSiteOptions,
|
|
112
114
|
stakeholderCategoryOptions,
|
|
113
115
|
stakeholderSubCategoriesOptions,
|
|
114
116
|
administrativeLevel1,
|
|
115
117
|
administrativeLevel2,
|
|
116
118
|
positionInMineralSupplyChainOptions,
|
|
117
119
|
subCategoriesOptions,
|
|
120
|
+
activityAtSite,
|
|
118
121
|
} = options || {};
|
|
119
122
|
|
|
120
123
|
const _default = {
|
|
121
|
-
status: [
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
value: "private",
|
|
128
|
-
label: t("Private"),
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
category: stakeholderCategoryOptions || categoryOptions,
|
|
132
|
-
country: countries,
|
|
133
|
-
subCategory: subCategoriesOptions,
|
|
134
|
-
activity: activityAtSiteOptions,
|
|
124
|
+
status: getStatusOptions(t) || [],
|
|
125
|
+
// category: stakeholderCategoryOptions || categoryOptions || [],
|
|
126
|
+
country: countries || [],
|
|
127
|
+
// subCategory: subCategoriesOptions || [],
|
|
128
|
+
activity: activityAtSiteOptions || activityAtSite || [],
|
|
135
129
|
administrativeLevel1,
|
|
136
130
|
administrativeLevel2,
|
|
137
|
-
positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions,
|
|
131
|
+
// positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions,
|
|
138
132
|
}
|
|
139
133
|
|
|
140
134
|
return _default;
|
|
@@ -21,10 +21,10 @@ export const getFiltersConfig = ({t}) => {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export const getFilterOptions = (options, t) => {
|
|
24
|
-
const { countries
|
|
24
|
+
const { countries, category, categoriesOptions } = options || {};
|
|
25
25
|
return {
|
|
26
|
-
country: countries,
|
|
27
|
-
category: categoriesOptions || category,
|
|
26
|
+
country: countries || [],
|
|
27
|
+
category: categoriesOptions || category || [],
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -90,7 +90,7 @@ export const mapItem = (data, options, goTo, getRedirectLink, operatorData = {},
|
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
return goTo(
|
|
93
|
-
getRedirectLink(`/app
|
|
93
|
+
getRedirectLink(`/app/operator-summary/${data.datastakeId}`),
|
|
94
94
|
);
|
|
95
95
|
},
|
|
96
96
|
}
|
|
@@ -58,7 +58,9 @@ import {
|
|
|
58
58
|
getFiltersConfig as getFiltersConfigProductionSites,
|
|
59
59
|
getFilterOptions as getFilterOptionsProductionSites,
|
|
60
60
|
formConfig as formConfigProductionSites,
|
|
61
|
-
viewConfig as viewConfigProductionSites
|
|
61
|
+
viewConfig as viewConfigProductionSites,
|
|
62
|
+
sclFormConfig as sclFormConfigProductionSites,
|
|
63
|
+
sclViewConfig as sclViewConfigProductionSites
|
|
62
64
|
} from '../Locations/MineSite/config.js';
|
|
63
65
|
import { getColumns as getColumnsProductionSites } from "../Locations/MineSite/columns.js";
|
|
64
66
|
|
|
@@ -106,6 +108,13 @@ export const FILTER_REGISTRY = {
|
|
|
106
108
|
formConfig: formConfigActivities,
|
|
107
109
|
viewConfig: viewConfigActivities,
|
|
108
110
|
columns: getColumnsActivities,
|
|
111
|
+
},
|
|
112
|
+
'corrective-actions': {
|
|
113
|
+
config: getFiltersConfigActivities,
|
|
114
|
+
options: getFilterOptionsActivities,
|
|
115
|
+
formConfig: formConfigActivities,
|
|
116
|
+
viewConfig: viewConfigActivities,
|
|
117
|
+
columns: getColumnsActivities,
|
|
109
118
|
},
|
|
110
119
|
incidents: {
|
|
111
120
|
config: getFiltersConfigIncidents,
|
|
@@ -127,6 +136,13 @@ export const FILTER_REGISTRY = {
|
|
|
127
136
|
formConfig: formConfigProductionSites,
|
|
128
137
|
viewConfig: viewConfigProductionSites,
|
|
129
138
|
columns: getColumnsProductionSites,
|
|
139
|
+
},
|
|
140
|
+
scl: {
|
|
141
|
+
config: getFiltersConfigProductionSites,
|
|
142
|
+
options: getFilterOptionsProductionSites,
|
|
143
|
+
formConfig: sclFormConfigProductionSites,
|
|
144
|
+
viewConfig: sclViewConfigProductionSites,
|
|
145
|
+
columns: getColumnsProductionSites,
|
|
130
146
|
},
|
|
131
147
|
documents: {
|
|
132
148
|
config: getFilterConfigDocuments,
|
|
@@ -56,6 +56,7 @@ export const useTablePage = ({
|
|
|
56
56
|
data,
|
|
57
57
|
applications,
|
|
58
58
|
subjectClear,
|
|
59
|
+
APP,
|
|
59
60
|
}) => {
|
|
60
61
|
const [selectOptions, setSelectOptions] = useState();
|
|
61
62
|
const [activeTab, setActiveTab] = useState("own");
|
|
@@ -80,8 +81,9 @@ export const useTablePage = ({
|
|
|
80
81
|
subject,
|
|
81
82
|
data,
|
|
82
83
|
applications,
|
|
84
|
+
APP,
|
|
83
85
|
}),
|
|
84
|
-
[t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications, subject, getColumns]
|
|
86
|
+
[t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications, subject, getColumns, APP]
|
|
85
87
|
);
|
|
86
88
|
|
|
87
89
|
const selectFiltersConfig = useMemo(() =>
|
|
@@ -29,6 +29,7 @@ const TablePage = ({
|
|
|
29
29
|
formValue: {},
|
|
30
30
|
form: {},
|
|
31
31
|
},
|
|
32
|
+
headerInfo = {},
|
|
32
33
|
defaultValues = {},
|
|
33
34
|
extendingFilters = {},
|
|
34
35
|
getData = () => {},
|
|
@@ -71,12 +72,13 @@ const TablePage = ({
|
|
|
71
72
|
data,
|
|
72
73
|
applications,
|
|
73
74
|
subjectClear,
|
|
75
|
+
APP,
|
|
74
76
|
});
|
|
75
77
|
|
|
76
78
|
return (
|
|
77
79
|
<TablePageWithTabs
|
|
78
80
|
t={t}
|
|
79
|
-
title={t(viewConfig?.title || "")}
|
|
81
|
+
title={t(headerInfo?.title || viewConfig?.title || "")}
|
|
80
82
|
breadCrumbs={breadcrumbs}
|
|
81
83
|
location={location}
|
|
82
84
|
loading={loading}
|
|
@@ -95,7 +97,7 @@ const TablePage = ({
|
|
|
95
97
|
view={subject}
|
|
96
98
|
getActiveTab={handleActiveTabChange}
|
|
97
99
|
onDownload={onDownload && typeof onDownload === 'function' ? onDownload : undefined}
|
|
98
|
-
drawerTitle={t(viewConfig?.createTitle || "")}
|
|
100
|
+
drawerTitle={t(headerInfo?.createTitle || viewConfig?.createTitle || "")}
|
|
99
101
|
>
|
|
100
102
|
{({onDrawerClose}) => (
|
|
101
103
|
<Create
|
|
@@ -126,10 +128,10 @@ const TablePage = ({
|
|
|
126
128
|
formData={formConfig.formData}
|
|
127
129
|
formValue={formConfig.formValue}
|
|
128
130
|
form={formConfig.form}
|
|
129
|
-
namespace={formInfo
|
|
130
|
-
view={formInfo.view}
|
|
131
|
-
scope={formInfo.scope}
|
|
132
|
-
formType={formInfo.formType}
|
|
131
|
+
namespace={formConfig?.namespace || formInfo?.namespace}
|
|
132
|
+
view={formConfig?.view || formInfo.view}
|
|
133
|
+
scope={formConfig?.scope || formInfo.scope}
|
|
134
|
+
formType={formConfig?.formType || formInfo.formType}
|
|
133
135
|
defaultData={defaultValues}
|
|
134
136
|
/>
|
|
135
137
|
)}
|
|
@@ -49,6 +49,7 @@ const View = ({
|
|
|
49
49
|
addData,
|
|
50
50
|
options,
|
|
51
51
|
getSubjectsDetails,
|
|
52
|
+
namespaceOverrides,
|
|
52
53
|
// ADD CALLBACK TO GET THE CURRENT NAMESPACE CONFIG
|
|
53
54
|
}) => {
|
|
54
55
|
const getNamespaceConfig = (namespace) => namespaceConfiguration?.[namespace] || {};
|
|
@@ -110,6 +111,7 @@ const View = ({
|
|
|
110
111
|
namespaceConfig: namespaceConfiguration,
|
|
111
112
|
APP,
|
|
112
113
|
viewConfig,
|
|
114
|
+
namespaceOverrides: namespaceOverrides,
|
|
113
115
|
});
|
|
114
116
|
|
|
115
117
|
const groupForm = useMemo(() => {
|
|
@@ -167,7 +169,7 @@ const View = ({
|
|
|
167
169
|
module: APP,
|
|
168
170
|
view: namespaceConfig?.view,
|
|
169
171
|
...(namespaceConfig?.scope && { scope: namespaceConfig.scope }),
|
|
170
|
-
datastakeId: id,
|
|
172
|
+
datastakeId: id ? id : 'user',
|
|
171
173
|
version,
|
|
172
174
|
source,
|
|
173
175
|
})
|
|
@@ -220,7 +222,7 @@ const View = ({
|
|
|
220
222
|
<>
|
|
221
223
|
<div className={"daf-view-form"}>
|
|
222
224
|
<Header
|
|
223
|
-
title={data?.name || ""}
|
|
225
|
+
title={(namespace === 'kyc' ? "KYC" : data?.name) || ""}
|
|
224
226
|
breadcrumbs={breadcrumbs}
|
|
225
227
|
goBackTo={goBack}
|
|
226
228
|
actionButtons={actionButtons}
|
|
@@ -100,3 +100,16 @@ export const filterParams = (value, module) => {
|
|
|
100
100
|
|
|
101
101
|
return { ...rest, ...params };
|
|
102
102
|
};
|
|
103
|
+
|
|
104
|
+
export const getStatusOptions = (t) => {
|
|
105
|
+
return [
|
|
106
|
+
{
|
|
107
|
+
value: "submitted",
|
|
108
|
+
label: t("Submitted"),
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
value: "private",
|
|
112
|
+
label: t("Private"),
|
|
113
|
+
},
|
|
114
|
+
]
|
|
115
|
+
}
|
package/src/pages.js
CHANGED
|
@@ -2,17 +2,8 @@
|
|
|
2
2
|
export { default as SupplyChainDashboard } from './@daf/pages/Dashboards/SupplyChain/index.jsx';
|
|
3
3
|
export { default as UserDashboard } from './@daf/pages/Dashboards/UserDashboard/index.jsx';
|
|
4
4
|
export { default as SelfAssesment } from './@daf/pages/Dashboards/SelfAssesment/index.jsx';
|
|
5
|
-
export { default as OperatorsTable } from './@daf/pages/Stakeholders/Operators/index.jsx';
|
|
6
|
-
export { default as LocationsTable } from './@daf/pages/Locations/index.jsx';
|
|
7
|
-
export { default as StakeholdersTable } from './@daf/pages/Stakeholders/index.jsx';
|
|
8
|
-
export { default as EventsTable } from './@daf/pages/Events/index.jsx';
|
|
9
|
-
export { default as DocumentsTable } from './@daf/pages/Documents/index.jsx';
|
|
10
|
-
export { default as WorkersTable } from './@daf/pages/Stakeholders/Workers/index.jsx';
|
|
11
|
-
export { default as ActivitiesTable } from './@daf/pages/Events/Activities/index.jsx';
|
|
12
5
|
|
|
13
|
-
|
|
14
|
-
export { default as ProductionSitesTable } from './@daf/pages/Locations/MineSite/index.jsx';
|
|
15
|
-
export { default as UsersTable } from './@daf/core/components/Screens/Users/index.jsx';
|
|
6
|
+
// Tables
|
|
16
7
|
export { default as PartnersTable } from './@daf/pages/Partners/index.jsx';
|
|
17
8
|
export { default as TablePage } from './@daf/pages/TablePage/index.jsx';
|
|
18
9
|
|