@undp/carbon-library 1.0.302-CARBON-428-bugfix.0 → 1.0.302-CARBON-433.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/esm/index.js CHANGED
@@ -6678,7 +6678,7 @@ var AddNewCompanyComponent = function (props) {
6678
6678
  String(value).trim() === undefined ||
6679
6679
  value === null ||
6680
6680
  value === undefined) {
6681
- throw new Error("".concat(t("addCompany:nationalSopValue"), " s").concat(t("isRequired")));
6681
+ throw new Error("".concat(t("addCompany:nationalSopValue"), " ").concat(t("isRequired")));
6682
6682
  }
6683
6683
  return [2 /*return*/];
6684
6684
  });
@@ -7855,6 +7855,15 @@ var ProgrammeManagementComponent = function (props) {
7855
7855
  setMinistryLevelFilter(false);
7856
7856
  }
7857
7857
  }
7858
+ else if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.CERTIFIER) {
7859
+ setDataFilter(v.target.checked
7860
+ ? {
7861
+ key: "certifierId",
7862
+ operation: "ANY",
7863
+ value: userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyId,
7864
+ }
7865
+ : undefined);
7866
+ }
7858
7867
  else {
7859
7868
  setDataFilter(v.target.checked
7860
7869
  ? {
@@ -16239,7 +16248,7 @@ var InvestmentCreationComponent = function (props) {
16239
16248
  .unix();
16240
16249
  }
16241
16250
  payload.instrument = Array.isArray(payload.instrument) ? payload.instrument : [payload.instrument];
16242
- // payload.fromCompanyIds = data.companyId.map((e) => Number(e));
16251
+ payload.fromCompanyIds = data.companyId.map(function (e) { return Number(e); });
16243
16252
  payload.percentage = val.percentage;
16244
16253
  payload.toCompanyId = Number(payload.toCompanyId);
16245
16254
  _a.label = 1;
@@ -17685,7 +17694,7 @@ var InvestmentManagementComponent = function (props) {
17685
17694
  return handleTableChange(val, sorter);
17686
17695
  }, locale: {
17687
17696
  emptyText: (React.createElement(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE, description: tableData.length === 0
17688
- ? t("programme:noInvestmentData")
17697
+ ? t("programme:noinvestment")
17689
17698
  : null })),
17690
17699
  } }))))),
17691
17700
  popupInfo && selectedReq && (React.createElement(InvestmentActionModel, { investment: selectedReq, onCancel: function () {
@@ -20066,23 +20075,11 @@ var Assessment = function (props) {
20066
20075
  changedValues = {};
20067
20076
  if (info.changedFields && info.changedFields.length > 0) {
20068
20077
  info.changedFields.map(function (changedField) { return __awaiter(void 0, void 0, void 0, function () {
20069
- var base64Value, values_1;
20070
20078
  return __generator(this, function (_a) {
20071
- switch (_a.label) {
20072
- case 0:
20073
- if (!(changedField.name[0] === "document")) return [3 /*break*/, 2];
20074
- return [4 /*yield*/, getBase64(changedField.value[0].originFileObj)];
20075
- case 1:
20076
- base64Value = _a.sent();
20077
- console.log("FEAsibility document : ", base64Value);
20078
- values_1 = base64Value;
20079
- setCobenefitsAssessmentDetails(function (pre) { return (__assign(__assign({}, pre), { document: values_1 })); });
20080
- return [3 /*break*/, 3];
20081
- case 2:
20082
- changedValues[changedField.name[0]] = changedField.value;
20083
- _a.label = 3;
20084
- case 3: return [2 /*return*/];
20079
+ if (changedField.name[0] !== "document") {
20080
+ changedValues[changedField.name[0]] = changedField.value;
20085
20081
  }
20082
+ return [2 /*return*/];
20086
20083
  });
20087
20084
  }); });
20088
20085
  setCobenefitsAssessmentDetails(function (pre) { return (__assign(__assign({}, pre), changedValues)); });
@@ -20117,6 +20114,34 @@ var Assessment = function (props) {
20117
20114
  setIsPersonListedDetailsVisible(false);
20118
20115
  }
20119
20116
  };
20117
+ var onAssesmentDocument = function (e) { return __awaiter(void 0, void 0, void 0, function () {
20118
+ var base64Value, values_1;
20119
+ var _a;
20120
+ return __generator(this, function (_b) {
20121
+ switch (_b.label) {
20122
+ case 0:
20123
+ if (!((e === null || e === void 0 ? void 0 : e.fileList.length) > 0 && ((_a = e === null || e === void 0 ? void 0 : e.fileList[0]) === null || _a === void 0 ? void 0 : _a.name))) return [3 /*break*/, 2];
20124
+ return [4 /*yield*/, getBase64(e.fileList[0].originFileObj)];
20125
+ case 1:
20126
+ base64Value = _b.sent();
20127
+ values_1 = base64Value;
20128
+ setCobenefitsAssessmentDetails(function (pre) { return (__assign(__assign({}, pre), { document: values_1 })); });
20129
+ return [3 /*break*/, 3];
20130
+ case 2:
20131
+ setCobenefitsAssessmentDetails(function (pre) {
20132
+ pre.document; var rest = __rest(pre, ["document"]);
20133
+ if (Object.keys(rest).length === 0) {
20134
+ return undefined;
20135
+ }
20136
+ else {
20137
+ return __assign({}, rest);
20138
+ }
20139
+ });
20140
+ _b.label = 3;
20141
+ case 3: return [2 /*return*/];
20142
+ }
20143
+ });
20144
+ }); };
20120
20145
  var normFile = function (e) {
20121
20146
  if (Array.isArray(e)) {
20122
20147
  return e;
@@ -20331,7 +20356,7 @@ var Assessment = function (props) {
20331
20356
  ] },
20332
20357
  React.createElement(Upload, { accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", beforeUpload: function (file) {
20333
20358
  return false;
20334
- }, className: "design-upload-section", name: "document", listType: "picture", multiple: false, maxCount: 1 },
20359
+ }, className: "design-upload-section", name: "document", listType: "picture", multiple: false, maxCount: 1, onChange: onAssesmentDocument },
20335
20360
  React.createElement(Button, { className: "upload-doc", size: "large", icon: React.createElement(UploadOutlined, null) }, "Upload")))),
20336
20361
  viewOnly && assessmentViewData.document && (React.createElement(Form.Item, { label: t("assessmentDocuments"), name: "assessmentDocuments" },
20337
20362
  React.createElement("a", { href: assessmentViewData.document, target: "_blank", rel: "noopener noreferrer", download: true }, assessmentViewData.document))))))))));
@@ -24200,7 +24225,7 @@ var CreditTransferComponent = function (props) {
24200
24225
  else {
24201
24226
  setMinistryLevelFilter(false);
24202
24227
  }
24203
- } }, t("ndcAction:ministryLevel")))),
24228
+ } }, t("view:ministryLevel")))),
24204
24229
  React.createElement("div", { className: "search-bar" },
24205
24230
  React.createElement(Search, { onPressEnter: onSearch, placeholder: "Search", allowClear: true, onChange: function (e) {
24206
24231
  return e.target.value === ""
@@ -28745,7 +28770,9 @@ var InvestmentBody = function (props) {
28745
28770
  React.createElement("div", { className: "invester" },
28746
28771
  React.createElement("div", { className: "name-and-progress" },
28747
28772
  React.createElement("div", { className: "name" }, investmentData === null || investmentData === void 0 ? void 0 : investmentData.invester),
28748
- React.createElement("div", { className: "progress" }, (investmentData === null || investmentData === void 0 ? void 0 : investmentData.status) === InvestmentStatus.APPROVED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })))),
28773
+ React.createElement("div", { className: "progress" },
28774
+ (investmentData === null || investmentData === void 0 ? void 0 : investmentData.status) === InvestmentStatus.APPROVED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
28775
+ (investmentData === null || investmentData === void 0 ? void 0 : investmentData.status) === InvestmentStatus.REJECTED && (React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
28749
28776
  React.createElement("div", { className: "time" }, moment(parseInt(investmentData === null || investmentData === void 0 ? void 0 : investmentData.createdAt)).format("DD MMMM YYYY @ HH:mm"))),
28750
28777
  React.createElement("div", { className: "amount" },
28751
28778
  "$",
@@ -29215,8 +29242,26 @@ var ProgrammeRetireForm = function (props) {
29215
29242
  var ProgrammeRevokeForm = function (props) {
29216
29243
  var programme = props.programme, onFinish = props.onFinish, onCancel = props.onCancel, actionBtnText = props.actionBtnText, subText = props.subText, showCertifiers = props.showCertifiers, translator = props.translator;
29217
29244
  var t = translator.t;
29245
+ var form = Form.useForm()[0];
29218
29246
  var _a = useState(undefined), popupError = _a[0], setPopupError = _a[1];
29219
29247
  var _b = useState(false), loading = _b[0], setLoading = _b[1];
29248
+ var _c = useState(false), remarks = _c[0], setRemarks = _c[1];
29249
+ var onRemarkValues = function () { return __awaiter(void 0, void 0, void 0, function () {
29250
+ var comment;
29251
+ return __generator(this, function (_a) {
29252
+ comment = form.getFieldValue("comment");
29253
+ if (comment === undefined || comment === "") {
29254
+ setRemarks(false);
29255
+ }
29256
+ else {
29257
+ setRemarks(true);
29258
+ }
29259
+ return [2 /*return*/];
29260
+ });
29261
+ }); };
29262
+ useEffect(function () {
29263
+ onRemarkValues();
29264
+ });
29220
29265
  return (React.createElement("div", { className: "transfer-form" },
29221
29266
  React.createElement(Row, null,
29222
29267
  React.createElement(Col, { span: 24, className: "sub-text" }, subText)),
@@ -29224,7 +29269,7 @@ var ProgrammeRevokeForm = function (props) {
29224
29269
  certifierId: programme.certifierId && programme.certifierId.length === 1
29225
29270
  ? Number(programme.certifierId[0])
29226
29271
  : undefined,
29227
- }, onChange: function () { return setPopupError(undefined); }, onFinish: function (d) { return __awaiter(void 0, void 0, void 0, function () {
29272
+ }, onChange: function () { return setPopupError(undefined); }, onValuesChange: onRemarkValues, form: form, onFinish: function (d) { return __awaiter(void 0, void 0, void 0, function () {
29228
29273
  var res;
29229
29274
  return __generator(this, function (_a) {
29230
29275
  switch (_a.label) {
@@ -29263,7 +29308,7 @@ var ProgrammeRevokeForm = function (props) {
29263
29308
  popupError ? (React.createElement(Alert, { className: "error", message: popupError, type: "error", showIcon: true })) : (""),
29264
29309
  React.createElement(Form.Item, { className: "footer" },
29265
29310
  React.createElement(Button, { htmlType: "button", onClick: onCancel }, t("view:cancel")),
29266
- React.createElement(Button, { className: "mg-left-2", type: "primary", htmlType: "submit", loading: loading }, actionBtnText)))));
29311
+ React.createElement(Button, { className: "mg-left-2", type: "primary", htmlType: "submit", loading: loading, disabled: !remarks }, actionBtnText)))));
29267
29312
  };
29268
29313
 
29269
29314
  var ProgrammeTransferForm = function (props) {