datastake-daf 0.6.806 → 0.6.807

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.
@@ -13989,7 +13989,7 @@ const getTabs = t => {
13989
13989
  label: t("Events")
13990
13990
  }];
13991
13991
  };
13992
- const getFiltersConfig$a = (t, filters, locationCategories) => {
13992
+ const getFiltersConfig$b = (t, filters, locationCategories) => {
13993
13993
  const value = filters.type ? {
13994
13994
  value: filters.type
13995
13995
  } : {};
@@ -14192,7 +14192,7 @@ function MineSites({
14192
14192
  config: dataFetchConfig
14193
14193
  });
14194
14194
  const tabs = React.useMemo(() => getTabs(t), [t]);
14195
- const filtersConfig = React.useMemo(() => getFiltersConfig$a(t, filters, locationCategories), [activeTab, filters, t, locationCategories]);
14195
+ const filtersConfig = React.useMemo(() => getFiltersConfig$b(t, filters, locationCategories), [activeTab, filters, t, locationCategories]);
14196
14196
  const onFilterChange = filters => {
14197
14197
  setFilters(p => ({
14198
14198
  ...p,
@@ -15879,7 +15879,7 @@ const NavigationAction = ({
15879
15879
  });
15880
15880
  };
15881
15881
 
15882
- const getColumns$f = ({
15882
+ const getColumns$g = ({
15883
15883
  t,
15884
15884
  data,
15885
15885
  user,
@@ -16005,7 +16005,7 @@ function OrganisationInformation({
16005
16005
  });
16006
16006
  }, [organisationInfo, data]);
16007
16007
  const columns = React.useMemo(() => {
16008
- return getColumns$f({
16008
+ return getColumns$g({
16009
16009
  t,
16010
16010
  data: tableData,
16011
16011
  user,
@@ -16136,7 +16136,7 @@ const Style$8 = styled__default["default"].div`
16136
16136
  }
16137
16137
  `;
16138
16138
 
16139
- const getColumns$e = ({
16139
+ const getColumns$f = ({
16140
16140
  t = () => {},
16141
16141
  options = {},
16142
16142
  user = {},
@@ -16293,7 +16293,7 @@ function ProductionSites({
16293
16293
  return productionSites?.length > 5 ? ComponentWithFocus : "div";
16294
16294
  }, [productionSites]);
16295
16295
  const columns = React.useMemo(() => {
16296
- return getColumns$e({
16296
+ return getColumns$f({
16297
16297
  t,
16298
16298
  options,
16299
16299
  user,
@@ -16527,7 +16527,7 @@ const getAdminLevelName = (data, level) => {
16527
16527
  return entry?.name || "-";
16528
16528
  };
16529
16529
 
16530
- const getColumns$d = ({
16530
+ const getColumns$e = ({
16531
16531
  t,
16532
16532
  activeTab,
16533
16533
  options,
@@ -16821,7 +16821,7 @@ function AssociatedInformation$1({
16821
16821
  console.log({
16822
16822
  data
16823
16823
  });
16824
- const columns = React.useMemo(() => getColumns$d({
16824
+ const columns = React.useMemo(() => getColumns$e({
16825
16825
  t,
16826
16826
  isMonitoring: false,
16827
16827
  activeTab,
@@ -17160,7 +17160,7 @@ const copyToClipboard = id => {
17160
17160
  }
17161
17161
  };
17162
17162
 
17163
- const filtersConfig = {
17163
+ const filtersConfig$1 = {
17164
17164
  name: "",
17165
17165
  datastakeId: ""
17166
17166
  };
@@ -17179,7 +17179,7 @@ const selectFiltersConfig = {
17179
17179
  getValue: option => option.value
17180
17180
  }
17181
17181
  };
17182
- const checkboxConfig = {
17182
+ const checkboxConfig$1 = {
17183
17183
  name: "Name",
17184
17184
  datastakeId: "ID"
17185
17185
  };
@@ -17205,7 +17205,7 @@ const getPartnershipTypes = t => {
17205
17205
  }];
17206
17206
  };
17207
17207
 
17208
- const getColumns$c = ({
17208
+ const getColumns$d = ({
17209
17209
  t,
17210
17210
  accept,
17211
17211
  decline,
@@ -19366,6 +19366,12 @@ const showHideInput$3 = (input, formsValue, repeatValues) => {
19366
19366
  }
19367
19367
  return true;
19368
19368
  };
19369
+ const getNkey = namespace => {
19370
+ if (['location', 'scl', 'village', 'event', 'incidents', 'corrective-actions', 'testimonials', 'initiatives', 'victims', 'pictures', 'documents', 'lir', 'sp', 'im', 'sci', 'bpe', 'gm'].includes(namespace)) {
19371
+ return 'scoping';
19372
+ }
19373
+ return namespace;
19374
+ };
19369
19375
  const groupSubsections = (form, onlyConf = false) => {
19370
19376
  return Object.keys(form).reduce((f, fKey) => {
19371
19377
  if (form[fKey].subSection) {
@@ -40508,7 +40514,7 @@ const PartnersTable = ({
40508
40514
  setTotalRequests,
40509
40515
  t
40510
40516
  });
40511
- const columns = React.useMemo(() => getColumns$c({
40517
+ const columns = React.useMemo(() => getColumns$d({
40512
40518
  t,
40513
40519
  accept,
40514
40520
  decline,
@@ -40571,13 +40577,13 @@ const PartnersTable = ({
40571
40577
  defaultActiveTab: "partners",
40572
40578
  columns: columns,
40573
40579
  data: data,
40574
- checkboxConfig: checkboxConfig,
40580
+ checkboxConfig: checkboxConfig$1,
40575
40581
  APP: APP,
40576
40582
  getApiBaseUrl: getApiBaseUrl,
40577
40583
  selectOptions: selectOptions,
40578
40584
  selectFiltersConfig: selectFiltersConfig,
40579
40585
  getRedirectLink: getRedirectLink,
40580
- filtersConfig: filtersConfig,
40586
+ filtersConfig: filtersConfig$1,
40581
40587
  isMobile: isMobile,
40582
40588
  view: "partners",
40583
40589
  getActiveTab: handleActiveTabChange,
@@ -40670,12 +40676,12 @@ const Create = ({
40670
40676
  let {
40671
40677
  form = {},
40672
40678
  data = defaultData || {}
40673
- } = !edit ? formData || {} : {
40679
+ } = !edit ? formData[`${APP}-${view}`] || {} : {
40674
40680
  form: formConfig,
40675
40681
  data: formValue
40676
40682
  };
40677
40683
  React.useEffect(() => {
40678
- if (Object.keys(form).length === 0) {
40684
+ if (Object.keys(form).length === 0 && !formData[`${APP}-${view}`]) {
40679
40685
  if (!edit) {
40680
40686
  getData({
40681
40687
  namespace,
@@ -40745,7 +40751,7 @@ const Create = ({
40745
40751
  });
40746
40752
  };
40747
40753
 
40748
- const getFiltersConfig$9 = ({
40754
+ const getFiltersConfig$a = ({
40749
40755
  t
40750
40756
  }) => {
40751
40757
  return {
@@ -40776,7 +40782,7 @@ const getFiltersConfig$9 = ({
40776
40782
  }
40777
40783
  };
40778
40784
  };
40779
- const getFilterOptions$9 = (options, t) => {
40785
+ const getFilterOptions$a = (options, t) => {
40780
40786
  const {
40781
40787
  countries,
40782
40788
  category,
@@ -40880,7 +40886,7 @@ function sourceAvatarConfig(items, user, applications) {
40880
40886
  });
40881
40887
  }
40882
40888
 
40883
- const getColumns$b = ({
40889
+ const getColumns$c = ({
40884
40890
  t,
40885
40891
  goTo,
40886
40892
  user,
@@ -41034,7 +41040,7 @@ const getColumns$b = ({
41034
41040
  }
41035
41041
  }].filter(column => column.show !== false);
41036
41042
 
41037
- const getFiltersConfig$8 = ({
41043
+ const getFiltersConfig$9 = ({
41038
41044
  t
41039
41045
  }) => {
41040
41046
  return {
@@ -41202,7 +41208,7 @@ const getFiltersConfig$8 = ({
41202
41208
  }
41203
41209
  };
41204
41210
  };
41205
- const getFilterOptions$8 = (options, t) => {
41211
+ const getFilterOptions$9 = (options, t) => {
41206
41212
  const {
41207
41213
  statusOptions,
41208
41214
  categoryOptions,
@@ -41271,7 +41277,7 @@ const renderStatusTag = ({
41271
41277
  }
41272
41278
  };
41273
41279
 
41274
- const getColumns$a = ({
41280
+ const getColumns$b = ({
41275
41281
  t,
41276
41282
  goTo,
41277
41283
  user,
@@ -41478,7 +41484,7 @@ const getColumns$a = ({
41478
41484
  }
41479
41485
  }].filter(column => column.show !== false);
41480
41486
 
41481
- const getFiltersConfig$7 = ({
41487
+ const getFiltersConfig$8 = ({
41482
41488
  t
41483
41489
  }) => {
41484
41490
  return {
@@ -41619,7 +41625,7 @@ const getFiltersConfig$7 = ({
41619
41625
  }
41620
41626
  };
41621
41627
  };
41622
- const getFilterOptions$7 = (options, t) => {
41628
+ const getFilterOptions$8 = (options, t) => {
41623
41629
  const {
41624
41630
  statusOptions,
41625
41631
  categoryOptions,
@@ -41657,7 +41663,7 @@ const viewConfig$6 = {
41657
41663
  createTitle: "Create Worker"
41658
41664
  };
41659
41665
 
41660
- const getColumns$9 = ({
41666
+ const getColumns$a = ({
41661
41667
  t,
41662
41668
  goTo,
41663
41669
  user,
@@ -41833,7 +41839,7 @@ const getColumns$9 = ({
41833
41839
  }
41834
41840
  }].filter(column => column.show !== false);
41835
41841
 
41836
- const getFiltersConfig$6 = ({
41842
+ const getFiltersConfig$7 = ({
41837
41843
  t
41838
41844
  }) => {
41839
41845
  return {
@@ -41985,7 +41991,7 @@ const getFiltersConfig$6 = ({
41985
41991
  }
41986
41992
  };
41987
41993
  };
41988
- const getFilterOptions$6 = (options, t) => {
41994
+ const getFilterOptions$7 = (options, t) => {
41989
41995
  const {
41990
41996
  timeframe = [],
41991
41997
  status,
@@ -42144,7 +42150,7 @@ MoreTags.propTypes = {
42144
42150
  limit: PropTypes__default["default"].number
42145
42151
  };
42146
42152
 
42147
- const getColumns$8 = ({
42153
+ const getColumns$9 = ({
42148
42154
  t,
42149
42155
  goTo,
42150
42156
  user,
@@ -42376,7 +42382,7 @@ const getColumns$8 = ({
42376
42382
  }
42377
42383
  }].filter(column => column.show !== false);
42378
42384
 
42379
- const getFiltersConfig$5 = ({
42385
+ const getFiltersConfig$6 = ({
42380
42386
  t
42381
42387
  }) => {
42382
42388
  return {
@@ -42548,7 +42554,7 @@ const getFiltersConfig$5 = ({
42548
42554
  }
42549
42555
  };
42550
42556
  };
42551
- const getFilterOptions$5 = (options, t) => {
42557
+ const getFilterOptions$6 = (options, t) => {
42552
42558
  const {
42553
42559
  timeframe = [],
42554
42560
  statusOptions,
@@ -42601,7 +42607,7 @@ const getEventCategoryBySubject = (eventCategoryObject, subject, isSingular = fa
42601
42607
  return eventCategoryObject[key] || null;
42602
42608
  };
42603
42609
 
42604
- const getColumns$7 = ({
42610
+ const getColumns$8 = ({
42605
42611
  t,
42606
42612
  goTo,
42607
42613
  user,
@@ -42811,7 +42817,7 @@ const getColumns$7 = ({
42811
42817
  }
42812
42818
  }].filter(column => column.show !== false);
42813
42819
 
42814
- const getFiltersConfig$4 = ({
42820
+ const getFiltersConfig$5 = ({
42815
42821
  t
42816
42822
  }) => {
42817
42823
  return {
@@ -42982,7 +42988,7 @@ const getFiltersConfig$4 = ({
42982
42988
  }
42983
42989
  };
42984
42990
  };
42985
- const getFilterOptions$4 = (options, t) => {
42991
+ const getFilterOptions$5 = (options, t) => {
42986
42992
  const {
42987
42993
  timeframe = [],
42988
42994
  statusOptions,
@@ -43026,7 +43032,7 @@ const viewConfig$3 = {
43026
43032
  createTitle: "Create Incident"
43027
43033
  };
43028
43034
 
43029
- const getColumns$6 = ({
43035
+ const getColumns$7 = ({
43030
43036
  t,
43031
43037
  goTo,
43032
43038
  user,
@@ -43236,7 +43242,7 @@ const getColumns$6 = ({
43236
43242
  }
43237
43243
  }].filter(column => column.show !== false);
43238
43244
 
43239
- const getFiltersConfig$3 = ({
43245
+ const getFiltersConfig$4 = ({
43240
43246
  t
43241
43247
  }) => {
43242
43248
  return {
@@ -43267,7 +43273,7 @@ const getFiltersConfig$3 = ({
43267
43273
  }
43268
43274
  };
43269
43275
  };
43270
- const getFilterOptions$3 = (options, t) => {
43276
+ const getFilterOptions$4 = (options, t) => {
43271
43277
  const {
43272
43278
  countries,
43273
43279
  category,
@@ -43289,7 +43295,7 @@ const viewConfig$2 = {
43289
43295
  createTitle: "Create Location"
43290
43296
  };
43291
43297
 
43292
- const getColumns$5 = ({
43298
+ const getColumns$6 = ({
43293
43299
  t,
43294
43300
  goTo,
43295
43301
  user,
@@ -43459,7 +43465,7 @@ const getColumns$5 = ({
43459
43465
  }
43460
43466
  }].filter(column => column.show !== false);
43461
43467
 
43462
- const getFiltersConfig$2 = ({
43468
+ const getFiltersConfig$3 = ({
43463
43469
  t
43464
43470
  }) => {
43465
43471
  return {
@@ -43617,7 +43623,7 @@ const getFiltersConfig$2 = ({
43617
43623
  }
43618
43624
  };
43619
43625
  };
43620
- const getFilterOptions$2 = (options, t) => {
43626
+ const getFilterOptions$3 = (options, t) => {
43621
43627
  const {
43622
43628
  statusOptions = [],
43623
43629
  categoryOptions = [],
@@ -43703,7 +43709,7 @@ MoreOptions.propTypes = {
43703
43709
  limit: PropTypes__default["default"].number
43704
43710
  };
43705
43711
 
43706
- const getColumns$4 = ({
43712
+ const getColumns$5 = ({
43707
43713
  t,
43708
43714
  goTo,
43709
43715
  user,
@@ -43912,7 +43918,7 @@ const getColumns$4 = ({
43912
43918
  }
43913
43919
  }].filter(column => column.show !== false);
43914
43920
 
43915
- const getFiltersConfig$1 = ({
43921
+ const getFiltersConfig$2 = ({
43916
43922
  t
43917
43923
  }) => {
43918
43924
  return {
@@ -43925,7 +43931,7 @@ const getFiltersConfig$1 = ({
43925
43931
  }
43926
43932
  };
43927
43933
  };
43928
- const getFilterOptions$1 = (options, t) => {
43934
+ const getFilterOptions$2 = (options, t) => {
43929
43935
  const {
43930
43936
  timeframe = []
43931
43937
  } = options || {};
@@ -43945,7 +43951,7 @@ const viewConfig = {
43945
43951
  createTitle: "Create Document"
43946
43952
  };
43947
43953
 
43948
- const getColumns$3 = ({
43954
+ const getColumns$4 = ({
43949
43955
  t,
43950
43956
  goTo,
43951
43957
  user,
@@ -44066,81 +44072,81 @@ const getColumns$3 = ({
44066
44072
 
44067
44073
  const FILTER_REGISTRY = {
44068
44074
  stakeholders: {
44069
- config: getFiltersConfig$9,
44070
- options: getFilterOptions$9,
44075
+ config: getFiltersConfig$a,
44076
+ options: getFilterOptions$a,
44071
44077
  formConfig: formConfig$8,
44072
44078
  viewConfig: viewConfig$8,
44073
- columns: getColumns$b
44079
+ columns: getColumns$c
44074
44080
  },
44075
44081
  workers: {
44076
- config: getFiltersConfig$7,
44077
- options: getFilterOptions$7,
44082
+ config: getFiltersConfig$8,
44083
+ options: getFilterOptions$8,
44078
44084
  formConfig: formConfig$6,
44079
44085
  viewConfig: viewConfig$6,
44080
- columns: getColumns$9
44086
+ columns: getColumns$a
44081
44087
  },
44082
44088
  operators: {
44083
- config: getFiltersConfig$8,
44084
- options: getFilterOptions$8,
44089
+ config: getFiltersConfig$9,
44090
+ options: getFilterOptions$9,
44085
44091
  formConfig: formConfig$7,
44086
44092
  viewConfig: viewConfig$7,
44087
- columns: getColumns$a
44093
+ columns: getColumns$b
44088
44094
  },
44089
44095
  events: {
44090
- config: getFiltersConfig$6,
44091
- options: getFilterOptions$6,
44096
+ config: getFiltersConfig$7,
44097
+ options: getFilterOptions$7,
44092
44098
  formConfig: formConfig$5,
44093
44099
  viewConfig: viewConfig$5,
44094
- columns: getColumns$8
44100
+ columns: getColumns$9
44095
44101
  },
44096
44102
  activities: {
44097
- config: getFiltersConfig$5,
44098
- options: getFilterOptions$5,
44103
+ config: getFiltersConfig$6,
44104
+ options: getFilterOptions$6,
44099
44105
  formConfig: formConfig$4,
44100
44106
  viewConfig: viewConfig$4,
44101
- columns: getColumns$7
44107
+ columns: getColumns$8
44102
44108
  },
44103
44109
  'corrective-actions': {
44104
- config: getFiltersConfig$5,
44105
- options: getFilterOptions$5,
44110
+ config: getFiltersConfig$6,
44111
+ options: getFilterOptions$6,
44106
44112
  formConfig: formConfig$4,
44107
44113
  viewConfig: viewConfig$4,
44108
- columns: getColumns$7
44114
+ columns: getColumns$8
44109
44115
  },
44110
44116
  incidents: {
44111
- config: getFiltersConfig$4,
44112
- options: getFilterOptions$4,
44117
+ config: getFiltersConfig$5,
44118
+ options: getFilterOptions$5,
44113
44119
  formConfig: formConfig$3,
44114
44120
  viewConfig: viewConfig$3,
44115
- columns: getColumns$6
44121
+ columns: getColumns$7
44116
44122
  },
44117
44123
  locations: {
44118
- config: getFiltersConfig$3,
44119
- options: getFilterOptions$3,
44124
+ config: getFiltersConfig$4,
44125
+ options: getFilterOptions$4,
44120
44126
  formConfig: formConfig$2,
44121
44127
  viewConfig: viewConfig$2,
44122
- columns: getColumns$5
44128
+ columns: getColumns$6
44123
44129
  },
44124
44130
  'production-sites': {
44125
- config: getFiltersConfig$2,
44126
- options: getFilterOptions$2,
44131
+ config: getFiltersConfig$3,
44132
+ options: getFilterOptions$3,
44127
44133
  formConfig: formConfig$1,
44128
44134
  viewConfig: viewConfig$1,
44129
- columns: getColumns$4
44135
+ columns: getColumns$5
44130
44136
  },
44131
44137
  scl: {
44132
- config: getFiltersConfig$2,
44133
- options: getFilterOptions$2,
44138
+ config: getFiltersConfig$3,
44139
+ options: getFilterOptions$3,
44134
44140
  formConfig: sclFormConfig,
44135
44141
  viewConfig: sclViewConfig,
44136
- columns: getColumns$4
44142
+ columns: getColumns$5
44137
44143
  },
44138
44144
  documents: {
44139
- config: getFiltersConfig$1,
44140
- options: getFilterOptions$1,
44145
+ config: getFiltersConfig$2,
44146
+ options: getFilterOptions$2,
44141
44147
  formConfig: formConfig,
44142
44148
  viewConfig: viewConfig,
44143
- columns: getColumns$3
44149
+ columns: getColumns$4
44144
44150
  }
44145
44151
  };
44146
44152
  const DEFAULT_SUBJECT = 'stakeholders';
@@ -44161,7 +44167,7 @@ const getSelectFiltersConfig = ({
44161
44167
  datastakeId: ''
44162
44168
  };
44163
44169
  };
44164
- const getFiltersConfig = ({
44170
+ const getFiltersConfig$1 = ({
44165
44171
  t,
44166
44172
  subject
44167
44173
  }) => {
@@ -44170,7 +44176,7 @@ const getFiltersConfig = ({
44170
44176
  t
44171
44177
  });
44172
44178
  };
44173
- const getFilterOptions = ({
44179
+ const getFilterOptions$1 = ({
44174
44180
  t,
44175
44181
  subject,
44176
44182
  options
@@ -44191,7 +44197,7 @@ const getViewConfig = ({
44191
44197
  return registry?.viewConfig;
44192
44198
  };
44193
44199
 
44194
- const getColumns$2 = ({
44200
+ const getColumns$3 = ({
44195
44201
  t,
44196
44202
  goTo,
44197
44203
  user,
@@ -44279,7 +44285,7 @@ const useTablePage = ({
44279
44285
  extendingFilters: extendingFilters,
44280
44286
  subject
44281
44287
  });
44282
- const columns = React.useMemo(() => getColumns$2({
44288
+ const columns = React.useMemo(() => getColumns$3({
44283
44289
  t,
44284
44290
  goTo,
44285
44291
  user,
@@ -44291,21 +44297,21 @@ const useTablePage = ({
44291
44297
  data,
44292
44298
  applications,
44293
44299
  APP
44294
- }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications, subject, getColumns$2, APP]);
44295
- const selectFiltersConfig = React.useMemo(() => getFiltersConfig({
44300
+ }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications, subject, getColumns$3, APP]);
44301
+ const selectFiltersConfig = React.useMemo(() => getFiltersConfig$1({
44296
44302
  t,
44297
44303
  subject
44298
- }), [t, subject, getFiltersConfig]);
44304
+ }), [t, subject, getFiltersConfig$1]);
44299
44305
  React.useEffect(() => {
44300
44306
  setSelectOptions(prev => ({
44301
44307
  ...prev,
44302
- ...getFilterOptions({
44308
+ ...getFilterOptions$1({
44303
44309
  t,
44304
44310
  subject,
44305
44311
  options
44306
44312
  })
44307
44313
  }));
44308
- }, [options, t, subject, getFilterOptions]);
44314
+ }, [options, t, subject, getFilterOptions$1]);
44309
44315
  const checkboxConfig = React.useMemo(() => getCheckboxConfig({
44310
44316
  subject
44311
44317
  }), [subject, getCheckboxConfig]);
@@ -55068,7 +55074,7 @@ const CommunityParticipation = ({
55068
55074
  const ACTIVITIES_TAB$1 = 'activities';
55069
55075
  const PARTNERS_TAB$1 = 'partners';
55070
55076
  const INCIDENTS_TAB$1 = 'incidents';
55071
- const getColumns$1 = ({
55077
+ const getColumns$2 = ({
55072
55078
  projectId,
55073
55079
  t,
55074
55080
  show = 'show',
@@ -55749,7 +55755,7 @@ const AssociatedInformation = ({
55749
55755
  const handleTabChange = React.useCallback(value => {
55750
55756
  setActiveTab(value);
55751
55757
  }, []);
55752
- const columns = React.useMemo(() => getColumns$1({
55758
+ const columns = React.useMemo(() => getColumns$2({
55753
55759
  t,
55754
55760
  activeTab,
55755
55761
  view: activeTab,
@@ -58026,6 +58032,612 @@ const MonitoringActivitySummary = ({
58026
58032
  });
58027
58033
  };
58028
58034
 
58035
+ const getColumns$1 = ({
58036
+ t,
58037
+ goTo,
58038
+ user,
58039
+ removeUser = () => {},
58040
+ resendInvite = () => {},
58041
+ setUserToEdit = () => {},
58042
+ userRoles = [],
58043
+ company = {},
58044
+ canCreate = false,
58045
+ app
58046
+ }) => [
58047
+ // {
58048
+ // dataIndex: 'datastakeId',
58049
+ // title: t('ID'),
58050
+ // ellipsis: true,
58051
+ // show: true,
58052
+ // render: (v, all) => {
58053
+ // if (all.empty) {
58054
+ // return <div className="daf-default-cell" />
58055
+ // }
58056
+
58057
+ // return <Tooltip title={v}>{v}</Tooltip>;
58058
+ // },
58059
+ // },
58060
+ {
58061
+ dataIndex: 'firstName',
58062
+ title: t('Name'),
58063
+ ellipsis: true,
58064
+ show: true,
58065
+ render: (v, all) => {
58066
+ if (all.empty) {
58067
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
58068
+ className: "daf-default-cell"
58069
+ });
58070
+ }
58071
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
58072
+ title: v,
58073
+ children: v
58074
+ });
58075
+ }
58076
+ }, {
58077
+ dataIndex: 'lastName',
58078
+ title: t('Last Name'),
58079
+ ellipsis: true,
58080
+ show: true,
58081
+ render: (v, all) => {
58082
+ if (all.empty) {
58083
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
58084
+ className: "daf-default-cell"
58085
+ });
58086
+ }
58087
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
58088
+ title: v,
58089
+ children: v
58090
+ });
58091
+ }
58092
+ }, {
58093
+ dataIndex: 'email',
58094
+ title: t('Email'),
58095
+ ellipsis: true,
58096
+ show: true,
58097
+ render: (v, all) => {
58098
+ if (all.empty) {
58099
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
58100
+ className: "daf-default-cell"
58101
+ });
58102
+ }
58103
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
58104
+ title: v,
58105
+ children: v
58106
+ });
58107
+ }
58108
+ }, {
58109
+ title: t("Status"),
58110
+ dataIndex: "status",
58111
+ key: "status",
58112
+ width: 150,
58113
+ ellipsis: false,
58114
+ show: true,
58115
+ render: (status, users) => {
58116
+ if (users.empty) {
58117
+ return null;
58118
+ }
58119
+ if (status === "inactive") {
58120
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
58121
+ color: "red",
58122
+ style: {
58123
+ width: 100,
58124
+ textAlign: "center"
58125
+ },
58126
+ children: t("Blocked")
58127
+ });
58128
+ }
58129
+ if (status === "active") {
58130
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
58131
+ color: "green",
58132
+ style: {
58133
+ width: 100,
58134
+ textAlign: "center"
58135
+ },
58136
+ children: t("Active")
58137
+ });
58138
+ }
58139
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tag, {
58140
+ color: "orange",
58141
+ style: {
58142
+ width: 100,
58143
+ textAlign: "center"
58144
+ },
58145
+ children: t("Pending")
58146
+ });
58147
+ }
58148
+ }, {
58149
+ title: t("Last Login"),
58150
+ dataIndex: "lastLogin",
58151
+ key: "lastLogin",
58152
+ width: 125,
58153
+ render: (date, all) => {
58154
+ if (all.empty) {
58155
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
58156
+ className: "daf-default-cell"
58157
+ });
58158
+ }
58159
+ const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
58160
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
58161
+ title: _date,
58162
+ children: _date
58163
+ });
58164
+ },
58165
+ ellipsis: true
58166
+ }, {
58167
+ title: t("User Role"),
58168
+ dataIndex: "roleName",
58169
+ key: "role",
58170
+ show: true,
58171
+ render: (val, all) => {
58172
+ if (all.empty) {
58173
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
58174
+ className: "daf-default-cell"
58175
+ });
58176
+ }
58177
+
58178
+ // Display role name if available, fallback to role ID
58179
+ const displayValue = val || all.role;
58180
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
58181
+ title: displayValue,
58182
+ children: displayValue
58183
+ });
58184
+ }
58185
+ }, {
58186
+ title: t(""),
58187
+ key: "actions",
58188
+ width: 60,
58189
+ show: removeUser || setUserToEdit,
58190
+ render: (row, all) => {
58191
+ if (all.empty) {
58192
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
58193
+ className: "daf-default-cell"
58194
+ });
58195
+ }
58196
+ const _v = userRoles?.find(r => r.value === all.role);
58197
+ const items = [removeUser ? {
58198
+ key: "removeUser",
58199
+ onClick: () => {
58200
+ antd.Modal.confirm({
58201
+ title: t("Are you sure you want to remove this user from your organisation?"),
58202
+ onOk: () => removeUser(all.id),
58203
+ cancelText: t("No"),
58204
+ okText: "Yes",
58205
+ closable: true
58206
+ });
58207
+ },
58208
+ label: t("Remove User")
58209
+ } : null, setUserToEdit ? {
58210
+ key: "editPermission",
58211
+ onClick: () => setUserToEdit(all),
58212
+ disabled: all.isAdmin || _v?.isForAppAdmin,
58213
+ label: t("Edit Permissions")
58214
+ } : null, all.invitationToken && canCreate ? {
58215
+ key: "copyLink",
58216
+ onClick: () => {
58217
+ if (location.pathname.includes(`/${APP}`)) {
58218
+ navigator.clipboard.writeText(`${window.location.host}/${app}/r/${company.inviteToken}/${all.invitationToken}`);
58219
+ } else {
58220
+ navigator.clipboard.writeText(`${window.location.host}/r/${company.inviteToken}/${all.invitationToken}`);
58221
+ }
58222
+ antd.message.info({
58223
+ content: t("Invitation link copied")
58224
+ });
58225
+ },
58226
+ label: t("Copy Invitation Link")
58227
+ } : null, all.invitationToken && canCreate ? {
58228
+ key: "resendInvite",
58229
+ onClick: () => {
58230
+ antd.Modal.confirm({
58231
+ title: t("Are you sure you want to invite this user again? This user will receive a new notification"),
58232
+ onOk: () => resendInvite(all.id),
58233
+ cancelText: t("No"),
58234
+ okText: "Yes",
58235
+ closable: true
58236
+ });
58237
+ },
58238
+ label: t("Resend Invite")
58239
+ } : null];
58240
+ return /*#__PURE__*/jsxRuntime.jsx(MoreMenu, {
58241
+ items: items
58242
+ });
58243
+ },
58244
+ client: false
58245
+ }].filter(column => column.show !== false);
58246
+
58247
+ const checkboxConfig = {
58248
+ name: 'Name',
58249
+ datastakeId: 'ID'
58250
+ };
58251
+ const getFiltersConfig = ({
58252
+ t
58253
+ }) => {
58254
+ return {
58255
+ email: {
58256
+ type: 'text',
58257
+ label: 'Email',
58258
+ placeholder: t => `${t('Filter by')} ${t('Email').toLowerCase()}`,
58259
+ style: {
58260
+ flex: 1
58261
+ },
58262
+ labelStyle: {
58263
+ flex: 1
58264
+ },
58265
+ getLabel: option => option.label,
58266
+ getValue: option => option.value
58267
+ },
58268
+ status: {
58269
+ type: "select",
58270
+ label: "Status",
58271
+ placeholder: t => `${t("Filter by")} ${t("Status").toLowerCase()}`,
58272
+ style: {
58273
+ flex: 1
58274
+ },
58275
+ labelStyle: {
58276
+ fley: 1
58277
+ },
58278
+ getLabel: option => option.label,
58279
+ getValue: option => option.value
58280
+ },
58281
+ timeframe: {
58282
+ type: "timeframe",
58283
+ label: "Timeframe",
58284
+ placeholder: t => `${t("Filter by")} ${t("Timeframe").toLowerCase()}`,
58285
+ style: {
58286
+ flex: 1
58287
+ },
58288
+ labelStyle: {
58289
+ flex: 1
58290
+ }
58291
+ },
58292
+ userRole: {
58293
+ type: "select",
58294
+ label: "User Role",
58295
+ placeholder: t => `${t("Filter by")} ${t("User Role").toLowerCase()}`,
58296
+ style: {
58297
+ flex: 1
58298
+ },
58299
+ labelStyle: {
58300
+ flex: 1
58301
+ }
58302
+ }
58303
+ };
58304
+ };
58305
+ const filtersConfig = {
58306
+ name: '',
58307
+ datastakeId: ''
58308
+ };
58309
+ const getFilterOptions = (options, t) => {
58310
+ const {
58311
+ emailOptions = [],
58312
+ statusOptions = [],
58313
+ timeframeOptions = [],
58314
+ userRoleOptions = []
58315
+ } = options || {};
58316
+ const _default = {
58317
+ timeframe: timeframeOptions,
58318
+ email: emailOptions,
58319
+ status: statusOptions,
58320
+ userRole: userRoleOptions,
58321
+ status: [{
58322
+ value: "active",
58323
+ label: "Active"
58324
+ }, {
58325
+ value: "pending",
58326
+ label: "Pending"
58327
+ }]
58328
+ };
58329
+ return _default;
58330
+ };
58331
+ const getUserForm = ({
58332
+ t,
58333
+ userRoles = [],
58334
+ APP
58335
+ }) => {
58336
+ return {
58337
+ user: {
58338
+ position: 0,
58339
+ firstName: {
58340
+ group: "user",
58341
+ section: "user",
58342
+ moduleScope: {
58343
+ cadd: ["scoping", "new", "linking-extra"],
58344
+ pme: ["scoping", "new", "linking-extra"]
58345
+ },
58346
+ label: t("First Name"),
58347
+ comment: false,
58348
+ type: "text",
58349
+ rules: [{
58350
+ required: true,
58351
+ message: "This field is required"
58352
+ }],
58353
+ mergeStrategy: "simple",
58354
+ position: 1
58355
+ },
58356
+ lastName: {
58357
+ group: "user",
58358
+ section: "user",
58359
+ moduleScope: {
58360
+ cadd: ["scoping", "new", "linking-extra"],
58361
+ pme: ["scoping", "new", "linking-extra"]
58362
+ },
58363
+ label: t("Last Name"),
58364
+ comment: false,
58365
+ type: "text",
58366
+ rules: [{
58367
+ required: true,
58368
+ message: "This field is required"
58369
+ }],
58370
+ mergeStrategy: "simple",
58371
+ position: 2
58372
+ },
58373
+ email: {
58374
+ group: "user",
58375
+ section: "user",
58376
+ moduleScope: {
58377
+ cadd: ["scoping", "new", "linking-extra"],
58378
+ pme: ["scoping", "new", "linking-extra"]
58379
+ },
58380
+ label: t("Email"),
58381
+ comment: false,
58382
+ type: "text",
58383
+ rules: [{
58384
+ required: true,
58385
+ message: "This field is required"
58386
+ }, {
58387
+ type: "email",
58388
+ message: "errors::field must be email"
58389
+ }],
58390
+ mergeStrategy: "simple",
58391
+ position: 3
58392
+ },
58393
+ role: {
58394
+ group: "user",
58395
+ section: "user",
58396
+ moduleScope: {
58397
+ cadd: ["scoping", "new", "linking", "linking-extra", "admin"],
58398
+ pme: ["scoping", "new", "linking", "linking-extra", "admin"]
58399
+ },
58400
+ label: t("User Role"),
58401
+ placeholder: t("User Role"),
58402
+ comment: false,
58403
+ type: "select",
58404
+ options: userRoles.filter(r => r.canBeAssignedToSubUsers && r.app === APP).map(v => ({
58405
+ label: t(v.label),
58406
+ value: v.value
58407
+ })),
58408
+ optionsName: "userRoles",
58409
+ // tooltip: <UserRolePopover t={t} />,
58410
+ sortOptions: true,
58411
+ rules: [{
58412
+ required: true,
58413
+ message: "This field is required"
58414
+ }],
58415
+ position: 4
58416
+ }
58417
+ }
58418
+ };
58419
+ };
58420
+
58421
+ const UsersCreate = ({
58422
+ onSubmitted = () => {},
58423
+ onCancel = () => {},
58424
+ user = {},
58425
+ APP,
58426
+ query,
58427
+ goTo = () => {},
58428
+ t = () => {},
58429
+ ajaxForms = {},
58430
+ changeAjaxForms = () => {},
58431
+ ajaxOptions = {},
58432
+ changeAjaxOptions = () => {},
58433
+ getAppHeader = () => {},
58434
+ getApiBaseUrl = () => {},
58435
+ userToEdit = null,
58436
+ userRoles = []
58437
+ }) => {
58438
+ const disabledInputs = React.useMemo(() => !userToEdit ? [] : ['firstName', 'lastName', 'email'], [userToEdit]);
58439
+ const data = React.useMemo(() => ({
58440
+ ...(userToEdit || {}),
58441
+ userRole: userToEdit?.role
58442
+ }), [userToEdit]);
58443
+ const form = React.useMemo(() => getUserForm({
58444
+ t,
58445
+ userRoles,
58446
+ APP
58447
+ }), [t, userRoles, APP]);
58448
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
58449
+ className: "daf-create-form",
58450
+ children: /*#__PURE__*/jsxRuntime.jsx(DynamicForm, {
58451
+ form: form,
58452
+ data: data,
58453
+ showSaveAndNext: false,
58454
+ module: APP,
58455
+ onCancel: onCancel,
58456
+ isCreate: true,
58457
+ t: t,
58458
+ user: user,
58459
+ ajaxForms: ajaxForms,
58460
+ ajaxOptions: ajaxOptions,
58461
+ getAppHeader: getAppHeader,
58462
+ getApiBaseUrl: getApiBaseUrl,
58463
+ changeAjaxOptions: changeAjaxOptions,
58464
+ app: APP,
58465
+ query: query,
58466
+ goTo: goTo,
58467
+ changeAjaxForms: changeAjaxForms,
58468
+ disabledInputs: disabledInputs,
58469
+ submit: payload => {
58470
+ onSubmitted({
58471
+ ...payload,
58472
+ apps: {
58473
+ [APP]: {
58474
+ ...((userToEdit?.apps || {})[APP] || {}),
58475
+ role: payload.role
58476
+ }
58477
+ }
58478
+ });
58479
+ }
58480
+ })
58481
+ });
58482
+ };
58483
+
58484
+ const UsersTable = ({
58485
+ t = () => {},
58486
+ goTo = () => {},
58487
+ user = {},
58488
+ options = {},
58489
+ getRedirectLink = () => {},
58490
+ theme = {},
58491
+ loading = false,
58492
+ data = {},
58493
+ isMobile,
58494
+ APP,
58495
+ location,
58496
+ getData = () => {},
58497
+ getApiBaseUrl = () => {},
58498
+ getAppHeader = () => {},
58499
+ onInviteUser = () => {},
58500
+ onEditUser = () => {},
58501
+ query = {},
58502
+ ajaxForms = {},
58503
+ changeAjaxForms = () => {},
58504
+ ajaxOptions = {},
58505
+ changeAjaxOptions = () => {},
58506
+ extendingFilters = {},
58507
+ userRoles = []
58508
+ }) => {
58509
+ const [selectOptions, setSelectOptions] = React.useState();
58510
+ const params = new URLSearchParams(location?.search);
58511
+ const [openCreateModal, setOpenCreateModal] = React.useState(params.has("create"));
58512
+ const [userToEdit, setUserToEdit] = React.useState(null);
58513
+ const columns = React.useMemo(() => getColumns$1({
58514
+ t,
58515
+ goTo,
58516
+ user,
58517
+ options,
58518
+ getRedirectLink,
58519
+ theme,
58520
+ subject: 'user',
58521
+ data,
58522
+ setUserToEdit
58523
+ }), [t, goTo, user, options, getRedirectLink, theme, data]);
58524
+ const breadCrumbs = [];
58525
+ const {
58526
+ paginationQuery,
58527
+ searchParams,
58528
+ otherParams,
58529
+ sortBy,
58530
+ sortDir
58531
+ } = useGetQueryParams({
58532
+ location
58533
+ });
58534
+ React.useMemo(() => ({
58535
+ ...otherParams,
58536
+ ...extendingFilters
58537
+ }), [otherParams, extendingFilters]);
58538
+ React.useEffect(() => {
58539
+ getData({
58540
+ pagination: paginationQuery,
58541
+ ...(Object.keys(searchParams).length > 0 && {
58542
+ search: searchParams
58543
+ }),
58544
+ ...otherParams,
58545
+ sortBy: {
58546
+ [sortBy || 'updatedAt']: sortDir ? sortDir === 'ascend' ? 1 : -1 : -1
58547
+ },
58548
+ ...extendingFilters
58549
+ }, 'users');
58550
+ }, [location.search, JSON.stringify(extendingFilters)]);
58551
+ const selectFiltersConfig = React.useMemo(() => getFiltersConfig({
58552
+ t
58553
+ }), [t]);
58554
+ React.useEffect(() => {
58555
+ setSelectOptions(prev => ({
58556
+ ...prev,
58557
+ ...getFilterOptions(options)
58558
+ }));
58559
+ }, [options, t]);
58560
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
58561
+ className: "semibold form-input-output daf-create-view",
58562
+ children: [/*#__PURE__*/jsxRuntime.jsx(DAFHeader, {
58563
+ title: t("users"),
58564
+ breadcrumbs: breadCrumbs,
58565
+ actionButtons: [{
58566
+ type: "primary",
58567
+ onClick: () => setOpenCreateModal(true),
58568
+ tooltip: t("New"),
58569
+ icon: "Add"
58570
+ }]
58571
+ // onDownload={() => {
58572
+ // console.log("download");
58573
+ // }}
58574
+ // downloadDisabled={false}
58575
+ }), /*#__PURE__*/jsxRuntime.jsx(BaseScreen, {
58576
+ t: t,
58577
+ checkboxConfig: checkboxConfig,
58578
+ defaultTableFilters: {},
58579
+ columns: columns,
58580
+ data: data,
58581
+ loading: loading,
58582
+ location: location,
58583
+ goTo: goTo,
58584
+ APP: APP,
58585
+ getApiBaseUrl: getApiBaseUrl,
58586
+ selectOptions: selectOptions,
58587
+ selectFilters: selectFiltersConfig,
58588
+ view: "users",
58589
+ getRedirectLink: getRedirectLink,
58590
+ defaultUrlParams: {},
58591
+ module: APP,
58592
+ filtersConfig: filtersConfig,
58593
+ isMobile: isMobile
58594
+ }), (openCreateModal || !!userToEdit) && /*#__PURE__*/jsxRuntime.jsx(antd.Drawer, {
58595
+ destroyOnClose: true,
58596
+ title: /*#__PURE__*/jsxRuntime.jsx(DrawerHeader, {
58597
+ title: t(userToEdit ? "Edit User" : "New User")
58598
+ }),
58599
+ open: openCreateModal || !!userToEdit,
58600
+ onClose: () => {
58601
+ setOpenCreateModal(false);
58602
+ setUserToEdit(null);
58603
+ },
58604
+ width: CREATE_DRAWER_WIDTH,
58605
+ bodyStyle: {
58606
+ padding: 0
58607
+ },
58608
+ maskClosable: false,
58609
+ children: /*#__PURE__*/jsxRuntime.jsx(UsersCreate, {
58610
+ t: t,
58611
+ goTo: goTo,
58612
+ user: user,
58613
+ APP: APP,
58614
+ getApiBaseUrl: getApiBaseUrl,
58615
+ getAppHeader: getAppHeader,
58616
+ onSubmitted: payload => {
58617
+ if (userToEdit) {
58618
+ onEditUser(payload);
58619
+ } else {
58620
+ onInviteUser(payload);
58621
+ }
58622
+ setOpenCreateModal(false);
58623
+ setUserToEdit(null);
58624
+ },
58625
+ onCancel: () => {
58626
+ setOpenCreateModal(false);
58627
+ setUserToEdit(null);
58628
+ },
58629
+ query: query,
58630
+ ajaxForms: ajaxForms,
58631
+ changeAjaxForms: changeAjaxForms,
58632
+ ajaxOptions: ajaxOptions,
58633
+ changeAjaxOptions: changeAjaxOptions,
58634
+ userRoles: userRoles,
58635
+ userToEdit: userToEdit
58636
+ })
58637
+ })]
58638
+ });
58639
+ };
58640
+
58029
58641
  const useViewUrlParams = ({
58030
58642
  params,
58031
58643
  push,
@@ -58137,45 +58749,65 @@ const usePrepareForm$1 = ({
58137
58749
  const [linkingForms, setLinkingForms] = React.useState({});
58138
58750
  const [loading, setLoading] = React.useState(true);
58139
58751
  const [notFound, setNotFound] = React.useState(false);
58752
+ console.log({
58753
+ form,
58754
+ data,
58755
+ groups,
58756
+ linkingForms,
58757
+ loading,
58758
+ notFound
58759
+ });
58140
58760
  const prepareForm = currentView => {
58141
58761
  const dKey = namespaceConfig?.dataKey;
58142
- if (hasKeyInObject(allData, dKey)) {
58762
+ const nKey = `${APP}-${currentView}`;
58763
+ console.log({
58764
+ dKey,
58765
+ nKey,
58766
+ allData
58767
+ });
58768
+ console.log({
58769
+ condition1: hasKeyInObject(allData, dKey)
58770
+ });
58771
+ console.log({
58772
+ condition2: hasKeyInObject(allData[dKey], nKey)
58773
+ });
58774
+ if (hasKeyInObject(allData, dKey) && hasKeyInObject(allData[dKey], nKey)) {
58143
58775
  const {
58144
58776
  form = {},
58145
58777
  data = {},
58146
58778
  config = {},
58147
58779
  linkingForms = {}
58148
- } = JSON.parse(JSON.stringify(allData[dKey] || {}));
58149
- if (Object.keys(form).length > 0) {
58150
- if (data.datastakeId === id || id === "user" || data.id === id) {
58151
- if (viewConfig.adminNamespaces.includes(namespace)) {
58152
- setForm(form);
58153
- } else {
58154
- setForm({
58155
- ...form,
58156
- linking: {
58157
- position: 100,
58158
- excludeFromEdit: true,
58159
- label: t("Linked Subjects"),
58160
- template: "linkingSubjects"
58161
- }
58162
- });
58163
- }
58164
- setData(data);
58165
- setGroups(config.groups || {});
58166
- setLinkingForms(linkingForms);
58780
+ } = JSON.parse(JSON.stringify(allData[dKey][nKey] || {}));
58781
+ console.log("here", dKey, nKey);
58782
+ if (data.datastakeId === id || id === "user" || data.id === id) {
58783
+ if (viewConfig.adminNamespaces.includes(namespace)) {
58784
+ setForm(form);
58785
+ } else {
58786
+ setForm({
58787
+ ...form,
58788
+ linking: {
58789
+ position: 100,
58790
+ excludeFromEdit: true,
58791
+ label: t("Linked Subjects"),
58792
+ template: "linkingSubjects"
58793
+ }
58794
+ });
58795
+ }
58796
+ setData(data);
58797
+ setGroups(config.groups || {});
58798
+ setLinkingForms(linkingForms);
58799
+ setLoading(false);
58800
+ setNotFound(false);
58801
+ } else if (!data.id) {
58802
+ if (mode === "proxy") {
58803
+ window.location.reload();
58804
+ } else {
58167
58805
  setLoading(false);
58168
- setNotFound(false);
58169
- } else if (!data.id) {
58170
- if (mode === "proxy") {
58171
- window.location.reload();
58172
- } else {
58173
- setLoading(false);
58174
- setNotFound(true);
58175
- }
58806
+ setNotFound(true);
58176
58807
  }
58177
58808
  }
58178
58809
  }
58810
+ console.log('data', data);
58179
58811
  };
58180
58812
  const getCertainData = allData?.[namespaceConfig?.dataKey];
58181
58813
  React.useEffect(() => {
@@ -58307,7 +58939,8 @@ const useCallToGetData = ({
58307
58939
  const isFirstRender = React.useRef(true);
58308
58940
  const callToGetData = (_doCall = false) => {
58309
58941
  const dKey = namespaceConfig?.dataKey;
58310
- const doCall = _doCall ? true : hasKeyInObject(allData, dKey) ? allData[dKey]?.data?.datastakeId !== id : true;
58942
+ const nKey = `${APP}-${getNkey(namespace || "")}`;
58943
+ const doCall = _doCall ? true : hasKeyInObject(allData, dKey) && hasKeyInObject(allData[dKey], nKey) ? allData[dKey][nKey]?.data?.datastakeId !== id : true;
58311
58944
  if (doCall) {
58312
58945
  if (isSupported) {
58313
58946
  namespaceGet[namespace]();
@@ -59154,15 +59787,16 @@ const usePrepareForm = ({
59154
59787
  const prepareForm = (setExtra = true) => {
59155
59788
  if (isSupported) {
59156
59789
  const dKey = namespaceConfig?.dataKey;
59157
- if (hasKeyInObject(allData, dKey)) {
59158
- const d = JSON.parse(JSON.stringify(allData[dKey].data || {}));
59790
+ const nKey = `${APP}-${namespaceConfig?.view}`;
59791
+ if (hasKeyInObject(allData, dKey) && hasKeyInObject(allData[dKey], nKey)) {
59792
+ const d = JSON.parse(JSON.stringify(allData[dKey][nKey].data || {}));
59159
59793
  Object.keys(d).forEach(k => {
59160
59794
  if (d[k] === null) {
59161
59795
  d[k] = undefined;
59162
59796
  }
59163
59797
  });
59164
59798
  if (d.datastakeId === id || d.applicationId === id || id === "user" || d.id === id) {
59165
- const formG = mapFormGroup(allData[dKey].form || {}, d);
59799
+ const formG = mapFormGroup(allData[dKey][nKey].form || {}, d);
59166
59800
  setForm(formG);
59167
59801
  if (setExtra) {
59168
59802
  if ((d || {}).risk && Array.isArray(formG) && formG.find(r => r.id === "risk")) {
@@ -59198,7 +59832,7 @@ const usePrepareForm = ({
59198
59832
  setOriginalData({
59199
59833
  ...d
59200
59834
  });
59201
- setLinkingForms(allData[dKey].linkingForms);
59835
+ setLinkingForms(allData[dKey][nKey].linkingForms);
59202
59836
  setLoading(false);
59203
59837
  return;
59204
59838
  }
@@ -59214,7 +59848,7 @@ const usePrepareForm = ({
59214
59848
  setOriginalData({
59215
59849
  ...d
59216
59850
  });
59217
- setLinkingForms(allData[dKey].linkingForms);
59851
+ setLinkingForms(allData[dKey][nKey].linkingForms);
59218
59852
  setLoading(false);
59219
59853
  }
59220
59854
  }
@@ -59655,4 +60289,5 @@ exports.SelfAssesment = SelfAssesment;
59655
60289
  exports.SupplyChainDashboard = SupplyChain;
59656
60290
  exports.TablePage = TablePage;
59657
60291
  exports.UserDashboard = UserDashboard;
60292
+ exports.UsersTable = UsersTable;
59658
60293
  exports.View = View;