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
@@ -6192,6 +6192,17 @@ DAFHeader.propTypes = {
6192
6192
  filtersConfig: PropTypes__default["default"].any
6193
6193
  };
6194
6194
 
6195
+ const MultiSelectStyled = styled__default["default"](antd.Select)`
6196
+ &.ant-select-single {
6197
+ .ant-select-selector {
6198
+ padding-inline-end: 24px !important;
6199
+ padding: 0 !important;
6200
+ max-width: 56px !important;
6201
+ width: 56px !important;
6202
+ }
6203
+ }
6204
+ `;
6205
+
6195
6206
  const {
6196
6207
  useToken: useToken$8
6197
6208
  } = antd.theme;
@@ -6330,7 +6341,7 @@ function Multiselect({
6330
6341
  });
6331
6342
  }
6332
6343
  };
6333
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
6344
+ return /*#__PURE__*/jsxRuntime.jsx(MultiSelectStyled, {
6334
6345
  mode: isSingle ? undefined : "multiple",
6335
6346
  value: selectValue,
6336
6347
  onChange: onSelectChange,
@@ -6387,7 +6398,8 @@ function Multiselect({
6387
6398
  border: `1px solid ${token.baseGray40}`,
6388
6399
  display: "flex",
6389
6400
  alignItems: "center",
6390
- justifyContent: "center"
6401
+ justifyContent: "center",
6402
+ padding: 0
6391
6403
  },
6392
6404
  children: option?.avatar || getFirstChar(option?.label)
6393
6405
  }, value);
@@ -8348,11 +8360,11 @@ function getStakeholderPosition({
8348
8360
  angleDeg
8349
8361
  };
8350
8362
  }
8351
- function applyAnimationDirect(el, isShortLink) {
8363
+ function applyAnimationDirect(el, isShortLink, lineFlow = "downstream") {
8352
8364
  if (!(el instanceof SVGElement) || isShortLink) return;
8353
8365
  el.style.strokeDasharray = "10, 10";
8354
8366
  el.style.strokeDashoffset = "0";
8355
- el.style.animation = "dash-flow 1.2s linear infinite";
8367
+ el.style.animation = `dash-flow 1.2s linear infinite ${lineFlow === "upstream" && "reverse"}`;
8356
8368
  el.classList.add('animated-polyline');
8357
8369
  }
8358
8370
  function removeAnimationFromElement(element) {
@@ -14306,7 +14318,7 @@ function BarChart({
14306
14318
  return Array.from(new Array(11), (v, i) => i * 10);
14307
14319
  }
14308
14320
  } : {}),
14309
- ...xAxisConfig,
14321
+ ...(Object.keys(xAxisConfig).length > 0 ? xAxisConfig : {}),
14310
14322
  label: {
14311
14323
  formatter: isPercentage ? v => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, s => `${s},`) + " %" : formattedXAxis,
14312
14324
  ...xAxisConfig?.label
@@ -14436,6 +14448,10 @@ const useContributionsGraph = ({
14436
14448
  });
14437
14449
  }, [data, t]);
14438
14450
  const isEmpty = React.useMemo(() => _data?.length === 0, [_data]);
14451
+ console.log({
14452
+ _data,
14453
+ isEmpty
14454
+ });
14439
14455
  const chartConfig = React.useMemo(() => {
14440
14456
  return {
14441
14457
  data: _data,
@@ -14443,13 +14459,11 @@ const useContributionsGraph = ({
14443
14459
  yFieldKey: "category",
14444
14460
  seriesField: "type",
14445
14461
  isGroup: true,
14446
- ...(isEmpty && {
14447
- xAxisConfig: {
14448
- min: 0,
14449
- max: 10,
14450
- tickCount: 5
14451
- }
14452
- }),
14462
+ xAxisConfig: isEmpty ? {
14463
+ min: 0,
14464
+ max: 10,
14465
+ tickCount: 5
14466
+ } : {},
14453
14467
  renderTooltipContent: (title, items) => {
14454
14468
  const tooltipItems = items.map(item => ({
14455
14469
  label: item.name,
@@ -14505,10 +14519,11 @@ function ContributionsGraph({
14505
14519
  loading: loading,
14506
14520
  title: t("Contributions"),
14507
14521
  className: "with-border-header h-w-btn-header no-px-body",
14508
- children: /*#__PURE__*/jsxRuntime.jsx(BarChart, {
14522
+ children: /*#__PURE__*/React.createElement(BarChart, {
14509
14523
  ...chartConfig,
14510
14524
  height: "400px",
14511
- t: t
14525
+ t: t,
14526
+ key: data?.length
14512
14527
  })
14513
14528
  });
14514
14529
  }
@@ -15296,6 +15311,8 @@ const getColumns$d = ({
15296
15311
  title: t('ID'),
15297
15312
  ellipsis: true,
15298
15313
  show: true,
15314
+ key: "datastakeId",
15315
+ sorter: () => 0 + 0,
15299
15316
  render: (v, all) => {
15300
15317
  if (all.empty) {
15301
15318
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -15312,6 +15329,8 @@ const getColumns$d = ({
15312
15329
  title: t('Name'),
15313
15330
  ellipsis: true,
15314
15331
  show: true,
15332
+ key: "name",
15333
+ sorter: () => 0 + 0,
15315
15334
  render: (v, all) => {
15316
15335
  if (all.empty) {
15317
15336
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -15345,6 +15364,8 @@ const getColumns$d = ({
15345
15364
  title: t('Legal Form'),
15346
15365
  ellipsis: true,
15347
15366
  show: true,
15367
+ key: "subCategory",
15368
+ sorter: () => 0 + 0,
15348
15369
  render: (v, all) => {
15349
15370
  if (all.empty) {
15350
15371
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -16346,6 +16367,7 @@ const BaseScreen = ({
16346
16367
  showFilters: showFilters,
16347
16368
  defaultFilters: defaultFilters,
16348
16369
  onChange: onTableChange,
16370
+ t: t,
16349
16371
  ...rest
16350
16372
  }), /*#__PURE__*/jsxRuntime.jsx(Pagination, {
16351
16373
  t: t,
@@ -30163,7 +30185,9 @@ const useGetQueryParams = ({
30163
30185
  },
30164
30186
  otherParams: {
30165
30187
  ...rest
30166
- }
30188
+ },
30189
+ sortBy,
30190
+ sortDir
30167
30191
  };
30168
30192
  }, [queryParams]);
30169
30193
  return params;
@@ -30411,7 +30435,7 @@ const getFiltersConfig$9 = ({
30411
30435
  country: {
30412
30436
  type: 'select',
30413
30437
  label: 'Country',
30414
- placeholder: t => `${t('Filter by')} ${t('Country').toLowerCase()}`,
30438
+ placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
30415
30439
  style: {
30416
30440
  flex: 1
30417
30441
  },
@@ -30444,7 +30468,7 @@ const getFiltersConfig$9 = ({
30444
30468
  }
30445
30469
  return t('Province');
30446
30470
  },
30447
- placeholder: t => `${t('Filter by')} ${t('Province').toLowerCase()}`,
30471
+ placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
30448
30472
  filters: data => ({
30449
30473
  country: data.country,
30450
30474
  level: 'level_1'
@@ -30488,7 +30512,7 @@ const getFiltersConfig$9 = ({
30488
30512
  return t('Province');
30489
30513
  },
30490
30514
  show: data => !(data.country && data.administrativeLevel1),
30491
- placeholder: t => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
30515
+ placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
30492
30516
  filters: data => ({
30493
30517
  country: data.country,
30494
30518
  level: 'level_2',
@@ -30511,7 +30535,7 @@ const getFiltersConfig$9 = ({
30511
30535
  subCategory: {
30512
30536
  type: 'select',
30513
30537
  label: 'Sub Category',
30514
- placeholder: t => `${t('Filter by')} ${t('Sub Category').toLowerCase()}`,
30538
+ placeholder: () => `${t('Filter by')} ${t('Sub Category').toLowerCase()}`,
30515
30539
  style: {
30516
30540
  flex: 1
30517
30541
  },
@@ -30547,7 +30571,7 @@ const getFiltersConfig$9 = ({
30547
30571
  positionInTheMineralSupplyChain: {
30548
30572
  type: 'select',
30549
30573
  label: 'Position',
30550
- placeholder: t => `${t('Filter by')} ${t('Position').toLowerCase()}`,
30574
+ placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
30551
30575
  style: {
30552
30576
  flex: 1
30553
30577
  },
@@ -30560,7 +30584,7 @@ const getFiltersConfig$9 = ({
30560
30584
  status: {
30561
30585
  type: "select",
30562
30586
  label: "Status",
30563
- placeholder: t => `${t("Filter by")} ${t("Status").toLowerCase()}`,
30587
+ placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
30564
30588
  style: {
30565
30589
  flex: 1
30566
30590
  },
@@ -30592,10 +30616,10 @@ const getFilterOptions$9 = (options, t) => {
30592
30616
  subCategory: subCategoriesOptions,
30593
30617
  status: [{
30594
30618
  value: "submitted",
30595
- label: "Submitted"
30619
+ label: t("Submitted")
30596
30620
  }, {
30597
30621
  value: "private",
30598
- label: "Private"
30622
+ label: t("Private")
30599
30623
  }]
30600
30624
  };
30601
30625
  return _default;
@@ -30618,7 +30642,7 @@ const getFiltersConfig$8 = ({
30618
30642
  country: {
30619
30643
  type: 'select',
30620
30644
  label: 'Country',
30621
- placeholder: t => `${t('Filter by')} ${t('Country').toLowerCase()}`,
30645
+ placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
30622
30646
  style: {
30623
30647
  flex: 1
30624
30648
  },
@@ -30651,7 +30675,7 @@ const getFiltersConfig$8 = ({
30651
30675
  }
30652
30676
  return t('Province');
30653
30677
  },
30654
- placeholder: t => `${t('Filter by')} ${t('Province').toLowerCase()}`,
30678
+ placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
30655
30679
  filters: data => ({
30656
30680
  country: data.country,
30657
30681
  level: 'level_1'
@@ -30695,7 +30719,7 @@ const getFiltersConfig$8 = ({
30695
30719
  return t('Province');
30696
30720
  },
30697
30721
  show: data => !(data.country && data.administrativeLevel1),
30698
- placeholder: t => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
30722
+ placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
30699
30723
  filters: data => ({
30700
30724
  country: data.country,
30701
30725
  level: 'level_2',
@@ -30718,7 +30742,7 @@ const getFiltersConfig$8 = ({
30718
30742
  activity: {
30719
30743
  type: 'select',
30720
30744
  label: 'Activity',
30721
- placeholder: t => `${t('Filter by')} ${t('Activity').toLowerCase()}`,
30745
+ placeholder: () => `${t('Filter by')} ${t('Activity').toLowerCase()}`,
30722
30746
  style: {
30723
30747
  flex: 1
30724
30748
  },
@@ -30726,35 +30750,12 @@ const getFiltersConfig$8 = ({
30726
30750
  flex: 1
30727
30751
  },
30728
30752
  getLabel: option => option.label,
30729
- getValue: option => option.value,
30730
- filterOptions: val => {
30731
- if (val) {
30732
- const {
30733
- option,
30734
- filters
30735
- } = val;
30736
- if (filters && option) {
30737
- const {
30738
- filters: optionFilters
30739
- } = option;
30740
- if (Array.isArray(optionFilters) && optionFilters.length) {
30741
- const {
30742
- value,
30743
- condition
30744
- } = optionFilters[0];
30745
- if (condition === 'includes') {
30746
- return value.includes('corporation');
30747
- }
30748
- }
30749
- }
30750
- }
30751
- return true;
30752
- }
30753
+ getValue: option => option.value
30753
30754
  },
30754
30755
  positionInTheMineralSupplyChain: {
30755
30756
  type: 'select',
30756
30757
  label: 'Position',
30757
- placeholder: t => `${t('Filter by')} ${t('Position').toLowerCase()}`,
30758
+ placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
30758
30759
  style: {
30759
30760
  flex: 1
30760
30761
  },
@@ -30767,7 +30768,7 @@ const getFiltersConfig$8 = ({
30767
30768
  status: {
30768
30769
  type: "select",
30769
30770
  label: "Status",
30770
- placeholder: t => `${t("Filter by")} ${t("Status").toLowerCase()}`,
30771
+ placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
30771
30772
  style: {
30772
30773
  flex: 1
30773
30774
  },
@@ -30796,10 +30797,10 @@ const getFilterOptions$8 = (options, t) => {
30796
30797
  const _default = {
30797
30798
  status: [{
30798
30799
  value: "submitted",
30799
- label: "Submitted"
30800
+ label: t("Submitted")
30800
30801
  }, {
30801
30802
  value: "private",
30802
- label: "Private"
30803
+ label: t("Private")
30803
30804
  }],
30804
30805
  category: stakeholderCategoryOptions || categoryOptions,
30805
30806
  country: countries,
@@ -30833,25 +30834,31 @@ const getColumns$b = ({
30833
30834
  subject,
30834
30835
  data,
30835
30836
  applications
30836
- }) => [
30837
- // {
30838
- // dataIndex: 'datastakeId',
30839
- // title: t('ID'),
30840
- // ellipsis: true,
30841
- // show: true,
30842
- // render: (v, all) => {
30843
- // if (all.empty) {
30844
- // return <div className="daf-default-cell" />
30845
- // }
30846
-
30847
- // return <Tooltip title={v}>{v}</Tooltip>;
30848
- // },
30849
- // },
30850
- {
30837
+ }) => [{
30838
+ dataIndex: 'datastakeId',
30839
+ title: t('Title'),
30840
+ ellipsis: true,
30841
+ show: true,
30842
+ key: "datastakeId",
30843
+ sorter: () => 0 + 0,
30844
+ render: (v, all) => {
30845
+ if (all.empty) {
30846
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
30847
+ className: "daf-default-cell"
30848
+ });
30849
+ }
30850
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
30851
+ title: v,
30852
+ children: v
30853
+ });
30854
+ }
30855
+ }, {
30851
30856
  dataIndex: 'name',
30852
30857
  title: t('Name'),
30853
30858
  ellipsis: true,
30854
30859
  show: true,
30860
+ key: "name",
30861
+ sorter: () => 0 + 0,
30855
30862
  render: (v, all) => {
30856
30863
  if (all.empty) {
30857
30864
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -30865,9 +30872,11 @@ const getColumns$b = ({
30865
30872
  }
30866
30873
  }, {
30867
30874
  dataIndex: 'mineSite',
30868
- title: t('Position'),
30875
+ title: t('Site'),
30869
30876
  ellipsis: true,
30870
30877
  show: true,
30878
+ key: "mineSite",
30879
+ sorter: () => 0 + 0,
30871
30880
  render: (v, all) => {
30872
30881
  if (all.empty) {
30873
30882
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31112,30 +31121,7 @@ const getFiltersConfig$7 = ({
31112
31121
  flex: 1
31113
31122
  },
31114
31123
  getLabel: option => option.label,
31115
- getValue: option => option.value,
31116
- filterOptions: val => {
31117
- if (val) {
31118
- const {
31119
- option,
31120
- filters
31121
- } = val;
31122
- if (filters && option) {
31123
- const {
31124
- filters: optionFilters
31125
- } = option;
31126
- if (Array.isArray(optionFilters) && optionFilters.length) {
31127
- const {
31128
- value,
31129
- condition
31130
- } = optionFilters[0];
31131
- if (condition === 'includes') {
31132
- return value.includes('corporation');
31133
- }
31134
- }
31135
- }
31136
- }
31137
- return true;
31138
- }
31124
+ getValue: option => option.value
31139
31125
  },
31140
31126
  category: {
31141
31127
  type: 'select',
@@ -31340,6 +31326,8 @@ const getColumns$a = ({
31340
31326
  title: t('ID'),
31341
31327
  ellipsis: true,
31342
31328
  show: true,
31329
+ key: "datastakeId",
31330
+ sorter: () => 0 + 0,
31343
31331
  render: (v, all) => {
31344
31332
  if (all.empty) {
31345
31333
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31356,6 +31344,8 @@ const getColumns$a = ({
31356
31344
  title: t('Title'),
31357
31345
  ellipsis: true,
31358
31346
  show: true,
31347
+ key: "name",
31348
+ sorter: () => 0 + 0,
31359
31349
  render: (v, all) => {
31360
31350
  if (all.empty) {
31361
31351
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31372,6 +31362,8 @@ const getColumns$a = ({
31372
31362
  title: t('Type'),
31373
31363
  ellipsis: true,
31374
31364
  show: true,
31365
+ key: "typeOfEvent",
31366
+ sorter: () => 0 + 0,
31375
31367
  render: (v, all) => {
31376
31368
  if (all.empty) {
31377
31369
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31559,12 +31551,13 @@ const getFiltersConfig$6 = ({
31559
31551
  label: "Timeframe",
31560
31552
  style: {
31561
31553
  flex: 1
31562
- }
31554
+ },
31555
+ t: t
31563
31556
  },
31564
31557
  country: {
31565
31558
  type: 'select',
31566
31559
  label: 'Country',
31567
- placeholder: t => `${t('Filter by')} ${t('Country').toLowerCase()}`,
31560
+ placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
31568
31561
  style: {
31569
31562
  flex: 1
31570
31563
  },
@@ -31597,7 +31590,7 @@ const getFiltersConfig$6 = ({
31597
31590
  }
31598
31591
  return t('Province');
31599
31592
  },
31600
- placeholder: t => `${t('Filter by')} ${t('Province').toLowerCase()}`,
31593
+ placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
31601
31594
  filters: data => ({
31602
31595
  country: data.country,
31603
31596
  level: 'level_1'
@@ -31641,7 +31634,7 @@ const getFiltersConfig$6 = ({
31641
31634
  return t('Province');
31642
31635
  },
31643
31636
  show: data => !(data.country && data.administrativeLevel1),
31644
- placeholder: t => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
31637
+ placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
31645
31638
  filters: data => ({
31646
31639
  country: data.country,
31647
31640
  level: 'level_2',
@@ -31664,7 +31657,7 @@ const getFiltersConfig$6 = ({
31664
31657
  category: {
31665
31658
  type: 'select',
31666
31659
  label: 'Category',
31667
- placeholder: t => `${t('Filter by')} ${t('Category').toLowerCase()}`,
31660
+ placeholder: () => `${t('Filter by')} ${t('Category').toLowerCase()}`,
31668
31661
  style: {
31669
31662
  flex: 1
31670
31663
  },
@@ -31700,7 +31693,7 @@ const getFiltersConfig$6 = ({
31700
31693
  positionInTheMineralSupplyChain: {
31701
31694
  type: 'select',
31702
31695
  label: 'Position',
31703
- placeholder: t => `${t('Filter by')} ${t('Position').toLowerCase()}`,
31696
+ placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
31704
31697
  style: {
31705
31698
  flex: 1
31706
31699
  },
@@ -31713,7 +31706,7 @@ const getFiltersConfig$6 = ({
31713
31706
  status: {
31714
31707
  type: "select",
31715
31708
  label: "Status",
31716
- placeholder: t => `${t("Filter by")} ${t("Status").toLowerCase()}`,
31709
+ placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
31717
31710
  style: {
31718
31711
  flex: 1
31719
31712
  },
@@ -31738,18 +31731,23 @@ const getFilterOptions$6 = (options, t) => {
31738
31731
  administrativeLevel1,
31739
31732
  administrativeLevel2,
31740
31733
  positionInMineralSupplyChainOptions,
31741
- subCategoriesOptions
31734
+ subCategoriesOptions,
31735
+ eventCategoryOptions = []
31742
31736
  } = options || {};
31737
+ const _categoryOptions = eventCategoryOptions?.map(item => ({
31738
+ value: item.value,
31739
+ label: typeof item.label === 'object' ? Object.values(item.label)[1] : item.label
31740
+ }));
31743
31741
  const _default = {
31744
31742
  timeframe: timeframe,
31745
31743
  status: [{
31746
31744
  value: "submitted",
31747
- label: "Submitted"
31745
+ label: t("Submitted")
31748
31746
  }, {
31749
31747
  value: "private",
31750
- label: "Private"
31748
+ label: t("Private")
31751
31749
  }],
31752
- category: stakeholderCategoryOptions || categoryOptions,
31750
+ category: _categoryOptions,
31753
31751
  country: countries,
31754
31752
  subCategory: subCategoriesOptions,
31755
31753
  // category: category,
@@ -31795,6 +31793,8 @@ const getColumns$9 = ({
31795
31793
  title: t('ID'),
31796
31794
  ellipsis: true,
31797
31795
  show: true,
31796
+ key: "datastakeId",
31797
+ sorter: () => 0 + 0,
31798
31798
  render: (v, all) => {
31799
31799
  if (all.empty) {
31800
31800
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31811,6 +31811,8 @@ const getColumns$9 = ({
31811
31811
  title: t('Title'),
31812
31812
  ellipsis: true,
31813
31813
  show: true,
31814
+ key: "name",
31815
+ sorter: () => 0 + 0,
31814
31816
  render: (v, all) => {
31815
31817
  if (all.empty) {
31816
31818
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31826,6 +31828,7 @@ const getColumns$9 = ({
31826
31828
  title: t("Date"),
31827
31829
  dataIndex: "date",
31828
31830
  key: "date",
31831
+ sorter: () => 0 + 0,
31829
31832
  render: (date, all) => {
31830
31833
  if (all.empty) {
31831
31834
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -32172,18 +32175,23 @@ const getFilterOptions$5 = (options, t) => {
32172
32175
  administrativeLevel1,
32173
32176
  administrativeLevel2,
32174
32177
  positionInMineralSupplyChainOptions,
32175
- subCategoriesOptions
32178
+ subCategoriesOptions,
32179
+ eventCategoryOptions = []
32176
32180
  } = options || {};
32181
+ const _categoryOptions = eventCategoryOptions?.map(item => ({
32182
+ value: item.value,
32183
+ label: typeof item.label === 'object' ? Object.values(item.label)[0] : item.label
32184
+ }));
32177
32185
  const _default = {
32178
32186
  timeframe: timeframe,
32179
32187
  status: [{
32180
32188
  value: "submitted",
32181
- label: "Submitted"
32189
+ label: t("Submitted")
32182
32190
  }, {
32183
32191
  value: "private",
32184
- label: "Private"
32192
+ label: t("Private")
32185
32193
  }],
32186
- category: stakeholderCategoryOptions || categoryOptions,
32194
+ category: _categoryOptions,
32187
32195
  country: countries,
32188
32196
  subCategory: subCategoriesOptions,
32189
32197
  // category: category,
@@ -32220,6 +32228,8 @@ const getColumns$8 = ({
32220
32228
  title: t('ID'),
32221
32229
  ellipsis: true,
32222
32230
  show: true,
32231
+ key: "datastakeId",
32232
+ sorter: () => 0 + 0,
32223
32233
  render: (v, all) => {
32224
32234
  if (all.empty) {
32225
32235
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -32236,6 +32246,8 @@ const getColumns$8 = ({
32236
32246
  title: t('Title'),
32237
32247
  ellipsis: true,
32238
32248
  show: true,
32249
+ key: "name",
32250
+ sorter: () => 0 + 0,
32239
32251
  render: (v, all) => {
32240
32252
  if (all.empty) {
32241
32253
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -32251,6 +32263,7 @@ const getColumns$8 = ({
32251
32263
  title: t("Date"),
32252
32264
  dataIndex: "date",
32253
32265
  key: "date",
32266
+ sorter: () => 0 + 0,
32254
32267
  render: (date, all) => {
32255
32268
  if (all.empty) {
32256
32269
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -32638,7 +32651,7 @@ const getFiltersConfig$3 = ({
32638
32651
  country: {
32639
32652
  type: 'select',
32640
32653
  label: 'Country',
32641
- placeholder: t => `${t('Filter by')} ${t('Country').toLowerCase()}`,
32654
+ placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
32642
32655
  style: {
32643
32656
  flex: 1
32644
32657
  },
@@ -32671,7 +32684,7 @@ const getFiltersConfig$3 = ({
32671
32684
  }
32672
32685
  return t('Province');
32673
32686
  },
32674
- placeholder: t => `${t('Filter by')} ${t('Province').toLowerCase()}`,
32687
+ placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
32675
32688
  filters: data => ({
32676
32689
  country: data.country,
32677
32690
  level: 'level_1'
@@ -32715,7 +32728,7 @@ const getFiltersConfig$3 = ({
32715
32728
  return t('Province');
32716
32729
  },
32717
32730
  show: data => !(data.country && data.administrativeLevel1),
32718
- placeholder: t => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
32731
+ placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
32719
32732
  filters: data => ({
32720
32733
  country: data.country,
32721
32734
  level: 'level_2',
@@ -32738,7 +32751,7 @@ const getFiltersConfig$3 = ({
32738
32751
  product: {
32739
32752
  type: 'select',
32740
32753
  label: 'Product',
32741
- placeholder: t => `${t('Filter by')} ${t('Product').toLowerCase()}`,
32754
+ placeholder: () => `${t('Filter by')} ${t('Product').toLowerCase()}`,
32742
32755
  style: {
32743
32756
  flex: 1
32744
32757
  },
@@ -32746,35 +32759,25 @@ const getFiltersConfig$3 = ({
32746
32759
  flex: 1
32747
32760
  },
32748
32761
  getLabel: option => option.label,
32749
- getValue: option => option.value,
32750
- filterOptions: val => {
32751
- if (val) {
32752
- const {
32753
- option,
32754
- filters
32755
- } = val;
32756
- if (filters && option) {
32757
- const {
32758
- filters: optionFilters
32759
- } = option;
32760
- if (Array.isArray(optionFilters) && optionFilters.length) {
32761
- const {
32762
- value,
32763
- condition
32764
- } = optionFilters[0];
32765
- if (condition === 'includes') {
32766
- return value.includes('corporation');
32767
- }
32768
- }
32769
- }
32770
- }
32771
- return true;
32772
- }
32762
+ getValue: option => option.value
32763
+ },
32764
+ type: {
32765
+ type: 'select',
32766
+ label: 'Type',
32767
+ placeholder: () => `${t('Filter by')} ${t('Type').toLowerCase()}`,
32768
+ style: {
32769
+ flex: 1
32770
+ },
32771
+ labelStyle: {
32772
+ flex: 1
32773
+ },
32774
+ getLabel: option => option.label,
32775
+ getValue: option => option.value
32773
32776
  },
32774
32777
  positionInTheMineralSupplyChain: {
32775
32778
  type: 'select',
32776
32779
  label: 'Position',
32777
- placeholder: t => `${t('Filter by')} ${t('Position').toLowerCase()}`,
32780
+ placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
32778
32781
  style: {
32779
32782
  flex: 1
32780
32783
  },
@@ -32787,7 +32790,7 @@ const getFiltersConfig$3 = ({
32787
32790
  status: {
32788
32791
  type: "select",
32789
32792
  label: "Status",
32790
- placeholder: t => `${t("Filter by")} ${t("Status").toLowerCase()}`,
32793
+ placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
32791
32794
  style: {
32792
32795
  flex: 1
32793
32796
  },
@@ -32810,21 +32813,24 @@ const getFilterOptions$3 = (options, t) => {
32810
32813
  stakeholderCategoryOptions,
32811
32814
  stakeholderSubCategoriesOptions,
32812
32815
  administrativeLevel1,
32813
- administrativeLevel2
32816
+ administrativeLevel2,
32817
+ mineralOptions,
32818
+ locationCategories = []
32814
32819
  } = options || {};
32815
32820
  const _default = {
32816
32821
  category: stakeholderCategoryOptions || categoryOptions,
32817
32822
  country: countries,
32818
- product: product,
32823
+ product: mineralOptions,
32824
+ type: locationCategories,
32819
32825
  administrativeLevel1,
32820
32826
  administrativeLevel2,
32821
32827
  subCategory: subCategoriesOptions,
32822
32828
  status: [{
32823
32829
  value: "submitted",
32824
- label: "Submitted"
32830
+ label: t("Submitted")
32825
32831
  }, {
32826
32832
  value: "private",
32827
- label: "Private"
32833
+ label: t("Private")
32828
32834
  }]
32829
32835
  };
32830
32836
  return _default;
@@ -32892,6 +32898,8 @@ const getColumns$6 = ({
32892
32898
  title: t('ID'),
32893
32899
  ellipsis: true,
32894
32900
  show: true,
32901
+ key: "datastakeId",
32902
+ sorter: () => 0 + 0,
32895
32903
  render: (v, all) => {
32896
32904
  if (all.empty) {
32897
32905
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -32908,6 +32916,8 @@ const getColumns$6 = ({
32908
32916
  title: t('Name'),
32909
32917
  ellipsis: true,
32910
32918
  show: true,
32919
+ key: "name",
32920
+ sorter: () => 0 + 0,
32911
32921
  render: (v, all) => {
32912
32922
  if (all.empty) {
32913
32923
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -32955,7 +32965,7 @@ const getColumns$6 = ({
32955
32965
  }
32956
32966
  }, {
32957
32967
  dataIndex: 'category',
32958
- title: t('Type'),
32968
+ title: t('type'),
32959
32969
  ellipsis: true,
32960
32970
  show: true,
32961
32971
  render: (v, all) => {
@@ -33528,6 +33538,12 @@ const TablePage = ({
33528
33538
  breadcrumbs = [],
33529
33539
  onDownload
33530
33540
  }) => {
33541
+ const _options = React.useMemo(() => {
33542
+ return {
33543
+ ...options,
33544
+ ...data?.options
33545
+ };
33546
+ }, [options, data?.options]);
33531
33547
  const {
33532
33548
  activeTab,
33533
33549
  selectOptions,
@@ -33543,7 +33559,7 @@ const TablePage = ({
33543
33559
  location,
33544
33560
  getData,
33545
33561
  extendingFilters,
33546
- options,
33562
+ options: _options,
33547
33563
  t,
33548
33564
  goTo,
33549
33565
  user,
@@ -35083,23 +35099,27 @@ const checkboxConfig = {
35083
35099
  name: "Name",
35084
35100
  datastakeId: "ID"
35085
35101
  };
35086
- const partnerTypes = [{
35087
- label: "Individual",
35088
- value: "individual"
35089
- }, {
35090
- label: "Organisation",
35091
- value: "organisation"
35092
- }];
35093
- const partnershipTypes = [{
35094
- label: "Source",
35095
- value: "source"
35096
- }, {
35097
- label: "Client",
35098
- value: "client"
35099
- }, {
35100
- label: "Exchange",
35101
- value: "exchange"
35102
- }];
35102
+ const getPartnerTypes = t => {
35103
+ return [{
35104
+ label: t("Individual"),
35105
+ value: "individual"
35106
+ }, {
35107
+ label: t("Organisation"),
35108
+ value: "organisation"
35109
+ }];
35110
+ };
35111
+ const getPartnershipTypes = t => {
35112
+ return [{
35113
+ label: t("Source"),
35114
+ value: "source"
35115
+ }, {
35116
+ label: t("Client"),
35117
+ value: "client"
35118
+ }, {
35119
+ label: t("Exchange"),
35120
+ value: "exchange"
35121
+ }];
35122
+ };
35103
35123
 
35104
35124
  const getColumns$2 = ({
35105
35125
  t,
@@ -35152,6 +35172,7 @@ const getColumns$2 = ({
35152
35172
  className: "daf-default-cell"
35153
35173
  });
35154
35174
  }
35175
+ const partnershipTypes = getPartnershipTypes(t);
35155
35176
  return partnershipTypes.find(v => v.value === val)?.label || val || "-";
35156
35177
  }
35157
35178
  }, {
@@ -35168,6 +35189,7 @@ const getColumns$2 = ({
35168
35189
  className: "daf-default-cell"
35169
35190
  });
35170
35191
  }
35192
+ const partnerTypes = getPartnerTypes(t);
35171
35193
  return partnerTypes.find(v => v.value === val)?.label || val || "-";
35172
35194
  }
35173
35195
  }, {
@@ -35473,6 +35495,8 @@ const Create = ({
35473
35495
  getAppHeader = () => {},
35474
35496
  getApiBaseUrl = () => {}
35475
35497
  }) => {
35498
+ const partnerTypes = React.useMemo(() => getPartnerTypes(t), [t]);
35499
+ const partnershipTypes = React.useMemo(() => getPartnershipTypes(t), [t]);
35476
35500
  const form = React.useMemo(() => ({
35477
35501
  identification: {
35478
35502
  partnershipType: {
@@ -35679,6 +35703,8 @@ const Edit = ({
35679
35703
  }) => {
35680
35704
  const [MainForm] = antd.Form.useForm();
35681
35705
  const [loading, setLoading] = React.useState(false);
35706
+ React.useMemo(() => getPartnerTypes(t), [t]);
35707
+ const partnershipTypes = React.useMemo(() => getPartnershipTypes(t), [t]);
35682
35708
  React.useEffect(() => {
35683
35709
  MainForm.setFieldsValue({
35684
35710
  ...partner,
@@ -37235,6 +37261,9 @@ const TradeRelationships = ({
37235
37261
  operatorData,
37236
37262
  APP
37237
37263
  });
37264
+ console.log({
37265
+ graphData
37266
+ });
37238
37267
  React.useEffect(() => {
37239
37268
  const defaultProduct = filterConfig?.[0]?.options?.[0]?.value;
37240
37269
  if (!filters.products && defaultProduct) {
@@ -37914,12 +37943,12 @@ const OperatorSummary = ({
37914
37943
  });
37915
37944
  return /*#__PURE__*/jsxRuntime.jsxs(DashboardLayout, {
37916
37945
  header: /*#__PURE__*/jsxRuntime.jsx(DAFHeader, {
37917
- title: hasSelect ? t("Operator Review") : (singleItemData?.name || "") + " " + t("Summary"),
37946
+ title: hasSelect ? t("Operator Review") : `${singleItemData?.name || ""} ${singleItemData?.name ? t("Summary") : ""}`,
37918
37947
  className: "with-border-header h-w-btn-header no-px-body",
37919
37948
  goBackTo: !hasSelect && goBack,
37920
37949
  breadcrumbs: breadcrumbs,
37921
37950
  addedHeaderFirst: true,
37922
- actionButtons: [{
37951
+ actionButtons: hasSelect ? [] : [{
37923
37952
  tooltip: t("Details"),
37924
37953
  icon: "FileEdit",
37925
37954
  onClick: () => {
@@ -37933,9 +37962,6 @@ const OperatorSummary = ({
37933
37962
  }],
37934
37963
  addedHeader: /*#__PURE__*/jsxRuntime.jsx("div", {
37935
37964
  className: "flex flex-row gap-4",
37936
- style: {
37937
- marginRight: 8
37938
- },
37939
37965
  children: /*#__PURE__*/jsxRuntime.jsx(Multiselect, {
37940
37966
  options: [...sourceOptions],
37941
37967
  isAvatarGroup: true,
@@ -37951,7 +37977,10 @@ const OperatorSummary = ({
37951
37977
  dropDownWidth: 200,
37952
37978
  defaultSelected: (partners || []).map(p => p.id) || []
37953
37979
  }, partners?.length)
37954
- })
37980
+ }),
37981
+ onDownload: () => {
37982
+ console.log("onDownload");
37983
+ }
37955
37984
  }),
37956
37985
  children: [hasSelect && /*#__PURE__*/jsxRuntime.jsx("section", {
37957
37986
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
@@ -47063,13 +47092,12 @@ const MineSummary = ({
47063
47092
  });
47064
47093
  return /*#__PURE__*/jsxRuntime.jsxs(DashboardLayout, {
47065
47094
  header: /*#__PURE__*/jsxRuntime.jsx(DAFHeader, {
47066
- title: hasSelect ? t("Mine Review") : (singleItemData?.name || "") + " " + t("Summary"),
47095
+ title: hasSelect ? t("Mine Review") : `${singleItemData?.name || ""} ${singleItemData?.name ? t("Summary") : ""}`,
47067
47096
  className: "with-border-header h-w-btn-header no-px-body",
47068
47097
  goBackTo: !hasSelect && goBack,
47069
- loading: loading,
47070
47098
  breadcrumbs: breadcrumbs,
47071
47099
  addedHeaderFirst: true,
47072
- actionButtons: [{
47100
+ actionButtons: hasSelect ? [] : [{
47073
47101
  tooltip: t("Details"),
47074
47102
  icon: "FileEdit",
47075
47103
  onClick: () => {
@@ -47083,9 +47111,6 @@ const MineSummary = ({
47083
47111
  }],
47084
47112
  addedHeader: /*#__PURE__*/jsxRuntime.jsx("div", {
47085
47113
  className: "flex flex-row gap-4",
47086
- style: {
47087
- marginRight: 8
47088
- },
47089
47114
  children: /*#__PURE__*/jsxRuntime.jsx(Multiselect, {
47090
47115
  options: [...sourceOptions],
47091
47116
  isAvatarGroup: true,
@@ -47101,7 +47126,10 @@ const MineSummary = ({
47101
47126
  dropDownWidth: 200,
47102
47127
  defaultSelected: (partners || []).map(p => p.id) || []
47103
47128
  }, partners?.length)
47104
- })
47129
+ }),
47130
+ onDownload: () => {
47131
+ console.log("onDownload");
47132
+ }
47105
47133
  }),
47106
47134
  children: [hasSelect && /*#__PURE__*/jsxRuntime.jsx("section", {
47107
47135
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
@@ -47258,19 +47286,19 @@ const usePrepareForm = ({
47258
47286
  linkingForms = {}
47259
47287
  } = JSON.parse(JSON.stringify(allData[dKey][nKey] || {}));
47260
47288
  if (data.datastakeId === id || id === "user") {
47261
- if (viewConfig.linkingSubjects.includes(namespace)) {
47262
- setForm({
47263
- ...form,
47264
- linking: {
47265
- position: 100,
47266
- excludeFromEdit: true,
47267
- label: t("Linked Subjects"),
47268
- template: "linkingSubjects"
47269
- }
47270
- });
47271
- } else {
47272
- setForm(form);
47273
- }
47289
+ // if (viewConfig.linkingSubjects.includes(namespace)) {
47290
+ setForm({
47291
+ ...form,
47292
+ linking: {
47293
+ position: 100,
47294
+ excludeFromEdit: true,
47295
+ label: t("Linked Subjects"),
47296
+ template: "linkingSubjects"
47297
+ }
47298
+ });
47299
+ // } else {
47300
+ // setForm(form);
47301
+ // }
47274
47302
  setData(data);
47275
47303
  setGroups(config.groups || {});
47276
47304
  setLinkingForms(linkingForms);
@@ -47577,6 +47605,18 @@ const renderType = ({
47577
47605
  }
47578
47606
  return "--";
47579
47607
  };
47608
+ const namespaceMap = {
47609
+ locations: "location",
47610
+ documents: "document",
47611
+ stakeholders: "stakeholder",
47612
+ events: "event",
47613
+ incidents: "event",
47614
+ correctiveActions: "event",
47615
+ "production-sites": "location",
47616
+ operators: "stakeholder",
47617
+ workers: "stakeholder",
47618
+ activities: "event"
47619
+ };
47580
47620
 
47581
47621
  const getColumns = ({
47582
47622
  t,
@@ -47831,10 +47871,11 @@ const LinkingTemplate = ({
47831
47871
  }), [conf]);
47832
47872
  const id = conf.allData.id;
47833
47873
  const dataSource = conf?.linkingTemplateContextData?.[id];
47874
+ const _namespace = namespaceMap[namespace];
47834
47875
  const changeData = async () => {
47835
47876
  try {
47836
47877
  const _data = await LinkedSubjectsService$1.getLinkedSubjects({
47837
- namespace,
47878
+ namespace: _namespace,
47838
47879
  id,
47839
47880
  mod: conf.mod
47840
47881
  });
@@ -47920,18 +47961,10 @@ function Template({
47920
47961
  conf,
47921
47962
  namespace
47922
47963
  }) {
47923
- switch (namespace) {
47924
- case 'locations':
47925
- case 'documents':
47926
- case 'stakeholders':
47927
- case 'events':
47928
- return /*#__PURE__*/jsxRuntime.jsx(LinkingTemplate, {
47929
- conf: conf,
47930
- namespace: namespace
47931
- });
47932
- default:
47933
- return null;
47934
- }
47964
+ return /*#__PURE__*/jsxRuntime.jsx(LinkingTemplate, {
47965
+ conf: conf,
47966
+ namespace: namespace
47967
+ });
47935
47968
  }
47936
47969
 
47937
47970
  const View = ({
@@ -48145,14 +48178,12 @@ const View = ({
48145
48178
  addedHeaderFirst: true,
48146
48179
  addedHeader: /*#__PURE__*/jsxRuntime.jsx("div", {
48147
48180
  className: "flex flex-row gap-4",
48148
- style: {
48149
- marginRight: 8
48150
- },
48151
48181
  children: /*#__PURE__*/jsxRuntime.jsx(Multiselect, {
48152
48182
  options: [...sourceOptions],
48153
48183
  isAvatarGroup: true,
48154
48184
  selectionType: "checkbox",
48155
48185
  canUnselectLast: false,
48186
+ isSingle: true,
48156
48187
  onChange: selected => {
48157
48188
  setSelectedPartners(prev => ({
48158
48189
  ...prev,