@undp/carbon-library 1.0.293-CARBON-Sprint-54.2 → 1.0.293-CARBON-434.1

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.
package/dist/cjs/index.js CHANGED
@@ -6713,7 +6713,7 @@ var AddNewCompanyComponent = function (props) {
6713
6713
  React.createElement(antd.Radio.Button, { className: companyRoleClassName, value: companyRole },
6714
6714
  companyRole === exports.CompanyRole.CERTIFIER ? (React.createElement(icons.SafetyOutlined, { className: "role-icons" })) : companyRole ===
6715
6715
  exports.CompanyRole.PROGRAMME_DEVELOPER ? (React.createElement(icons.ExperimentOutlined, { className: "role-icons" })) : companyRole === exports.CompanyRole.MINISTRY ? (React.createElement(icons.AuditOutlined, { className: "role-icons" })) : (React.createElement(icons.BankOutlined, { className: "role-icons" })),
6716
- (companyRole === exports.CompanyRole.PROGRAMME_DEVELOPER) ? "Developer" : companyRole))) : (React.createElement(React.Fragment, null,
6716
+ companyRole))) : (React.createElement(React.Fragment, null,
6717
6717
  React.createElement("div", { className: "certifier-radio-container", style: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) ===
6718
6718
  exports.CompanyRole.MINISTRY
6719
6719
  ? {
@@ -6979,7 +6979,7 @@ styleInject(css_248z$u);
6979
6979
  var CompanyRoleIcon = function (props) {
6980
6980
  var role = props.role;
6981
6981
  return (React.createElement("div", { style: { display: 'flex', alignItems: 'center' } },
6982
- role === 'Government' ? (React.createElement(RoleIcon, { icon: React.createElement(icons.BankOutlined, null), bg: GovBGColor, color: GovColor })) : role === 'Certifier' ? (React.createElement(RoleIcon, { icon: React.createElement(icons.SafetyOutlined, null), bg: CertBGColor, color: CertColor })) : role === 'ProgrammeDeveloper' ? (React.createElement(RoleIcon, { icon: React.createElement(icons.ExperimentOutlined, null), bg: DevBGColor, color: DevColor })) : React.createElement(RoleIcon, { icon: React.createElement(icons.AuditOutlined, null), bg: MinBGColor, color: MinColor }),
6982
+ role === 'Government' ? (React.createElement(RoleIcon, { icon: React.createElement(icons.BankOutlined, null), bg: GovBGColor, color: GovColor })) : role === 'Certifier' ? (React.createElement(RoleIcon, { icon: React.createElement(icons.SafetyOutlined, null), bg: CertBGColor, color: CertColor })) : (React.createElement(RoleIcon, { icon: React.createElement(icons.ExperimentOutlined, null), bg: DevBGColor, color: DevColor })),
6983
6983
  role === 'ProgrammeDeveloper' ? React.createElement("div", null, 'Developer') : React.createElement("div", null, role)));
6984
6984
  };
6985
6985
 
@@ -17029,7 +17029,7 @@ var InvestmentManagementComponent = function (props) {
17029
17029
  style: "color-primary",
17030
17030
  click: function () {
17031
17031
  showModalOnAction(record, {
17032
- title: t("creditTransfer:acceptFinancingTitle"),
17032
+ title: t("creditTransfer:acceptTitle"),
17033
17033
  icon: React.createElement(Icon__namespace.ClipboardCheck, null),
17034
17034
  actionBtnText: t("creditTransfer:proceed"),
17035
17035
  okAction: function (requestId, comment) {
@@ -19655,20 +19655,26 @@ var Assessment = function (props) {
19655
19655
  if (info.changedFields && info.changedFields.length > 0) {
19656
19656
  info.changedFields.map(function (changedField) { return __awaiter(void 0, void 0, void 0, function () {
19657
19657
  var base64Value, values_1;
19658
- return __generator(this, function (_a) {
19659
- switch (_a.label) {
19658
+ var _a;
19659
+ return __generator(this, function (_b) {
19660
+ switch (_b.label) {
19660
19661
  case 0:
19661
19662
  if (!(changedField.name[0] === "document")) return [3 /*break*/, 2];
19662
19663
  return [4 /*yield*/, getBase64(changedField.value[0].originFileObj)];
19663
19664
  case 1:
19664
- base64Value = _a.sent();
19665
+ base64Value = _b.sent();
19665
19666
  console.log("FEAsibility document : ", base64Value);
19666
19667
  values_1 = base64Value;
19667
19668
  setCobenefitsAssessmentDetails(function (pre) { return (__assign(__assign({}, pre), { document: values_1 })); });
19668
19669
  return [3 /*break*/, 3];
19669
19670
  case 2:
19670
- changedValues[changedField.name[0]] = changedField.value;
19671
- _a.label = 3;
19671
+ if (changedField.value && ((_a = changedField.value) === null || _a === void 0 ? void 0 : _a.length) > 0) {
19672
+ changedValues[changedField.name[0]] = changedField.value;
19673
+ }
19674
+ else {
19675
+ changedValues[changedField.name[0]] = undefined;
19676
+ }
19677
+ _b.label = 3;
19672
19678
  case 3: return [2 /*return*/];
19673
19679
  }
19674
19680
  });
@@ -21973,7 +21979,18 @@ var CoBenifitsComponent = function (props) {
21973
21979
  setCoBenefitDetails(function (pre) { return (__assign(__assign({}, pre), { sdgGoals: sdgGoalsDetails })); });
21974
21980
  };
21975
21981
  var onGenderParityFormSubmit = function (genderParityDetails) {
21976
- setCoBenefitDetails(function (pre) { return (__assign(__assign({}, pre), { genderPariy: genderParityDetails })); });
21982
+ if (genderParityDetails) {
21983
+ var values = Object.values(genderParityDetails).filter(function (val) {
21984
+ return (val !== undefined && val.trim().length === 0) || val === undefined;
21985
+ });
21986
+ var keys = Object.keys(genderParityDetails);
21987
+ if (keys.length === values.length) {
21988
+ setCoBenefitDetails(function (pre) { return (__assign(__assign({}, pre), { genderPariy: undefined })); });
21989
+ }
21990
+ else {
21991
+ setCoBenefitDetails(function (pre) { return (__assign(__assign({}, pre), { genderPariy: genderParityDetails })); });
21992
+ }
21993
+ }
21977
21994
  };
21978
21995
  var onEnvironmentalFormSubmit = function (environmentalsDetails) {
21979
21996
  setCoBenefitDetails(function (pre) { return (__assign(__assign({}, pre), { environmental: environmentalsDetails })); });
@@ -21982,8 +21999,19 @@ var CoBenifitsComponent = function (props) {
21982
21999
  setCoBenefitDetails(function (pre) { return (__assign(__assign({}, pre), { economic: economicDetails })); });
21983
22000
  };
21984
22001
  var onAssessmentFormSubmit = function (coBenefitsAssessmentDetails, isFormValid) {
21985
- setCoBenefitDetails(function (pre) { return (__assign(__assign({}, pre), { assessmentDetails: coBenefitsAssessmentDetails })); });
21986
- setIsAssessmentFormValid(isFormValid);
22002
+ if (coBenefitsAssessmentDetails) {
22003
+ var values = Object.values(coBenefitsAssessmentDetails).filter(function (val) {
22004
+ return (val !== undefined && val.trim().length === 0) || val === undefined;
22005
+ });
22006
+ var keys = Object.keys(coBenefitsAssessmentDetails);
22007
+ if (keys.length === values.length) {
22008
+ setCoBenefitDetails(function (pre) { return (__assign(__assign({}, pre), { assessmentDetails: undefined })); });
22009
+ }
22010
+ else {
22011
+ setCoBenefitDetails(function (pre) { return (__assign(__assign({}, pre), { assessmentDetails: coBenefitsAssessmentDetails })); });
22012
+ }
22013
+ setIsAssessmentFormValid(isFormValid);
22014
+ }
21987
22015
  };
21988
22016
  var onSafeguardFormSubmit = function (safeguardDetails) {
21989
22017
  setCoBenefitDetails(function (pre) { return (__assign(__assign({}, pre), { safeguardDetails: safeguardDetails })); });
@@ -23476,7 +23504,7 @@ var CreditTransferComponent = function (props) {
23476
23504
  style: "color-primary",
23477
23505
  click: function () {
23478
23506
  showModalOnAction(record, {
23479
- title: t("creditTransfer:acceptCreditTransferTitle"),
23507
+ title: t("creditTransfer:acceptTitle"),
23480
23508
  icon: React.createElement(Icon__namespace.ClipboardCheck, null),
23481
23509
  actionBtnText: t("creditTransfer:proceed"),
23482
23510
  okAction: function (requestId, comment) {