@djb25/digit-ui-module-vendor 1.0.71 → 1.0.72

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.
@@ -40,7 +40,10 @@ function _catch(body, recover) {
40
40
 
41
41
  const _require = require("@djb25/digit-ui-react-components"),
42
42
  DatePicker = _require.DatePicker;
43
- const SurveyorConfig = function (t, agencies, reportingManagers, disabled) {
43
+ const SurveyorConfig = function (t, genderMenu, disabled) {
44
+ if (genderMenu === void 0) {
45
+ genderMenu = [];
46
+ }
44
47
  return [{
45
48
  head: "ES_VENDOR_SURVEYOR_BASIC_DETAILS",
46
49
  body: [{
@@ -90,11 +93,16 @@ const SurveyorConfig = function (t, agencies, reportingManagers, disabled) {
90
93
  error: t("ES_VENDOR_INVALID_EMAIL")
91
94
  }
92
95
  }, {
93
- label: t("ES_VENDOR_SURVEYOR_GENDER"),
96
+ label: t("ES_FSM_REGISTRY_NEW_GENDER"),
94
97
  isMandatory: true,
95
98
  type: "component",
96
99
  key: "gender",
97
- component: "SelectEkycDropdown"
100
+ component: "SelectEkycDropdown",
101
+ populators: {
102
+ name: "gender",
103
+ options: genderMenu,
104
+ optionsKey: "i18nKey"
105
+ }
98
106
  }, {
99
107
  label: t("ES_FSM_REGISTRY_NEW_DOB"),
100
108
  isMandatory: true,
@@ -208,8 +216,26 @@ const AddSurveyor = _ref => {
208
216
  });
209
217
  }
210
218
  }, [isSupervisor, supervisorSearchResponse, isSupervisorSearchLoading, matchedSupervisor]);
219
+ const _useState4 = useState([]),
220
+ genderMenu = _useState4[0],
221
+ setGenderMenu = _useState4[1];
222
+ const stateId = Digit.ULBService.getStateId();
223
+ const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
224
+ genderTypeData = _Digit$Hooks$obps$use.data;
225
+ useEffect(() => {
226
+ var _genderTypeData$commo, _genderTypeData$commo2;
227
+ if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
228
+ var _genderTypeData$commo3, _genderTypeData$commo4;
229
+ const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
230
+ i18nKey: "COMMON_GENDER_" + genderDetails.code,
231
+ code: "" + genderDetails.code,
232
+ value: "" + genderDetails.code
233
+ }));
234
+ setGenderMenu(menuItems);
235
+ }
236
+ }, [genderTypeData]);
211
237
  const Config = useMemo(() => {
212
- const baseConfig = SurveyorConfig(t);
238
+ const baseConfig = SurveyorConfig(t, genderMenu);
213
239
  if (isSupervisor) {
214
240
  return baseConfig.map(section => _extends({}, section, {
215
241
  body: section.body.map(field => {
@@ -225,7 +251,7 @@ const AddSurveyor = _ref => {
225
251
  }));
226
252
  }
227
253
  return baseConfig;
228
- }, [t, isSupervisor]);
254
+ }, [t, genderMenu, isSupervisor]);
229
255
  const isValidAge = dateStr => {
230
256
  if (!dateStr) return false;
231
257
  const today = new Date();
@@ -3452,7 +3478,10 @@ const SupervisorDetails = props => {
3452
3478
 
3453
3479
  const _require$1 = require("@djb25/digit-ui-react-components"),
3454
3480
  DatePicker$1 = _require$1.DatePicker;
3455
- const SupervisorConfig = function (t, agencies, reportingManagers, disabled) {
3481
+ const SupervisorConfig = function (t, genderMenu, disabled) {
3482
+ if (genderMenu === void 0) {
3483
+ genderMenu = [];
3484
+ }
3456
3485
  if (disabled === void 0) {
3457
3486
  disabled = false;
3458
3487
  }
@@ -3513,11 +3542,16 @@ const SupervisorConfig = function (t, agencies, reportingManagers, disabled) {
3513
3542
  className: "payment-form-text-input-correction"
3514
3543
  }
3515
3544
  }, {
3516
- label: t("ES_VENDOR_SUPERVISOR_GENDER"),
3545
+ label: t("ES_FSM_REGISTRY_NEW_GENDER"),
3517
3546
  isMandatory: true,
3518
3547
  type: "component",
3519
3548
  key: "gender",
3520
- component: "SelectEkycDropdown"
3549
+ component: "SelectEkycDropdown",
3550
+ populators: {
3551
+ name: "gender",
3552
+ options: genderMenu,
3553
+ optionsKey: "i18nKey"
3554
+ }
3521
3555
  }, {
3522
3556
  label: t("ES_FSM_REGISTRY_NEW_DOB"),
3523
3557
  isMandatory: true,
@@ -3592,7 +3626,27 @@ const AddSupervisor = _ref => {
3592
3626
  const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSupervisorCreate(tenantId),
3593
3627
  mutateAsync = _Digit$Hooks$fsm$useS.mutateAsync;
3594
3628
  const history = useHistory();
3595
- const Config = SupervisorConfig(t);
3629
+ const _useState3 = useState([]),
3630
+ genderMenu = _useState3[0],
3631
+ setGenderMenu = _useState3[1];
3632
+ const stateId = Digit.ULBService.getStateId();
3633
+ const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
3634
+ genderTypeData = _Digit$Hooks$obps$use.data;
3635
+ useEffect(() => {
3636
+ var _genderTypeData$commo, _genderTypeData$commo2;
3637
+ if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
3638
+ var _genderTypeData$commo3, _genderTypeData$commo4;
3639
+ const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
3640
+ i18nKey: "COMMON_GENDER_" + genderDetails.code,
3641
+ code: "" + genderDetails.code,
3642
+ value: "" + genderDetails.code
3643
+ }));
3644
+ setGenderMenu(menuItems);
3645
+ }
3646
+ }, [genderTypeData]);
3647
+ const Config = React.useMemo(() => {
3648
+ return SupervisorConfig(t, genderMenu);
3649
+ }, [t, genderMenu]);
3596
3650
  const defaultValues = {
3597
3651
  role: {
3598
3652
  code: "SUPERVISOR",
@@ -5422,7 +5476,27 @@ const EditSupervisor = () => {
5422
5476
  isLoading = _Digit$Hooks$fsm$useS.isLoading;
5423
5477
  const _Digit$Hooks$fsm$useS2 = Digit.Hooks.fsm.useSupervisorUpdate(tenantId),
5424
5478
  mutate = _Digit$Hooks$fsm$useS2.mutate;
5425
- const Config = SupervisorConfig(t);
5479
+ const _useState5 = useState([]),
5480
+ genderMenu = _useState5[0],
5481
+ setGenderMenu = _useState5[1];
5482
+ const stateId = Digit.ULBService.getStateId();
5483
+ const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
5484
+ genderTypeData = _Digit$Hooks$obps$use.data;
5485
+ useEffect(() => {
5486
+ var _genderTypeData$commo, _genderTypeData$commo2;
5487
+ if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
5488
+ var _genderTypeData$commo3, _genderTypeData$commo4;
5489
+ const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
5490
+ i18nKey: "COMMON_GENDER_" + genderDetails.code,
5491
+ code: "" + genderDetails.code,
5492
+ value: "" + genderDetails.code
5493
+ }));
5494
+ setGenderMenu(menuItems);
5495
+ }
5496
+ }, [genderTypeData]);
5497
+ const Config = React.useMemo(() => {
5498
+ return SupervisorConfig(t, genderMenu);
5499
+ }, [t, genderMenu]);
5426
5500
  useEffect(() => {
5427
5501
  if (supervisorSearchResponse && supervisorSearchResponse.supervisors && supervisorSearchResponse.supervisors.length > 0) {
5428
5502
  var _details$owner, _details$owner2, _details$owner3, _details$owner4, _details$owner5, _details$owner6, _details$owner7;
@@ -5599,7 +5673,27 @@ const EditSurveyor = () => {
5599
5673
  isLoading = _Digit$Hooks$fsm$useS.isLoading;
5600
5674
  const _Digit$Hooks$fsm$useS2 = Digit.Hooks.fsm.useSurveyorUpdate(tenantId),
5601
5675
  mutate = _Digit$Hooks$fsm$useS2.mutate;
5602
- const Config = SurveyorConfig(t);
5676
+ const _useState5 = useState([]),
5677
+ genderMenu = _useState5[0],
5678
+ setGenderMenu = _useState5[1];
5679
+ const stateId = Digit.ULBService.getStateId();
5680
+ const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
5681
+ genderTypeData = _Digit$Hooks$obps$use.data;
5682
+ useEffect(() => {
5683
+ var _genderTypeData$commo, _genderTypeData$commo2;
5684
+ if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
5685
+ var _genderTypeData$commo3, _genderTypeData$commo4;
5686
+ const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
5687
+ i18nKey: "COMMON_GENDER_" + genderDetails.code,
5688
+ code: "" + genderDetails.code,
5689
+ value: "" + genderDetails.code
5690
+ }));
5691
+ setGenderMenu(menuItems);
5692
+ }
5693
+ }, [genderTypeData]);
5694
+ const Config = React.useMemo(() => {
5695
+ return SurveyorConfig(t, genderMenu);
5696
+ }, [t, genderMenu]);
5603
5697
  useEffect(() => {
5604
5698
  if (surveyorSearchResponse && surveyorSearchResponse.surveyors && surveyorSearchResponse.surveyors.length > 0) {
5605
5699
  var _details$owner, _details$owner2, _details$owner3, _details$owner4, _details$owner5, _details$owner6, _details$owner7, _details$owner8, _details$owner9;