datastake-daf 0.6.754 → 0.6.755

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.
@@ -13282,7 +13282,7 @@ const getTabs = t => {
13282
13282
  label: t("Events")
13283
13283
  }];
13284
13284
  };
13285
- const getFiltersConfig$9 = (t, filters, locationCategories) => {
13285
+ const getFiltersConfig$a = (t, filters, locationCategories) => {
13286
13286
  const value = filters.type ? {
13287
13287
  value: filters.type
13288
13288
  } : {};
@@ -13485,7 +13485,7 @@ function MineSites({
13485
13485
  config: dataFetchConfig
13486
13486
  });
13487
13487
  const tabs = React.useMemo(() => getTabs(t), [t]);
13488
- const filtersConfig = React.useMemo(() => getFiltersConfig$9(t, filters, locationCategories), [activeTab, filters, t, locationCategories]);
13488
+ const filtersConfig = React.useMemo(() => getFiltersConfig$a(t, filters, locationCategories), [activeTab, filters, t, locationCategories]);
13489
13489
  const onFilterChange = filters => {
13490
13490
  setFilters(p => ({
13491
13491
  ...p,
@@ -16039,7 +16039,7 @@ const getLinkValue$4 = (value, linkingObject) => {
16039
16039
  }
16040
16040
  return null;
16041
16041
  };
16042
- const getColumns$8 = ({
16042
+ const getColumns$9 = ({
16043
16043
  t,
16044
16044
  goTo,
16045
16045
  user,
@@ -16242,11 +16242,11 @@ const getColumns$8 = ({
16242
16242
  }
16243
16243
  }].filter(column => column.show !== false);
16244
16244
 
16245
- const checkboxConfig$8 = {
16245
+ const checkboxConfig$9 = {
16246
16246
  name: 'Name',
16247
16247
  datastakeId: 'ID'
16248
16248
  };
16249
- const getFiltersConfig$8 = ({
16249
+ const getFiltersConfig$9 = ({
16250
16250
  t
16251
16251
  }) => {
16252
16252
  return {
@@ -16414,11 +16414,11 @@ const getFiltersConfig$8 = ({
16414
16414
  }
16415
16415
  };
16416
16416
  };
16417
- const filtersConfig$8 = {
16417
+ const filtersConfig$9 = {
16418
16418
  name: '',
16419
16419
  datastakeId: ''
16420
16420
  };
16421
- const getFilterOptions$8 = (options, t) => {
16421
+ const getFilterOptions$9 = (options, t) => {
16422
16422
  const {
16423
16423
  statusOptions = [],
16424
16424
  categoryOptions = [],
@@ -30028,7 +30028,7 @@ const OperatorsTable = ({
30028
30028
  }) => {
30029
30029
  const [selectOptions, setSelectOptions] = React.useState();
30030
30030
  const [activeTab, setActiveTab] = React.useState('own');
30031
- const columns = React.useMemo(() => getColumns$8({
30031
+ const columns = React.useMemo(() => getColumns$9({
30032
30032
  t,
30033
30033
  goTo,
30034
30034
  user,
@@ -30071,14 +30071,14 @@ const OperatorsTable = ({
30071
30071
  }, 'operators');
30072
30072
  }, [location.search, activeTab, JSON.stringify(extendingFilters)]);
30073
30073
  const selectFiltersConfig = React.useMemo(() => {
30074
- return getFiltersConfig$8({
30074
+ return getFiltersConfig$9({
30075
30075
  t
30076
30076
  });
30077
30077
  }, [t]);
30078
30078
  React.useEffect(() => {
30079
30079
  setSelectOptions(prev => ({
30080
30080
  ...prev,
30081
- ...getFilterOptions$8(options)
30081
+ ...getFilterOptions$9(options)
30082
30082
  }));
30083
30083
  }, [options, t]);
30084
30084
  const handleActiveTabChange = React.useCallback(value => {
@@ -30094,13 +30094,13 @@ const OperatorsTable = ({
30094
30094
  defaultActiveTab: "own",
30095
30095
  columns: columns,
30096
30096
  data: data,
30097
- checkboxConfig: checkboxConfig$8,
30097
+ checkboxConfig: checkboxConfig$9,
30098
30098
  APP: APP,
30099
30099
  getApiBaseUrl: getApiBaseUrl,
30100
30100
  selectOptions: selectOptions,
30101
30101
  selectFiltersConfig: selectFiltersConfig,
30102
30102
  getRedirectLink: getRedirectLink,
30103
- filtersConfig: filtersConfig$8,
30103
+ filtersConfig: filtersConfig$9,
30104
30104
  isMobile: isMobile,
30105
30105
  view: "operators",
30106
30106
  getActiveTab: handleActiveTabChange,
@@ -30147,7 +30147,7 @@ const getLinkValue$3 = (value, linkingObject) => {
30147
30147
  }
30148
30148
  return null;
30149
30149
  };
30150
- const getColumns$7 = ({
30150
+ const getColumns$8 = ({
30151
30151
  t,
30152
30152
  goTo,
30153
30153
  user,
@@ -30333,11 +30333,11 @@ const getColumns$7 = ({
30333
30333
  }
30334
30334
  }].filter(column => column.show !== false);
30335
30335
 
30336
- const checkboxConfig$7 = {
30336
+ const checkboxConfig$8 = {
30337
30337
  name: 'Name',
30338
30338
  datastakeId: 'ID'
30339
30339
  };
30340
- const getFiltersConfig$7 = ({
30340
+ const getFiltersConfig$8 = ({
30341
30341
  t
30342
30342
  }) => {
30343
30343
  return {
@@ -30368,11 +30368,11 @@ const getFiltersConfig$7 = ({
30368
30368
  }
30369
30369
  };
30370
30370
  };
30371
- const filtersConfig$7 = {
30371
+ const filtersConfig$8 = {
30372
30372
  name: '',
30373
30373
  datastakeId: ''
30374
30374
  };
30375
- const getFilterOptions$7 = (options, t) => {
30375
+ const getFilterOptions$8 = (options, t) => {
30376
30376
  const {
30377
30377
  countries = [],
30378
30378
  category = []
@@ -30515,7 +30515,7 @@ const LocationsTable = ({
30515
30515
  }) => {
30516
30516
  const [selectOptions, setSelectOptions] = React.useState();
30517
30517
  const [activeTab, setActiveTab] = React.useState("own");
30518
- const columns = React.useMemo(() => getColumns$7({
30518
+ const columns = React.useMemo(() => getColumns$8({
30519
30519
  t,
30520
30520
  goTo,
30521
30521
  user,
@@ -30551,14 +30551,14 @@ const LocationsTable = ({
30551
30551
  data
30552
30552
  });
30553
30553
  const selectFiltersConfig = React.useMemo(() => {
30554
- return getFiltersConfig$7({
30554
+ return getFiltersConfig$8({
30555
30555
  t
30556
30556
  });
30557
30557
  }, [t]);
30558
30558
  React.useEffect(() => {
30559
30559
  setSelectOptions(prev => ({
30560
30560
  ...prev,
30561
- ...getFilterOptions$7(options)
30561
+ ...getFilterOptions$8(options)
30562
30562
  }));
30563
30563
  }, [options, t]);
30564
30564
  const handleActiveTabChange = React.useCallback(value => {
@@ -30577,13 +30577,13 @@ const LocationsTable = ({
30577
30577
  defaultActiveTab: "own",
30578
30578
  columns: columns,
30579
30579
  data: data,
30580
- checkboxConfig: checkboxConfig$7,
30580
+ checkboxConfig: checkboxConfig$8,
30581
30581
  APP: APP,
30582
30582
  getApiBaseUrl: getApiBaseUrl,
30583
30583
  selectOptions: selectOptions,
30584
30584
  selectFiltersConfig: selectFiltersConfig,
30585
30585
  getRedirectLink: getRedirectLink,
30586
- filtersConfig: filtersConfig$7,
30586
+ filtersConfig: filtersConfig$8,
30587
30587
  isMobile: isMobile,
30588
30588
  view: "locations",
30589
30589
  getActiveTab: handleActiveTabChange,
@@ -30622,7 +30622,7 @@ const LocationsTable = ({
30622
30622
  });
30623
30623
  };
30624
30624
 
30625
- const getColumns$6 = ({
30625
+ const getColumns$7 = ({
30626
30626
  t,
30627
30627
  goTo,
30628
30628
  user,
@@ -30793,11 +30793,11 @@ const getColumns$6 = ({
30793
30793
  }
30794
30794
  }].filter(column => column.show !== false);
30795
30795
 
30796
- const checkboxConfig$6 = {
30796
+ const checkboxConfig$7 = {
30797
30797
  name: 'Name',
30798
30798
  datastakeId: 'ID'
30799
30799
  };
30800
- const getFiltersConfig$6 = ({
30800
+ const getFiltersConfig$7 = ({
30801
30801
  t
30802
30802
  }) => {
30803
30803
  return {
@@ -30828,11 +30828,11 @@ const getFiltersConfig$6 = ({
30828
30828
  }
30829
30829
  };
30830
30830
  };
30831
- const filtersConfig$6 = {
30831
+ const filtersConfig$7 = {
30832
30832
  name: '',
30833
30833
  datastakeId: ''
30834
30834
  };
30835
- const getFilterOptions$6 = (options, t) => {
30835
+ const getFilterOptions$7 = (options, t) => {
30836
30836
  const {
30837
30837
  countries = [],
30838
30838
  category = []
@@ -30975,7 +30975,7 @@ const StakeholdersTable = ({
30975
30975
  }) => {
30976
30976
  const [selectOptions, setSelectOptions] = React.useState();
30977
30977
  const [activeTab, setActiveTab] = React.useState("own");
30978
- const columns = React.useMemo(() => getColumns$6({
30978
+ const columns = React.useMemo(() => getColumns$7({
30979
30979
  t,
30980
30980
  goTo,
30981
30981
  user,
@@ -31007,14 +31007,14 @@ const StakeholdersTable = ({
31007
31007
  }, 'stakeholders');
31008
31008
  }, [paginationQuery, otherParams, searchParams, activeTab]);
31009
31009
  const selectFiltersConfig = React.useMemo(() => {
31010
- return getFiltersConfig$6({
31010
+ return getFiltersConfig$7({
31011
31011
  t
31012
31012
  });
31013
31013
  }, [t]);
31014
31014
  React.useEffect(() => {
31015
31015
  setSelectOptions(prev => ({
31016
31016
  ...prev,
31017
- ...getFilterOptions$6(options)
31017
+ ...getFilterOptions$7(options)
31018
31018
  }));
31019
31019
  }, [options, t]);
31020
31020
  const handleActiveTabChange = React.useCallback(value => {
@@ -31033,13 +31033,13 @@ const StakeholdersTable = ({
31033
31033
  defaultActiveTab: "own",
31034
31034
  columns: columns,
31035
31035
  data: data,
31036
- checkboxConfig: checkboxConfig$6,
31036
+ checkboxConfig: checkboxConfig$7,
31037
31037
  APP: APP,
31038
31038
  getApiBaseUrl: getApiBaseUrl,
31039
31039
  selectOptions: selectOptions,
31040
31040
  selectFiltersConfig: selectFiltersConfig,
31041
31041
  getRedirectLink: getRedirectLink,
31042
- filtersConfig: filtersConfig$6,
31042
+ filtersConfig: filtersConfig$7,
31043
31043
  isMobile: isMobile,
31044
31044
  view: "stakeholders",
31045
31045
  getActiveTab: handleActiveTabChange,
@@ -31221,7 +31221,7 @@ const renderEventStatusTag = ({
31221
31221
  });
31222
31222
  }
31223
31223
  };
31224
- const getColumns$5 = ({
31224
+ const getColumns$6 = ({
31225
31225
  t,
31226
31226
  goTo,
31227
31227
  user,
@@ -31455,11 +31455,11 @@ const getColumns$5 = ({
31455
31455
  }
31456
31456
  }].filter(column => column.show !== false);
31457
31457
 
31458
- const checkboxConfig$5 = {
31458
+ const checkboxConfig$6 = {
31459
31459
  name: 'Name',
31460
31460
  datastakeId: 'ID'
31461
31461
  };
31462
- const getFiltersConfig$5 = ({
31462
+ const getFiltersConfig$6 = ({
31463
31463
  t
31464
31464
  }) => {
31465
31465
  return {
@@ -31647,11 +31647,11 @@ const getFiltersConfig$5 = ({
31647
31647
  }
31648
31648
  };
31649
31649
  };
31650
- const filtersConfig$5 = {
31650
+ const filtersConfig$6 = {
31651
31651
  name: '',
31652
31652
  datastakeId: ''
31653
31653
  };
31654
- const getFilterOptions$5 = (options, t) => {
31654
+ const getFilterOptions$6 = (options, t) => {
31655
31655
  const {
31656
31656
  timeframe = [],
31657
31657
  status = [],
@@ -31809,7 +31809,7 @@ const EventsTable = ({
31809
31809
  }) => {
31810
31810
  const [selectOptions, setSelectOptions] = React.useState();
31811
31811
  const [activeTab, setActiveTab] = React.useState("own");
31812
- const columns = React.useMemo(() => getColumns$5({
31812
+ const columns = React.useMemo(() => getColumns$6({
31813
31813
  t,
31814
31814
  goTo,
31815
31815
  user,
@@ -31853,14 +31853,14 @@ const EventsTable = ({
31853
31853
  }, 'events');
31854
31854
  }, [location.search, activeTab, JSON.stringify(extendingFilters)]);
31855
31855
  const selectFiltersConfig = React.useMemo(() => {
31856
- return getFiltersConfig$5({
31856
+ return getFiltersConfig$6({
31857
31857
  t
31858
31858
  });
31859
31859
  }, [t]);
31860
31860
  React.useEffect(() => {
31861
31861
  setSelectOptions(prev => ({
31862
31862
  ...prev,
31863
- ...getFilterOptions$5(options)
31863
+ ...getFilterOptions$6(options)
31864
31864
  }));
31865
31865
  }, [options, t]);
31866
31866
  const handleActiveTabChange = React.useCallback(value => {
@@ -31879,13 +31879,13 @@ const EventsTable = ({
31879
31879
  defaultActiveTab: "own",
31880
31880
  columns: columns,
31881
31881
  data: data,
31882
- checkboxConfig: checkboxConfig$5,
31882
+ checkboxConfig: checkboxConfig$6,
31883
31883
  APP: APP,
31884
31884
  getApiBaseUrl: getApiBaseUrl,
31885
31885
  selectOptions: selectOptions,
31886
31886
  selectFiltersConfig: selectFiltersConfig,
31887
31887
  getRedirectLink: getRedirectLink,
31888
- filtersConfig: filtersConfig$5,
31888
+ filtersConfig: filtersConfig$6,
31889
31889
  isMobile: isMobile,
31890
31890
  view: "events",
31891
31891
  getActiveTab: handleActiveTabChange,
@@ -31925,7 +31925,7 @@ const EventsTable = ({
31925
31925
  });
31926
31926
  };
31927
31927
 
31928
- const getColumns$4 = ({
31928
+ const getColumns$5 = ({
31929
31929
  t,
31930
31930
  goTo,
31931
31931
  user,
@@ -32059,11 +32059,11 @@ const getColumns$4 = ({
32059
32059
  }
32060
32060
  }].filter(column => column.show !== false);
32061
32061
 
32062
- const checkboxConfig$4 = {
32062
+ const checkboxConfig$5 = {
32063
32063
  name: 'Name',
32064
32064
  datastakeId: 'ID'
32065
32065
  };
32066
- const getFiltersConfig$4 = ({
32066
+ const getFiltersConfig$5 = ({
32067
32067
  t
32068
32068
  }) => {
32069
32069
  return {
@@ -32076,11 +32076,11 @@ const getFiltersConfig$4 = ({
32076
32076
  }
32077
32077
  };
32078
32078
  };
32079
- const filtersConfig$4 = {
32079
+ const filtersConfig$5 = {
32080
32080
  name: '',
32081
32081
  datastakeId: ''
32082
32082
  };
32083
- const getFilterOptions$4 = (options, t) => {
32083
+ const getFilterOptions$5 = (options, t) => {
32084
32084
  const {
32085
32085
  timeframe = []
32086
32086
  } = options || {};
@@ -32221,7 +32221,7 @@ const DocumentsTable = ({
32221
32221
  }) => {
32222
32222
  const [selectOptions, setSelectOptions] = React.useState();
32223
32223
  const [activeTab, setActiveTab] = React.useState("own");
32224
- const columns = React.useMemo(() => getColumns$4({
32224
+ const columns = React.useMemo(() => getColumns$5({
32225
32225
  t,
32226
32226
  goTo,
32227
32227
  user,
@@ -32258,14 +32258,14 @@ const DocumentsTable = ({
32258
32258
  }, 'documents');
32259
32259
  }, [paginationQuery, otherParams, searchParams, activeTab]);
32260
32260
  const selectFiltersConfig = React.useMemo(() => {
32261
- return getFiltersConfig$4({
32261
+ return getFiltersConfig$5({
32262
32262
  t
32263
32263
  });
32264
32264
  }, [t]);
32265
32265
  React.useEffect(() => {
32266
32266
  setSelectOptions(prev => ({
32267
32267
  ...prev,
32268
- ...getFilterOptions$4(options)
32268
+ ...getFilterOptions$5(options)
32269
32269
  }));
32270
32270
  }, [options, t]);
32271
32271
  const handleActiveTabChange = React.useCallback(value => {
@@ -32284,13 +32284,13 @@ const DocumentsTable = ({
32284
32284
  defaultActiveTab: "own",
32285
32285
  columns: columns,
32286
32286
  data: data,
32287
- checkboxConfig: checkboxConfig$4,
32287
+ checkboxConfig: checkboxConfig$5,
32288
32288
  APP: APP,
32289
32289
  getApiBaseUrl: getApiBaseUrl,
32290
32290
  selectOptions: selectOptions,
32291
32291
  selectFiltersConfig: selectFiltersConfig,
32292
32292
  getRedirectLink: getRedirectLink,
32293
- filtersConfig: filtersConfig$4,
32293
+ filtersConfig: filtersConfig$5,
32294
32294
  isMobile: isMobile,
32295
32295
  view: "documents",
32296
32296
  getActiveTab: handleActiveTabChange,
@@ -32364,7 +32364,7 @@ const renderStatusTag$2 = ({
32364
32364
  });
32365
32365
  }
32366
32366
  };
32367
- const getColumns$3 = ({
32367
+ const getColumns$4 = ({
32368
32368
  t,
32369
32369
  goTo,
32370
32370
  user,
@@ -32536,11 +32536,11 @@ const getColumns$3 = ({
32536
32536
  }
32537
32537
  }].filter(column => column.show !== false);
32538
32538
 
32539
- const checkboxConfig$3 = {
32539
+ const checkboxConfig$4 = {
32540
32540
  name: 'Name',
32541
32541
  datastakeId: 'ID'
32542
32542
  };
32543
- const getFiltersConfig$3 = ({
32543
+ const getFiltersConfig$4 = ({
32544
32544
  t
32545
32545
  }) => {
32546
32546
  return {
@@ -32708,11 +32708,11 @@ const getFiltersConfig$3 = ({
32708
32708
  }
32709
32709
  };
32710
32710
  };
32711
- const filtersConfig$3 = {
32711
+ const filtersConfig$4 = {
32712
32712
  name: '',
32713
32713
  datastakeId: ''
32714
32714
  };
32715
- const getFilterOptions$3 = (options, t) => {
32715
+ const getFilterOptions$4 = (options, t) => {
32716
32716
  const {
32717
32717
  statusOptions = [],
32718
32718
  categoryOptions = [],
@@ -32880,7 +32880,7 @@ const WorkersTable = ({
32880
32880
  }) => {
32881
32881
  const [selectOptions, setSelectOptions] = React.useState();
32882
32882
  const [activeTab, setActiveTab] = React.useState('own');
32883
- const columns = React.useMemo(() => getColumns$3({
32883
+ const columns = React.useMemo(() => getColumns$4({
32884
32884
  t,
32885
32885
  goTo,
32886
32886
  user,
@@ -32923,14 +32923,14 @@ const WorkersTable = ({
32923
32923
  }, 'workers');
32924
32924
  }, [location.search, activeTab, JSON.stringify(extendingFilters)]);
32925
32925
  const selectFiltersConfig = React.useMemo(() => {
32926
- return getFiltersConfig$3({
32926
+ return getFiltersConfig$4({
32927
32927
  t
32928
32928
  });
32929
32929
  }, [t]);
32930
32930
  React.useEffect(() => {
32931
32931
  setSelectOptions(prev => ({
32932
32932
  ...prev,
32933
- ...getFilterOptions$3(options)
32933
+ ...getFilterOptions$4(options)
32934
32934
  }));
32935
32935
  }, [options, t]);
32936
32936
  const handleActiveTabChange = React.useCallback(value => {
@@ -32946,13 +32946,13 @@ const WorkersTable = ({
32946
32946
  defaultActiveTab: "own",
32947
32947
  columns: columns,
32948
32948
  data: data,
32949
- checkboxConfig: checkboxConfig$3,
32949
+ checkboxConfig: checkboxConfig$4,
32950
32950
  APP: APP,
32951
32951
  getApiBaseUrl: getApiBaseUrl,
32952
32952
  selectOptions: selectOptions,
32953
32953
  selectFiltersConfig: selectFiltersConfig,
32954
32954
  getRedirectLink: getRedirectLink,
32955
- filtersConfig: filtersConfig$3,
32955
+ filtersConfig: filtersConfig$4,
32956
32956
  isMobile: isMobile,
32957
32957
  view: "workers",
32958
32958
  getActiveTab: handleActiveTabChange,
@@ -33042,7 +33042,7 @@ const renderStatusTag$1 = ({
33042
33042
  });
33043
33043
  }
33044
33044
  };
33045
- const getColumns$2 = ({
33045
+ const getColumns$3 = ({
33046
33046
  t,
33047
33047
  goTo,
33048
33048
  user,
@@ -33262,11 +33262,11 @@ const getColumns$2 = ({
33262
33262
  }
33263
33263
  }].filter(column => column.show !== false);
33264
33264
 
33265
- const checkboxConfig$2 = {
33265
+ const checkboxConfig$3 = {
33266
33266
  name: 'Name',
33267
33267
  datastakeId: 'ID'
33268
33268
  };
33269
- const getFiltersConfig$2 = ({
33269
+ const getFiltersConfig$3 = ({
33270
33270
  t
33271
33271
  }) => {
33272
33272
  return {
@@ -33441,11 +33441,11 @@ const getFiltersConfig$2 = ({
33441
33441
  }
33442
33442
  };
33443
33443
  };
33444
- const filtersConfig$2 = {
33444
+ const filtersConfig$3 = {
33445
33445
  name: '',
33446
33446
  datastakeId: ''
33447
33447
  };
33448
- const getFilterOptions$2 = (options, t) => {
33448
+ const getFilterOptions$3 = (options, t) => {
33449
33449
  const {
33450
33450
  timeframe = [],
33451
33451
  statusOptions = [],
@@ -33615,7 +33615,7 @@ const ActivitiesTable = ({
33615
33615
  }) => {
33616
33616
  const [selectOptions, setSelectOptions] = React.useState();
33617
33617
  const [activeTab, setActiveTab] = React.useState("own");
33618
- const columns = React.useMemo(() => getColumns$2({
33618
+ const columns = React.useMemo(() => getColumns$3({
33619
33619
  t,
33620
33620
  goTo,
33621
33621
  user,
@@ -33658,14 +33658,14 @@ const ActivitiesTable = ({
33658
33658
  }, 'activities');
33659
33659
  }, [location.search, activeTab, JSON.stringify(extendingFilters)]);
33660
33660
  const selectFiltersConfig = React.useMemo(() => {
33661
- return getFiltersConfig$2({
33661
+ return getFiltersConfig$3({
33662
33662
  t
33663
33663
  });
33664
33664
  }, [t]);
33665
33665
  React.useEffect(() => {
33666
33666
  setSelectOptions(prev => ({
33667
33667
  ...prev,
33668
- ...getFilterOptions$2(options)
33668
+ ...getFilterOptions$3(options)
33669
33669
  }));
33670
33670
  }, [options, t]);
33671
33671
  const handleActiveTabChange = React.useCallback(value => {
@@ -33681,13 +33681,13 @@ const ActivitiesTable = ({
33681
33681
  defaultActiveTab: "own",
33682
33682
  columns: columns,
33683
33683
  data: data,
33684
- checkboxConfig: checkboxConfig$2,
33684
+ checkboxConfig: checkboxConfig$3,
33685
33685
  APP: APP,
33686
33686
  getApiBaseUrl: getApiBaseUrl,
33687
33687
  selectOptions: selectOptions,
33688
33688
  selectFiltersConfig: selectFiltersConfig,
33689
33689
  getRedirectLink: getRedirectLink,
33690
- filtersConfig: filtersConfig$2,
33690
+ filtersConfig: filtersConfig$3,
33691
33691
  isMobile: isMobile,
33692
33692
  view: "activities",
33693
33693
  getActiveTab: handleActiveTabChange,
@@ -33777,7 +33777,7 @@ const renderStatusTag = ({
33777
33777
  });
33778
33778
  }
33779
33779
  };
33780
- const getColumns$1 = ({
33780
+ const getColumns$2 = ({
33781
33781
  t,
33782
33782
  goTo,
33783
33783
  user,
@@ -33988,11 +33988,11 @@ const getColumns$1 = ({
33988
33988
  }
33989
33989
  }].filter(column => column.show !== false);
33990
33990
 
33991
- const checkboxConfig$1 = {
33991
+ const checkboxConfig$2 = {
33992
33992
  name: 'Name',
33993
33993
  datastakeId: 'ID'
33994
33994
  };
33995
- const getFiltersConfig$1 = ({
33995
+ const getFiltersConfig$2 = ({
33996
33996
  t
33997
33997
  }) => {
33998
33998
  return {
@@ -34167,11 +34167,11 @@ const getFiltersConfig$1 = ({
34167
34167
  }
34168
34168
  };
34169
34169
  };
34170
- const filtersConfig$1 = {
34170
+ const filtersConfig$2 = {
34171
34171
  name: '',
34172
34172
  datastakeId: ''
34173
34173
  };
34174
- const getFilterOptions$1 = (options, t) => {
34174
+ const getFilterOptions$2 = (options, t) => {
34175
34175
  const {
34176
34176
  timeframe = [],
34177
34177
  statusOptions = [],
@@ -34341,7 +34341,7 @@ const IncidentsTable = ({
34341
34341
  }) => {
34342
34342
  const [selectOptions, setSelectOptions] = React.useState();
34343
34343
  const [activeTab, setActiveTab] = React.useState("own");
34344
- const columns = React.useMemo(() => getColumns$1({
34344
+ const columns = React.useMemo(() => getColumns$2({
34345
34345
  t,
34346
34346
  goTo,
34347
34347
  user,
@@ -34384,14 +34384,14 @@ const IncidentsTable = ({
34384
34384
  }, 'incidents');
34385
34385
  }, [location.search, activeTab, JSON.stringify(extendingFilters)]);
34386
34386
  const selectFiltersConfig = React.useMemo(() => {
34387
- return getFiltersConfig$1({
34387
+ return getFiltersConfig$2({
34388
34388
  t
34389
34389
  });
34390
34390
  }, [t]);
34391
34391
  React.useEffect(() => {
34392
34392
  setSelectOptions(prev => ({
34393
34393
  ...prev,
34394
- ...getFilterOptions$1(options)
34394
+ ...getFilterOptions$2(options)
34395
34395
  }));
34396
34396
  }, [options, t]);
34397
34397
  const handleActiveTabChange = React.useCallback(value => {
@@ -34407,13 +34407,13 @@ const IncidentsTable = ({
34407
34407
  defaultActiveTab: "own",
34408
34408
  columns: columns,
34409
34409
  data: data,
34410
- checkboxConfig: checkboxConfig$1,
34410
+ checkboxConfig: checkboxConfig$2,
34411
34411
  APP: APP,
34412
34412
  getApiBaseUrl: getApiBaseUrl,
34413
34413
  selectOptions: selectOptions,
34414
34414
  selectFiltersConfig: selectFiltersConfig,
34415
34415
  getRedirectLink: getRedirectLink,
34416
- filtersConfig: filtersConfig$1,
34416
+ filtersConfig: filtersConfig$2,
34417
34417
  isMobile: isMobile,
34418
34418
  view: "incidents",
34419
34419
  getActiveTab: handleActiveTabChange,
@@ -34460,7 +34460,7 @@ const getLinkValue = (value, linkingObject) => {
34460
34460
  }
34461
34461
  return null;
34462
34462
  };
34463
- const getColumns = ({
34463
+ const getColumns$1 = ({
34464
34464
  t,
34465
34465
  goTo,
34466
34466
  user,
@@ -34665,11 +34665,11 @@ const getColumns = ({
34665
34665
  }
34666
34666
  }].filter(column => column.show !== false);
34667
34667
 
34668
- const checkboxConfig = {
34668
+ const checkboxConfig$1 = {
34669
34669
  name: 'Name',
34670
34670
  datastakeId: 'ID'
34671
34671
  };
34672
- const getFiltersConfig = ({
34672
+ const getFiltersConfig$1 = ({
34673
34673
  t
34674
34674
  }) => {
34675
34675
  return {
@@ -34837,11 +34837,11 @@ const getFiltersConfig = ({
34837
34837
  }
34838
34838
  };
34839
34839
  };
34840
- const filtersConfig = {
34840
+ const filtersConfig$1 = {
34841
34841
  name: '',
34842
34842
  datastakeId: ''
34843
34843
  };
34844
- const getFilterOptions = (options, t) => {
34844
+ const getFilterOptions$1 = (options, t) => {
34845
34845
  const {
34846
34846
  statusOptions = [],
34847
34847
  categoryOptions = [],
@@ -35009,7 +35009,7 @@ const ProductionSitesTable = ({
35009
35009
  }) => {
35010
35010
  const [selectOptions, setSelectOptions] = React.useState();
35011
35011
  const [activeTab, setActiveTab] = React.useState('own');
35012
- const columns = React.useMemo(() => getColumns({
35012
+ const columns = React.useMemo(() => getColumns$1({
35013
35013
  t,
35014
35014
  goTo,
35015
35015
  user,
@@ -35051,14 +35051,14 @@ const ProductionSitesTable = ({
35051
35051
  }, 'production-sites');
35052
35052
  }, [location.search, activeTab, JSON.stringify(extendingFilters)]);
35053
35053
  const selectFiltersConfig = React.useMemo(() => {
35054
- return getFiltersConfig({
35054
+ return getFiltersConfig$1({
35055
35055
  t
35056
35056
  });
35057
35057
  }, [t]);
35058
35058
  React.useEffect(() => {
35059
35059
  setSelectOptions(prev => ({
35060
35060
  ...prev,
35061
- ...getFilterOptions(options)
35061
+ ...getFilterOptions$1(options)
35062
35062
  }));
35063
35063
  }, [options, t]);
35064
35064
  const handleActiveTabChange = React.useCallback(value => {
@@ -35074,13 +35074,13 @@ const ProductionSitesTable = ({
35074
35074
  defaultActiveTab: "own",
35075
35075
  columns: columns,
35076
35076
  data: data?.data,
35077
- checkboxConfig: checkboxConfig,
35077
+ checkboxConfig: checkboxConfig$1,
35078
35078
  APP: APP,
35079
35079
  getApiBaseUrl: getApiBaseUrl,
35080
35080
  selectOptions: selectOptions,
35081
35081
  selectFiltersConfig: selectFiltersConfig,
35082
35082
  getRedirectLink: getRedirectLink,
35083
- filtersConfig: filtersConfig,
35083
+ filtersConfig: filtersConfig$1,
35084
35084
  isMobile: isMobile,
35085
35085
  view: "production-sites",
35086
35086
  getActiveTab: handleActiveTabChange,
@@ -35121,6 +35121,615 @@ const ProductionSitesTable = ({
35121
35121
  });
35122
35122
  };
35123
35123
 
35124
+ const getColumns = ({
35125
+ t,
35126
+ goTo,
35127
+ user,
35128
+ removeUser = () => {},
35129
+ resendInvite = () => {},
35130
+ setUserToEdit = () => {},
35131
+ userRoles = [],
35132
+ company = {},
35133
+ canCreate = false,
35134
+ app
35135
+ }) => [
35136
+ // {
35137
+ // dataIndex: 'datastakeId',
35138
+ // title: t('ID'),
35139
+ // ellipsis: true,
35140
+ // show: true,
35141
+ // render: (v, all) => {
35142
+ // if (all.empty) {
35143
+ // return <div className="daf-default-cell" />
35144
+ // }
35145
+
35146
+ // return <Tooltip title={v}>{v}</Tooltip>;
35147
+ // },
35148
+ // },
35149
+ {
35150
+ dataIndex: 'firstName',
35151
+ title: t('Name'),
35152
+ ellipsis: true,
35153
+ show: true,
35154
+ render: (v, all) => {
35155
+ if (all.empty) {
35156
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
35157
+ className: "daf-default-cell"
35158
+ });
35159
+ }
35160
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
35161
+ title: v,
35162
+ children: v
35163
+ });
35164
+ }
35165
+ }, {
35166
+ dataIndex: 'lastName',
35167
+ title: t('Last Name'),
35168
+ ellipsis: true,
35169
+ show: true,
35170
+ render: (v, all) => {
35171
+ if (all.empty) {
35172
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
35173
+ className: "daf-default-cell"
35174
+ });
35175
+ }
35176
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
35177
+ title: v,
35178
+ children: v
35179
+ });
35180
+ }
35181
+ }, {
35182
+ dataIndex: 'email',
35183
+ title: t('Email'),
35184
+ ellipsis: true,
35185
+ show: true,
35186
+ render: (v, all) => {
35187
+ if (all.empty) {
35188
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
35189
+ className: "daf-default-cell"
35190
+ });
35191
+ }
35192
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
35193
+ title: v,
35194
+ children: v
35195
+ });
35196
+ }
35197
+ }, {
35198
+ title: t("Status"),
35199
+ dataIndex: "status",
35200
+ key: "status",
35201
+ width: 150,
35202
+ ellipsis: false,
35203
+ show: true,
35204
+ render: (status, users) => {
35205
+ if (users.empty) {
35206
+ return null;
35207
+ }
35208
+ if (status === "inactive") {
35209
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
35210
+ color: "red",
35211
+ style: {
35212
+ width: 100,
35213
+ textAlign: "center"
35214
+ },
35215
+ children: t("Blocked")
35216
+ });
35217
+ }
35218
+ if (status === "active") {
35219
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
35220
+ color: "green",
35221
+ style: {
35222
+ width: 100,
35223
+ textAlign: "center"
35224
+ },
35225
+ children: t("Active")
35226
+ });
35227
+ }
35228
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
35229
+ color: "orange",
35230
+ style: {
35231
+ width: 100,
35232
+ textAlign: "center"
35233
+ },
35234
+ children: t("Pending")
35235
+ });
35236
+ }
35237
+ }, {
35238
+ title: t("Last Login"),
35239
+ dataIndex: "lastLogin",
35240
+ key: "lastLogin",
35241
+ width: 125,
35242
+ render: (date, all) => {
35243
+ if (all.empty) {
35244
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
35245
+ className: "daf-default-cell"
35246
+ });
35247
+ }
35248
+ const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
35249
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
35250
+ title: _date,
35251
+ children: _date
35252
+ });
35253
+ },
35254
+ ellipsis: true
35255
+ }, {
35256
+ title: t("User Role"),
35257
+ dataIndex: "roleName",
35258
+ key: "role",
35259
+ show: true,
35260
+ render: (val, all) => {
35261
+ if (all.empty) {
35262
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
35263
+ className: "daf-default-cell"
35264
+ });
35265
+ }
35266
+
35267
+ // Display role name if available, fallback to role ID
35268
+ const displayValue = val || all.role;
35269
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
35270
+ title: displayValue,
35271
+ children: displayValue
35272
+ });
35273
+ }
35274
+ }, {
35275
+ title: t(""),
35276
+ key: "actions",
35277
+ width: 60,
35278
+ show: removeUser || setUserToEdit,
35279
+ render: (row, all) => {
35280
+ if (all.empty) {
35281
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
35282
+ className: "daf-default-cell"
35283
+ });
35284
+ }
35285
+ const _v = userRoles?.find(r => r.value === all.role);
35286
+ const items = [removeUser ? {
35287
+ key: "removeUser",
35288
+ onClick: () => {
35289
+ antd.Modal.confirm({
35290
+ title: t("Are you sure you want to remove this user from your organisation?"),
35291
+ onOk: () => removeUser(all.id),
35292
+ cancelText: t("No"),
35293
+ okText: "Yes",
35294
+ closable: true
35295
+ });
35296
+ },
35297
+ label: t("Remove User")
35298
+ } : null, setUserToEdit ? {
35299
+ key: "editPermission",
35300
+ onClick: () => setUserToEdit(all),
35301
+ disabled: all.isAdmin || _v?.isForAppAdmin,
35302
+ label: t("Edit Permissions")
35303
+ } : null, all.invitationToken && canCreate ? {
35304
+ key: "copyLink",
35305
+ onClick: () => {
35306
+ if (location.pathname.includes(`/${APP}`)) {
35307
+ navigator.clipboard.writeText(`${window.location.host}/${app}/r/${company.inviteToken}/${all.invitationToken}`);
35308
+ } else {
35309
+ navigator.clipboard.writeText(`${window.location.host}/r/${company.inviteToken}/${all.invitationToken}`);
35310
+ }
35311
+ antd.message.info({
35312
+ content: t("Invitation link copied")
35313
+ });
35314
+ },
35315
+ label: t("Copy Invitation Link")
35316
+ } : null, all.invitationToken && canCreate ? {
35317
+ key: "resendInvite",
35318
+ onClick: () => {
35319
+ antd.Modal.confirm({
35320
+ title: t("Are you sure you want to invite this user again? This user will receive a new notification"),
35321
+ onOk: () => resendInvite(all.id),
35322
+ cancelText: t("No"),
35323
+ okText: "Yes",
35324
+ closable: true
35325
+ });
35326
+ },
35327
+ label: t("Resend Invite")
35328
+ } : null];
35329
+ return /*#__PURE__*/jsxRuntime.jsx(MoreMenu, {
35330
+ items: items
35331
+ });
35332
+ },
35333
+ client: false
35334
+ }].filter(column => column.show !== false);
35335
+
35336
+ const checkboxConfig = {
35337
+ name: 'Name',
35338
+ datastakeId: 'ID'
35339
+ };
35340
+ const getFiltersConfig = ({
35341
+ t
35342
+ }) => {
35343
+ return {
35344
+ email: {
35345
+ type: 'text',
35346
+ label: 'Email',
35347
+ placeholder: t => `${t('Filter by')} ${t('Email').toLowerCase()}`,
35348
+ style: {
35349
+ flex: 1
35350
+ },
35351
+ labelStyle: {
35352
+ flex: 1
35353
+ },
35354
+ getLabel: option => option.label,
35355
+ getValue: option => option.value
35356
+ },
35357
+ status: {
35358
+ type: "select",
35359
+ label: "Status",
35360
+ placeholder: t => `${t("Filter by")} ${t("Status").toLowerCase()}`,
35361
+ style: {
35362
+ flex: 1
35363
+ },
35364
+ labelStyle: {
35365
+ fley: 1
35366
+ },
35367
+ getLabel: option => option.label,
35368
+ getValue: option => option.value
35369
+ },
35370
+ timeframe: {
35371
+ type: "timeframe",
35372
+ label: "Timeframe",
35373
+ placeholder: t => `${t("Filter by")} ${t("Timeframe").toLowerCase()}`,
35374
+ style: {
35375
+ flex: 1
35376
+ },
35377
+ labelStyle: {
35378
+ flex: 1
35379
+ }
35380
+ },
35381
+ userRole: {
35382
+ type: "select",
35383
+ label: "User Role",
35384
+ placeholder: t => `${t("Filter by")} ${t("User Role").toLowerCase()}`,
35385
+ style: {
35386
+ flex: 1
35387
+ },
35388
+ labelStyle: {
35389
+ flex: 1
35390
+ }
35391
+ }
35392
+ };
35393
+ };
35394
+ const filtersConfig = {
35395
+ name: '',
35396
+ datastakeId: ''
35397
+ };
35398
+ const getFilterOptions = (options, t) => {
35399
+ const {
35400
+ emailOptions = [],
35401
+ statusOptions = [],
35402
+ timeframeOptions = [],
35403
+ userRoleOptions = []
35404
+ } = options || {};
35405
+ console.log({
35406
+ options
35407
+ });
35408
+ const _default = {
35409
+ timeframe: timeframeOptions,
35410
+ email: emailOptions,
35411
+ status: statusOptions,
35412
+ userRole: userRoleOptions,
35413
+ status: [{
35414
+ value: "active",
35415
+ label: "Active"
35416
+ }, {
35417
+ value: "pending",
35418
+ label: "Pending"
35419
+ }]
35420
+ };
35421
+ return _default;
35422
+ };
35423
+ const getUserForm = ({
35424
+ t,
35425
+ userRoles = [],
35426
+ APP
35427
+ }) => {
35428
+ return {
35429
+ user: {
35430
+ position: 0,
35431
+ firstName: {
35432
+ group: "user",
35433
+ section: "user",
35434
+ moduleScope: {
35435
+ cadd: ["scoping", "new", "linking-extra"],
35436
+ pme: ["scoping", "new", "linking-extra"]
35437
+ },
35438
+ label: t("First Name"),
35439
+ comment: false,
35440
+ type: "text",
35441
+ rules: [{
35442
+ required: true,
35443
+ message: "This field is required"
35444
+ }],
35445
+ mergeStrategy: "simple",
35446
+ position: 1
35447
+ },
35448
+ lastName: {
35449
+ group: "user",
35450
+ section: "user",
35451
+ moduleScope: {
35452
+ cadd: ["scoping", "new", "linking-extra"],
35453
+ pme: ["scoping", "new", "linking-extra"]
35454
+ },
35455
+ label: t("Last Name"),
35456
+ comment: false,
35457
+ type: "text",
35458
+ rules: [{
35459
+ required: true,
35460
+ message: "This field is required"
35461
+ }],
35462
+ mergeStrategy: "simple",
35463
+ position: 2
35464
+ },
35465
+ email: {
35466
+ group: "user",
35467
+ section: "user",
35468
+ moduleScope: {
35469
+ cadd: ["scoping", "new", "linking-extra"],
35470
+ pme: ["scoping", "new", "linking-extra"]
35471
+ },
35472
+ label: t("Email"),
35473
+ comment: false,
35474
+ type: "text",
35475
+ rules: [{
35476
+ required: true,
35477
+ message: "This field is required"
35478
+ }, {
35479
+ type: "email",
35480
+ message: "errors::field must be email"
35481
+ }],
35482
+ mergeStrategy: "simple",
35483
+ position: 3
35484
+ },
35485
+ role: {
35486
+ group: "user",
35487
+ section: "user",
35488
+ moduleScope: {
35489
+ cadd: ["scoping", "new", "linking", "linking-extra", "admin"],
35490
+ pme: ["scoping", "new", "linking", "linking-extra", "admin"]
35491
+ },
35492
+ label: t("User Role"),
35493
+ placeholder: t("User Role"),
35494
+ comment: false,
35495
+ type: "select",
35496
+ options: userRoles.filter(r => r.canBeAssignedToSubUsers && r.app === APP).map(v => ({
35497
+ label: t(v.label),
35498
+ value: v.value
35499
+ })),
35500
+ optionsName: "userRoles",
35501
+ // tooltip: <UserRolePopover t={t} />,
35502
+ sortOptions: true,
35503
+ rules: [{
35504
+ required: true,
35505
+ message: "This field is required"
35506
+ }],
35507
+ position: 4
35508
+ }
35509
+ }
35510
+ };
35511
+ };
35512
+
35513
+ const UsersCreate = ({
35514
+ onSubmitted = () => {},
35515
+ onCancel = () => {},
35516
+ user = {},
35517
+ APP,
35518
+ query,
35519
+ goTo = () => {},
35520
+ t = () => {},
35521
+ ajaxForms = {},
35522
+ changeAjaxForms = () => {},
35523
+ ajaxOptions = {},
35524
+ changeAjaxOptions = () => {},
35525
+ getAppHeader = () => {},
35526
+ getApiBaseUrl = () => {},
35527
+ userToEdit = null,
35528
+ userRoles = []
35529
+ }) => {
35530
+ const disabledInputs = React.useMemo(() => !userToEdit ? [] : ['firstName', 'lastName', 'email'], [userToEdit]);
35531
+ const data = React.useMemo(() => ({
35532
+ ...(userToEdit || {}),
35533
+ userRole: userToEdit?.role
35534
+ }), [userToEdit]);
35535
+ const form = React.useMemo(() => getUserForm({
35536
+ t,
35537
+ userRoles,
35538
+ APP
35539
+ }), [t, userRoles, APP]);
35540
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
35541
+ className: "daf-create-form",
35542
+ children: /*#__PURE__*/jsxRuntime.jsx(DynamicForm, {
35543
+ form: form,
35544
+ data: data,
35545
+ showSaveAndNext: false,
35546
+ module: APP,
35547
+ onCancel: onCancel,
35548
+ isCreate: true,
35549
+ t: t,
35550
+ user: user,
35551
+ ajaxForms: ajaxForms,
35552
+ ajaxOptions: ajaxOptions,
35553
+ getAppHeader: getAppHeader,
35554
+ getApiBaseUrl: getApiBaseUrl,
35555
+ changeAjaxOptions: changeAjaxOptions,
35556
+ app: APP,
35557
+ query: query,
35558
+ goTo: goTo,
35559
+ changeAjaxForms: changeAjaxForms,
35560
+ disabledInputs: disabledInputs,
35561
+ submit: payload => {
35562
+ onSubmitted({
35563
+ ...payload,
35564
+ apps: {
35565
+ [APP]: {
35566
+ ...((userToEdit?.apps || {})[APP] || {}),
35567
+ role: payload.role
35568
+ }
35569
+ }
35570
+ });
35571
+ }
35572
+ })
35573
+ });
35574
+ };
35575
+
35576
+ const UsersTable = ({
35577
+ t = () => {},
35578
+ goTo = () => {},
35579
+ user = {},
35580
+ options = {},
35581
+ getRedirectLink = () => {},
35582
+ theme = {},
35583
+ loading = false,
35584
+ data = {},
35585
+ isMobile,
35586
+ APP,
35587
+ location,
35588
+ getData = () => {},
35589
+ getApiBaseUrl = () => {},
35590
+ getAppHeader = () => {},
35591
+ onInviteUser = () => {},
35592
+ onEditUser = () => {},
35593
+ query = {},
35594
+ ajaxForms = {},
35595
+ changeAjaxForms = () => {},
35596
+ ajaxOptions = {},
35597
+ changeAjaxOptions = () => {},
35598
+ extendingFilters = {},
35599
+ userRoles = []
35600
+ }) => {
35601
+ const [selectOptions, setSelectOptions] = React.useState();
35602
+ const params = new URLSearchParams(location?.search);
35603
+ const [openCreateModal, setOpenCreateModal] = React.useState(params.has("create"));
35604
+ const [userToEdit, setUserToEdit] = React.useState(null);
35605
+ const columns = React.useMemo(() => getColumns({
35606
+ t,
35607
+ goTo,
35608
+ user,
35609
+ options,
35610
+ getRedirectLink,
35611
+ theme,
35612
+ subject: 'user',
35613
+ data,
35614
+ setUserToEdit
35615
+ }), [t, goTo, user, options, getRedirectLink, theme, data]);
35616
+ const breadCrumbs = [];
35617
+ const {
35618
+ paginationQuery,
35619
+ searchParams,
35620
+ otherParams,
35621
+ sortBy,
35622
+ sortDir
35623
+ } = useGetQueryParams({
35624
+ location
35625
+ });
35626
+ React.useMemo(() => ({
35627
+ ...otherParams,
35628
+ ...extendingFilters
35629
+ }), [otherParams, extendingFilters]);
35630
+ React.useEffect(() => {
35631
+ getData({
35632
+ pagination: paginationQuery,
35633
+ ...(Object.keys(searchParams).length > 0 && {
35634
+ search: searchParams
35635
+ }),
35636
+ ...otherParams,
35637
+ sortBy: {
35638
+ [sortBy || 'updatedAt']: sortDir ? sortDir === 'ascend' ? 1 : -1 : -1
35639
+ },
35640
+ ...extendingFilters
35641
+ }, 'users');
35642
+ }, [location.search, JSON.stringify(extendingFilters)]);
35643
+ const selectFiltersConfig = React.useMemo(() => getFiltersConfig({
35644
+ t
35645
+ }), [t]);
35646
+ React.useEffect(() => {
35647
+ setSelectOptions(prev => ({
35648
+ ...prev,
35649
+ ...getFilterOptions(options)
35650
+ }));
35651
+ }, [options, t]);
35652
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
35653
+ className: "semibold form-input-output daf-create-view",
35654
+ children: [/*#__PURE__*/jsxRuntime.jsx(DAFHeader, {
35655
+ title: t("users"),
35656
+ breadcrumbs: breadCrumbs,
35657
+ actionButtons: [{
35658
+ type: "primary",
35659
+ onClick: () => setOpenCreateModal(true),
35660
+ tooltip: t("New"),
35661
+ icon: "Add"
35662
+ }]
35663
+ // onDownload={() => {
35664
+ // console.log("download");
35665
+ // }}
35666
+ // downloadDisabled={false}
35667
+ }), /*#__PURE__*/jsxRuntime.jsx(BaseScreen, {
35668
+ t: t,
35669
+ checkboxConfig: checkboxConfig,
35670
+ defaultTableFilters: {},
35671
+ columns: columns,
35672
+ data: data,
35673
+ loading: loading,
35674
+ location: location,
35675
+ goTo: goTo,
35676
+ APP: APP,
35677
+ getApiBaseUrl: getApiBaseUrl,
35678
+ selectOptions: selectOptions,
35679
+ selectFilters: selectFiltersConfig,
35680
+ view: "users",
35681
+ getRedirectLink: getRedirectLink,
35682
+ defaultUrlParams: {},
35683
+ module: APP,
35684
+ filtersConfig: filtersConfig,
35685
+ isMobile: isMobile
35686
+ }), (openCreateModal || !!userToEdit) && /*#__PURE__*/jsxRuntime.jsx(antd.Drawer, {
35687
+ destroyOnClose: true,
35688
+ title: /*#__PURE__*/jsxRuntime.jsx(DrawerHeader, {
35689
+ title: t(userToEdit ? "Edit User" : "New User")
35690
+ }),
35691
+ open: openCreateModal || !!userToEdit,
35692
+ onClose: () => {
35693
+ setOpenCreateModal(false);
35694
+ setUserToEdit(null);
35695
+ },
35696
+ width: CREATE_DRAWER_WIDTH,
35697
+ bodyStyle: {
35698
+ padding: 0
35699
+ },
35700
+ maskClosable: false,
35701
+ children: /*#__PURE__*/jsxRuntime.jsx(UsersCreate, {
35702
+ t: t,
35703
+ goTo: goTo,
35704
+ user: user,
35705
+ APP: APP,
35706
+ getApiBaseUrl: getApiBaseUrl,
35707
+ getAppHeader: getAppHeader,
35708
+ onSubmitted: payload => {
35709
+ if (userToEdit) {
35710
+ onEditUser(payload);
35711
+ } else {
35712
+ onInviteUser(payload);
35713
+ }
35714
+ setOpenCreateModal(false);
35715
+ setUserToEdit(null);
35716
+ },
35717
+ onCancel: () => {
35718
+ setOpenCreateModal(false);
35719
+ setUserToEdit(null);
35720
+ },
35721
+ query: query,
35722
+ ajaxForms: ajaxForms,
35723
+ changeAjaxForms: changeAjaxForms,
35724
+ ajaxOptions: ajaxOptions,
35725
+ changeAjaxOptions: changeAjaxOptions,
35726
+ userRoles: userRoles,
35727
+ userToEdit: userToEdit
35728
+ })
35729
+ })]
35730
+ });
35731
+ };
35732
+
35124
35733
  const useSummary = ({
35125
35734
  getOne,
35126
35735
  getMultiple,
@@ -41910,4 +42519,5 @@ exports.RestorationActivitySummary = RestorationActivitySummary;
41910
42519
  exports.StakeholdersTable = StakeholdersTable;
41911
42520
  exports.SupplyChainDashboard = SupplyChain;
41912
42521
  exports.UserDashboard = UserDashboard;
42522
+ exports.UsersTable = UsersTable;
41913
42523
  exports.WorkersTable = WorkersTable;