@undp/carbon-library 1.0.175-CARBON-347.7 → 1.0.175-CARBON-347.9

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/index.js CHANGED
@@ -1233,6 +1233,11 @@ exports.InvestmentCreationType = void 0;
1233
1233
  InvestmentCreationType["EXISTING"] = "Existing";
1234
1234
  InvestmentCreationType["NEW"] = "New";
1235
1235
  })(exports.InvestmentCreationType || (exports.InvestmentCreationType = {}));
1236
+ exports.InvestmentOwnershipType = void 0;
1237
+ (function (InvestmentOwnershipType) {
1238
+ InvestmentOwnershipType["PROJECT"] = "Project";
1239
+ InvestmentOwnershipType["NATIONAL"] = "National";
1240
+ })(exports.InvestmentOwnershipType || (exports.InvestmentOwnershipType = {}));
1236
1241
  exports.InvestmentStream = void 0;
1237
1242
  (function (InvestmentStream) {
1238
1243
  InvestmentStream["CLIMATE_FINANCE"] = "ClimateFinance";
@@ -15649,7 +15654,7 @@ var UserManagementComponent = function (props) {
15649
15654
  React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: handleOk, onActionCanceled: handleCancel, openModal: openDeleteConfirmationModal, errorMsg: errorMsg, loading: loading })));
15650
15655
  };
15651
15656
 
15652
- var css_248z$j = ".steps-actions {\n display: flex;\n flex-direction: row-reverse;\n margin-right: 1rem;\n justify-content: flex-start; }\n\n.investment-title-bar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0px 0px 30px 0px; }\n .investment-title-bar .title {\n display: flex;\n flex-direction: column;\n justify-content: space-between; }\n .investment-title-bar .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n .investment-title-bar .flex-display {\n margin-left: 15px; }\n\n.ownership-container {\n padding: 15px 0px; }\n .ownership-container .label {\n color: rgba(58, 53, 65, 0.5); }\n\n.separator {\n padding: 5px;\n color: #d8d8d8; }\n\n.role-group .ant-col-13 {\n max-width: 320px; }\n\n.role-group .condition-radio-container {\n width: 48%;\n text-align: center; }\n .role-group .condition-radio-container .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {\n color: #ffffff !important;\n border-color: #9155fd !important;\n box-shadow: none;\n max-width: 200px; }\n\n.role-group .ant-radio-button-wrapper::before {\n background-color: transparent; }\n\n.role-group .anticon {\n margin-right: 0.5rem; }\n\n.role-group .ant-radio-button-wrapper {\n border: 1px solid #d9d9d9;\n color: rgba(140, 140, 140, 0.7) !important;\n width: 100% !important; }\n\n.role-group .condition-radio {\n width: 100%;\n text-transform: uppercase; }\n .role-group .condition-radio .ant-radio-button-checked {\n background: #9155fd;\n color: #ffffff; }\n\n.role-group .role-icons {\n margin-right: 5px; }\n\n.investment-management .role-icon {\n padding: 0.5rem 0.6rem; }\n\n.investment-management .ant-tag {\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Rejected'] + .ant-checkbox-inner {\n background-color: rgba(237, 77, 71, 0.6);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Cancelled'] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Accepted'] + .ant-checkbox-inner {\n background-color: #16b1ff;\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Pending'] + .ant-checkbox-inner {\n background-color: rgba(118, 195, 39, 0.6);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='Recognised'] + .ant-checkbox-inner {\n background-color: #976ed7;\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value='NotRecognised'] + .ant-checkbox-inner {\n background-color: #ffa070;\n border: none; }\n";
15657
+ var css_248z$j = ".steps-actions {\n display: flex;\n flex-direction: row-reverse;\n margin-right: 1rem;\n justify-content: flex-start; }\n\n.details-part-two .ant-input-number {\n width: 50%;\n margin-left: 15px; }\n\n.investment-title-bar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0px 0px 30px 0px; }\n .investment-title-bar .title {\n display: flex;\n flex-direction: column;\n justify-content: space-between; }\n .investment-title-bar .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n .investment-title-bar .flex-display {\n margin-left: 15px; }\n\n.ownership-container {\n padding: 15px 0px; }\n .ownership-container .label {\n color: rgba(58, 53, 65, 0.5); }\n\n.separator {\n padding: 5px;\n color: #d8d8d8; }\n\n.role-group .ant-col-13 {\n max-width: 320px; }\n\n.role-group .condition-radio-container {\n width: 48%;\n text-align: center; }\n .role-group .condition-radio-container .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {\n color: #ffffff !important;\n border-color: #9155fd !important;\n box-shadow: none;\n max-width: 200px; }\n\n.role-group .ant-radio-button-wrapper::before {\n background-color: transparent; }\n\n.role-group .anticon {\n margin-right: 0.5rem; }\n\n.role-group .ant-radio-button-wrapper {\n border: 1px solid #d9d9d9;\n color: rgba(140, 140, 140, 0.7) !important;\n width: 100% !important; }\n\n.role-group .condition-radio {\n width: 100%;\n text-transform: uppercase; }\n .role-group .condition-radio .ant-radio-button-checked {\n background: #9155fd;\n color: #ffffff; }\n\n.role-group .role-icons {\n margin-right: 5px; }\n\n.investment-management .role-icon {\n padding: 0.5rem 0.6rem; }\n\n.investment-management .ant-tag {\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value=\"Rejected\"] + .ant-checkbox-inner {\n background-color: rgba(237, 77, 71, 0.6);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value=\"Cancelled\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value=\"Accepted\"] + .ant-checkbox-inner {\n background-color: #16b1ff;\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value=\"Pending\"] + .ant-checkbox-inner {\n background-color: rgba(118, 195, 39, 0.6);\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value=\"Recognised\"] + .ant-checkbox-inner {\n background-color: #976ed7;\n border: none; }\n\n.investment-management .ant-checkbox-checked .ant-checkbox-input[value=\"NotRecognised\"] + .ant-checkbox-inner {\n background-color: #ffa070;\n border: none; }\n";
15653
15658
  styleInject(css_248z$j);
15654
15659
 
15655
15660
  var Loading = function () {
@@ -15657,22 +15662,34 @@ var Loading = function () {
15657
15662
  };
15658
15663
 
15659
15664
  var InvestmentCreationComponent = function (props) {
15660
- var t = props.t, useLocation = props.useLocation, onNavigateToProgrammeManagementView = props.onNavigateToProgrammeManagementView, onNavigateToProgrammeView = props.onNavigateToProgrammeView;
15665
+ var t = props.t, useLocation = props.useLocation, onNavigateToProgrammeManagementView = props.onNavigateToProgrammeManagementView, onNavigateToProgrammeView = props.onNavigateToProgrammeView, onNavigateToInvestmentManagementView = props.onNavigateToInvestmentManagementView;
15661
15666
  var state = useLocation().state;
15662
15667
  var _a = React.useState(), data = _a[0], setData = _a[1];
15668
+ var _b = React.useState({}), companyNames = _b[0], setCompanyNames = _b[1];
15669
+ var _c = React.useState({}); _c[0]; var setUserOrganization = _c[1];
15670
+ var _d = React.useState({}), investmentNames = _d[0], setInvestmentNames = _d[1];
15671
+ var _e = React.useState(), projectData = _e[0], setProjectData = _e[1];
15672
+ var _f = React.useState(), investmentData = _f[0], setInvestmentData = _f[1];
15673
+ var _g = React.useState([]), allProjectData = _g[0], setAllProjectData = _g[1];
15663
15674
  var formOne = antd.Form.useForm()[0];
15664
15675
  var formTwo = antd.Form.useForm()[0];
15665
15676
  var post = useConnection().post;
15666
- var _b = React.useState(false), loading = _b[0], setLoading = _b[1];
15667
- var _c = React.useState("New"), typeCreation = _c[0], setTypeCreation = _c[1];
15668
- var _d = React.useState(false), loadingList = _d[0], setLoadingList = _d[1];
15669
- var _e = React.useState(0), current = _e[0], setCurrent = _e[1];
15670
- var _f = React.useState(0), currentPercTotal = _f[0], setCurrentPercTotal = _f[1];
15671
- var _g = React.useState([]), organisationsList = _g[0], setOrganisationList = _g[1];
15672
- var _h = React.useState([]), instrument = _h[0], setInstrument = _h[1];
15673
- var _j = React.useState(), stepOneData = _j[0], setStepOneData = _j[1];
15674
- var _k = React.useState(), govData = _k[0], setGovData = _k[1];
15677
+ var _h = React.useState(false), loading = _h[0], setLoading = _h[1];
15678
+ var _j = React.useState("New"), typeCreation = _j[0], setTypeCreation = _j[1];
15679
+ var _k = React.useState(exports.InvestmentOwnershipType.PROJECT), investmentOwnershipType = _k[0], setInvestmentOwnershipType = _k[1];
15680
+ var _l = React.useState(false), loadingList = _l[0], setLoadingList = _l[1];
15681
+ var _m = React.useState(false), loadingInvestment = _m[0], setLoadingInvestment = _m[1];
15682
+ var _o = React.useState(false), loadingProgData = _o[0], setLoadingProgData = _o[1];
15683
+ var _p = React.useState(0), current = _p[0], setCurrent = _p[1];
15684
+ var _q = React.useState(0), currentPercTotal = _q[0], setCurrentPercTotal = _q[1];
15685
+ var _r = React.useState([]), organisationsList = _r[0], setOrganisationList = _r[1];
15686
+ var _s = React.useState([]), nationalInvestmentList = _s[0], setNationalInvestmentList = _s[1];
15687
+ var _t = React.useState([]), instrument = _t[0], setInstrument = _t[1];
15688
+ var _u = React.useState(), stepOneData = _u[0], setStepOneData = _u[1];
15689
+ var _v = React.useState(), govData = _v[0], setGovData = _v[1];
15675
15690
  var userInfoState = useUserContext().userInfoState;
15691
+ var _w = React.useState([]), ministrySectoralScope = _w[0], setMinistrySectoralScope = _w[1];
15692
+ var _x = React.useState({}), prevInvestor = _x[0], setPrevInvestor = _x[1];
15676
15693
  var instrumentOptions = Object.keys(exports.Instrument).map(function (k, index) { return ({
15677
15694
  label: addSpaces(Object.values(exports.Instrument)[index]),
15678
15695
  value: Object.values(exports.Instrument)[index],
@@ -15723,52 +15740,215 @@ var InvestmentCreationComponent = function (props) {
15723
15740
  }
15724
15741
  });
15725
15742
  }); };
15726
- var getOrganisationsDetails = function () { return __awaiter(void 0, void 0, void 0, function () {
15727
- var filterAnd, _i, _a, c, response, error_2;
15743
+ var getAllProjectData = function () { return __awaiter(void 0, void 0, void 0, function () {
15744
+ var response, error_2;
15745
+ return __generator(this, function (_a) {
15746
+ switch (_a.label) {
15747
+ case 0:
15748
+ setLoadingProgData(true);
15749
+ _a.label = 1;
15750
+ case 1:
15751
+ _a.trys.push([1, 5, 6, 7]);
15752
+ if (!data) return [3 /*break*/, 4];
15753
+ if (!!(data === null || data === void 0 ? void 0 : data.programmeId)) return [3 /*break*/, 3];
15754
+ console.log("data non existing", data);
15755
+ console.log("getting all Project data");
15756
+ return [4 /*yield*/, post("national/programme/query", {
15757
+ page: 1,
15758
+ size: 100,
15759
+ filterAnd: [
15760
+ {
15761
+ key: "currentStage",
15762
+ operation: "!=",
15763
+ value: exports.ProgrammeStageUnified.Rejected,
15764
+ },
15765
+ ],
15766
+ })];
15767
+ case 2:
15768
+ response = _a.sent();
15769
+ if (response.data) {
15770
+ setAllProjectData(response === null || response === void 0 ? void 0 : response.data);
15771
+ console.log("all Project data", response === null || response === void 0 ? void 0 : response.data);
15772
+ }
15773
+ return [3 /*break*/, 4];
15774
+ case 3:
15775
+ console.log("setting current Project data");
15776
+ setAllProjectData([data]);
15777
+ _a.label = 4;
15778
+ case 4: return [3 /*break*/, 7];
15779
+ case 5:
15780
+ error_2 = _a.sent();
15781
+ console.log("Error in getting all programme data", error_2);
15782
+ return [3 /*break*/, 7];
15783
+ case 6:
15784
+ setLoadingProgData(false);
15785
+ return [7 /*endfinally*/];
15786
+ case 7: return [2 /*return*/];
15787
+ }
15788
+ });
15789
+ }); };
15790
+ var setSelectedProgramme = function (value) { return __awaiter(void 0, void 0, void 0, function () {
15791
+ var _i, allProjectData_1, obj;
15792
+ return __generator(this, function (_a) {
15793
+ console.log("setSelectedProgramme", value);
15794
+ for (_i = 0, allProjectData_1 = allProjectData; _i < allProjectData_1.length; _i++) {
15795
+ obj = allProjectData_1[_i];
15796
+ if (obj.programmeId == value) {
15797
+ setProjectData(obj);
15798
+ break;
15799
+ }
15800
+ }
15801
+ return [2 /*return*/];
15802
+ });
15803
+ }); };
15804
+ var setSelectedInvestment = function (value) { return __awaiter(void 0, void 0, void 0, function () {
15805
+ return __generator(this, function (_a) {
15806
+ console.log("setSelectedInvestment", value);
15807
+ setInvestmentData(investmentNames[value]);
15808
+ return [2 /*return*/];
15809
+ });
15810
+ }); };
15811
+ var getNationalInvestmentDetails = function () { return __awaiter(void 0, void 0, void 0, function () {
15812
+ var filterAnd, response, investmentData_1, _i, _a, investment, error_3;
15728
15813
  return __generator(this, function (_b) {
15729
15814
  switch (_b.label) {
15730
15815
  case 0:
15731
- setLoadingList(true);
15816
+ setLoadingInvestment(true);
15732
15817
  _b.label = 1;
15733
15818
  case 1:
15734
15819
  _b.trys.push([1, 3, 4, 5]);
15735
15820
  filterAnd = [];
15736
15821
  filterAnd = [
15737
15822
  {
15738
- key: "companyRole",
15823
+ key: "category",
15739
15824
  operation: "=",
15740
- value: exports.CompanyRole.PROGRAMME_DEVELOPER.toString(),
15825
+ value: exports.InvestmentOwnershipType.NATIONAL.toString(),
15826
+ },
15827
+ {
15828
+ key: "amount",
15829
+ operation: ">",
15830
+ value: 0,
15741
15831
  },
15742
15832
  ];
15743
15833
  if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.PROGRAMME_DEVELOPER) {
15744
15834
  filterAnd.push({
15745
- key: "companyId",
15746
- operation: "!=",
15835
+ key: "toCompanyId",
15836
+ operation: "=",
15747
15837
  value: userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyId,
15748
15838
  });
15749
15839
  }
15750
- for (_i = 0, _a = data === null || data === void 0 ? void 0 : data.companyId; _i < _a.length; _i++) {
15751
- c = _a[_i];
15752
- filterAnd.push({
15753
- key: "companyId",
15754
- operation: "!=",
15755
- value: c,
15756
- });
15757
- }
15758
- return [4 /*yield*/, post("national/organisation/queryNames", {
15840
+ return [4 /*yield*/, post("national/programme/investmentQuery", {
15759
15841
  page: 1,
15760
15842
  size: 100,
15761
15843
  filterAnd: filterAnd,
15762
15844
  })];
15763
15845
  case 2:
15764
15846
  response = _b.sent();
15847
+ if (response.data) {
15848
+ setNationalInvestmentList(response === null || response === void 0 ? void 0 : response.data);
15849
+ investmentData_1 = {};
15850
+ for (_i = 0, _a = response === null || response === void 0 ? void 0 : response.data; _i < _a.length; _i++) {
15851
+ investment = _a[_i];
15852
+ investmentData_1[investment.requestId] = investment;
15853
+ }
15854
+ setInvestmentNames(investmentData_1);
15855
+ console.log(investmentData_1);
15856
+ }
15857
+ return [3 /*break*/, 5];
15858
+ case 3:
15859
+ error_3 = _b.sent();
15860
+ console.log("Error in getting national Investments list", error_3);
15861
+ return [3 /*break*/, 5];
15862
+ case 4:
15863
+ setLoadingInvestment(false);
15864
+ return [7 /*endfinally*/];
15865
+ case 5: return [2 /*return*/];
15866
+ }
15867
+ });
15868
+ }); };
15869
+ var getUserOrganization = function () { return __awaiter(void 0, void 0, void 0, function () {
15870
+ var response, error_4;
15871
+ return __generator(this, function (_a) {
15872
+ switch (_a.label) {
15873
+ case 0:
15874
+ _a.trys.push([0, 2, , 3]);
15875
+ return [4 /*yield*/, post("national/organisation/query", {
15876
+ page: 1,
15877
+ size: 100,
15878
+ filterAnd: [
15879
+ { key: "companyId", operation: "=", value: userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyId },
15880
+ ],
15881
+ })];
15882
+ case 1:
15883
+ response = _a.sent();
15884
+ console.log("getUserOrganization", response.data[0]);
15885
+ setUserOrganization(response.data[0]);
15886
+ setMinistrySectoralScope(response.data[0].sectoralScope);
15887
+ return [3 /*break*/, 3];
15888
+ case 2:
15889
+ error_4 = _a.sent();
15890
+ console.log("Error in getting user organization", error_4);
15891
+ return [3 /*break*/, 3];
15892
+ case 3: return [2 /*return*/];
15893
+ }
15894
+ });
15895
+ }); };
15896
+ var getOrganisationsDetails = function () { return __awaiter(void 0, void 0, void 0, function () {
15897
+ var filterAnd, filterOr, _i, _a, c, filters, response, companyName, _b, _c, company, error_5;
15898
+ return __generator(this, function (_d) {
15899
+ switch (_d.label) {
15900
+ case 0:
15901
+ setLoadingList(true);
15902
+ _d.label = 1;
15903
+ case 1:
15904
+ _d.trys.push([1, 3, 4, 5]);
15905
+ filterAnd = [];
15906
+ filterOr = [];
15907
+ filterAnd = [
15908
+ {
15909
+ key: "companyRole",
15910
+ operation: "=",
15911
+ value: exports.CompanyRole.PROGRAMME_DEVELOPER.toString(),
15912
+ },
15913
+ ];
15914
+ // if (userInfoState?.companyRole === CompanyRole.PROGRAMME_DEVELOPER) {
15915
+ // filterAnd.push({
15916
+ // key: "companyId",
15917
+ // operation: "!=",
15918
+ // value: userInfoState?.companyId,
15919
+ // });
15920
+ // }
15921
+ if (data === null || data === void 0 ? void 0 : data.companyId) {
15922
+ for (_i = 0, _a = data === null || data === void 0 ? void 0 : data.companyId; _i < _a.length; _i++) {
15923
+ c = _a[_i];
15924
+ filterOr.push({
15925
+ key: "companyId",
15926
+ operation: "=",
15927
+ value: c,
15928
+ });
15929
+ }
15930
+ }
15931
+ filters = void 0;
15932
+ if (filterOr.length) {
15933
+ filters.filterOr = filterOr;
15934
+ }
15935
+ return [4 /*yield*/, post("national/organisation/queryNames", __assign({ page: 1, size: 100, filterAnd: filterAnd }, filters))];
15936
+ case 2:
15937
+ response = _d.sent();
15765
15938
  if (response.data) {
15766
15939
  setOrganisationList(response === null || response === void 0 ? void 0 : response.data);
15940
+ companyName = {};
15941
+ for (_b = 0, _c = response === null || response === void 0 ? void 0 : response.data; _b < _c.length; _b++) {
15942
+ company = _c[_b];
15943
+ companyName[Number(company.companyId)] = company.name;
15944
+ }
15945
+ setCompanyNames(companyName);
15946
+ console.log(companyName);
15767
15947
  }
15768
15948
  return [3 /*break*/, 5];
15769
15949
  case 3:
15770
- error_2 = _b.sent();
15771
- console.log("Error in getting organization list", error_2);
15950
+ error_5 = _d.sent();
15951
+ console.log("Error in getting organization list", error_5);
15772
15952
  return [3 /*break*/, 5];
15773
15953
  case 4:
15774
15954
  setLoadingList(false);
@@ -15783,52 +15963,71 @@ var InvestmentCreationComponent = function (props) {
15783
15963
  return;
15784
15964
  }
15785
15965
  if (state === null || state === void 0 ? void 0 : state.record) {
15966
+ console.log("condition 1 data", state === null || state === void 0 ? void 0 : state.record);
15786
15967
  setData(state === null || state === void 0 ? void 0 : state.record);
15787
15968
  }
15788
15969
  else {
15970
+ console.log("condition 2 data", { ownership: true });
15789
15971
  setData({ ownership: true });
15790
15972
  }
15791
15973
  }, []);
15792
15974
  React.useEffect(function () {
15793
- if (data) {
15794
- var keys = Object.keys(data);
15795
- if (keys[0] !== "ownership") {
15796
- getOrganisationsDetails();
15797
- }
15798
- }
15975
+ // if (data) {
15976
+ // const keys = Object.keys(data);
15977
+ // if (keys[0] !== "ownership") {
15978
+ // getOrganisationsDetails();
15979
+ // }
15980
+ // }
15981
+ getNationalInvestmentDetails();
15982
+ getOrganisationsDetails();
15799
15983
  getGovernmentDetails();
15984
+ getAllProjectData();
15985
+ getUserOrganization();
15800
15986
  }, [data]);
15801
- if (!data) {
15987
+ if (!data && allProjectData.length == 0) {
15802
15988
  return React.createElement(Loading, null);
15803
15989
  }
15804
15990
  console.log("data", data);
15805
- var companyName = {};
15806
15991
  if (data && Object.keys(data)[0] !== "ownership") {
15807
- for (var _i = 0, _l = data === null || data === void 0 ? void 0 : data.company; _i < _l.length; _i++) {
15808
- var company = _l[_i];
15809
- companyName[company === null || company === void 0 ? void 0 : company.companyId] = company;
15810
- }
15992
+ // for (const company of data!?.company) {
15993
+ // companyName[company?.companyId] = company;
15994
+ // }
15811
15995
  if (!data.proponentPercentage) {
15812
15996
  data.proponentPercentage = [100];
15813
15997
  }
15814
15998
  }
15815
15999
  var nextOne = function (val) {
16000
+ console.log("step 1 values", val);
16001
+ if (val.typeCreation == exports.InvestmentCreationType.EXISTING) {
16002
+ val.toCompanyId = investmentData.toCompanyId;
16003
+ }
15816
16004
  setCurrent(current + 1);
15817
16005
  setStepOneData(val);
16006
+ if (data === null || data === void 0 ? void 0 : data.programmeId)
16007
+ setSelectedProgramme(data.programmeId);
16008
+ if (prevInvestor && prevInvestor != val.toCompanyId && !(data === null || data === void 0 ? void 0 : data.programmeId)) {
16009
+ formTwo.resetFields();
16010
+ setCurrentPercTotal(0);
16011
+ setProjectData(undefined);
16012
+ }
15818
16013
  };
15819
16014
  var prevOne = function () {
15820
16015
  setCurrent(current - 1);
16016
+ setPrevInvestor(stepOneData.toCompanyId);
16017
+ // formTwo.resetFields();
16018
+ // setCurrentPercTotal(0);
16019
+ // setProjectData(undefined);
15821
16020
  };
15822
16021
  var submitInvestment = function (val) { return __awaiter(void 0, void 0, void 0, function () {
15823
- var payload, response, error_3;
16022
+ var payload, response, error_6;
15824
16023
  return __generator(this, function (_a) {
15825
16024
  switch (_a.label) {
15826
16025
  case 0:
15827
16026
  console.log(val);
15828
16027
  console.log(stepOneData);
16028
+ console.log("OwnershipType", investmentOwnershipType);
15829
16029
  setLoading(true);
15830
16030
  payload = stepOneData;
15831
- payload.programmeId = data.programmeId;
15832
16031
  payload.amount = parseFloat(payload.amount);
15833
16032
  if (payload.interestRate) {
15834
16033
  payload.interestRate = parseFloat(payload.interestRate);
@@ -15836,15 +16035,27 @@ var InvestmentCreationComponent = function (props) {
15836
16035
  if (payload.paymentPerMetric) {
15837
16036
  payload.paymentPerMetric = parseFloat(payload.paymentPerMetric);
15838
16037
  }
15839
- payload.fromCompanyIds = data.companyId.map(function (e) { return Number(e); });
15840
- payload.percentage = val.percentage;
15841
16038
  payload.toCompanyId = Number(payload.toCompanyId);
15842
16039
  _a.label = 1;
15843
16040
  case 1:
15844
- _a.trys.push([1, 3, 4, 5]);
16041
+ _a.trys.push([1, 6, 7, 8]);
16042
+ response = void 0;
16043
+ if (!(investmentOwnershipType == exports.InvestmentOwnershipType.PROJECT)) return [3 /*break*/, 3];
16044
+ if (typeCreation == exports.InvestmentCreationType.EXISTING) {
16045
+ payload.nationalInvestmentId = investmentData.requestId;
16046
+ }
16047
+ payload.programmeId = projectData === null || projectData === void 0 ? void 0 : projectData.programmeId;
16048
+ payload.fromCompanyIds = projectData === null || projectData === void 0 ? void 0 : projectData.companyId.map(function (e) { return Number(e); });
16049
+ payload.percentage = val.percentage;
15845
16050
  return [4 /*yield*/, post("national/programme/addInvestment", payload)];
15846
16051
  case 2:
15847
16052
  response = _a.sent();
16053
+ return [3 /*break*/, 5];
16054
+ case 3: return [4 /*yield*/, post("national/organisation/addInvestment", payload)];
16055
+ case 4:
16056
+ response = _a.sent();
16057
+ _a.label = 5;
16058
+ case 5:
15848
16059
  console.log("investment creation -> ", response);
15849
16060
  if ((response === null || response === void 0 ? void 0 : response.statusText) === "SUCCESS") {
15850
16061
  antd.message.open({
@@ -15854,22 +16065,24 @@ var InvestmentCreationComponent = function (props) {
15854
16065
  style: { textAlign: "right", marginRight: 15, marginTop: 10 },
15855
16066
  });
15856
16067
  }
15857
- onNavigateToProgrammeView(data.programmeId);
15858
- return [3 /*break*/, 5];
15859
- case 3:
15860
- error_3 = _a.sent();
15861
- console.log("Error in investment creation - ", error_3);
16068
+ (data === null || data === void 0 ? void 0 : data.programmeId)
16069
+ ? onNavigateToProgrammeView(data === null || data === void 0 ? void 0 : data.programmeId)
16070
+ : onNavigateToInvestmentManagementView();
16071
+ return [3 /*break*/, 8];
16072
+ case 6:
16073
+ error_6 = _a.sent();
16074
+ console.log("Error in investment creation - ", error_6);
15862
16075
  antd.message.open({
15863
16076
  type: "error",
15864
- content: error_3 === null || error_3 === void 0 ? void 0 : error_3.message,
16077
+ content: error_6 === null || error_6 === void 0 ? void 0 : error_6.message,
15865
16078
  duration: 4,
15866
16079
  style: { textAlign: "right", marginRight: 15, marginTop: 10 },
15867
16080
  });
15868
- return [3 /*break*/, 5];
15869
- case 4:
16081
+ return [3 /*break*/, 8];
16082
+ case 7:
15870
16083
  setLoading(false);
15871
16084
  return [7 /*endfinally*/];
15872
- case 5: return [2 /*return*/];
16085
+ case 8: return [2 /*return*/];
15873
16086
  }
15874
16087
  });
15875
16088
  }); };
@@ -15883,6 +16096,14 @@ var InvestmentCreationComponent = function (props) {
15883
16096
  var onChangeTypeCreation = function (e) {
15884
16097
  console.log("radio checked", e.target.value);
15885
16098
  setTypeCreation(e.target.value);
16099
+ formOne.resetFields();
16100
+ formTwo.resetFields();
16101
+ setCurrentPercTotal(0);
16102
+ setProjectData(undefined);
16103
+ };
16104
+ var onChangeInvestmentOwnershipType = function (e) {
16105
+ console.log("investment ownership type radio checked", e.target.value);
16106
+ setInvestmentOwnershipType(e.target.value);
15886
16107
  };
15887
16108
  return (React.createElement("div", { className: "add-programme-main-container" },
15888
16109
  React.createElement("div", { className: "title-container" },
@@ -15917,7 +16138,18 @@ var InvestmentCreationComponent = function (props) {
15917
16138
  message: "".concat(t("programme:investorName"), " ").concat(t("isRequired")),
15918
16139
  },
15919
16140
  ] },
15920
- React.createElement(antd.Select, { size: "large", loading: loadingList }, organisationsList.map(function (organisation) { return (React.createElement(antd.Select.Option, { key: organisation.companyId, value: organisation.companyId }, organisation.name)); }))))),
16141
+ React.createElement(antd.Select, { size: "large", loading: loadingList }, organisationsList.map(function (organisation) {
16142
+ if (data === null || data === void 0 ? void 0 : data.programmeId) {
16143
+ if (data.companyId
16144
+ .map(function (id) { return Number(id); })
16145
+ .includes(Number(organisation.companyId))) {
16146
+ return (React.createElement(antd.Select.Option, { key: organisation.companyId, value: organisation.companyId }, organisation.name));
16147
+ }
16148
+ }
16149
+ else {
16150
+ return (React.createElement(antd.Select.Option, { key: organisation.companyId, value: organisation.companyId }, organisation.name));
16151
+ }
16152
+ }))))),
15921
16153
  React.createElement(antd.Col, { xl: 12, md: 24 },
15922
16154
  React.createElement("div", { className: "details-part-two" },
15923
16155
  React.createElement(antd.Form.Item, { label: t("programme:amountInvested"), name: "amount", rules: [
@@ -16105,104 +16337,237 @@ var InvestmentCreationComponent = function (props) {
16105
16337
  React.createElement(antd.Row, { className: "row", gutter: [16, 16] },
16106
16338
  React.createElement(antd.Col, { xl: 12, md: 24 },
16107
16339
  React.createElement(antd.Form.Item, { label: t("programme:esgType"), name: "esgClassification" },
16108
- React.createElement(antd.Select, { size: "large" }, Object.values(exports.ESGType).map(function (esg) { return (React.createElement(antd.Select.Option, { value: esg }, esg)); }))))),
16109
- React.createElement(antd.Form.Item, null,
16110
- React.createElement("div", { className: "steps-actions" },
16111
- React.createElement(antd.Button, { type: "primary", htmlType: "submit", loading: loading, onSubmit: nextOne }, t("programme:next")))))),
16340
+ React.createElement(antd.Select, { size: "large" }, Object.values(exports.ESGType).map(function (esg) { return (React.createElement(antd.Select.Option, { value: esg }, esg)); }))))))),
16112
16341
  typeCreation == exports.InvestmentCreationType.EXISTING && (React.createElement("div", null,
16113
16342
  React.createElement(antd.Row, { className: "row", gutter: [16, 16] },
16114
16343
  React.createElement(antd.Col, { xl: 12, md: 24 },
16115
16344
  React.createElement("div", { className: "details-part-one" },
16116
- React.createElement(antd.Form.Item, { label: t("programme:investorName"), name: "toCompanyId", wrapperCol: { span: 24 }, className: "organisation", rules: [
16345
+ React.createElement(antd.Form.Item, { label: t("programme:existingInvestmentSource"), name: "existinngInvestmentId", wrapperCol: { span: 24 }, rules: [
16117
16346
  {
16118
16347
  required: true,
16119
- message: "".concat(t("programme:investorName"), " ").concat(t("isRequired")),
16348
+ message: "".concat(t("programme:existingInvestmentSource"), " ").concat(t("isRequired")),
16120
16349
  },
16121
16350
  ] },
16122
- React.createElement(antd.Select, { size: "large", loading: loadingList }, organisationsList.map(function (organisation) { return (React.createElement(antd.Select.Option, { key: organisation.companyId, value: organisation.companyId }, organisation.name)); })))))),
16351
+ React.createElement(antd.Select, { size: "large", loading: loadingInvestment, onChange: setSelectedInvestment }, nationalInvestmentList.map(function (investment) { return (React.createElement(antd.Select.Option, { key: investment.requestId, value: investment.requestId }, investment.investmentName)); })))))),
16123
16352
  React.createElement(antd.Row, { className: "row", gutter: [16, 16] },
16124
16353
  React.createElement(antd.Col, { xl: 12, md: 24 },
16125
- React.createElement("div", { className: "details-part-one" },
16126
- React.createElement(antd.Form.Item, { label: t("programme:investorName"), name: "toCompanyId", wrapperCol: { span: 24 }, className: "organisation", rules: [
16354
+ React.createElement("div", { className: "details-part-two" },
16355
+ React.createElement(antd.Form.Item, { label: t("programme:amountInvested"), name: "amount", rules: [
16127
16356
  {
16128
16357
  required: true,
16129
- message: "".concat(t("programme:investorName"), " ").concat(t("isRequired")),
16358
+ message: "",
16359
+ },
16360
+ {
16361
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
16362
+ return __generator(this, function (_a) {
16363
+ if (String(value).trim() === "" ||
16364
+ String(value).trim() ===
16365
+ undefined ||
16366
+ value === null ||
16367
+ value === undefined) {
16368
+ throw new Error("".concat(t("programme:amountInvested"), " ").concat(t("isRequired")));
16369
+ }
16370
+ else if (!isNaN(value) &&
16371
+ Number(value) > 0) {
16372
+ return [2 /*return*/, Promise.resolve()];
16373
+ }
16374
+ else {
16375
+ throw new Error("".concat(t("programme:amountInvested"), " ").concat(t("isInvalid")));
16376
+ }
16377
+ });
16378
+ }); },
16379
+ },
16380
+ function (_a) {
16381
+ var getFieldValue = _a.getFieldValue;
16382
+ return ({
16383
+ validator: function (rule, v) {
16384
+ if (getFieldValue("amount") &&
16385
+ investmentData &&
16386
+ investmentData.amount <
16387
+ parseFloat(getFieldValue("amount"))) {
16388
+ // eslint-disable-next-line prefer-promise-reject-errors
16389
+ return Promise.reject("Amount > Available");
16390
+ }
16391
+ return Promise.resolve();
16392
+ },
16393
+ });
16130
16394
  },
16131
16395
  ] },
16132
- React.createElement(antd.Select, { size: "large", loading: loadingList }, organisationsList.map(function (organisation) { return (React.createElement(antd.Select.Option, { key: organisation.companyId, value: organisation.companyId }, organisation.name)); })))))))))))),
16396
+ React.createElement(antd.Input, { size: "large" })))),
16397
+ React.createElement(antd.Col, { xl: 12, md: 24 },
16398
+ React.createElement("div", { className: "details-part-two" },
16399
+ React.createElement(antd.Form.Item, { label: " ", name: "sourceAmount" },
16400
+ React.createElement("div", null,
16401
+ "/",
16402
+ React.createElement(antd.InputNumber, { size: "large", width: "100%", formatter: function (value) {
16403
+ return "$".concat(addCommSep(value));
16404
+ }, disabled: true, value: investmentData
16405
+ ? investmentData.amount
16406
+ : 0 })))))))),
16407
+ React.createElement(antd.Form.Item, null,
16408
+ React.createElement("div", { className: "steps-actions" },
16409
+ React.createElement(antd.Button, { type: "primary", htmlType: "submit", loading: loading, onSubmit: nextOne }, t("programme:next")))))))),
16133
16410
  },
16134
16411
  {
16135
16412
  title: (React.createElement("div", { className: "step-title-container" },
16136
16413
  React.createElement("div", { className: "step-count" }, "02"),
16137
16414
  React.createElement("div", { className: "title" }, t("programme:ownership")))),
16138
16415
  description: current === 1 && (React.createElement("div", null,
16139
- React.createElement("div", { className: "programme-sought-form-container ownership-container" }, Object.keys(data).length > 0 && (React.createElement("div", { className: "programme-sought-form" },
16140
- React.createElement(antd.Form, { labelCol: { span: 20 }, wrapperCol: { span: 24 }, form: formTwo, name: "investment-sought", className: "investment-sought-form", layout: "vertical", requiredMark: true, onChange: onPercentageChange, onFinish: submitInvestment }, data === null || data === void 0 ? void 0 :
16141
- data.companyId.map(function (companyId, index) {
16142
- return (React.createElement(antd.Row, { className: "row", gutter: [16, 16] },
16143
- React.createElement(antd.Col, { xl: 8, md: 15 },
16144
- React.createElement("div", { className: "label" },
16145
- companyName[companyId].name,
16146
- React.createElement("span", { className: "required-mark" }, "*"))),
16147
- React.createElement(antd.Col, { xl: 8, md: 9 },
16148
- React.createElement(antd.Form.Item, { className: "inline", name: ["percentage", index], initialValue: 0, rules: [
16149
- {
16150
- pattern: new RegExp(/^[+]?([.]\d+|\d+[.]?\d*)$/g),
16151
- message: "Percentage Should be a positive number",
16152
- },
16416
+ React.createElement("div", { className: "investment-sought-form-container" },
16417
+ React.createElement("div", { className: "investment-sought-form" },
16418
+ React.createElement(antd.Form, { labelCol: { span: 20 }, wrapperCol: { span: 24 }, name: "investment-sought", className: "investment-sought-form", layout: "vertical", requiredMark: true },
16419
+ React.createElement(antd.Row, { className: "row", gutter: [4, 4] },
16420
+ React.createElement(antd.Col, { xl: 8, md: 12 },
16421
+ React.createElement(antd.Form.Item, { label: t("programme:typeCreation"), wrapperCol: { span: 13 }, className: "role-group", name: "investmentOwnershipType", rules: [
16153
16422
  {
16154
- required: true,
16155
- message: "Required field",
16156
- },
16157
- function (_a) {
16158
- var getFieldValue = _a.getFieldValue;
16159
- return ({
16160
- validator: function (rule, v) {
16161
- if (getFieldValue([
16162
- "percentage",
16163
- index,
16164
- ]) &&
16165
- parseFloat(getFieldValue([
16166
- "percentage",
16167
- index,
16168
- ])) >
16169
- data.proponentPercentage[index]) {
16170
- // eslint-disable-next-line prefer-promise-reject-errors
16171
- return Promise.reject("Amount > Available");
16172
- }
16173
- return Promise.resolve();
16174
- },
16175
- });
16423
+ required: false,
16176
16424
  },
16177
16425
  ] },
16178
- React.createElement(antd.InputNumber, { placeholder: "", controls: false, disabled: govData.companyId == companyId,
16179
- // disabled={userInfoState?.companyId === Number(companyId)}
16180
- onKeyPress: function (event) {
16181
- if (!/[0-9\.]/.test(event.key)) {
16182
- event.preventDefault();
16183
- }
16184
- } })),
16185
- React.createElement("div", { className: "inline separator" }, "/"),
16186
- React.createElement(antd.Form.Item, { className: "inline" },
16187
- React.createElement(antd.InputNumber, { placeholder: String(data === null || data === void 0 ? void 0 : data.proponentPercentage[index]), disabled: true })))));
16188
- }),
16189
- React.createElement(antd.Row, { className: "row", gutter: [16, 16] },
16190
- React.createElement(antd.Col, { xl: 8, md: 15 },
16191
- React.createElement("div", { className: "label" }, t("programme:total"))),
16192
- React.createElement(antd.Col, { xl: 8, md: 9 },
16193
- React.createElement(antd.Form.Item, { className: "inline", name: ["total"] },
16194
- React.createElement(antd.InputNumber, { placeholder: currentPercTotal + "", controls: false, disabled: true, onKeyPress: function (event) {
16195
- if (!/[0-9\.]/.test(event.key)) {
16196
- event.preventDefault();
16426
+ React.createElement(antd.Radio.Group, { size: "large", defaultValue: typeCreation ==
16427
+ exports.InvestmentCreationType.EXISTING
16428
+ ? exports.InvestmentOwnershipType.PROJECT
16429
+ : investmentOwnershipType }, Object.values(exports.InvestmentOwnershipType).map(function (k, index) {
16430
+ if (!(typeCreation ==
16431
+ exports.InvestmentCreationType.EXISTING &&
16432
+ k == exports.InvestmentOwnershipType.NATIONAL) &&
16433
+ !(k ==
16434
+ exports.InvestmentOwnershipType.NATIONAL &&
16435
+ (data === null || data === void 0 ? void 0 : data.programmeId))) {
16436
+ return (React.createElement("div", { className: "condition-radio-container" },
16437
+ React.createElement(antd.Tooltip, { title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) ==
16438
+ exports.CompanyRole.PROGRAMME_DEVELOPER &&
16439
+ stepOneData.toCompanyId !=
16440
+ userInfoState.companyId &&
16441
+ k ==
16442
+ exports.InvestmentOwnershipType.NATIONAL
16443
+ ? "This action is unauthorized due to the selected investor name."
16444
+ : "", color: TooltipColor, key: TooltipColor },
16445
+ React.createElement(antd.Radio.Button, { className: "condition-radio", value: k, onChange: onChangeInvestmentOwnershipType, disabled: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) ==
16446
+ exports.CompanyRole.PROGRAMME_DEVELOPER &&
16447
+ stepOneData.toCompanyId !=
16448
+ userInfoState.companyId &&
16449
+ k ==
16450
+ exports.InvestmentOwnershipType.NATIONAL }, t("programme:" + k)))));
16197
16451
  }
16198
- } })),
16199
- React.createElement("div", { className: "inline separator" }, "/"),
16200
- React.createElement(antd.Form.Item, { className: "inline" },
16201
- React.createElement(antd.InputNumber, { disabled: true, placeholder: "100" })))),
16202
- React.createElement(antd.Form.Item, null,
16203
- React.createElement("div", { className: "steps-actions" },
16204
- React.createElement(antd.Button, { type: "primary", htmlType: "submit", loading: loading, onSubmit: submitInvestment }, t("programme:submit")),
16205
- React.createElement(antd.Button, { className: "back-btn", onClick: function () { return prevOne(); }, loading: loading }, t("programme:back")))))))))),
16452
+ })))))))),
16453
+ React.createElement("div", { className: "programme-sought-form-container ownership-container" },
16454
+ React.createElement("div", { className: "programme-sought-form" },
16455
+ React.createElement(antd.Form, { labelCol: { span: 20 }, wrapperCol: { span: 24 }, form: formTwo, name: "investment-sought", className: "investment-sought-form", layout: "vertical", requiredMark: true, onChange: onPercentageChange, onFinish: submitInvestment },
16456
+ allProjectData.length > 0 &&
16457
+ investmentOwnershipType ==
16458
+ exports.InvestmentOwnershipType.PROJECT && (React.createElement("div", null,
16459
+ React.createElement(antd.Row, { className: "row", gutter: [16, 16] },
16460
+ React.createElement(antd.Col, { xl: 12, md: 24 },
16461
+ React.createElement("div", { className: "details-part-one" },
16462
+ React.createElement(antd.Form.Item, { label: t("programme:title"), name: "projectId", wrapperCol: { span: 24 }, initialValue: allProjectData.length == 1
16463
+ ? allProjectData[0].programmeId
16464
+ : null, rules: [
16465
+ {
16466
+ required: true,
16467
+ message: "".concat(t("programme:title"), " ").concat(t("isRequired")),
16468
+ },
16469
+ ] },
16470
+ React.createElement(antd.Select, { size: "large", loading: loadingProgData,
16471
+ // defaultValue={
16472
+ // allProjectData.length == 1
16473
+ // ? allProjectData[0].programmeId
16474
+ // : null
16475
+ // }
16476
+ disabled: allProjectData.length == 1, onChange: setSelectedProgramme }, allProjectData.map(function (project) {
16477
+ if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) ==
16478
+ exports.CompanyRole.PROGRAMME_DEVELOPER &&
16479
+ Number(stepOneData.toCompanyId) !=
16480
+ userInfoState.companyId) {
16481
+ if (project.companyId
16482
+ .map(function (id) { return Number(id); })
16483
+ .includes(userInfoState.companyId)) {
16484
+ return (React.createElement(antd.Select.Option, { key: project.programmeId, value: project.programmeId }, project.title));
16485
+ }
16486
+ }
16487
+ else if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) ===
16488
+ exports.CompanyRole.MINISTRY) {
16489
+ if (ministrySectoralScope.includes(project.sectoralScope)) {
16490
+ return (React.createElement(antd.Select.Option, { key: project.programmeId, value: project.programmeId }, project.title));
16491
+ }
16492
+ }
16493
+ else {
16494
+ return (React.createElement(antd.Select.Option, { key: project.programmeId, value: project.programmeId }, project.title));
16495
+ }
16496
+ })))))), projectData === null || projectData === void 0 ? void 0 :
16497
+ projectData.companyId.map(function (companyId, index) {
16498
+ if (formTwo.getFieldValue("percentage") &&
16499
+ formTwo.getFieldValue("percentage")[index] &&
16500
+ companyId == stepOneData.toCompanyId) {
16501
+ formTwo.getFieldValue("percentage")[index] = 0;
16502
+ }
16503
+ return (React.createElement(antd.Row, { className: "row", gutter: [16, 16] },
16504
+ React.createElement(antd.Col, { xl: 8, md: 15 },
16505
+ React.createElement("div", { className: "label" },
16506
+ companyNames[Number(companyId)],
16507
+ React.createElement("span", { className: "required-mark" }, "*"))),
16508
+ React.createElement(antd.Col, { xl: 8, md: 9 },
16509
+ React.createElement(antd.Form.Item, { className: "inline", name: ["percentage", index], initialValue: 0, rules: [
16510
+ {
16511
+ pattern: new RegExp(/^[+]?([.]\d+|\d+[.]?\d*)$/g),
16512
+ message: "Percentage Should be a positive number",
16513
+ },
16514
+ {
16515
+ required: true,
16516
+ message: "Required field",
16517
+ },
16518
+ function (_a) {
16519
+ var getFieldValue = _a.getFieldValue;
16520
+ return ({
16521
+ validator: function (rule, v) {
16522
+ if (getFieldValue([
16523
+ "percentage",
16524
+ index,
16525
+ ]) &&
16526
+ parseFloat(getFieldValue([
16527
+ "percentage",
16528
+ index,
16529
+ ])) >
16530
+ projectData
16531
+ .proponentPercentage[index]) {
16532
+ // eslint-disable-next-line prefer-promise-reject-errors
16533
+ return Promise.reject("Amount > Available");
16534
+ }
16535
+ return Promise.resolve();
16536
+ },
16537
+ });
16538
+ },
16539
+ ] },
16540
+ React.createElement(antd.InputNumber, { placeholder: "", controls: false, disabled: govData.companyId ==
16541
+ companyId ||
16542
+ companyId ==
16543
+ stepOneData.toCompanyId, value: 0,
16544
+ // disabled={userInfoState?.companyId === Number(companyId)}
16545
+ onKeyPress: function (event) {
16546
+ if (!/[0-9\.]/.test(event.key)) {
16547
+ event.preventDefault();
16548
+ }
16549
+ } })),
16550
+ React.createElement("div", { className: "inline separator" }, "/"),
16551
+ React.createElement(antd.Form.Item, { className: "inline" },
16552
+ React.createElement(antd.InputNumber, { placeholder: String(projectData === null || projectData === void 0 ? void 0 : projectData.proponentPercentage[index]), disabled: true })))));
16553
+ }),
16554
+ React.createElement(antd.Row, { className: "row", gutter: [16, 16] },
16555
+ React.createElement(antd.Col, { xl: 8, md: 15 },
16556
+ React.createElement("div", { className: "label" }, t("programme:total"))),
16557
+ React.createElement(antd.Col, { xl: 8, md: 9 },
16558
+ React.createElement(antd.Form.Item, { className: "inline", name: ["total"] },
16559
+ React.createElement(antd.InputNumber, { placeholder: currentPercTotal + "", controls: false, disabled: true, onKeyPress: function (event) {
16560
+ if (!/[0-9\.]/.test(event.key)) {
16561
+ event.preventDefault();
16562
+ }
16563
+ } })),
16564
+ React.createElement("div", { className: "inline separator" }, "/"),
16565
+ React.createElement(antd.Form.Item, { className: "inline" },
16566
+ React.createElement(antd.InputNumber, { disabled: true, placeholder: "100" })))))),
16567
+ React.createElement(antd.Form.Item, null,
16568
+ React.createElement("div", { className: "steps-actions" },
16569
+ React.createElement(antd.Button, { type: "primary", htmlType: "submit", loading: loading, onSubmit: submitInvestment }, t("programme:submit")),
16570
+ React.createElement(antd.Button, { className: "back-btn", onClick: function () { return prevOne(); }, loading: loading }, t("programme:back"))))))))),
16206
16571
  },
16207
16572
  ] })))));
16208
16573
  };
@@ -16651,7 +17016,10 @@ var InvestmentManagementComponent = function (props) {
16651
17016
  sorter: true,
16652
17017
  align: "left",
16653
17018
  render: function (item) {
16654
- return React.createElement("span", { className: "clickable" }, item);
17019
+ if (item) {
17020
+ return React.createElement("span", { className: "clickable" }, item);
17021
+ }
17022
+ return React.createElement("span", null, "-");
16655
17023
  },
16656
17024
  onCell: function (record, rowIndex) {
16657
17025
  return {
@@ -16709,6 +17077,12 @@ var InvestmentManagementComponent = function (props) {
16709
17077
  key: "programmeSector",
16710
17078
  sorter: true,
16711
17079
  align: "left",
17080
+ render: function (item) {
17081
+ if (item) {
17082
+ return React.createElement("span", null, item);
17083
+ }
17084
+ return React.createElement("span", null, "-");
17085
+ },
16712
17086
  },
16713
17087
  {
16714
17088
  title: t("programme:investor"),
@@ -16792,7 +17166,11 @@ var InvestmentManagementComponent = function (props) {
16792
17166
  React.createElement("div", { className: "title-bar" },
16793
17167
  React.createElement("div", { className: "body-title" }, t("programme:investmentTitle")),
16794
17168
  React.createElement("div", { className: "body-sub-title" }, t("programme:investmentDesc"))),
16795
- React.createElement("div", { className: "actions" }, enableAddOwnership && (React.createElement("div", { className: "action-bar" },
17169
+ React.createElement("div", { className: "actions" }, enableAddOwnership &&
17170
+ ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) == exports.CompanyRole.MINISTRY ||
17171
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) == exports.CompanyRole.GOVERNMENT ||
17172
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) == exports.CompanyRole.PROGRAMME_DEVELOPER) &&
17173
+ userInfoState.userRole != exports.Role.ViewOnly && (React.createElement("div", { className: "action-bar" },
16796
17174
  React.createElement(antd.Button, { type: "primary", size: "large", block: true, icon: React.createElement(icons.PlusOutlined, null), onClick: onClickAddOwnership }, t("programme:addOwnership")))))),
16797
17175
  React.createElement("div", { className: "content-card" },
16798
17176
  React.createElement(antd.Row, null,
@@ -16833,7 +17211,7 @@ var InvestmentManagementComponent = function (props) {
16833
17211
  return handleTableChange(val, sorter);
16834
17212
  }, locale: {
16835
17213
  emptyText: (React.createElement(antd.Empty, { image: antd.Empty.PRESENTED_IMAGE_SIMPLE, description: tableData.length === 0
16836
- ? t("creditTransfer:noTransfer")
17214
+ ? t("programme:noInvestmentData")
16837
17215
  : null })),
16838
17216
  } }))))),
16839
17217
  popupInfo && selectedReq && (React.createElement(InvestmentActionModel, { investment: selectedReq, onCancel: function () {