@mseva/digit-ui-module-noc 1.0.79-dev.13 → 1.0.79-dev.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,12 +2,14 @@ import { SearchField, TextInput, CardLabelError, SubmitBar, Loader as Loader$2,
2
2
  import React, { Fragment, useMemo, useReducer, useCallback, useState, useEffect as useEffect$1, useRef } from 'react';
3
3
  import { Link, useLocation, useHistory, Switch, useParams, useRouteMatch } from 'react-router-dom';
4
4
  import { useTranslation } from 'react-i18next';
5
+ import CryptoJS from 'crypto-js';
5
6
  import { useFormContext, useForm, FormProvider, Controller, useFieldArray } from 'react-hook-form';
6
7
  import { useQueryClient } from 'react-query';
7
8
  import EXIF from 'exif-js';
8
9
  import { combineReducers } from 'redux';
9
10
  import { useDispatch, useSelector } from 'react-redux';
10
11
 
12
+ const SECRET_KEY = localStorage.getItem("token");
11
13
  const convertEpochToDate = dateEpoch => {
12
14
  if (dateEpoch) {
13
15
  const dateFromApi = new Date(dateEpoch);
@@ -304,18 +306,19 @@ const downloadPdfFromURL = async receiptUrl => {
304
306
  window.open(downloadUrl, "_blank");
305
307
  }
306
308
  };
307
- function encodeURIComponentCustom(str) {
308
- return str.split("").map(char => {
309
- const code = char.charCodeAt(0);
310
- if (code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || ["-", "_", ".", "~"].includes(char)) {
311
- return char;
312
- }
313
- return "%" + code.toString(16).toUpperCase();
314
- }).join("");
315
- }
316
- function decodeURIComponentCustom(str) {
317
- return str.replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
318
- }
309
+ const encodeURIComponentCustom = text => {
310
+ const encrypted = CryptoJS.AES.encrypt(text, SECRET_KEY).toString();
311
+ return encrypted.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
312
+ };
313
+ const decodeURIComponentCustom = cipherText => {
314
+ try {
315
+ const base64 = cipherText.replace(/-/g, "+").replace(/_/g, "/");
316
+ const bytes = CryptoJS.AES.decrypt(base64, SECRET_KEY);
317
+ return bytes.toString(CryptoJS.enc.Utf8);
318
+ } catch (e) {
319
+ return null;
320
+ }
321
+ };
319
322
 
320
323
  function listCacheClear() {
321
324
  this.__data__ = [];
@@ -7805,7 +7808,7 @@ const EmployeeApp = ({
7805
7808
  path: `${path}/inbox/application-overview/:nocid`,
7806
7809
  component: NOCEmployeeApplicationOverview
7807
7810
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
7808
- path: `${path}/search/application-overview/:id`,
7811
+ path: `${path}/search/application-overview/:nocid`,
7809
7812
  component: ApplicationOverview
7810
7813
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
7811
7814
  path: `${path}/inbox`,
@@ -13442,6 +13445,8 @@ const AssessmentHistory = ({
13442
13445
  }, "Cancel"), "\xA0\xA0\xA0\xA0\xA0\xA0\xA0 ")), index !== assessmentData.length - 1 && /*#__PURE__*/React.createElement("hr", null)))));
13443
13446
  };
13444
13447
 
13448
+ const SECRET_KEY$1 = localStorage.getItem("token");
13449
+
13445
13450
  const ApplicationHistory = ({
13446
13451
  applicationData
13447
13452
  }) => {
@@ -15575,8 +15580,9 @@ const ApplicationDetails = props => {
15575
15580
  const ApplicationOverview = () => {
15576
15581
  var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _nocDatils$2, _workflowDetails$data8, _workflowDetails$data9, _applicationDetails$a, _applicationDetails$a2, _applicationDetails$a3;
15577
15582
  const {
15578
- id
15583
+ nocid
15579
15584
  } = useParams();
15585
+ const id = decodeURIComponentCustom(nocid);
15580
15586
  const {
15581
15587
  t
15582
15588
  } = useTranslation();
@@ -15609,6 +15615,8 @@ const ApplicationOverview = () => {
15609
15615
  data: applicationDetails
15610
15616
  } = Digit.Hooks.noc.useNOCDetails(t, tenantId, {
15611
15617
  applicationNo: id
15618
+ }, {
15619
+ enabled: !!id
15612
15620
  });
15613
15621
  const {
15614
15622
  isLoading: updatingApplication,
@@ -21019,7 +21027,9 @@ const NOCEmployeeApplicationOverview = () => {
21019
21027
  refetch
21020
21028
  } = Digit.Hooks.noc.useNOCSearchApplication({
21021
21029
  applicationNo: id
21022
- }, tenantId);
21030
+ }, tenantId, {
21031
+ enabled: !!id
21032
+ });
21023
21033
  const loading = isLoading || getLoader;
21024
21034
  const applicationDetails = data === null || data === void 0 ? void 0 : data.resData;
21025
21035
  console.log("applicationDetails", applicationDetails);
@@ -21254,10 +21264,12 @@ const NOCEmployeeApplicationOverview = () => {
21254
21264
  });
21255
21265
  const application = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$N17 = applicationDetails.Noc) === null || _applicationDetails$N17 === void 0 ? void 0 : _applicationDetails$N17[0];
21256
21266
  const callbackUrl = `${window.location.origin}/digit-ui/employee/noc/esign/complete/${id}`;
21267
+ const authToken = localStorage.getItem('token');
21257
21268
  eSignCertificate({
21258
21269
  fileStoreId,
21259
21270
  tenantId,
21260
- callbackUrl
21271
+ callbackUrl,
21272
+ authToken
21261
21273
  }, {
21262
21274
  onSuccess: () => console.log("✅ eSign initiated successfully"),
21263
21275
  onError: error => {
@@ -22566,7 +22578,8 @@ const useInboxMobileCardsData = ({
22566
22578
  [t("NOC_APPLICATION_NUMBER")]: applicationId,
22567
22579
  [t("TL_COMMON_TABLE_COL_APP_DATE")]: format(new Date(date), 'dd/MM/yyyy'),
22568
22580
  [t("NOC_PRIMARY_OWNER_NAME_LABEL")]: t(owner),
22569
- [t("PT_COMMON_TABLE_COL_STATUS_LABEL")]: t(status)
22581
+ [t("PT_COMMON_TABLE_COL_STATUS_LABEL")]: t(status),
22582
+ "Generated ID": encodeURIComponentCustom(applicationId)
22570
22583
  }));
22571
22584
  const MobileSortFormValues = () => {
22572
22585
  const sortOrderOptions = [{
@@ -22599,7 +22612,7 @@ const useInboxMobileCardsData = ({
22599
22612
  return {
22600
22613
  data: dataForMobileInboxCards,
22601
22614
  linkPrefix: `${parentRoute}/inbox/application-overview/`,
22602
- serviceRequestIdKey: t("NOC_APPLICATION_NUMBER"),
22615
+ serviceRequestIdKey: "Generated ID",
22603
22616
  MobileSortFormValues
22604
22617
  };
22605
22618
  };
@@ -23047,7 +23060,7 @@ const App = () => {
23047
23060
  path: `${path}/my-application`,
23048
23061
  component: NOCCitizenMyApplications
23049
23062
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
23050
- path: `${path}/edit-application/:id`,
23063
+ path: `${path}/edit-application/:nocid`,
23051
23064
  component: NewNOCEditApplication
23052
23065
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
23053
23066
  path: `${path}/search/application-overview/:nocid`,
@@ -29352,8 +29365,9 @@ const updatedCreateEmployeeconfig$1 = createEmployeeConfig$1.map(item => {
29352
29365
  const EditApplication = () => {
29353
29366
  var _applicationDetails$N, _nocObject$nocDetails, _nocObject$nocDetails2, _nocObject$nocDetails3, _nocObject$nocDetails4, _nocObject$documents, _nocObject$nocDetails5, _nocObject$nocDetails6, _nocObject$nocDetails7, _nocObject$nocDetails8, _nocObject$nocDetails9, _nocObject$nocDetails0, _genderTypeData$commo, _genderTypeData$commo2, _genderTypeData$commo3, _zoneList$tenant, _zoneList$tenant$zone, _zoneList$tenant$zone2, _applicationDetails$N2;
29354
29367
  const {
29355
- id
29368
+ nocid
29356
29369
  } = useParams();
29370
+ const id = decodeURIComponentCustom(nocid);
29357
29371
  const history = useHistory();
29358
29372
  const {
29359
29373
  t
@@ -29374,7 +29388,9 @@ const EditApplication = () => {
29374
29388
  data
29375
29389
  } = Digit.Hooks.noc.useNOCSearchApplication({
29376
29390
  applicationNo: id
29377
- }, tenantId);
29391
+ }, tenantId, {
29392
+ enabled: !!id
29393
+ });
29378
29394
  const applicationDetails = data === null || data === void 0 ? void 0 : data.resData;
29379
29395
  console.log("applicationDetails here==>", applicationDetails);
29380
29396
  const nocObject = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$N = applicationDetails.Noc) === null || _applicationDetails$N === void 0 ? void 0 : _applicationDetails$N[0]) || {};
@@ -29718,7 +29734,7 @@ const MyApplications = ({
29718
29734
  label: t("TL_VIEW_DETAILS"),
29719
29735
  onSubmit: () => {
29720
29736
  var _application$Applicat0;
29721
- return history.push(`/digit-ui/citizen/noc/search/application-overview/${application === null || application === void 0 ? void 0 : (_application$Applicat0 = application.Applications) === null || _application$Applicat0 === void 0 ? void 0 : _application$Applicat0.applicationNo}`);
29737
+ return history.push(`/digit-ui/citizen/noc/search/application-overview/${encodeURIComponentCustom(application === null || application === void 0 ? void 0 : (_application$Applicat0 = application.Applications) === null || _application$Applicat0 === void 0 ? void 0 : _application$Applicat0.applicationNo)}`);
29722
29738
  }
29723
29739
  }));
29724
29740
  })) : /*#__PURE__*/React.createElement("div", {
@@ -29771,7 +29787,9 @@ const CitizenApplicationOverview = () => {
29771
29787
  refetch
29772
29788
  } = Digit.Hooks.noc.useNOCSearchApplication({
29773
29789
  applicationNo: id
29774
- }, tenantId);
29790
+ }, tenantId, {
29791
+ enabled: !!id
29792
+ });
29775
29793
  const applicationDetails = data === null || data === void 0 ? void 0 : data.resData;
29776
29794
  const [timeObj, setTimeObj] = useState(null);
29777
29795
  const [appDate, setAppDate] = useState(null);
@@ -30159,7 +30177,8 @@ const CitizenApplicationOverview = () => {
30159
30177
  Licenses: [action]
30160
30178
  };
30161
30179
  if ((action === null || action === void 0 ? void 0 : action.action) == "EDIT") {
30162
- history.push(`/digit-ui/citizen/noc/edit-application/${appNo}`);
30180
+ const encyptedID = encodeURIComponentCustom(appNo);
30181
+ history.push(`/digit-ui/citizen/noc/edit-application/${encyptedID}`);
30163
30182
  } else if ((action === null || action === void 0 ? void 0 : action.action) == "DRAFT") {
30164
30183
  setShowToast({
30165
30184
  key: "true",
@@ -30761,7 +30780,7 @@ const SearchApplicationMobileView$1 = ({
30761
30780
  data: propsMobileInboxCards,
30762
30781
  isTwoDynamicPrefix: false,
30763
30782
  linkPrefix: `/digit-ui/citizen/noc/search/application-overview/`,
30764
- serviceRequestIdKey: t("NOC_APPLICATION_NUMBER")
30783
+ serviceRequestIdKey: "Generated ID"
30765
30784
  }));
30766
30785
  };
30767
30786
 
@@ -30893,7 +30912,8 @@ const SearchApplication$1 = ({
30893
30912
  const propsMobileInboxCards = useMemo(() => data === null || data === void 0 ? void 0 : data.map(data => ({
30894
30913
  [t("NOC_APPLICATION_NUMBER")]: (data === null || data === void 0 ? void 0 : data.applicationNo) || "-",
30895
30914
  [t("TL_COMMON_TABLE_COL_APP_DATE")]: (data === null || data === void 0 ? void 0 : data.date) || "-",
30896
- [t("PT_COMMON_TABLE_COL_STATUS_LABEL")]: data !== null && data !== void 0 && data.applicationStatus ? t(`${data.applicationStatus}`) : "-"
30915
+ [t("PT_COMMON_TABLE_COL_STATUS_LABEL")]: data !== null && data !== void 0 && data.applicationStatus ? t(`${data.applicationStatus}`) : "-",
30916
+ "Generated ID": encodeURIComponentCustom(data === null || data === void 0 ? void 0 : data.applicationNo)
30897
30917
  })), [data]);
30898
30918
  if (isMobile) return /*#__PURE__*/React.createElement(FormProvider, methods, /*#__PURE__*/React.createElement(SearchApplicationMobileView$1, {
30899
30919
  SearchFormFieldsComponent: SearchFormFieldsComponent$1,