@undp/carbon-library 1.0.117 → 1.0.119

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,6 +75,7 @@ export interface Programme {
75
75
  typeOfMitigation: TypeOfMitigation;
76
76
  geographicalLocationCordintes: any;
77
77
  mitigationActions: any;
78
+ environmentalAssessmentRegistrationNo: any;
78
79
  }
79
80
  export interface ProgrammeR extends Programme {
80
81
  currentStage: ProgrammeStageR;
package/dist/esm/index.js CHANGED
@@ -320,6 +320,7 @@ var getGeneralFields = function (programme, system) {
320
320
  startDate: DateTime.fromSeconds(Number(programme.startTime)),
321
321
  endDate: DateTime.fromSeconds(Number(programme.endTime)),
322
322
  buyerCountry: programme.programmeProperties.buyerCountryEligibility,
323
+ environmentalAssessmentRegistrationNo: programme.environmentalAssessmentRegistrationNo
323
324
  };
324
325
  if (system === CarbonSystemType.UNIFIED || system === CarbonSystemType.MRV) {
325
326
  var prog = programme;
@@ -11855,35 +11856,35 @@ var sectoralScopes = {
11855
11856
  ],
11856
11857
  };
11857
11858
  var ProgrammeCreationComponent = function (props) {
11858
- var _a, _b;
11859
+ var _a, _b, _c;
11859
11860
  var useUserContext = props.useUserContext, useConnection = props.useConnection, useLocation = props.useLocation, onNavigateToProgrammeView = props.onNavigateToProgrammeView, translator = props.translator;
11860
11861
  var t = translator.t;
11861
11862
  var state = useLocation().state;
11862
11863
  var formOne = Form.useForm()[0];
11863
11864
  var formTwo = Form.useForm()[0];
11864
11865
  Form.useForm()[0];
11865
- var _c = useConnection(); _c.put; var get = _c.get, post = _c.post;
11866
+ var _d = useConnection(); _d.put; var get = _d.get, post = _d.post;
11866
11867
  var userInfoState = useUserContext().userInfoState;
11867
- var _d = useState(false), loading = _d[0], setLoading = _d[1];
11868
- var _e = useState(false), loadingList = _e[0], setLoadingList = _e[1];
11869
- var _f = useState(), ndcScopeChanged = _f[0], setNdcScopeChanged = _f[1];
11870
- var _g = useState(), ndcScopeValue = _g[0], setNdcScopeValue = _g[1];
11871
- var _h = useState(), stepOneData = _h[0], setStepOneData = _h[1];
11872
- var _j = useState(0), current = _j[0], setCurrent = _j[1];
11873
- var _k = useState(false), isUpdate = _k[0]; _k[1];
11874
- var _l = useState(), includedInNDC = _l[0], setIncludedInNDC = _l[1];
11875
- var _m = useState([]), countries = _m[0], setCountries = _m[1];
11876
- var _o = useState([]), organisationsList = _o[0], setOrganisationList = _o[1];
11877
- var _p = useState(""), userOrgTaxId = _p[0], setUserOrgTaxId = _p[1];
11878
- var _q = useState([]), regionsList = _q[0], setRegionsList = _q[1];
11879
- var _r = useState(); _r[0]; var setProgrammeDetailsObj = _r[1];
11880
- var _s = useState(), selectedOrgs = _s[0], setSelectedOrgs = _s[1];
11881
- var _t = useState(false), ownershipPercentageValidation = _t[0], setOwnershipPercentageValidation = _t[1];
11882
- var _u = useState(""), selectedSector = _u[0], setSelectedSector = _u[1];
11883
- var _v = useState([]); _v[0]; var setMinistrySectoralScope = _v[1];
11884
- var _w = useState([]), availableSecoralScope = _w[0], setAvailableSectoralScope = _w[1];
11885
- var _x = useState([]), selectableSectoralScope = _x[0], setSelectableSectoralScope = _x[1];
11886
- var _y = useState([]), availableSectar = _y[0], setAvailableSectar = _y[1];
11868
+ var _e = useState(false), loading = _e[0], setLoading = _e[1];
11869
+ var _f = useState(false), loadingList = _f[0], setLoadingList = _f[1];
11870
+ var _g = useState(), ndcScopeChanged = _g[0], setNdcScopeChanged = _g[1];
11871
+ var _h = useState(), ndcScopeValue = _h[0], setNdcScopeValue = _h[1];
11872
+ var _j = useState(), stepOneData = _j[0], setStepOneData = _j[1];
11873
+ var _k = useState(0), current = _k[0], setCurrent = _k[1];
11874
+ var _l = useState(false), isUpdate = _l[0]; _l[1];
11875
+ var _m = useState(), includedInNDC = _m[0], setIncludedInNDC = _m[1];
11876
+ var _o = useState([]), countries = _o[0], setCountries = _o[1];
11877
+ var _p = useState([]), organisationsList = _p[0], setOrganisationList = _p[1];
11878
+ var _q = useState(""), userOrgTaxId = _q[0], setUserOrgTaxId = _q[1];
11879
+ var _r = useState([]), regionsList = _r[0], setRegionsList = _r[1];
11880
+ var _s = useState(); _s[0]; var setProgrammeDetailsObj = _s[1];
11881
+ var _t = useState(), selectedOrgs = _t[0], setSelectedOrgs = _t[1];
11882
+ var _u = useState(false), ownershipPercentageValidation = _u[0], setOwnershipPercentageValidation = _u[1];
11883
+ var _v = useState(""), selectedSector = _v[0], setSelectedSector = _v[1];
11884
+ var _w = useState([]); _w[0]; var setMinistrySectoralScope = _w[1];
11885
+ var _x = useState([]), availableSecoralScope = _x[0], setAvailableSectoralScope = _x[1];
11886
+ var _y = useState([]), selectableSectoralScope = _y[0], setSelectableSectoralScope = _y[1];
11887
+ var _z = useState([]), availableSectar = _z[0], setAvailableSectar = _z[1];
11887
11888
  var initialOrganisationOwnershipValues = [
11888
11889
  {
11889
11890
  organisation: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) !== CompanyRole.GOVERNMENT &&
@@ -12171,6 +12172,7 @@ var ProgrammeCreationComponent = function (props) {
12171
12172
  ndcScope: (values === null || values === void 0 ? void 0 : values.ndcScope) === "true" ? true : false,
12172
12173
  })), (includedInNDC !== undefined &&
12173
12174
  includedInNDC !== null && { includedInNdc: includedInNDC })),
12175
+ environmentalAssessmentRegistrationNo: values === null || values === void 0 ? void 0 : values.environmentalAssessmentRegistrationNo
12174
12176
  };
12175
12177
  if ((logoBase64 === null || logoBase64 === void 0 ? void 0 : logoBase64.length) > 0) {
12176
12178
  programmeDetails.designDocument = logoBase64;
@@ -12544,7 +12546,27 @@ var ProgrammeCreationComponent = function (props) {
12544
12546
  }),
12545
12547
  React.createElement(Form.Item, null,
12546
12548
  React.createElement(Button, { type: "dashed", onClick: function () { return add(); }, icon: React.createElement(PlusOutlined, null) }))));
12547
- }))),
12549
+ }),
12550
+ React.createElement(Form.Item, { label: t("addProgramme:environmentalAssessmentRegistrationNo"), name: "environmentalAssessmentRegistrationNo", initialValue: (_c = state === null || state === void 0 ? void 0 : state.record) === null || _c === void 0 ? void 0 : _c.environmentalAssessmentRegistrationNo, rules: [
12551
+ {
12552
+ required: true,
12553
+ message: "",
12554
+ },
12555
+ {
12556
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
12557
+ return __generator(this, function (_a) {
12558
+ if (String(value).trim() === "" ||
12559
+ String(value).trim() === undefined ||
12560
+ value === null ||
12561
+ value === undefined) {
12562
+ throw new Error("".concat(t("addProgramme:environmentalAssessmentRegistrationNo"), " ").concat(t("isRequired")));
12563
+ }
12564
+ return [2 /*return*/];
12565
+ });
12566
+ }); },
12567
+ },
12568
+ ] },
12569
+ React.createElement(Input, { size: "large" })))),
12548
12570
  React.createElement(Col, { xl: 12, md: 24 },
12549
12571
  React.createElement("div", { className: "details-part-two" },
12550
12572
  React.createElement(Form.Item, { label: t("addProgramme:externalId"), name: "externalId", rules: [
@@ -21784,7 +21806,7 @@ var RegistryDashboardComponent = function (props) {
21784
21806
  var _42 = useState(), programmeLocationsMapLayer = _42[0], setProgrammeLocationsMapLayer = _42[1];
21785
21807
  var _43 = useState([]), fileList = _43[0], setFileList = _43[1];
21786
21808
  var _44 = useState("-"), selectedFile = _44[0], setSelectedFile = _44[1];
21787
- var _45 = useState(" "), selectedurl = _45[0], setSelectedurl = _45[1];
21809
+ var _45 = useState(""), selectedurl = _45[0], setSelectedurl = _45[1];
21788
21810
  var mapType = process.env.REACT_APP_MAP_TYPE
21789
21811
  ? process.env.REACT_APP_MAP_TYPE
21790
21812
  : "None";
@@ -23264,10 +23286,13 @@ var RegistryDashboardComponent = function (props) {
23264
23286
  React.createElement(Space, null,
23265
23287
  selectedFile,
23266
23288
  React.createElement(CaretDownOutlined, null)))),
23267
- React.createElement(Button, { className: "annual-report-downloadbutton" },
23289
+ selectedurl.trim().length === 0 && (React.createElement(Button, { className: "annual-report-downloadbutton" },
23268
23290
  React.createElement(Space, null,
23269
- React.createElement("a", { href: selectedurl, target: "_blank", rel: "noopener noreferrer", download: true },
23270
- React.createElement(LinkOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))))),
23291
+ React.createElement(LinkOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))),
23292
+ selectedurl.trim().length > 0 && (React.createElement("a", { href: selectedurl, target: "_blank", rel: "noopener noreferrer", download: true },
23293
+ React.createElement(Button, { className: "annual-report-downloadbutton" },
23294
+ React.createElement(Space, null,
23295
+ React.createElement(LinkOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } }))))))),
23271
23296
  React.createElement("div", { className: "filter-container" },
23272
23297
  React.createElement("div", { className: "date-filter" },
23273
23298
  React.createElement(RangePicker, { ranges: {