@undp/carbon-library 2.1.13-PAN-1.9 → 2.1.13-PAN-1.10

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/index.js CHANGED
@@ -20413,22 +20413,21 @@ var enablementTypesAndValues = [
20413
20413
  ];
20414
20414
 
20415
20415
  var NdcActionDetails = function (props) {
20416
- var _a, _b, _c, _d, _e;
20417
20416
  var isBackBtnVisible = props.isBackBtnVisible, onFormSubmit = props.onFormSubmit, ndcActionDetails = props.ndcActionDetails, translator = props.translator, programmeDetails = props.programmeDetails, onClickedBackBtn = props.onClickedBackBtn;
20418
20417
  translator.setDefaultNamespace("ndcAction");
20419
20418
  var t = translator.t;
20420
- var _f = React.useState(), ndcActionType = _f[0], setNdcActionType = _f[1];
20421
- var _g = React.useState(), methodology = _g[0], setMethodology = _g[1];
20422
- var _h = React.useState(), mitigationType = _h[0], setmitigationType = _h[1];
20423
- var _j = React.useState(""), mitigationSubType = _j[0], setMitigationSubType = _j[1];
20424
- var _k = React.useState(""), sector = _k[0], setSector = _k[1];
20425
- var _l = React.useState(""), subSector = _l[0], setSubSector = _l[1];
20426
- var _m = React.useState(ndcActionTypeList), ndcActionTypeListFiltered = _m[0]; _m[1];
20427
- var _o = React.useState([]), checkedOptionsGhgReduced = _o[0], setCheckedOptionsGhgReduced = _o[1];
20428
- var _p = React.useState([]), checkedOptionsGhgAvoided = _p[0], setCheckedOptionsGhgAvoided = _p[1];
20429
- var _q = React.useState(), inputNumberValueGhgAvoidedGas = _q[0], setInputNumberValueGhgAvoidedGas = _q[1];
20430
- var _r = React.useState(), inputNumberValueGhgReducedGas = _r[0], setInputNumberValueGhgReducedGas = _r[1];
20431
- var _s = React.useState(), includedInNAP = _s[0], setIncludedInNAP = _s[1];
20419
+ var _a = React.useState(), ndcActionType = _a[0], setNdcActionType = _a[1];
20420
+ var _b = React.useState(), methodology = _b[0], setMethodology = _b[1];
20421
+ var _c = React.useState(), mitigationType = _c[0], setmitigationType = _c[1];
20422
+ var _d = React.useState(""), mitigationSubType = _d[0], setMitigationSubType = _d[1];
20423
+ var _e = React.useState(""), sector = _e[0], setSector = _e[1];
20424
+ var _f = React.useState(""), subSector = _f[0], setSubSector = _f[1];
20425
+ var _g = React.useState(ndcActionTypeList), ndcActionTypeListFiltered = _g[0]; _g[1];
20426
+ var _h = React.useState([]), checkedOptionsGhgReduced = _h[0], setCheckedOptionsGhgReduced = _h[1];
20427
+ var _j = React.useState([]), checkedOptionsGhgAvoided = _j[0], setCheckedOptionsGhgAvoided = _j[1];
20428
+ var _k = React.useState(), inputNumberValueGhgAvoidedGas = _k[0], setInputNumberValueGhgAvoidedGas = _k[1];
20429
+ var _l = React.useState(), inputNumberValueGhgReducedGas = _l[0], setInputNumberValueGhgReducedGas = _l[1];
20430
+ var _m = React.useState(), includedInNAP = _m[0], setIncludedInNAP = _m[1];
20432
20431
  var form = antd.Form.useForm()[0];
20433
20432
  var maximumImageSize = process.env.REACT_APP_MAXIMUM_FILE_SIZE
20434
20433
  ? parseInt(process.env.REACT_APP_MAXIMUM_FILE_SIZE)
@@ -20436,9 +20435,26 @@ var NdcActionDetails = function (props) {
20436
20435
  //changing value to N2O. Previously it was N20(N-Two-Zero)
20437
20436
  var ghgEmissionsGas = ["CO2", "CH4", "N2O", "HFCs", "PFCs", "SF6"];
20438
20437
  React.useEffect(function () {
20438
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
20439
20439
  if (programmeDetails) {
20440
20440
  setSector(programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sector);
20441
20441
  setSubSector(programmeDetails === null || programmeDetails === void 0 ? void 0 : programmeDetails.sectoralScope);
20442
+ if (!ndcActionDetails) {
20443
+ console.log("Programme Details later changes : ->>>>>>>>>>>>>>>>>>>>>> ", sectorMitigationTypesListMapped[sector]
20444
+ ? (_c = (_b = (_a = sectorMitigationTypesListMapped[sector]) === null || _a === void 0 ? void 0 : _a.find(function (item) { return item.label === sector; })) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : ""
20445
+ : "", mitigationSubTypesListMapped[subSector]
20446
+ ? (_e = (_d = mitigationSubTypesListMapped[subSector]) === null || _d === void 0 ? void 0 : _d.find(function (item) { return item.label === subSector; })) === null || _e === void 0 ? void 0 : _e.label
20447
+ : "");
20448
+ console.log("Other detail 115 ------------- > ", programmeDetails);
20449
+ form.setFieldsValue({
20450
+ mitigationType: sectorMitigationTypesListMapped[sector]
20451
+ ? (_h = (_g = (_f = sectorMitigationTypesListMapped[sector]) === null || _f === void 0 ? void 0 : _f.find(function (item) { return item.label === sector; })) === null || _g === void 0 ? void 0 : _g.label) !== null && _h !== void 0 ? _h : ""
20452
+ : "",
20453
+ mitigationSubType: mitigationSubTypesListMapped[subSector]
20454
+ ? (_k = (_j = mitigationSubTypesListMapped[subSector]) === null || _j === void 0 ? void 0 : _j.find(function (item) { return item.label === subSector; })) === null || _k === void 0 ? void 0 : _k.label
20455
+ : "",
20456
+ });
20457
+ }
20442
20458
  }
20443
20459
  }, [programmeDetails]);
20444
20460
  React.useEffect(function () {
@@ -20834,9 +20850,15 @@ var NdcActionDetails = function (props) {
20834
20850
  ndcActionType === exports.NdcActionTypes.CrossCutting) && (React.createElement(React.Fragment, null,
20835
20851
  React.createElement(antd.Row, { justify: "start", align: "middle" },
20836
20852
  React.createElement(antd.Col, null,
20837
- React.createElement(antd.Form.Item, { label: t("ndcAction:mitigationType"), initialValue: sectorMitigationTypesListMapped[sector]
20838
- ? (_c = (_b = (_a = sectorMitigationTypesListMapped[sector]) === null || _a === void 0 ? void 0 : _a.find(function (item) { return item.label === sector; })) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : ""
20839
- : "", name: "mitigationType", rules: [
20853
+ React.createElement(antd.Form.Item, { label: t("ndcAction:mitigationType"),
20854
+ // initialValue={
20855
+ // sectorMitigationTypesListMapped[sector]
20856
+ // ? sectorMitigationTypesListMapped[sector]?.find(
20857
+ // (item: any) => item.label === sector
20858
+ // )?.label ?? ""
20859
+ // : ""
20860
+ // }
20861
+ name: "mitigationType", rules: [
20840
20862
  {
20841
20863
  required: true,
20842
20864
  message: "".concat(t("ndcAction:mitigationType"), " ").concat(t("ndcAction:isRequired")),
@@ -20854,9 +20876,15 @@ var NdcActionDetails = function (props) {
20854
20876
  ndcActionType === exports.NdcActionTypes.CrossCutting) &&
20855
20877
  mitigationType &&
20856
20878
  mitigationSubTypesListMapped[mitigationType] && (React.createElement(antd.Col, { style: { marginLeft: "38px" } },
20857
- React.createElement(antd.Form.Item, { label: t("ndcAction:mitigationSubType"), name: "mitigationSubType", initialValue: mitigationSubTypesListMapped[subSector]
20858
- ? (_e = (_d = mitigationSubTypesListMapped[subSector]) === null || _d === void 0 ? void 0 : _d.find(function (item) { return item.label === subSector; })) === null || _e === void 0 ? void 0 : _e.label
20859
- : "", rules: [
20879
+ React.createElement(antd.Form.Item, { label: t("ndcAction:mitigationSubType"), name: "mitigationSubType",
20880
+ // initialValue={
20881
+ // mitigationSubTypesListMapped[subSector]
20882
+ // ? mitigationSubTypesListMapped[subSector]?.find(
20883
+ // (item: any) => item.label === subSector
20884
+ // )?.label
20885
+ // : ""
20886
+ // }
20887
+ rules: [
20860
20888
  {
20861
20889
  required: true,
20862
20890
  message: "".concat(t("ndcAction:mitigationSubType"), " ").concat(t("ndcAction:isRequired")),