datastake-daf 0.6.821 → 0.6.823

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 (23) hide show
  1. package/dist/components/index.js +153 -93
  2. package/dist/pages/index.js +56 -19
  3. package/dist/utils/index.js +67 -134
  4. package/package.json +1 -1
  5. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +6 -5
  6. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +161 -73
  7. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/columns.js +3 -2
  8. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +26 -33
  9. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +3 -2
  10. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +2 -6
  11. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +1 -2
  12. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +2 -6
  13. package/src/@daf/core/components/Screens/Admin/AdminTables/hook.js +0 -1
  14. package/src/@daf/core/components/Screens/Admin/adminRoutes.js +3 -1
  15. package/src/@daf/core/components/ViewForm/content.jsx +2 -0
  16. package/src/@daf/pages/Events/config.js +2 -11
  17. package/src/@daf/pages/Stakeholders/ArmedGroups/config.js +34 -5
  18. package/src/constants/locales/en/translation.js +26 -10
  19. package/src/constants/locales/fr/translation.js +23 -75
  20. package/src/constants/locales/sp/translation.js +20 -61
  21. package/src/helpers/adminLevels.js +4 -0
  22. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +0 -79
  23. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/helper.js +0 -21
@@ -25049,6 +25049,13 @@ const Content$1 = _ref => {
25049
25049
  }
25050
25050
  return all;
25051
25051
  }, {});
25052
+ console.log({
25053
+ groups,
25054
+ singleGroupsKeys,
25055
+ addedContent,
25056
+ _length,
25057
+ groupped
25058
+ });
25052
25059
  return Object.keys(groupped).map(key => {
25053
25060
  const groups = groupped[key];
25054
25061
  return /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
@@ -42100,10 +42107,7 @@ const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValue
42100
42107
  }
42101
42108
  });
42102
42109
  if (hasChanges) {
42103
- setValues(prevValues => ({
42104
- ...prevValues,
42105
- ...resolvedValues
42106
- }));
42110
+ setValues(prevValues => _objectSpread2(_objectSpread2({}, prevValues), resolvedValues));
42107
42111
  MainForm.setFieldsValue(resolvedValues);
42108
42112
  }
42109
42113
  }, [values, parentValues, combinedPrefilledValues, setValues, MainForm]);
@@ -53963,7 +53967,6 @@ function useAdminTable({
53963
53967
  defaultPageSize: defaultPageSize || 20,
53964
53968
  getRedirectLink
53965
53969
  });
53966
- console.log(filter, "filter.activeFilters");
53967
53970
  const activeTab = React.useMemo(() => filter.activeFilters.activeTab, [filter.activeFilters]);
53968
53971
  const canClearSearch = React.useMemo(() => {
53969
53972
  return !!filter.activeFilters.search;
@@ -55043,6 +55046,9 @@ const getAdminLevelName = (data, level) => {
55043
55046
  const entry = Object.values(data || {}).find(item => item.level === level);
55044
55047
  return entry?.name || "-";
55045
55048
  };
55049
+ const getAdminLevel = (data, level) => {
55050
+ return Object.values(data || {})?.find(item => item.level === level);
55051
+ };
55046
55052
 
55047
55053
  const getColumns$6 = ({
55048
55054
  t,
@@ -55127,7 +55133,8 @@ const getColumns$6 = ({
55127
55133
  className: "daf-default-cell"
55128
55134
  });
55129
55135
  }
55130
- const category = findOptions(value, options?.locationCategories || []) || "--";
55136
+ const categories = [...(options?.locationCategories || []), ...(options?.productionSiteCategories || [])];
55137
+ const category = findOptions(value, categories) || "-";
55131
55138
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55132
55139
  title: category,
55133
55140
  children: category
@@ -55145,7 +55152,7 @@ const getColumns$6 = ({
55145
55152
  className: "daf-default-cell"
55146
55153
  });
55147
55154
  }
55148
- const country = findOptions(value, selectOptions?.country || []) || "--";
55155
+ const country = findOptions(value, selectOptions?.countries || []) || "-";
55149
55156
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55150
55157
  title: country,
55151
55158
  children: country
@@ -55301,7 +55308,8 @@ const getColumns$5 = ({
55301
55308
  key: "category",
55302
55309
  show: true,
55303
55310
  render: (value, all) => {
55304
- const label = findOptions(value, selectOptions?.category);
55311
+ const categories = [...(selectOptions?.locationCategories || []), ...(selectOptions?.productionSiteCategories || [])];
55312
+ const label = findOptions(value, categories);
55305
55313
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55306
55314
  title: label,
55307
55315
  children: label
@@ -55313,7 +55321,7 @@ const getColumns$5 = ({
55313
55321
  key: "country",
55314
55322
  show: true,
55315
55323
  render: (value, all) => {
55316
- const label = findOptions(value, selectOptions?.country);
55324
+ const label = findOptions(value, selectOptions?.countries);
55317
55325
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55318
55326
  title: label,
55319
55327
  children: label
@@ -55375,6 +55383,11 @@ function CombineLocationModal({
55375
55383
  } = useToken$5();
55376
55384
  const [MainForm] = antd.Form.useForm();
55377
55385
  const [isDisabled, setIsDisabled] = React.useState(true);
55386
+
55387
+ // Watch form values for cross-filtering
55388
+ const selectedCountry = antd.Form.useWatch('country', MainForm);
55389
+ const selectedProvince = antd.Form.useWatch('administrativeLevel1', MainForm);
55390
+ const selectedTerritory = antd.Form.useWatch('administrativeLevel2', MainForm);
55378
55391
  const columns = React.useMemo(() => {
55379
55392
  return getColumns$5({
55380
55393
  t,
@@ -55384,6 +55397,29 @@ function CombineLocationModal({
55384
55397
  entity
55385
55398
  });
55386
55399
  }, [selectedLocations, t, selectOptions, module, entity]);
55400
+ const categories = [...(selectOptions?.locationCategories || []), ...(selectOptions?.productionSiteCategories || [])];
55401
+ const getFilteredLocations = () => {
55402
+ return selectedLocations.filter(location => {
55403
+ if (selectedCountry && location.country !== selectedCountry) {
55404
+ return false;
55405
+ }
55406
+ if (selectedProvince) {
55407
+ const provinceData = getAdminLevel(location?.linking?.SCL, "level_1") || location?.linking?.SCL?.[location?.administrativeLevel1];
55408
+ const provinceCountry = provinceData?.country || location.country;
55409
+ if (provinceData?.id !== selectedProvince || selectedCountry && provinceCountry !== selectedCountry) {
55410
+ return false;
55411
+ }
55412
+ }
55413
+ if (selectedTerritory) {
55414
+ const territoryData = getAdminLevel(location?.linking?.SCL, "level_2") || location?.linking?.SCL?.[location?.administrativeLevel2];
55415
+ const territoryCountry = territoryData?.country || location.country;
55416
+ if (territoryData?.id !== selectedTerritory || selectedCountry && territoryCountry !== selectedCountry) {
55417
+ return false;
55418
+ }
55419
+ }
55420
+ return true;
55421
+ });
55422
+ };
55387
55423
  const onSubmit = () => {
55388
55424
  MainForm.validateFields().then(data => {
55389
55425
  const ids = selectedLocations.map(location => location.id);
@@ -55438,10 +55474,54 @@ function CombineLocationModal({
55438
55474
  form: MainForm,
55439
55475
  clearOnDestroy: true,
55440
55476
  className: "select-container",
55441
- onValuesChange: () => {
55442
- setIsDisabled(prev => {
55477
+ onValuesChange: changedValues => {
55478
+ if (changedValues.country !== undefined) {
55479
+ const currentValues = MainForm.getFieldsValue();
55480
+ const newCountry = changedValues.country;
55481
+ if (currentValues.administrativeLevel1) {
55482
+ const isProvinceValid = selectedLocations.some(location => {
55483
+ const provinceData = location?.linking?.SCL?.[location?.administrativeLevel1];
55484
+ return location.country === newCountry && provinceData?.id === currentValues.administrativeLevel1;
55485
+ });
55486
+ if (!isProvinceValid) {
55487
+ MainForm.setFieldsValue({
55488
+ administrativeLevel1: undefined,
55489
+ administrativeLevel2: undefined
55490
+ });
55491
+ }
55492
+ }
55493
+ if (currentValues.administrativeLevel2) {
55494
+ const isTerritoryValid = selectedLocations.some(location => {
55495
+ const territoryData = getAdminLevel(location?.linking?.SCL, "level_2") || location?.linking?.SCL?.[location?.administrativeLevel2];
55496
+ return location.country === newCountry && territoryData?.id === currentValues.administrativeLevel2;
55497
+ });
55498
+ if (!isTerritoryValid) {
55499
+ MainForm.setFieldsValue({
55500
+ administrativeLevel2: undefined
55501
+ });
55502
+ }
55503
+ }
55504
+ }
55505
+ if (changedValues.administrativeLevel1 !== undefined) {
55506
+ const currentValues = MainForm.getFieldsValue();
55507
+ const newProvince = changedValues.administrativeLevel1;
55508
+ if (currentValues.administrativeLevel2) {
55509
+ const isTerritoryValid = selectedLocations.some(location => {
55510
+ const provinceData = location?.linking?.SCL?.[location?.administrativeLevel1];
55511
+ const territoryData = getAdminLevel(location?.linking?.SCL, "level_2") || location?.linking?.SCL?.[location?.administrativeLevel2];
55512
+ return provinceData?.id === newProvince && territoryData?.id === currentValues.administrativeLevel2;
55513
+ });
55514
+ if (!isTerritoryValid) {
55515
+ MainForm.setFieldsValue({
55516
+ administrativeLevel2: undefined
55517
+ });
55518
+ }
55519
+ }
55520
+ }
55521
+ setIsDisabled(() => {
55443
55522
  const values = MainForm.getFieldsValue();
55444
- return Object.keys(values).some(key => values[key] === undefined);
55523
+ const requiredFields = entity?.includes("location") ? ["id", "name", "category", "country", "administrativeLevel1", "administrativeLevel2"] : ["id", "name", "category", "country"];
55524
+ return requiredFields.some(field => values[field] === undefined);
55445
55525
  });
55446
55526
  },
55447
55527
  style: {
@@ -55457,7 +55537,8 @@ function CombineLocationModal({
55457
55537
  value: location?.id || "-"
55458
55538
  };
55459
55539
  }),
55460
- placeholder: t("ID")
55540
+ placeholder: t("ID"),
55541
+ allowClear: true
55461
55542
  })
55462
55543
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
55463
55544
  className: "flex-1",
@@ -55471,23 +55552,25 @@ function CombineLocationModal({
55471
55552
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
55472
55553
  options: selectedLocations.map(location => {
55473
55554
  return {
55474
- label: (selectOptions?.category || []).find(option => option.value === location?.category)?.label || location?.category || "-",
55555
+ label: (categories || []).find(option => option.value === location?.category)?.label || location?.category || "-",
55475
55556
  value: location?.category || "-"
55476
55557
  };
55477
55558
  }).filter((option, index, self) => index === self.findIndex(o => o.value === option.value)),
55478
- placeholder: t("Category")
55559
+ placeholder: t("Category"),
55560
+ allowClear: true
55479
55561
  })
55480
55562
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
55481
55563
  className: "flex-1",
55482
55564
  name: "country",
55483
55565
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
55484
- options: selectedLocations.map(location => {
55566
+ options: getFilteredLocations().map(location => {
55485
55567
  return {
55486
- label: (selectOptions?.country || []).find(option => option.value === location?.country)?.label || location?.country || "-",
55568
+ label: (selectOptions?.countries || []).find(option => option.value === location?.country)?.label || location?.country || "-",
55487
55569
  value: location?.country || "-"
55488
55570
  };
55489
55571
  }).filter((option, index, self) => index === self.findIndex(o => o.value === option.value)),
55490
- placeholder: t("admin::country")
55572
+ placeholder: t("admin::country"),
55573
+ allowClear: true
55491
55574
  })
55492
55575
  }), entity?.includes("location") && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
55493
55576
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
@@ -55495,26 +55578,28 @@ function CombineLocationModal({
55495
55578
  name: "administrativeLevel1",
55496
55579
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
55497
55580
  placeholder: t("Province"),
55498
- options: selectedLocations.map(location => {
55499
- const _data = getAdminLevelName(location?.linking?.SCL, "level_1");
55581
+ options: getFilteredLocations().map(location => {
55582
+ const _data = getAdminLevel(location?.linking?.SCL, "level_1") || location?.linking?.SCL?.[location?.administrativeLevel1];
55500
55583
  return {
55501
55584
  label: _data?.name || "-",
55502
55585
  value: _data?.id || "-"
55503
55586
  };
55504
- }).filter((option, index, self) => index === self.findIndex(o => o.value === option.value))
55587
+ }).filter((option, index, self) => index === self.findIndex(o => o.value === option.value) && option.value !== "-"),
55588
+ allowClear: true
55505
55589
  })
55506
55590
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
55507
55591
  className: "flex-1",
55508
55592
  name: "administrativeLevel2",
55509
55593
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
55510
55594
  placeholder: t("Territory"),
55511
- options: selectedLocations.map(location => {
55512
- const _data = getAdminLevelName(location?.linking?.SCL, "level_2");
55595
+ options: getFilteredLocations().map(location => {
55596
+ const _data = getAdminLevel(location?.linking?.SCL, "level_2") || location?.linking?.SCL?.[location?.administrativeLevel2];
55513
55597
  return {
55514
55598
  label: _data?.name || "-",
55515
55599
  value: _data?.id || "-"
55516
55600
  };
55517
- }).filter((option, index, self) => index === self.findIndex(o => o.value === option.value))
55601
+ }).filter((option, index, self) => index === self.findIndex(o => o.value === option.value) && option.value !== "-"),
55602
+ allowClear: true
55518
55603
  })
55519
55604
  })]
55520
55605
  })]
@@ -55633,13 +55718,8 @@ function LocationTable(_ref) {
55633
55718
  refetchTrigger
55634
55719
  });
55635
55720
  const selectOptions = React.useMemo(() => {
55636
- var _config$options, _config$options2;
55637
- return {
55638
- category: (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.category,
55639
- country: (_config$options2 = config.options) === null || _config$options2 === void 0 ? void 0 : _config$options2.countries,
55640
- sources: []
55641
- };
55642
- }, [config.options]);
55721
+ return options;
55722
+ }, [options]);
55643
55723
  const columns = React.useMemo(() => {
55644
55724
  return getColumns$6({
55645
55725
  t,
@@ -55885,11 +55965,7 @@ const getColumns$4 = ({
55885
55965
  className: "daf-default-cell"
55886
55966
  });
55887
55967
  }
55888
- console.log({
55889
- value,
55890
- options
55891
- });
55892
- const category = findOptions(value, options?.categoriesOptions || []) || "-";
55968
+ const category = findOptions(value, options?.categoriesOptions || options?.category || []) || "-";
55893
55969
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55894
55970
  title: category,
55895
55971
  children: category
@@ -56029,21 +56105,6 @@ const getColumns$4 = ({
56029
56105
  return cols.filter(c => c[show]);
56030
56106
  };
56031
56107
 
56032
- const mapToSelectOptions = (items, valueKey, selectOptions, optionKey, customMapper = null) => {
56033
- return items.map(item => {
56034
- if (customMapper) {
56035
- return customMapper(item);
56036
- }
56037
- const value = item?.[valueKey] || "-";
56038
- const optionsList = selectOptions?.[optionKey] || [];
56039
- const foundOption = optionsList.find(option => option.value === value);
56040
- return {
56041
- label: foundOption?.label || value,
56042
- value: value
56043
- };
56044
- }).filter((option, index, self) => index === self.findIndex(o => o.value === option.value));
56045
- };
56046
-
56047
56108
  const getColumns$3 = ({
56048
56109
  t,
56049
56110
  selectOptions,
@@ -56078,7 +56139,11 @@ const getColumns$3 = ({
56078
56139
  key: "category",
56079
56140
  show: true,
56080
56141
  render: (value, all) => {
56081
- const label = findOptions(value, selectOptions?.category);
56142
+ console.log({
56143
+ value,
56144
+ selectOptions
56145
+ });
56146
+ const label = findOptions(value, selectOptions?.categoriesOptions || selectOptions?.category || []);
56082
56147
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
56083
56148
  title: label,
56084
56149
  children: label
@@ -56090,7 +56155,7 @@ const getColumns$3 = ({
56090
56155
  key: "country",
56091
56156
  show: true,
56092
56157
  render: (value, all) => {
56093
- const label = findOptions(value, selectOptions?.country);
56158
+ const label = findOptions(value, selectOptions?.countries || []);
56094
56159
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
56095
56160
  title: label,
56096
56161
  children: label
@@ -56161,6 +56226,28 @@ function CombineSubjectsModal({
56161
56226
  entity
56162
56227
  });
56163
56228
  }, [selectedSubjects, t, selectOptions, module, entity]);
56229
+ const countryOptions = React.useMemo(() => {
56230
+ return [...new Set(selectedSubjects.map(subject => subject?.country))].map(country => {
56231
+ console.log({
56232
+ country
56233
+ });
56234
+ return {
56235
+ label: findOptions(country, selectOptions?.countries || []),
56236
+ value: country || "-"
56237
+ };
56238
+ });
56239
+ }, [selectedSubjects, selectOptions]);
56240
+ const categoriesOptions = React.useMemo(() => {
56241
+ return [...new Set(selectedSubjects.map(subject => subject?.category))].map(country => {
56242
+ console.log({
56243
+ country
56244
+ });
56245
+ return {
56246
+ label: findOptions(country, selectOptions?.categoriesOptions || selectOptions?.category || []),
56247
+ value: country || "-"
56248
+ };
56249
+ });
56250
+ }, [selectedSubjects, selectOptions]);
56164
56251
  const onSubmit = () => {
56165
56252
  MainForm.validateFields().then(data => {
56166
56253
  const ids = selectedSubjects.map(subject => subject.id);
@@ -56232,7 +56319,8 @@ function CombineSubjectsModal({
56232
56319
  label: s?.datastakeId || "-",
56233
56320
  value: s?.id || "-"
56234
56321
  })),
56235
- placeholder: t("ID")
56322
+ placeholder: t("ID"),
56323
+ allowClear: true
56236
56324
  })
56237
56325
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
56238
56326
  className: "flex-1",
@@ -56244,44 +56332,18 @@ function CombineSubjectsModal({
56244
56332
  className: "flex-1",
56245
56333
  name: "category",
56246
56334
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
56247
- options: mapToSelectOptions(selectedSubjects, "category", selectOptions, "category"),
56248
- placeholder: t("Category")
56335
+ options: categoriesOptions,
56336
+ placeholder: t("Category"),
56337
+ allowClear: true
56249
56338
  })
56250
56339
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
56251
56340
  className: "flex-1",
56252
56341
  name: "country",
56253
56342
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
56254
- options: mapToSelectOptions(selectedSubjects, "country", selectOptions, "country"),
56255
- placeholder: t("admin::country")
56343
+ options: countryOptions,
56344
+ placeholder: t("admin::country"),
56345
+ allowClear: true
56256
56346
  })
56257
- }), entity.includes("location") && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
56258
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
56259
- className: "flex-1",
56260
- name: "administrativeLevel1",
56261
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
56262
- placeholder: t("Province"),
56263
- options: mapToSelectOptions(selectedSubjects, null, selectOptions, null, subject => {
56264
- const _data = getAdminLevelName(subject?.linking?.SCL, "level_1");
56265
- return {
56266
- label: _data?.name || "-",
56267
- value: _data?.id || "-"
56268
- };
56269
- })
56270
- })
56271
- }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
56272
- className: "flex-1",
56273
- name: "administrativeLevel2",
56274
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
56275
- placeholder: t("Territory"),
56276
- options: mapToSelectOptions(selectedSubjects, null, selectOptions, null, subject => {
56277
- const _data = getAdminLevelName(subject?.linking?.SCL, "level_2");
56278
- return {
56279
- label: _data?.name || "-",
56280
- value: _data?.id || "-"
56281
- };
56282
- })
56283
- })
56284
- })]
56285
56347
  })]
56286
56348
  })]
56287
56349
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -56398,13 +56460,8 @@ function SubjectsTable(_ref) {
56398
56460
  refetchTrigger
56399
56461
  });
56400
56462
  const selectOptions = React.useMemo(() => {
56401
- var _config$options, _config$options2;
56402
- return {
56403
- category: (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.category,
56404
- country: (_config$options2 = config.options) === null || _config$options2 === void 0 ? void 0 : _config$options2.countries,
56405
- sources: []
56406
- };
56407
- }, [config.options]);
56463
+ return options;
56464
+ }, [options]);
56408
56465
  const columns = React.useMemo(() => {
56409
56466
  return getColumns$4({
56410
56467
  t,
@@ -59288,6 +59345,9 @@ function getAdminRoutes(config) {
59288
59345
  userIsAdmin
59289
59346
  } = config;
59290
59347
  const APP_PREFIX = "APP_".concat(appName.toUpperCase());
59348
+ console.log({
59349
+ useAdminEventsConfig
59350
+ });
59291
59351
  function DashboardWrapper() {
59292
59352
  const dashboardConfig = useAdminDashboardConfig();
59293
59353
  return /*#__PURE__*/jsxRuntime.jsx(AdminDashboardScreen, {
@@ -42183,6 +42183,19 @@ const getFiltersConfig$a = ({
42183
42183
  t
42184
42184
  }) => {
42185
42185
  return {
42186
+ country: {
42187
+ type: 'select',
42188
+ label: 'Country',
42189
+ placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
42190
+ style: {
42191
+ flex: 1
42192
+ },
42193
+ labelStyle: {
42194
+ flex: 1
42195
+ },
42196
+ getLabel: option => option.label,
42197
+ getValue: option => option.value
42198
+ },
42186
42199
  status: {
42187
42200
  type: "select",
42188
42201
  label: "Status",
@@ -42196,11 +42209,40 @@ const getFiltersConfig$a = ({
42196
42209
  getLabel: option => option.label,
42197
42210
  getValue: option => option.value
42198
42211
  },
42199
- timeframe: {
42200
- type: "timeframe",
42201
- label: "Timeframe",
42212
+ subCategory: {
42213
+ type: 'select',
42214
+ label: 'Sub Category',
42215
+ placeholder: () => `${t('Filter by')} ${t('Sub Category').toLowerCase()}`,
42202
42216
  style: {
42203
42217
  flex: 1
42218
+ },
42219
+ labelStyle: {
42220
+ flex: 1
42221
+ },
42222
+ getLabel: option => option.label,
42223
+ getValue: option => option.value,
42224
+ filterOptions: val => {
42225
+ if (val) {
42226
+ const {
42227
+ option,
42228
+ filters
42229
+ } = val;
42230
+ if (filters && option) {
42231
+ const {
42232
+ filters: optionFilters
42233
+ } = option;
42234
+ if (Array.isArray(optionFilters) && optionFilters.length) {
42235
+ const {
42236
+ value,
42237
+ condition
42238
+ } = optionFilters[0];
42239
+ if (condition === 'includes') {
42240
+ return value.includes('nonStateArmedGroup');
42241
+ }
42242
+ }
42243
+ }
42244
+ }
42245
+ return true;
42204
42246
  }
42205
42247
  }
42206
42248
  };
@@ -42208,7 +42250,8 @@ const getFiltersConfig$a = ({
42208
42250
  const getFilterOptions$a = (options, t) => {
42209
42251
  const _default = {
42210
42252
  status: getStatusOptions(t) || [],
42211
- timeframe: []
42253
+ country: options.countries || [],
42254
+ subCategory: options.subCategory || []
42212
42255
  };
42213
42256
  return _default;
42214
42257
  };
@@ -42458,20 +42501,7 @@ const getFiltersConfig$9 = ({
42458
42501
  flex: 1
42459
42502
  }
42460
42503
  },
42461
- subCategory: {
42462
- type: 'select',
42463
- label: 'Category',
42464
- placeholder: t => `${t('Filter by')} ${t('Category').toLowerCase()}`,
42465
- style: {
42466
- flex: 1
42467
- },
42468
- labelStyle: {
42469
- flex: 1
42470
- },
42471
- getLabel: option => option.label,
42472
- getValue: option => option.value
42473
- },
42474
- category: {
42504
+ eventCategory: {
42475
42505
  type: 'select',
42476
42506
  label: 'Category',
42477
42507
  placeholder: t => `${t('Filter by')} ${t('Category').toLowerCase()}`,
@@ -42515,7 +42545,7 @@ const getFilterOptions$9 = (options, t) => {
42515
42545
  return {
42516
42546
  timeframe: timeframe,
42517
42547
  country: countries || [],
42518
- category: catOptions || [],
42548
+ eventCategory: catOptions || [],
42519
42549
  status: [{
42520
42550
  value: "submitted",
42521
42551
  label: t("Submitted")
@@ -50627,6 +50657,13 @@ const Content = ({
50627
50657
  }
50628
50658
  return all;
50629
50659
  }, {});
50660
+ console.log({
50661
+ groups,
50662
+ singleGroupsKeys,
50663
+ addedContent,
50664
+ _length,
50665
+ groupped
50666
+ });
50630
50667
  return Object.keys(groupped).map(key => {
50631
50668
  const groups = groupped[key];
50632
50669
  return /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {