@undp/carbon-library 1.0.17-CARBON-363.18 → 1.0.17-CARBON-363.35
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +201 -55
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Definitions/Definitions/ndcDetails.definitions.d.ts +17 -6
- package/dist/esm/index.js +202 -56
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Definitions/Definitions/ndcDetails.definitions.d.ts +17 -6
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
@@ -2047,7 +2047,7 @@ exports.NdcActionStatus = void 0;
|
|
2047
2047
|
NdcActionStatus["PENDING"] = "Pending";
|
2048
2048
|
NdcActionStatus["APPROVED"] = "Approved";
|
2049
2049
|
})(exports.NdcActionStatus || (exports.NdcActionStatus = {}));
|
2050
|
-
var getNdcActionStatusEnumVal = function (value) {
|
2050
|
+
var getNdcActionStatusEnumVal$1 = function (value) {
|
2051
2051
|
var index = Object.keys(exports.NdcActionStatus).indexOf(value);
|
2052
2052
|
if (index < 0) {
|
2053
2053
|
return value;
|
@@ -2055,7 +2055,7 @@ var getNdcActionStatusEnumVal = function (value) {
|
|
2055
2055
|
return Object.values(exports.NdcActionStatus)[index];
|
2056
2056
|
};
|
2057
2057
|
var getNdcStatusTagType = function (status) {
|
2058
|
-
switch (getNdcActionStatusEnumVal(status)) {
|
2058
|
+
switch (getNdcActionStatusEnumVal$1(status)) {
|
2059
2059
|
case exports.NdcActionStatus.PENDING:
|
2060
2060
|
return "processing";
|
2061
2061
|
case exports.NdcActionStatus.APPROVED:
|
@@ -26197,16 +26197,36 @@ var EditableCell = function (_a) {
|
|
26197
26197
|
var css_248z$4 = ".ndc-steps-actions {\n display: flex;\n flex-direction: row-reverse;\n margin-right: 1rem;\n justify-content: center; }\n .ndc-steps-actions .action-btn {\n border: 1px solid #16b1ff;\n color: #16b1ff;\n margin-right: 1rem; }\n .ndc-steps-actions .back-btn {\n border: 1px solid rgba(140, 140, 140, 0.7);\n color: rgba(140, 140, 140, 0.7);\n margin-right: 1rem; }\n .ndc-steps-actions .mg-left-1 {\n margin-left: 1rem; }\n";
|
26198
26198
|
styleInject(css_248z$4);
|
26199
26199
|
|
26200
|
-
var
|
26201
|
-
(function (
|
26202
|
-
|
26203
|
-
|
26204
|
-
})(
|
26200
|
+
var NdcDetailsActionType;
|
26201
|
+
(function (NdcDetailsActionType) {
|
26202
|
+
NdcDetailsActionType["MainAction"] = "MainAction";
|
26203
|
+
NdcDetailsActionType["SubAction"] = "SubAction";
|
26204
|
+
})(NdcDetailsActionType || (NdcDetailsActionType = {}));
|
26205
26205
|
var NdcDetailsActionStatus;
|
26206
26206
|
(function (NdcDetailsActionStatus) {
|
26207
|
-
NdcDetailsActionStatus[
|
26208
|
-
NdcDetailsActionStatus[
|
26207
|
+
NdcDetailsActionStatus["Pending"] = "Pending";
|
26208
|
+
NdcDetailsActionStatus["Approved"] = "Approved";
|
26209
|
+
NdcDetailsActionStatus["Rejected"] = "Rejected";
|
26209
26210
|
})(NdcDetailsActionStatus || (NdcDetailsActionStatus = {}));
|
26211
|
+
var getNdcActionStatusEnumVal = function (value) {
|
26212
|
+
var index = Object.keys(NdcDetailsActionStatus).indexOf(value);
|
26213
|
+
if (index < 0) {
|
26214
|
+
return value;
|
26215
|
+
}
|
26216
|
+
return Object.values(NdcDetailsActionStatus)[index];
|
26217
|
+
};
|
26218
|
+
var getNdcActionStatusTagType = function (status) {
|
26219
|
+
switch (getNdcActionStatusEnumVal(status)) {
|
26220
|
+
case NdcDetailsActionStatus.Rejected:
|
26221
|
+
return "error";
|
26222
|
+
case NdcDetailsActionStatus.Pending:
|
26223
|
+
return "processing";
|
26224
|
+
case NdcDetailsActionStatus.Approved:
|
26225
|
+
return "success";
|
26226
|
+
default:
|
26227
|
+
return "default";
|
26228
|
+
}
|
26229
|
+
};
|
26210
26230
|
|
26211
26231
|
var NdcDetailsComponent = function (props) {
|
26212
26232
|
var t = props.t, useConnection = props.useConnection, useUserContext = props.useUserContext;
|
@@ -26220,6 +26240,8 @@ var NdcDetailsComponent = function (props) {
|
|
26220
26240
|
var _e = React.useState(0), tableKey = _e[0], setTableKey = _e[1];
|
26221
26241
|
var _f = useConnection(), get = _f.get, post = _f.post, put = _f.put;
|
26222
26242
|
var _g = React.useState([]), ministryOrgList = _g[0], setMinistryOrgList = _g[1];
|
26243
|
+
var _h = React.useState({}), actionInfo = _h[0], setActionInfo = _h[1];
|
26244
|
+
var _j = React.useState(false), openConfirmationModal = _j[0], setOpenConfirmationModal = _j[1];
|
26223
26245
|
var userInfoState = useUserContext().userInfoState;
|
26224
26246
|
var loginMinistry = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT
|
26225
26247
|
? process.env.REACT_APP_GOVERNMENT_MINISTRY
|
@@ -26228,13 +26250,12 @@ var NdcDetailsComponent = function (props) {
|
|
26228
26250
|
: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY
|
26229
26251
|
? userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName
|
26230
26252
|
: undefined;
|
26231
|
-
var
|
26232
|
-
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT) &&
|
26253
|
+
var isGovernmentUser = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT &&
|
26233
26254
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly;
|
26234
26255
|
var ndcMainDetailsForPeriod = selectedPeriod.key !== "add_new"
|
26235
26256
|
? ndcDetailsData.filter(function (ndcDetail) {
|
26236
26257
|
return (ndcDetail.periodId === parseInt(selectedPeriod.key) &&
|
26237
|
-
ndcDetail.actionType ===
|
26258
|
+
ndcDetail.actionType === NdcDetailsActionType.MainAction);
|
26238
26259
|
})
|
26239
26260
|
: [];
|
26240
26261
|
var isMainNdcActionsEditable = !selectedPeriod.finalized &&
|
@@ -26242,6 +26263,7 @@ var NdcDetailsComponent = function (props) {
|
|
26242
26263
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly;
|
26243
26264
|
var isSubNdcActionsEditable = function (record) {
|
26244
26265
|
return (!selectedPeriod.finalized &&
|
26266
|
+
record.status !== NdcDetailsActionStatus.Approved &&
|
26245
26267
|
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT ||
|
26246
26268
|
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY &&
|
26247
26269
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName) === record.ministryName)) &&
|
@@ -26250,22 +26272,18 @@ var NdcDetailsComponent = function (props) {
|
|
26250
26272
|
var getSubNdcDetailsForPeriod = function (id) {
|
26251
26273
|
var subNdcDetails = ndcDetailsData.filter(function (ndcDetail) {
|
26252
26274
|
return (ndcDetail.parentActionId === id &&
|
26253
|
-
ndcDetail.actionType ===
|
26275
|
+
ndcDetail.actionType === NdcDetailsActionType.SubAction);
|
26254
26276
|
});
|
26255
26277
|
var emptySubNdcRow = {
|
26256
|
-
actionType:
|
26278
|
+
actionType: NdcDetailsActionType.SubAction,
|
26257
26279
|
nationalPlanObjective: "",
|
26258
26280
|
kpi: 0,
|
26259
26281
|
ministryName: loginMinistry,
|
26260
|
-
status: NdcDetailsActionStatus.
|
26282
|
+
status: NdcDetailsActionStatus.Pending,
|
26261
26283
|
parentActionId: id,
|
26262
26284
|
};
|
26263
26285
|
return __spreadArray(__spreadArray([], subNdcDetails, true), [emptySubNdcRow], false);
|
26264
26286
|
};
|
26265
|
-
var isAddNdcActionVisible = function () {
|
26266
|
-
return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT &&
|
26267
|
-
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
|
26268
|
-
};
|
26269
26287
|
var inRange = function (num, min, max) {
|
26270
26288
|
return num >= min && num <= max;
|
26271
26289
|
};
|
@@ -26290,13 +26308,52 @@ var NdcDetailsComponent = function (props) {
|
|
26290
26308
|
}
|
26291
26309
|
});
|
26292
26310
|
}); };
|
26311
|
+
var actionMenu = function (record) {
|
26312
|
+
if (record.status === NdcDetailsActionStatus.Pending && isGovernmentUser) {
|
26313
|
+
return (React.createElement(antd.List, { className: "action-menu", size: "small", dataSource: [
|
26314
|
+
{
|
26315
|
+
text: t("ndc:approve"),
|
26316
|
+
icon: React.createElement(Icon__namespace.BoxArrowInDown, null),
|
26317
|
+
click: function () {
|
26318
|
+
setActionInfo({
|
26319
|
+
action: "Approve",
|
26320
|
+
headerText: t("ndc:actionApproveTitle"),
|
26321
|
+
type: "primary",
|
26322
|
+
icon: React.createElement(Icon__namespace.BoxArrowInDown, null),
|
26323
|
+
recordId: record.id,
|
26324
|
+
});
|
26325
|
+
setOpenConfirmationModal(true);
|
26326
|
+
},
|
26327
|
+
},
|
26328
|
+
{
|
26329
|
+
text: t("ndc:reject"),
|
26330
|
+
icon: React.createElement(Icon__namespace.XOctagon, null),
|
26331
|
+
click: function () {
|
26332
|
+
setActionInfo({
|
26333
|
+
action: "Reject",
|
26334
|
+
headerText: t("ndc:rejectApproveTitle"),
|
26335
|
+
type: "danger",
|
26336
|
+
icon: React.createElement(Icon__namespace.BoxArrowInDown, null),
|
26337
|
+
recordId: record.id,
|
26338
|
+
});
|
26339
|
+
setOpenConfirmationModal(true);
|
26340
|
+
},
|
26341
|
+
},
|
26342
|
+
], renderItem: function (item) { return (React.createElement(antd.List.Item, { onClick: item.click },
|
26343
|
+
React.createElement(antd.Typography.Text, { className: "action-icon color-error" }, item.icon),
|
26344
|
+
React.createElement("span", null, item.text))); } }));
|
26345
|
+
}
|
26346
|
+
else {
|
26347
|
+
return null;
|
26348
|
+
}
|
26349
|
+
};
|
26293
26350
|
var defaultColumns = [
|
26294
26351
|
{
|
26295
26352
|
title: t("ndc:ndcColumnsNationalPlanObj"),
|
26296
26353
|
dataIndex: "nationalPlanObjective",
|
26297
26354
|
key: "nationalPlanObjective",
|
26298
26355
|
align: "left",
|
26299
|
-
width: "
|
26356
|
+
width: "40%",
|
26300
26357
|
editable: true,
|
26301
26358
|
render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObjective ? (React.createElement(antd.Space, { size: "middle" },
|
26302
26359
|
React.createElement("span", null, record.nationalPlanObjective))) : (React.createElement("input", { placeholder: "Please add the National Plan Objective", className: "ant-input", type: "text" })))); },
|
@@ -26306,31 +26363,50 @@ var NdcDetailsComponent = function (props) {
|
|
26306
26363
|
dataIndex: "kpi",
|
26307
26364
|
key: "kpi",
|
26308
26365
|
align: "left",
|
26309
|
-
width: "
|
26366
|
+
width: "15%",
|
26310
26367
|
editable: true,
|
26311
26368
|
render: function (_, record) { return (React.createElement(React.Fragment, null, record.kpi ? (React.createElement(antd.Space, { size: "middle" },
|
26312
26369
|
React.createElement("span", null, record.kpi))) : (React.createElement("input", { placeholder: "Enter Kpi", className: "ant-input", type: "text" })))); },
|
26313
26370
|
},
|
26314
26371
|
{
|
26315
|
-
title: "
|
26372
|
+
title: t("ndc:ndcColumnsMinistry"),
|
26316
26373
|
dataIndex: "ministryName",
|
26317
26374
|
key: "ministryName",
|
26318
26375
|
align: "left",
|
26319
|
-
width: "
|
26376
|
+
width: "30%",
|
26320
26377
|
editable: false,
|
26321
26378
|
render: function (_, record) { return (React.createElement(React.Fragment, null,
|
26322
26379
|
React.createElement(antd.Select, { disabled: !isSubNdcActionsEditable(record), defaultValue: record.ministryName ? record.ministryName : loginMinistry, style: { width: 320 }, onChange: function () { }, options: ministryOrgList }))); },
|
26323
26380
|
},
|
26381
|
+
{
|
26382
|
+
title: t("ndc:ndcColumnsStatus"),
|
26383
|
+
dataIndex: "status",
|
26384
|
+
key: "status",
|
26385
|
+
align: "left",
|
26386
|
+
width: "15%",
|
26387
|
+
editable: false,
|
26388
|
+
render: function (_, record) {
|
26389
|
+
var menu = actionMenu(record);
|
26390
|
+
return (React.createElement(React.Fragment, null,
|
26391
|
+
record.actionType === NdcDetailsActionType.SubAction ? (React.createElement(antd.Tooltip, { title: record.status, color: TooltipColor, key: TooltipColor },
|
26392
|
+
React.createElement(antd.Tag, { className: "clickable", color: getNdcActionStatusTagType(record.status) }, addSpaces(record.status)))) : (""),
|
26393
|
+
record.actionType === NdcDetailsActionType.SubAction && menu ? (React.createElement(antd.Popover, { placement: "bottomRight", content: menu, trigger: "click" },
|
26394
|
+
React.createElement(icons.EllipsisOutlined, { rotate: 90, style: {
|
26395
|
+
fontWeight: 600,
|
26396
|
+
fontSize: "1rem",
|
26397
|
+
cursor: "pointer",
|
26398
|
+
} }))) : (React.createElement("span", null))));
|
26399
|
+
},
|
26400
|
+
},
|
26324
26401
|
];
|
26325
26402
|
var columns = defaultColumns.map(function (col) {
|
26326
26403
|
if (!col.editable) {
|
26327
26404
|
return col;
|
26328
26405
|
}
|
26329
26406
|
return __assign(__assign({}, col), { onCell: function (record) {
|
26330
|
-
console.log("record", record);
|
26331
26407
|
return {
|
26332
26408
|
record: record,
|
26333
|
-
editable: record.actionType ===
|
26409
|
+
editable: record.actionType === NdcDetailsActionType.MainAction
|
26334
26410
|
? isMainNdcActionsEditable
|
26335
26411
|
: isSubNdcActionsEditable(record),
|
26336
26412
|
dataIndex: col.dataIndex,
|
@@ -26348,12 +26424,12 @@ var NdcDetailsComponent = function (props) {
|
|
26348
26424
|
if (!(selectedPeriod.key !== "add_new")) return [3 /*break*/, 2];
|
26349
26425
|
periodId = parseInt(selectedPeriod.key);
|
26350
26426
|
newData = {
|
26351
|
-
actionType:
|
26427
|
+
actionType: NdcDetailsActionType.MainAction,
|
26352
26428
|
nationalPlanObjective: "",
|
26353
26429
|
kpi: 0,
|
26354
26430
|
ministryName: loginMinistry,
|
26355
26431
|
periodId: periodId,
|
26356
|
-
status: NdcDetailsActionStatus.
|
26432
|
+
status: NdcDetailsActionStatus.Pending,
|
26357
26433
|
};
|
26358
26434
|
return [4 /*yield*/, post("national/programme/addNdcDetailsAction", __assign({}, newData))];
|
26359
26435
|
case 1:
|
@@ -26377,25 +26453,33 @@ var NdcDetailsComponent = function (props) {
|
|
26377
26453
|
cell: EditableCell,
|
26378
26454
|
},
|
26379
26455
|
};
|
26380
|
-
var
|
26381
|
-
var result;
|
26456
|
+
var onClickedDeletePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
26382
26457
|
return __generator(this, function (_a) {
|
26383
|
-
|
26384
|
-
|
26385
|
-
|
26386
|
-
|
26387
|
-
|
26388
|
-
|
26389
|
-
|
26390
|
-
|
26391
|
-
|
26392
|
-
|
26393
|
-
|
26458
|
+
setActionInfo({
|
26459
|
+
action: "Delete",
|
26460
|
+
headerText: t("ndc:periodDeleteConfirmTitle"),
|
26461
|
+
type: "danger",
|
26462
|
+
icon: React.createElement(Icon__namespace.XCircle, null),
|
26463
|
+
recordId: selectedPeriod.key,
|
26464
|
+
});
|
26465
|
+
setOpenConfirmationModal(true);
|
26466
|
+
return [2 /*return*/];
|
26467
|
+
});
|
26468
|
+
}); };
|
26469
|
+
var onClickedFinalizePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
26470
|
+
return __generator(this, function (_a) {
|
26471
|
+
setActionInfo({
|
26472
|
+
action: "Finalize",
|
26473
|
+
headerText: t("ndc:finalizeApproveTitle"),
|
26474
|
+
text: t("ndc:finalizeApproveSubTitle"),
|
26475
|
+
type: "primary",
|
26476
|
+
icon: React.createElement(Icon__namespace.Clipboard2Check, null),
|
26477
|
+
recordId: selectedPeriod.key,
|
26478
|
+
});
|
26479
|
+
setOpenConfirmationModal(true);
|
26480
|
+
return [2 /*return*/];
|
26394
26481
|
});
|
26395
26482
|
}); };
|
26396
|
-
var onFinalizePeriod = function () {
|
26397
|
-
//
|
26398
|
-
};
|
26399
26483
|
function ndcDetailsTableContent() {
|
26400
26484
|
return (React.createElement("div", null,
|
26401
26485
|
React.createElement(antd.Row, null,
|
@@ -26405,15 +26489,16 @@ var NdcDetailsComponent = function (props) {
|
|
26405
26489
|
indentSize: 0,
|
26406
26490
|
//defaultExpandedRowKeys: [parseInt(selectedNdcDetail.current.id)],
|
26407
26491
|
}, footer: function () {
|
26408
|
-
return
|
26492
|
+
return isGovernmentUser &&
|
26493
|
+
!selectedPeriod.finalized && (React.createElement(antd.Row, { justify: "center" },
|
26409
26494
|
React.createElement(antd.Button, { onClick: onClickedAddNewNdcDetail, type: "default", style: {
|
26410
26495
|
marginBottom: 16,
|
26411
26496
|
width: "100%",
|
26412
26497
|
} }, t("ndc:addNdcAction"))));
|
26413
26498
|
} }))),
|
26414
|
-
React.createElement(antd.Row, { justify: "end" },
|
26415
|
-
React.createElement(antd.Button, { className: "mg-left-1", type: "primary", onClick:
|
26416
|
-
React.createElement(antd.Button, { className: "mg-left-1", type: "primary", onClick:
|
26499
|
+
isGovernmentUser && !selectedPeriod.finalized ? (React.createElement(antd.Row, { justify: "end" },
|
26500
|
+
React.createElement(antd.Button, { className: "mg-left-1", type: "primary", onClick: onClickedDeletePeriod, htmlType: "submit", loading: loading }, t("ndc:delete")),
|
26501
|
+
React.createElement(antd.Button, { className: "mg-left-1", type: "primary", onClick: onClickedFinalizePeriod, htmlType: "submit", loading: loading }, t("ndc:finalize")))) : ("")));
|
26417
26502
|
}
|
26418
26503
|
var onAddNewPeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
26419
26504
|
var periodItem_1, existingIndex, response, addedPeriodItem, updatedPeriodItem_1;
|
@@ -26478,6 +26563,60 @@ var NdcDetailsComponent = function (props) {
|
|
26478
26563
|
setSelectedPeriod(selectedPeriod);
|
26479
26564
|
}
|
26480
26565
|
};
|
26566
|
+
var onActionConfirmed = function () { return __awaiter(void 0, void 0, void 0, function () {
|
26567
|
+
var response, response, response, result;
|
26568
|
+
return __generator(this, function (_a) {
|
26569
|
+
switch (_a.label) {
|
26570
|
+
case 0:
|
26571
|
+
if (!(actionInfo.action === "Approve")) return [3 /*break*/, 2];
|
26572
|
+
return [4 /*yield*/, get("national/programme/approveNdcDetailsAction", {
|
26573
|
+
id: actionInfo.recordId,
|
26574
|
+
})];
|
26575
|
+
case 1:
|
26576
|
+
response = _a.sent();
|
26577
|
+
console.log("response", response);
|
26578
|
+
return [3 /*break*/, 8];
|
26579
|
+
case 2:
|
26580
|
+
if (!(actionInfo.action === "Reject")) return [3 /*break*/, 4];
|
26581
|
+
return [4 /*yield*/, get("national/programme/rejectNdcDetailsAction", {
|
26582
|
+
id: actionInfo.recordId,
|
26583
|
+
})];
|
26584
|
+
case 3:
|
26585
|
+
response = _a.sent();
|
26586
|
+
console.log("response", response);
|
26587
|
+
return [3 /*break*/, 8];
|
26588
|
+
case 4:
|
26589
|
+
if (!(actionInfo.action === "Finalize")) return [3 /*break*/, 6];
|
26590
|
+
return [4 /*yield*/, post("national/programme/finalizeNdcDetailsPeriod", {
|
26591
|
+
id: selectedPeriod.key,
|
26592
|
+
})];
|
26593
|
+
case 5:
|
26594
|
+
response = _a.sent();
|
26595
|
+
console.log("response", response);
|
26596
|
+
if (response) {
|
26597
|
+
fetchNdcDetailPeriods();
|
26598
|
+
}
|
26599
|
+
return [3 /*break*/, 8];
|
26600
|
+
case 6:
|
26601
|
+
if (!(actionInfo.action === "Delete")) return [3 /*break*/, 8];
|
26602
|
+
return [4 /*yield*/, post("national/programme/deleteNdcDetailsPeriod", {
|
26603
|
+
id: selectedPeriod.key,
|
26604
|
+
})];
|
26605
|
+
case 7:
|
26606
|
+
result = _a.sent();
|
26607
|
+
if (result) {
|
26608
|
+
fetchNdcDetailPeriods();
|
26609
|
+
}
|
26610
|
+
_a.label = 8;
|
26611
|
+
case 8:
|
26612
|
+
setOpenConfirmationModal(false);
|
26613
|
+
return [2 /*return*/];
|
26614
|
+
}
|
26615
|
+
});
|
26616
|
+
}); };
|
26617
|
+
var onActionCanceled = function () {
|
26618
|
+
setOpenConfirmationModal(false);
|
26619
|
+
};
|
26481
26620
|
var fetchNdcDetailPeriods = function () { return __awaiter(void 0, void 0, void 0, function () {
|
26482
26621
|
var periods, addNewTab, response;
|
26483
26622
|
return __generator(this, function (_a) {
|
@@ -26497,10 +26636,16 @@ var NdcDetailsComponent = function (props) {
|
|
26497
26636
|
response = _a.sent();
|
26498
26637
|
if (response && response.data) {
|
26499
26638
|
periods = response.data.map(function (period) {
|
26500
|
-
return __assign(__assign({}, period), { key: period.id, label:
|
26639
|
+
return __assign(__assign({}, period), { key: period.id, label: period.finalized ? (React.createElement("span", null,
|
26640
|
+
React.createElement(icons.LockOutlined, null),
|
26641
|
+
" ",
|
26642
|
+
period.startYear,
|
26643
|
+
"-",
|
26644
|
+
period.endYear,
|
26645
|
+
" ")) : ("".concat(period.startYear, "-").concat(period.endYear)) });
|
26501
26646
|
});
|
26502
26647
|
}
|
26503
|
-
if (
|
26648
|
+
if (isGovernmentUser) {
|
26504
26649
|
periods.unshift(addNewTab);
|
26505
26650
|
}
|
26506
26651
|
setPeriodItems(periods);
|
@@ -26527,15 +26672,15 @@ var NdcDetailsComponent = function (props) {
|
|
26527
26672
|
var response, ministryOrgDetails;
|
26528
26673
|
return __generator(this, function (_a) {
|
26529
26674
|
switch (_a.label) {
|
26530
|
-
case 0: return [4 /*yield*/, get("national/
|
26675
|
+
case 0: return [4 /*yield*/, get("national/organisation/getMinistries")];
|
26531
26676
|
case 1:
|
26532
26677
|
response = _a.sent();
|
26533
|
-
console.log(
|
26678
|
+
console.log("fetchMinistries", response);
|
26534
26679
|
if (response && response.data) {
|
26535
26680
|
ministryOrgDetails = response.data.map(function (value) {
|
26536
26681
|
return {
|
26537
|
-
value: value.
|
26538
|
-
label: value.
|
26682
|
+
value: value.company_companyId,
|
26683
|
+
label: value.company_name,
|
26539
26684
|
};
|
26540
26685
|
});
|
26541
26686
|
setMinistryOrgList(ministryOrgDetails);
|
@@ -26559,7 +26704,8 @@ var NdcDetailsComponent = function (props) {
|
|
26559
26704
|
React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedPeriod.key, onChange: onTabChange })),
|
26560
26705
|
React.createElement("div", null, selectedPeriod.key === "add_new"
|
26561
26706
|
? addNewPeriodContent()
|
26562
|
-
: ndcDetailsTableContent())
|
26707
|
+
: ndcDetailsTableContent()),
|
26708
|
+
React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: onActionConfirmed, onActionCanceled: onActionCanceled, openModal: openConfirmationModal, errorMsg: "", loading: false })));
|
26563
26709
|
};
|
26564
26710
|
|
26565
26711
|
var ImgWithFallback = function (_a) {
|
@@ -28243,7 +28389,7 @@ exports.getCreditStageVal = getCreditStageVal;
|
|
28243
28389
|
exports.getFinancialFields = getFinancialFields;
|
28244
28390
|
exports.getGeneralFields = getGeneralFields;
|
28245
28391
|
exports.getInvestmentStatusEnumVal = getInvestmentStatusEnumVal;
|
28246
|
-
exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal;
|
28392
|
+
exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal$1;
|
28247
28393
|
exports.getNdcStatusTagType = getNdcStatusTagType;
|
28248
28394
|
exports.getRetirementTypeString = getRetirementTypeString;
|
28249
28395
|
exports.getStageEnumVal = getStageEnumVal;
|