datastake-daf 0.6.783 → 0.6.784

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.
Files changed (42) hide show
  1. package/dist/components/index.js +54 -46
  2. package/dist/hooks/index.js +3 -1
  3. package/dist/pages/index.js +236 -205
  4. package/dist/utils/index.js +9 -0
  5. package/package.json +1 -1
  6. package/src/@daf/core/components/Charts/BarChart/index.jsx +1 -1
  7. package/src/@daf/core/components/Dashboard/Map/ChainIcon/utils.js +2 -2
  8. package/src/@daf/core/components/Screens/BaseScreen/index.jsx +1 -0
  9. package/src/@daf/core/components/Select/MultiSelect/index.jsx +4 -2
  10. package/src/@daf/core/components/Select/MultiSelect/style.js +15 -0
  11. package/src/@daf/hooks/useGetQueryParams.js +3 -1
  12. package/src/@daf/pages/Dashboards/UserDashboard/components/ContributionsGraph/hook.js +6 -7
  13. package/src/@daf/pages/Dashboards/UserDashboard/components/ContributionsGraph/index.jsx +1 -1
  14. package/src/@daf/pages/Documents/config.js +5 -5
  15. package/src/@daf/pages/Events/Activities/columns.js +5 -0
  16. package/src/@daf/pages/Events/Activities/config.js +21 -17
  17. package/src/@daf/pages/Events/Incidents/columns.js +5 -0
  18. package/src/@daf/pages/Events/Incidents/config.js +14 -11
  19. package/src/@daf/pages/Events/columns.js +6 -0
  20. package/src/@daf/pages/Events/config.js +0 -16
  21. package/src/@daf/pages/Locations/MineSite/columns.js +5 -1
  22. package/src/@daf/pages/Locations/MineSite/config.js +21 -24
  23. package/src/@daf/pages/Partners/columns.js +3 -1
  24. package/src/@daf/pages/Partners/config.js +13 -9
  25. package/src/@daf/pages/Partners/create.jsx +5 -2
  26. package/src/@daf/pages/Partners/edit.jsx +4 -2
  27. package/src/@daf/pages/Stakeholders/Operators/columns.js +6 -0
  28. package/src/@daf/pages/Stakeholders/Operators/config.js +8 -8
  29. package/src/@daf/pages/Stakeholders/Workers/columns.js +19 -13
  30. package/src/@daf/pages/Stakeholders/Workers/config.js +8 -23
  31. package/src/@daf/pages/Summary/Minesite/index.jsx +6 -4
  32. package/src/@daf/pages/Summary/Operator/components/TradeRelationships/index.js +2 -0
  33. package/src/@daf/pages/Summary/Operator/index.jsx +6 -3
  34. package/src/@daf/pages/TablePage/index.jsx +8 -2
  35. package/src/@daf/pages/Template/components/LinkingTemplate/config.js +14 -1
  36. package/src/@daf/pages/Template/components/LinkingTemplate/index.jsx +4 -2
  37. package/src/@daf/pages/Template/index.jsx +1 -10
  38. package/src/@daf/pages/View/hooks/usePrepareForm.js +4 -4
  39. package/src/@daf/pages/View/index.jsx +2 -1
  40. package/src/constants/locales/en/translation.js +3 -0
  41. package/src/constants/locales/fr/translation.js +3 -0
  42. package/src/constants/locales/sp/translation.js +3 -0
@@ -7752,6 +7752,9 @@ function getRedirectPath(user, fallback = '', app, isDatastake) {
7752
7752
  }
7753
7753
 
7754
7754
  const en = {
7755
+ "Site": "Site",
7756
+ "Production Sites": "Production Sites",
7757
+ "Type of account": "Type of account",
7755
7758
  "accounts": "Accounts",
7756
7759
  "users": "Users",
7757
7760
  "subjects": "Subjects",
@@ -9070,6 +9073,9 @@ const en = {
9070
9073
  };
9071
9074
 
9072
9075
  const fr = {
9076
+ "Site": "Site",
9077
+ "Production Sites": "Sites de production",
9078
+ "Type of account": "Type de compte",
9073
9079
  "accounts": "Comptes",
9074
9080
  "users": "Utilisateurs",
9075
9081
  "subjects": "Sujets",
@@ -11022,6 +11028,9 @@ const fr = {
11022
11028
  };
11023
11029
 
11024
11030
  const sp = {
11031
+ "Site": "Sitio",
11032
+ "Production Sites": "Centros de producción",
11033
+ "Type of account": "Tipo de cuenta",
11025
11034
  "Identified Customers": "Clientes identificados",
11026
11035
  "Identified Suppliers": "Proveedores identificados",
11027
11036
  "Associated Mine Sites": "Sitios mineros asociados",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.783",
3
+ "version": "0.6.784",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -123,7 +123,7 @@ export default function BarChart({
123
123
  },
124
124
  }
125
125
  : {}),
126
- ...xAxisConfig,
126
+ ...(Object.keys(xAxisConfig).length > 0 ? xAxisConfig : {}),
127
127
  label: {
128
128
  formatter: isPercentage
129
129
  ? (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`) + " %"
@@ -117,13 +117,13 @@ export function getStakeholderPosition({ zoom, totalMarkers, markerIndex }) {
117
117
  return { x, y, center, radius, angleDeg };
118
118
  }
119
119
 
120
- function applyAnimationDirect(el, isShortLink) {
120
+ function applyAnimationDirect(el, isShortLink, lineFlow = "downstream") {
121
121
  if (!(el instanceof SVGElement) || isShortLink) return;
122
122
 
123
123
  el.style.strokeDasharray = "10, 10";
124
124
  el.style.strokeDashoffset = "0";
125
125
 
126
- el.style.animation = "dash-flow 1.2s linear infinite";
126
+ el.style.animation = `dash-flow 1.2s linear infinite ${lineFlow === "upstream" && "reverse"}`;
127
127
 
128
128
  el.classList.add('animated-polyline');
129
129
  }
@@ -150,6 +150,7 @@ const BaseScreen = ({
150
150
  showFilters={showFilters}
151
151
  defaultFilters={defaultFilters}
152
152
  onChange={onTableChange}
153
+ t={t}
153
154
  {...rest}
154
155
  />
155
156
  <Pagination
@@ -4,6 +4,7 @@ import PropTypes from "prop-types";
4
4
  import { Avatar, Checkbox } from "antd";
5
5
  import { theme } from "antd";
6
6
  import React from "react";
7
+ import MultiSelectStyled from "./style";
7
8
  const { useToken } = theme;
8
9
 
9
10
  /**
@@ -163,7 +164,7 @@ export default function Multiselect({
163
164
  };
164
165
 
165
166
  return (
166
- <Select
167
+ <MultiSelectStyled
167
168
  mode={isSingle ? undefined : "multiple"}
168
169
  value={selectValue}
169
170
  onChange={onSelectChange}
@@ -231,6 +232,7 @@ export default function Multiselect({
231
232
  display: "flex",
232
233
  alignItems: "center",
233
234
  justifyContent: "center",
235
+ padding: 0,
234
236
  }}
235
237
  >
236
238
  {option?.avatar || getFirstChar(option?.label)}
@@ -289,7 +291,7 @@ export default function Multiselect({
289
291
  }
290
292
  }}
291
293
  {...restProps}
292
- ></Select>
294
+ ></MultiSelectStyled>
293
295
  );
294
296
  }
295
297
 
@@ -0,0 +1,15 @@
1
+ import styled from 'styled-components';
2
+ import { Select } from 'antd';
3
+
4
+ const MultiSelectStyled = styled(Select)`
5
+ &.ant-select-single {
6
+ .ant-select-selector {
7
+ padding-inline-end: 24px !important;
8
+ padding: 0 !important;
9
+ max-width: 56px !important;
10
+ width: 56px !important;
11
+ }
12
+ }
13
+ `;
14
+
15
+ export default MultiSelectStyled;
@@ -18,7 +18,9 @@ export const useGetQueryParams = ({location}) => {
18
18
  },
19
19
  otherParams: {
20
20
  ...rest,
21
- }
21
+ },
22
+ sortBy,
23
+ sortDir,
22
24
  };
23
25
  }, [queryParams]);
24
26
 
@@ -12,6 +12,7 @@ export const useContributionsGraph = ({
12
12
  }, [data, t]);
13
13
 
14
14
  const isEmpty = useMemo(() => _data?.length === 0, [_data]);
15
+ console.log({_data, isEmpty})
15
16
 
16
17
  const chartConfig = useMemo(() => {
17
18
  return {
@@ -20,13 +21,11 @@ export const useContributionsGraph = ({
20
21
  yFieldKey: "category",
21
22
  seriesField: "type",
22
23
  isGroup: true,
23
- ...(isEmpty && {
24
- xAxisConfig: {
25
- min: 0,
26
- max: 10,
27
- tickCount: 5,
28
- }
29
- }),
24
+ xAxisConfig: isEmpty ? {
25
+ min: 0,
26
+ max: 10,
27
+ tickCount: 5,
28
+ } : {},
30
29
  renderTooltipContent: (title, items) => {
31
30
  const tooltipItems = items.map((item) => ({
32
31
  label: item.name,
@@ -41,7 +41,7 @@ function ContributionsGraph({
41
41
  title={t("Contributions")}
42
42
  className="with-border-header h-w-btn-header no-px-body"
43
43
  >
44
- <BarChart {...chartConfig} height="400px" t={t} />
44
+ <BarChart {...chartConfig} height="400px" t={t} key={data?.length} />
45
45
  </Widget>
46
46
  )
47
47
  }
@@ -1,10 +1,10 @@
1
1
  export const getFiltersConfig = ({t}) => {
2
2
  return {
3
- timeframe: {
4
- type: "timeframe",
5
- label: "Timeframe",
6
- style: { flex: 1 },
7
- },
3
+ timeframe: {
4
+ type: "timeframe",
5
+ label: "Timeframe",
6
+ style: { flex: 1 },
7
+ },
8
8
  }
9
9
  }
10
10
 
@@ -14,6 +14,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
14
14
  title: t('ID'),
15
15
  ellipsis: true,
16
16
  show: true,
17
+ key: "datastakeId",
18
+ sorter: () => 0 + 0,
17
19
  render: (v, all) => {
18
20
  if (all.empty) {
19
21
  return <div className="daf-default-cell" />
@@ -27,6 +29,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
27
29
  title: t('Title'),
28
30
  ellipsis: true,
29
31
  show: true,
32
+ key: "name",
33
+ sorter: () => 0 + 0,
30
34
  render: (v, all) => {
31
35
  if (all.empty) {
32
36
  return <div className="daf-default-cell" />
@@ -39,6 +43,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
39
43
  title: t("Date"),
40
44
  dataIndex: "date",
41
45
  key: "date",
46
+ sorter: () => 0 + 0,
42
47
  render: (date, all) => {
43
48
  if (all.empty) {
44
49
  return <div className="daf-default-cell" />;
@@ -1,16 +1,15 @@
1
1
  export const getFiltersConfig = ({t}) => {
2
2
  return {
3
-
4
-
5
- timeframe: {
6
- type: "timeframe",
7
- label: "Timeframe",
8
- style: { flex: 1 },
3
+ timeframe: {
4
+ type: "timeframe",
5
+ label: "Timeframe",
6
+ style: { flex: 1 },
7
+ t: t,
9
8
  },
10
9
  country: {
11
10
  type: 'select',
12
11
  label: 'Country',
13
- placeholder: (t) => `${t('Filter by')} ${t('Country').toLowerCase()}`,
12
+ placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
14
13
  style: { flex: 1 },
15
14
  labelStyle: { flex: 1 },
16
15
  getLabel: (option) => option.label,
@@ -34,7 +33,7 @@ timeframe: {
34
33
 
35
34
  return t('Province');
36
35
  },
37
- placeholder: (t) => `${t('Filter by')} ${t('Province').toLowerCase()}`,
36
+ placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
38
37
  filters: (data) => ({
39
38
  country: data.country,
40
39
  level: 'level_1',
@@ -66,7 +65,7 @@ timeframe: {
66
65
  return t('Province');
67
66
  },
68
67
  show: (data) => !(data.country && data.administrativeLevel1),
69
- placeholder: (t) => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
68
+ placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
70
69
  filters: (data) => ({
71
70
  country: data.country,
72
71
  level: 'level_2',
@@ -82,7 +81,7 @@ timeframe: {
82
81
  category: {
83
82
  type: 'select',
84
83
  label: 'Category',
85
- placeholder: (t) => `${t('Filter by')} ${t('Category').toLowerCase()}`,
84
+ placeholder: () => `${t('Filter by')} ${t('Category').toLowerCase()}`,
86
85
  style: { flex: 1 },
87
86
  labelStyle: { flex: 1 },
88
87
  getLabel: (option) => option.label,
@@ -106,7 +105,7 @@ timeframe: {
106
105
  positionInTheMineralSupplyChain: {
107
106
  type: 'select',
108
107
  label: 'Position',
109
- placeholder: (t) => `${t('Filter by')} ${t('Position').toLowerCase()}`,
108
+ placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
110
109
  style: { flex: 1 },
111
110
  labelStyle: { flex: 1 },
112
111
  getLabel: (option) => option.label,
@@ -115,7 +114,7 @@ timeframe: {
115
114
  status: {
116
115
  type: "select",
117
116
  label: "Status",
118
- placeholder: (t) => `${t("Filter by")} ${t("Status").toLowerCase()}`,
117
+ placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
119
118
  style: { flex: 1 },
120
119
  labelStyle: { fley: 1 },
121
120
  getLabel: (option) => option.label,
@@ -127,7 +126,6 @@ timeframe: {
127
126
  export const getFilterOptions = (options, t) => {
128
127
  const {
129
128
  timeframe = [],
130
-
131
129
  statusOptions = [],
132
130
  categoryOptions = [],
133
131
  countries = [],
@@ -139,21 +137,27 @@ export const getFilterOptions = (options, t) => {
139
137
  administrativeLevel2,
140
138
  positionInMineralSupplyChainOptions,
141
139
  subCategoriesOptions,
142
- } = options || {};
140
+ eventCategoryOptions = [],
141
+ } = options || {};
142
+
143
+ const _categoryOptions = eventCategoryOptions?.map((item) => ({
144
+ value: item.value,
145
+ label: typeof item.label === 'object' ? Object.values(item.label)[1] : item.label,
146
+ }))
143
147
 
144
148
  const _default = {
145
149
  timeframe: timeframe,
146
150
  status: [
147
151
  {
148
152
  value: "submitted",
149
- label: "Submitted",
153
+ label: t("Submitted"),
150
154
  },
151
155
  {
152
156
  value: "private",
153
- label: "Private",
157
+ label: t("Private"),
154
158
  },
155
159
  ],
156
- category: stakeholderCategoryOptions || categoryOptions,
160
+ category: _categoryOptions,
157
161
  country: countries,
158
162
  subCategory: subCategoriesOptions,
159
163
  // category: category,
@@ -14,6 +14,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
14
14
  title: t('ID'),
15
15
  ellipsis: true,
16
16
  show: true,
17
+ key: "datastakeId",
18
+ sorter: () => 0 + 0,
17
19
  render: (v, all) => {
18
20
  if (all.empty) {
19
21
  return <div className="daf-default-cell" />
@@ -27,6 +29,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
27
29
  title: t('Title'),
28
30
  ellipsis: true,
29
31
  show: true,
32
+ key: "name",
33
+ sorter: () => 0 + 0,
30
34
  render: (v, all) => {
31
35
  if (all.empty) {
32
36
  return <div className="daf-default-cell" />
@@ -39,6 +43,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
39
43
  title: t("Date"),
40
44
  dataIndex: "date",
41
45
  key: "date",
46
+ sorter: () => 0 + 0,
42
47
  render: (date, all) => {
43
48
  if (all.empty) {
44
49
  return <div className="daf-default-cell" />;
@@ -1,11 +1,9 @@
1
1
  export const getFiltersConfig = ({t}) => {
2
2
  return {
3
-
4
-
5
- timeframe: {
6
- type: "timeframe",
7
- label: "Timeframe",
8
- style: { flex: 1 },
3
+ timeframe: {
4
+ type: "timeframe",
5
+ label: "Timeframe",
6
+ style: { flex: 1 },
9
7
  },
10
8
  country: {
11
9
  type: 'select',
@@ -127,7 +125,6 @@ timeframe: {
127
125
  export const getFilterOptions = (options, t) => {
128
126
  const {
129
127
  timeframe = [],
130
-
131
128
  statusOptions = [],
132
129
  categoryOptions = [],
133
130
  countries = [],
@@ -139,21 +136,27 @@ export const getFilterOptions = (options, t) => {
139
136
  administrativeLevel2,
140
137
  positionInMineralSupplyChainOptions,
141
138
  subCategoriesOptions,
142
- } = options || {};
139
+ eventCategoryOptions = [],
140
+ } = options || {};
141
+
142
+ const _categoryOptions = eventCategoryOptions?.map((item) => ({
143
+ value: item.value,
144
+ label: typeof item.label === 'object' ? Object.values(item.label)[0] : item.label,
145
+ }))
143
146
 
144
147
  const _default = {
145
148
  timeframe: timeframe,
146
149
  status: [
147
150
  {
148
151
  value: "submitted",
149
- label: "Submitted",
152
+ label: t("Submitted"),
150
153
  },
151
154
  {
152
155
  value: "private",
153
- label: "Private",
156
+ label: t("Private"),
154
157
  },
155
158
  ],
156
- category: stakeholderCategoryOptions || categoryOptions,
159
+ category: _categoryOptions,
157
160
  country: countries,
158
161
  subCategory: subCategoriesOptions,
159
162
  // category: category,
@@ -14,6 +14,8 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
14
14
  title: t('ID'),
15
15
  ellipsis: true,
16
16
  show: true,
17
+ key: "datastakeId",
18
+ sorter: () => 0 + 0,
17
19
  render: (v, all) => {
18
20
  if (all.empty) {
19
21
  return <div className="daf-default-cell" />
@@ -27,6 +29,8 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
27
29
  title: t('Title'),
28
30
  ellipsis: true,
29
31
  show: true,
32
+ key: "name",
33
+ sorter: () => 0 + 0,
30
34
  render: (v, all) => {
31
35
  if (all.empty) {
32
36
  return <div className="daf-default-cell" />
@@ -40,6 +44,8 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
40
44
  title: t('Type'),
41
45
  ellipsis: true,
42
46
  show: true,
47
+ key: "typeOfEvent",
48
+ sorter: () => 0 + 0,
43
49
  render: (v, all) => {
44
50
  if (all.empty) {
45
51
  return <div className="daf-default-cell" />
@@ -1,6 +1,5 @@
1
1
  export const getFiltersConfig = ({t}) => {
2
2
  return {
3
-
4
3
  timeframe: {
5
4
  type: "timeframe",
6
5
  label: "Timeframe",
@@ -86,21 +85,6 @@ export const getFiltersConfig = ({t}) => {
86
85
  labelStyle: { flex: 1 },
87
86
  getLabel: (option) => option.label,
88
87
  getValue: (option) => option.value,
89
- filterOptions: (val) => {
90
- if (val) {
91
- const { option, filters } = val
92
- if (filters && option) {
93
- const { filters: optionFilters } = option;
94
- if (Array.isArray(optionFilters) && optionFilters.length) {
95
- const { value, condition } = optionFilters[0];
96
- if (condition === 'includes') {
97
- return value.includes('corporation');
98
- }
99
- }
100
- }
101
- }
102
- return true;
103
- },
104
88
  },
105
89
  category:{
106
90
  type: 'select',
@@ -15,6 +15,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
15
15
  title: t('ID'),
16
16
  ellipsis: true,
17
17
  show: true,
18
+ key: "datastakeId",
19
+ sorter: () => 0 + 0,
18
20
  render: (v, all) => {
19
21
  if (all.empty) {
20
22
  return <div className="daf-default-cell" />
@@ -28,6 +30,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
28
30
  title: t('Name'),
29
31
  ellipsis: true,
30
32
  show: true,
33
+ key: "name",
34
+ sorter: () => 0 + 0,
31
35
  render: (v, all) => {
32
36
  if (all.empty) {
33
37
  return <div className="daf-default-cell" />
@@ -68,7 +72,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
68
72
  },
69
73
  {
70
74
  dataIndex: 'category',
71
- title: t('Type'),
75
+ title: t('type'),
72
76
  ellipsis: true,
73
77
  show: true,
74
78
  render: (v, all) => {
@@ -3,7 +3,7 @@ export const getFiltersConfig = ({t}) => {
3
3
  country: {
4
4
  type: 'select',
5
5
  label: 'Country',
6
- placeholder: (t) => `${t('Filter by')} ${t('Country').toLowerCase()}`,
6
+ placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
7
7
  style: { flex: 1 },
8
8
  labelStyle: { flex: 1 },
9
9
  getLabel: (option) => option.label,
@@ -27,7 +27,7 @@ export const getFiltersConfig = ({t}) => {
27
27
 
28
28
  return t('Province');
29
29
  },
30
- placeholder: (t) => `${t('Filter by')} ${t('Province').toLowerCase()}`,
30
+ placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
31
31
  filters: (data) => ({
32
32
  country: data.country,
33
33
  level: 'level_1',
@@ -59,7 +59,7 @@ export const getFiltersConfig = ({t}) => {
59
59
  return t('Province');
60
60
  },
61
61
  show: (data) => !(data.country && data.administrativeLevel1),
62
- placeholder: (t) => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
62
+ placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
63
63
  filters: (data) => ({
64
64
  country: data.country,
65
65
  level: 'level_2',
@@ -75,31 +75,25 @@ export const getFiltersConfig = ({t}) => {
75
75
  product: {
76
76
  type: 'select',
77
77
  label: 'Product',
78
- placeholder: (t) => `${t('Filter by')} ${t('Product').toLowerCase()}`,
78
+ placeholder: () => `${t('Filter by')} ${t('Product').toLowerCase()}`,
79
+ style: { flex: 1 },
80
+ labelStyle: { flex: 1 },
81
+ getLabel: (option) => option.label,
82
+ getValue: (option) => option.value,
83
+ },
84
+ type: {
85
+ type: 'select',
86
+ label: 'Type',
87
+ placeholder: () => `${t('Filter by')} ${t('Type').toLowerCase()}`,
79
88
  style: { flex: 1 },
80
89
  labelStyle: { flex: 1 },
81
90
  getLabel: (option) => option.label,
82
91
  getValue: (option) => option.value,
83
- filterOptions: (val) => {
84
- if (val) {
85
- const { option, filters } = val
86
- if (filters && option) {
87
- const { filters: optionFilters } = option;
88
- if (Array.isArray(optionFilters) && optionFilters.length) {
89
- const { value, condition } = optionFilters[0];
90
- if (condition === 'includes') {
91
- return value.includes('corporation');
92
- }
93
- }
94
- }
95
- }
96
- return true;
97
- },
98
92
  },
99
93
  positionInTheMineralSupplyChain: {
100
94
  type: 'select',
101
95
  label: 'Position',
102
- placeholder: (t) => `${t('Filter by')} ${t('Position').toLowerCase()}`,
96
+ placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
103
97
  style: { flex: 1 },
104
98
  labelStyle: { flex: 1 },
105
99
  getLabel: (option) => option.label,
@@ -108,7 +102,7 @@ export const getFiltersConfig = ({t}) => {
108
102
  status: {
109
103
  type: "select",
110
104
  label: "Status",
111
- placeholder: (t) => `${t("Filter by")} ${t("Status").toLowerCase()}`,
105
+ placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
112
106
  style: { flex: 1 },
113
107
  labelStyle: { fley: 1 },
114
108
  getLabel: (option) => option.label,
@@ -129,23 +123,26 @@ export const getFilterOptions = (options, t) => {
129
123
  stakeholderSubCategoriesOptions,
130
124
  administrativeLevel1,
131
125
  administrativeLevel2,
126
+ mineralOptions,
127
+ locationCategories = [],
132
128
  } = options || {};
133
129
 
134
130
  const _default = {
135
131
  category: stakeholderCategoryOptions || categoryOptions,
136
132
  country: countries,
137
- product: product,
133
+ product: mineralOptions,
134
+ type: locationCategories,
138
135
  administrativeLevel1,
139
136
  administrativeLevel2,
140
137
  subCategory: subCategoriesOptions,
141
138
  status: [
142
139
  {
143
140
  value: "submitted",
144
- label: "Submitted",
141
+ label: t("Submitted"),
145
142
  },
146
143
  {
147
144
  value: "private",
148
- label: "Private",
145
+ label: t("Private"),
149
146
  },
150
147
  ],
151
148
  }
@@ -4,7 +4,7 @@ import MoreMenu from '../../core/components/Table/MoreMenu/index.jsx';
4
4
  import TooltipIcon from '../../core/components/Icon/TooltipIcon.jsx';
5
5
  import { findOptions, camelCaseToTitle } from '../../../helpers/StringHelper.js';
6
6
  import { copyToClipboard } from '../../../helpers/copyToClipboard.js';
7
- import { partnershipTypes, partnerTypes } from './config.js';
7
+ import { getPartnershipTypes, getPartnerTypes } from './config.js';
8
8
 
9
9
  export const getColumns = ({
10
10
  t,
@@ -63,6 +63,7 @@ export const getColumns = ({
63
63
  return <div className="daf-default-cell" />;
64
64
  }
65
65
 
66
+ const partnershipTypes = getPartnershipTypes(t);
66
67
  return partnershipTypes.find((v) => v.value === val)?.label || val || "-";
67
68
  },
68
69
  },
@@ -76,6 +77,7 @@ export const getColumns = ({
76
77
  return <div className="daf-default-cell" />;
77
78
  }
78
79
 
80
+ const partnerTypes = getPartnerTypes(t);
79
81
  return partnerTypes.find((v) => v.value === val)?.label || val || "-";
80
82
  },
81
83
  },
@@ -20,13 +20,17 @@ export const checkboxConfig = {
20
20
  datastakeId: "ID",
21
21
  };
22
22
 
23
- export const partnerTypes = [
24
- { label: "Individual", value: "individual" },
25
- { label: "Organisation", value: "organisation" },
26
- ];
23
+ export const getPartnerTypes = (t) => {
24
+ return [
25
+ { label: t("Individual"), value: "individual" },
26
+ { label: t("Organisation"), value: "organisation" },
27
+ ]
28
+ }
27
29
 
28
- export const partnershipTypes = [
29
- { label: "Source", value: "source" },
30
- { label: "Client", value: "client" },
31
- { label: "Exchange", value: "exchange" },
32
- ];
30
+ export const getPartnershipTypes = (t) => {
31
+ return [
32
+ { label: t("Source"), value: "source" },
33
+ { label: t("Client"), value: "client" },
34
+ { label: t("Exchange"), value: "exchange" },
35
+ ]
36
+ }