@mseva/digit-ui-module-ndc 1.0.72-dev.1 → 1.0.72-dev.1.1

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.
@@ -1,9 +1,9 @@
1
- import { Card, Banner, ActionBar, SubmitBar as SubmitBar$1, PrivateRoute, BreadCrumb, AppContainer, Dropdown, UploadFile, Modal, FormComposer, Toast, Loader as Loader$1, LinkButton, CardSubHeader, StatusTable, Row, TextInput, CardLabel, FilterFormField, RadioButtons, Menu, EmployeeModuleCard, SearchField, CheckBox, ComplaintIcon, Header, InboxComposer, MobileNumber, CardLabelError, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, Table, CardHeader, LabelFieldPair, DeleteIcon, KeyNote } from '@mseva/digit-ui-react-components';
1
+ import { Card, Banner, ActionBar, SubmitBar as SubmitBar$1, PrivateRoute, BreadCrumb, AppContainer, Dropdown, UploadFile, Modal, FormComposer, Toast, Loader as Loader$1, LinkButton, CardSubHeader, StatusTable, Row, TextInput, CardLabel, FilterFormField, RadioButtons, Menu, EmployeeModuleCard, SearchField, ComplaintIcon, InboxComposer, FilterForm, Table, MobileNumber, CardLabelError, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, CardHeader, LabelFieldPair, DeleteIcon, Header, KeyNote } from '@mseva/digit-ui-react-components';
2
2
  import React, { Fragment as Fragment$1, useState, useEffect, useMemo, useRef, useReducer, useCallback, forwardRef } from 'react';
3
3
  import { useHistory, useLocation, Switch, Route, useRouteMatch, useParams, Link } from 'react-router-dom';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { useDispatch, useSelector } from 'react-redux';
6
- import { useForm, Controller, useFormContext, FormProvider, useFieldArray } from 'react-hook-form';
6
+ import { useForm, Controller, useController, useFormContext, FormProvider, useFieldArray } from 'react-hook-form';
7
7
  import 'react-query';
8
8
  import { combineReducers } from 'redux';
9
9
 
@@ -2670,9 +2670,7 @@ const ApplicationOverview = () => {
2670
2670
  user = userInfo === null || userInfo === void 0 ? void 0 : userInfo.value;
2671
2671
  }
2672
2672
  const userRoles = (_user = user) === null || _user === void 0 ? void 0 : (_user$info = _user.info) === null || _user$info === void 0 ? void 0 : (_user$info$roles = _user$info.roles) === null || _user$info$roles === void 0 ? void 0 : _user$info$roles.map(e => e.code);
2673
- console.log('userRoles', userRoles);
2674
2673
  const isCemp = (_user2 = user) === null || _user2 === void 0 ? void 0 : (_user2$info = _user2.info) === null || _user2$info === void 0 ? void 0 : (_user2$info$roles$fin = _user2$info.roles.find(role => role.code === "CEMP")) === null || _user2$info$roles$fin === void 0 ? void 0 : _user2$info$roles$fin.code;
2675
- console.log('isCemp', isCemp);
2676
2674
  let actions = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data6 = workflowDetails.data) === null || _workflowDetails$data6 === void 0 ? void 0 : (_workflowDetails$data7 = _workflowDetails$data6.actionState) === null || _workflowDetails$data7 === void 0 ? void 0 : (_workflowDetails$data8 = _workflowDetails$data7.nextActions) === null || _workflowDetails$data8 === void 0 ? void 0 : _workflowDetails$data8.filter(e => {
2677
2675
  return (userRoles === null || userRoles === void 0 ? void 0 : userRoles.some(role => {
2678
2676
  var _e$roles;
@@ -3065,7 +3063,7 @@ const ApplicationOverview = () => {
3065
3063
  }) : /*#__PURE__*/React.createElement("div", null, t("TL_NO_DOCUMENTS_MSG")))), /*#__PURE__*/React.createElement(NewApplicationTimeline, {
3066
3064
  workflowDetails: workflowDetails,
3067
3065
  t: t
3068
- }), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A21 = applicationDetails.Applications) === null || _applicationDetails$A21 === void 0 ? void 0 : (_applicationDetails$A22 = _applicationDetails$A21[0]) === null || _applicationDetails$A22 === void 0 ? void 0 : _applicationDetails$A22.applicationStatus) !== "INITIATED" && actions && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data1 = workflowDetails.data) !== null && _workflowDetails$data1 !== void 0 && (_workflowDetails$data10 = _workflowDetails$data1.actionState) !== null && _workflowDetails$data10 !== void 0 && _workflowDetails$data10.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data11 = workflowDetails.data) !== null && _workflowDetails$data11 !== void 0 && _workflowDetails$data11.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
3066
+ }), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A21 = applicationDetails.Applications) === null || _applicationDetails$A21 === void 0 ? void 0 : (_applicationDetails$A22 = _applicationDetails$A21[0]) === null || _applicationDetails$A22 === void 0 ? void 0 : _applicationDetails$A22.applicationStatus) !== "INITIATED" && (actions === null || actions === void 0 ? void 0 : actions.length) > 0 && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data1 = workflowDetails.data) !== null && _workflowDetails$data1 !== void 0 && (_workflowDetails$data10 = _workflowDetails$data1.actionState) !== null && _workflowDetails$data10 !== void 0 && _workflowDetails$data10.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data11 = workflowDetails.data) !== null && _workflowDetails$data11 !== void 0 && _workflowDetails$data11.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
3069
3067
  localeKeyPrefix: `WF_EDITRENEWAL`,
3070
3068
  options: actions,
3071
3069
  optionKey: "action",
@@ -10810,7 +10808,7 @@ function _extends() {
10810
10808
  }, _extends.apply(null, arguments);
10811
10809
  }
10812
10810
 
10813
- const SearchFormFieldsComponents = ({
10811
+ const NewSearchFormFieldsComponent = ({
10814
10812
  registerRef,
10815
10813
  searchFormState,
10816
10814
  searchFieldComponents
@@ -10819,7 +10817,6 @@ const SearchFormFieldsComponents = ({
10819
10817
  t
10820
10818
  } = useTranslation();
10821
10819
  const isMobile = window.Digit.Utils.browser.isMobile();
10822
- console.log("searchFieldComponents", searchFieldComponents);
10823
10820
  if (!isMobile) {
10824
10821
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
10825
10822
  className: "search-container ndc-search-container-custom"
@@ -10837,7 +10834,7 @@ const SearchFormFieldsComponents = ({
10837
10834
  className: "search-action-wrapper ndc-search-action-wrapper"
10838
10835
  }, searchFieldComponents)))));
10839
10836
  }
10840
- return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
10837
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
10841
10838
  name: "applicationNo",
10842
10839
  inputRef: registerRef({})
10843
10840
  })), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("CORE_COMMON_PHONE_NUMBER")), /*#__PURE__*/React.createElement(TextInput, {
@@ -10846,7 +10843,7 @@ const SearchFormFieldsComponents = ({
10846
10843
  })));
10847
10844
  };
10848
10845
 
10849
- const FilterFormFieldsComponent = ({
10846
+ const NewFilterFormFieldsComponent = ({
10850
10847
  statuses,
10851
10848
  controlFilterForm,
10852
10849
  applicationTypesOfBPA,
@@ -10855,15 +10852,7 @@ const FilterFormFieldsComponent = ({
10855
10852
  const {
10856
10853
  t
10857
10854
  } = useTranslation();
10858
- const tenantId = Digit.ULBService.getStateId();
10859
- const [tlfilters, setTLFilters] = useState({
10860
- applicationStatus: []
10861
- });
10862
- useEffect(() => {
10863
- if (tlfilters) {
10864
- handleFilter(tlfilters);
10865
- }
10866
- }, [tlfilters]);
10855
+ const [showAllStatuses, setShowAllStatuses] = useState(false);
10867
10856
  const availableOptions = [{
10868
10857
  code: "ASSIGNED_TO_ME",
10869
10858
  name: `${t("ES_INBOX_ASSIGNED_TO_ME")}`
@@ -10875,43 +10864,128 @@ const FilterFormFieldsComponent = ({
10875
10864
  type.name = t(`WF_BPA_${type.code}`);
10876
10865
  type.i18nKey = t(`WF_BPA_${type.code}`);
10877
10866
  });
10878
- return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(FilterFormField, null, /*#__PURE__*/React.createElement(Controller, {
10867
+ const getVariantFromCode = code => {
10868
+ const value = String(code || "").toLowerCase();
10869
+ if (value.includes("approved")) return "success";
10870
+ if (value.includes("rejected")) return "danger";
10871
+ if (value.includes("pending")) return "warning";
10872
+ if (value.includes("inbox")) return "primary";
10873
+ if (value.includes("assigned")) return "primary";
10874
+ return "info";
10875
+ };
10876
+ const colorVariants = ["primary", "success", "warning", "danger", "info", "indigo", "teal", "pink", "amber", "slate"];
10877
+ const getVariantByIndex = (index, fallback) => colorVariants[index % colorVariants.length] || fallback;
10878
+ const {
10879
+ field: assigneeField
10880
+ } = useController({
10879
10881
  name: "assignee",
10880
- control: controlFilterForm,
10881
- render: props => /*#__PURE__*/React.createElement(RadioButtons, {
10882
- onSelect: e => {
10883
- props.onChange(e.code);
10884
- },
10885
- selectedOption: availableOptions.filter(option => option.code === props.value)[0],
10886
- optionsKey: "name",
10887
- options: availableOptions
10888
- })
10889
- })), /*#__PURE__*/React.createElement(FilterFormField, null, /*#__PURE__*/React.createElement(Controller, {
10882
+ control: controlFilterForm
10883
+ });
10884
+ const {
10885
+ field: statusField
10886
+ } = useController({
10890
10887
  name: "applicationStatus",
10891
10888
  control: controlFilterForm,
10892
- defaultValue: [],
10893
- render: props => {
10894
- const toggleStatus = statusCode => {
10895
- console.log(statusCode, "statusCode");
10896
- if (props.value.includes(statusCode)) {
10897
- props.onChange(props.value.filter(code => code !== statusCode));
10889
+ defaultValue: []
10890
+ });
10891
+ const statusValues = Array.isArray(statusField.value) ? statusField.value : [];
10892
+ const toggleStatus = statusCode => {
10893
+ let newStatusValues;
10894
+ if (statusValues.includes(statusCode)) {
10895
+ newStatusValues = statusValues.filter(code => code !== statusCode);
10896
+ } else {
10897
+ newStatusValues = [...statusValues, statusCode];
10898
+ }
10899
+ statusField.onChange(newStatusValues);
10900
+ if (typeof handleFilter === "function") {
10901
+ handleFilter({
10902
+ applicationStatus: newStatusValues.map(code => ({
10903
+ code
10904
+ }))
10905
+ });
10906
+ }
10907
+ };
10908
+ const cards = [...availableOptions.map(option => ({
10909
+ key: option.code,
10910
+ type: "assignee",
10911
+ label: option.name,
10912
+ subtitle: t("ES_INBOX_ASSIGNED"),
10913
+ count: null,
10914
+ code: option.code,
10915
+ icon: "⌂"
10916
+ })), ...(statuses || []).map(status => ({
10917
+ key: status.applicationstatus,
10918
+ type: "status",
10919
+ label: t(status.applicationstatus),
10920
+ subtitle: null,
10921
+ count: status.totalCount ?? status.count ?? status.noOfRecords ?? status.totalRecords ?? status.applicationCount ?? 0,
10922
+ code: status.applicationstatus,
10923
+ icon: "◎"
10924
+ }))];
10925
+ const visibleCards = showAllStatuses ? cards : cards.slice(0, 6);
10926
+ return /*#__PURE__*/React.createElement("div", {
10927
+ className: "ndc-new-inbox-filter-card",
10928
+ style: {
10929
+ marginTop: 16,
10930
+ marginBottom: 16
10931
+ }
10932
+ }, /*#__PURE__*/React.createElement(FilterFormField, null, /*#__PURE__*/React.createElement("div", {
10933
+ className: "ndc-new-filter-status-wrapper"
10934
+ }, /*#__PURE__*/React.createElement("div", {
10935
+ className: "ndc-new-filter-status-grid ndc-new-filter-card-grid"
10936
+ }, visibleCards.map((card, index) => {
10937
+ const isActive = card.type === "assignee" ? assigneeField.value === card.code : statusValues.includes(card.code);
10938
+ const variant = getVariantByIndex(index, getVariantFromCode(card.code));
10939
+ return /*#__PURE__*/React.createElement("button", {
10940
+ key: card.key,
10941
+ type: "button",
10942
+ className: `ndc-new-filter-status-card ndc-new-filter-option-card ndc-new-filter-card ${variant} ${isActive ? "active" : ""}`,
10943
+ onClick: () => {
10944
+ if (card.type === "assignee") {
10945
+ assigneeField.onChange(card.code);
10946
+ if (typeof handleFilter === "function") {
10947
+ handleFilter({
10948
+ assignee: card.code,
10949
+ applicationStatus: statusValues.map(code => ({
10950
+ code
10951
+ }))
10952
+ });
10953
+ }
10898
10954
  } else {
10899
- props.onChange([...props.value, statusCode]);
10900
- }
10901
- };
10902
- return /*#__PURE__*/React.createElement(Fragment$1, null, statuses === null || statuses === void 0 ? void 0 : statuses.map((status, index) => /*#__PURE__*/React.createElement(CheckBox, {
10903
- key: status.applicationstatus,
10904
- label: `${t(status.applicationstatus)} - ${status.count}`,
10905
- value: status.applicationstatus,
10906
- checked: props.value.includes(status.applicationstatus),
10907
- onChange: () => toggleStatus(status.applicationstatus),
10908
- index: index
10909
- })));
10955
+ toggleStatus(card.code);
10956
+ }
10957
+ }
10958
+ }, isActive ? /*#__PURE__*/React.createElement("span", {
10959
+ className: "ndc-new-filter-card-check",
10960
+ "aria-hidden": "true"
10961
+ }, "\u2713") : null, /*#__PURE__*/React.createElement("div", {
10962
+ className: "ndc-new-filter-status-title ndc-new-filter-option-title"
10963
+ }, card.label), card.subtitle ? /*#__PURE__*/React.createElement("div", {
10964
+ className: "ndc-new-filter-option-subtitle"
10965
+ }, card.subtitle) : /*#__PURE__*/React.createElement("div", {
10966
+ className: "ndc-new-filter-status-count"
10967
+ }, card.count !== null && card.count !== undefined ? card.count : ""), /*#__PURE__*/React.createElement("span", {
10968
+ className: "ndc-new-filter-card-icon",
10969
+ "aria-hidden": "true"
10970
+ }, /*#__PURE__*/React.createElement("span", null, card.icon)));
10971
+ })), cards.length > 6 ? /*#__PURE__*/React.createElement("div", {
10972
+ style: {
10973
+ display: "flex",
10974
+ justifyContent: "center",
10975
+ marginTop: 8
10910
10976
  }
10911
- })));
10977
+ }, /*#__PURE__*/React.createElement("button", {
10978
+ type: "button",
10979
+ className: "ndc-new-filter-show-more",
10980
+ onClick: () => setShowAllStatuses(prev => !prev),
10981
+ "aria-label": showAllStatuses ? t("ES_COMMON_SHOW_LESS") : t("ES_COMMON_SHOW_MORE")
10982
+ }, /*#__PURE__*/React.createElement("span", {
10983
+ className: "ndc-new-filter-show-more-icon",
10984
+ "aria-hidden": "true"
10985
+ }, showAllStatuses ? "▲" : "▼"))) : null)));
10912
10986
  };
10913
10987
 
10914
- const useInboxTableConfig = ({
10988
+ const useNewInboxTableConfig = ({
10915
10989
  parentRoute,
10916
10990
  onPageSizeChange,
10917
10991
  formState,
@@ -10924,33 +10998,87 @@ const useInboxTableConfig = ({
10924
10998
  const {
10925
10999
  t
10926
11000
  } = useTranslation();
10927
- const GetCell = value => /*#__PURE__*/React.createElement("span", {
10928
- className: "cell-text styled-cell"
10929
- }, value);
11001
+ const getStatusClass = status => {
11002
+ const value = String(status || "").toLowerCase();
11003
+ if (value.includes("approved")) return "approved";
11004
+ if (value.includes("rejected")) return "rejected";
11005
+ if (value.includes("forward")) return "forwarded";
11006
+ if (value.includes("process")) return "in-progress";
11007
+ if (value.includes("pending")) return "pending";
11008
+ if (value.includes("new")) return "new";
11009
+ return "default";
11010
+ };
11011
+ const renderStatusIcon = statusClass => {
11012
+ switch (statusClass) {
11013
+ case "approved":
11014
+ return /*#__PURE__*/React.createElement("svg", {
11015
+ viewBox: "0 0 24 24",
11016
+ width: "14",
11017
+ height: "14",
11018
+ fill: "none",
11019
+ stroke: "currentColor",
11020
+ strokeWidth: "2"
11021
+ }, /*#__PURE__*/React.createElement("path", {
11022
+ d: "M20 6L9 17l-5-5"
11023
+ }));
11024
+ case "rejected":
11025
+ return /*#__PURE__*/React.createElement("svg", {
11026
+ viewBox: "0 0 24 24",
11027
+ width: "14",
11028
+ height: "14",
11029
+ fill: "none",
11030
+ stroke: "currentColor",
11031
+ strokeWidth: "2"
11032
+ }, /*#__PURE__*/React.createElement("path", {
11033
+ d: "M18 6L6 18"
11034
+ }), /*#__PURE__*/React.createElement("path", {
11035
+ d: "M6 6l12 12"
11036
+ }));
11037
+ case "forwarded":
11038
+ return /*#__PURE__*/React.createElement("svg", {
11039
+ viewBox: "0 0 24 24",
11040
+ width: "14",
11041
+ height: "14",
11042
+ fill: "none",
11043
+ stroke: "currentColor",
11044
+ strokeWidth: "2"
11045
+ }, /*#__PURE__*/React.createElement("path", {
11046
+ d: "M5 12h14"
11047
+ }), /*#__PURE__*/React.createElement("path", {
11048
+ d: "M13 5l7 7-7 7"
11049
+ }));
11050
+ default:
11051
+ return null;
11052
+ }
11053
+ };
10930
11054
  const tableColumnConfig = useMemo(() => {
10931
11055
  return [{
10932
11056
  Header: t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL"),
10933
- accessor: "uuid",
11057
+ accessor: "applicationId",
10934
11058
  disableSortBy: true,
11059
+ className: "ndc-new-table-app",
10935
11060
  Cell: ({
10936
11061
  row
10937
11062
  }) => {
10938
- var _row$original, _row$original2;
10939
- console.log("row", row);
10940
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Link, {
10941
- to: `${parentRoute}/inbox/application-overview/${(_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.applicationId}`
10942
- }, /*#__PURE__*/React.createElement("span", {
10943
- className: "link"
10944
- }, (_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.applicationId)));
11063
+ var _row$original, _row$original2, _row$original3, _row$original4, _row$original5;
11064
+ return /*#__PURE__*/React.createElement("div", {
11065
+ className: "ndc-new-cell-stack"
11066
+ }, /*#__PURE__*/React.createElement(Link, {
11067
+ to: `${parentRoute}/inbox/application-overview/${(_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.applicationId}`,
11068
+ className: "ndc-new-app-link"
11069
+ }, ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.applicationId) || ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.applicationNo) || "-"), (_row$original4 = row.original) !== null && _row$original4 !== void 0 && _row$original4.locality ? /*#__PURE__*/React.createElement("div", {
11070
+ className: "ndc-new-cell-secondary"
11071
+ }, (_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.locality) : null);
10945
11072
  }
10946
11073
  }, {
10947
11074
  Header: t("TL_COMMON_TABLE_COL_APP_DATE"),
10948
- accessor: "createdtime",
11075
+ accessor: "date",
10949
11076
  Cell: ({
10950
11077
  row
10951
11078
  }) => {
10952
- var _row$original3, _row$original4;
10953
- return (_row$original3 = row.original) !== null && _row$original3 !== void 0 && _row$original3.date ? GetCell(format(new Date((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.date), "dd/MM/yyyy")) : "";
11079
+ var _row$original6, _row$original7;
11080
+ const dateValue = ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.date) || ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.createdTime);
11081
+ return dateValue ? format(new Date(dateValue), "dd/MM/yyyy") : "-";
10954
11082
  }
10955
11083
  }, {
10956
11084
  Header: t("PT_COMMON_TABLE_COL_STATUS_LABEL"),
@@ -10958,18 +11086,56 @@ const useInboxTableConfig = ({
10958
11086
  Cell: ({
10959
11087
  row
10960
11088
  }) => {
10961
- var _row$original5;
10962
- return t((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.status);
11089
+ var _row$original8, _row$original9;
11090
+ const statusValue = ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.status) || ((_row$original9 = row.original) === null || _row$original9 === void 0 ? void 0 : _row$original9.applicationStatus) || "-";
11091
+ const statusClass = getStatusClass(statusValue);
11092
+ return /*#__PURE__*/React.createElement("span", {
11093
+ className: `ndc-new-status-pill ${statusClass}`
11094
+ }, renderStatusIcon(statusClass), /*#__PURE__*/React.createElement("span", null, String(statusValue || "-").toLowerCase()));
11095
+ }
11096
+ }, {
11097
+ Header: t("CS_COMMON_ACTION"),
11098
+ accessor: "action",
11099
+ disableSortBy: true,
11100
+ className: "ndc-new-table-action",
11101
+ Cell: ({
11102
+ row
11103
+ }) => {
11104
+ var _row$original0;
11105
+ return /*#__PURE__*/React.createElement("span", {
11106
+ className: "ndc-new-action-group"
11107
+ }, /*#__PURE__*/React.createElement(Link, {
11108
+ to: `${parentRoute}/inbox/application-overview/${(_row$original0 = row.original) === null || _row$original0 === void 0 ? void 0 : _row$original0.applicationId}`,
11109
+ className: "ndc-new-icon ndc-new-icon-link",
11110
+ "aria-label": t("ES_COMMON_VIEW")
11111
+ }, /*#__PURE__*/React.createElement("svg", {
11112
+ viewBox: "0 0 24 24",
11113
+ width: "18",
11114
+ height: "18",
11115
+ fill: "none",
11116
+ stroke: "currentColor",
11117
+ strokeWidth: "2"
11118
+ }, /*#__PURE__*/React.createElement("path", {
11119
+ d: "M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"
11120
+ }), /*#__PURE__*/React.createElement("circle", {
11121
+ cx: "12",
11122
+ cy: "12",
11123
+ r: "3"
11124
+ }))));
10963
11125
  }
10964
11126
  }];
10965
- });
11127
+ }, [parentRoute, t]);
10966
11128
  return {
10967
- getCellProps: cellInfo => {
11129
+ getCellProps: () => ({
11130
+ style: {
11131
+ padding: "16px 20px",
11132
+ fontSize: "14px"
11133
+ }
11134
+ }),
11135
+ getRowProps: row => {
11136
+ var _row$original1, _row$original10;
10968
11137
  return {
10969
- style: {
10970
- padding: "20px 18px",
10971
- fontSize: "16px"
10972
- }
11138
+ className: `ndc-new-row ${getStatusClass((row === null || row === void 0 ? void 0 : (_row$original1 = row.original) === null || _row$original1 === void 0 ? void 0 : _row$original1.status) || (row === null || row === void 0 ? void 0 : (_row$original10 = row.original) === null || _row$original10 === void 0 ? void 0 : _row$original10.applicationStatus))}`
10973
11139
  };
10974
11140
  },
10975
11141
  disableSort: false,
@@ -11024,7 +11190,7 @@ const useInboxTableConfig = ({
11024
11190
  };
11025
11191
  };
11026
11192
 
11027
- const useInboxMobileCardsData = ({
11193
+ const useNewInboxMobileCardsData = ({
11028
11194
  parentRoute,
11029
11195
  table
11030
11196
  }) => {
@@ -11074,33 +11240,37 @@ const useInboxMobileCardsData = ({
11074
11240
  };
11075
11241
  };
11076
11242
 
11077
- const Inbox = ({
11078
- parentRoute
11243
+ const NewNDCInbox = ({
11244
+ parentRoute,
11245
+ tableColumns
11079
11246
  }) => {
11247
+ var _formState$filterForm3, _formState$filterForm4, _formState$filterForm5, _formState$tableForm5, _formState$tableForm6, _formState$tableForm7, _formState$tableForm8, _formState$tableForm9, _formState$tableForm0, _formState$tableForm1;
11080
11248
  const {
11081
11249
  t
11082
11250
  } = useTranslation();
11083
11251
  const tenantId = window.localStorage.getItem("Employee.tenant-id");
11084
- const [getFilter, setFilter] = useState();
11085
- const searchFormDefaultValues = {};
11086
- const filterFormDefaultValues = {
11252
+ const [activeStatusTab, setActiveStatusTab] = useState("ALL");
11253
+ const [topBarSearch, setTopBarSearch] = useState("");
11254
+ const businessServices = useMemo(() => businessServiceList(true) || [], []);
11255
+ const searchFormDefaultValues = useMemo(() => ({}), []);
11256
+ const filterFormDefaultValues = useMemo(() => ({
11087
11257
  moduleName: "ndc-services",
11088
11258
  applicationStatus: [],
11089
11259
  businessService: null,
11090
11260
  locality: [],
11091
11261
  assignee: "ASSIGNED_TO_ALL",
11092
- businessServiceArray: businessServiceList(true) || []
11093
- };
11094
- const tableOrderFormDefaultValues = {
11262
+ businessServiceArray: businessServices
11263
+ }), [businessServices]);
11264
+ const tableOrderFormDefaultValues = useMemo(() => ({
11095
11265
  sortBy: "",
11096
11266
  limit: window.Digit.Utils.browser.isMobile() ? 50 : 10,
11097
11267
  offset: 0,
11098
11268
  sortOrder: "DESC"
11099
- };
11269
+ }), []);
11100
11270
  function formReducer(state, payload) {
11101
11271
  switch (payload.action) {
11102
11272
  case "mutateSearchForm":
11103
- Digit.SessionStorage.set("NDC.INBOX", {
11273
+ Digit.SessionStorage.set("NDC.NEW_INBOX", {
11104
11274
  ...state,
11105
11275
  searchForm: payload.data
11106
11276
  });
@@ -11109,7 +11279,7 @@ const Inbox = ({
11109
11279
  searchForm: payload.data
11110
11280
  };
11111
11281
  case "mutateFilterForm":
11112
- Digit.SessionStorage.set("NDC.INBOX", {
11282
+ Digit.SessionStorage.set("NDC.NEW_INBOX", {
11113
11283
  ...state,
11114
11284
  filterForm: payload.data
11115
11285
  });
@@ -11118,7 +11288,7 @@ const Inbox = ({
11118
11288
  filterForm: payload.data
11119
11289
  };
11120
11290
  case "mutateTableForm":
11121
- Digit.SessionStorage.set("NDC.INBOX", {
11291
+ Digit.SessionStorage.set("NDC.NEW_INBOX", {
11122
11292
  ...state,
11123
11293
  tableForm: payload.data
11124
11294
  });
@@ -11128,7 +11298,7 @@ const Inbox = ({
11128
11298
  };
11129
11299
  }
11130
11300
  }
11131
- const InboxObjectInSessionStorage = Digit.SessionStorage.get("NDC.INBOX");
11301
+ const InboxObjectInSessionStorage = Digit.SessionStorage.get("NDC.NEW_INBOX");
11132
11302
  const onSearchFormReset = setSearchFormValue => {
11133
11303
  setSearchFormValue("sourceRefId", null);
11134
11304
  setSearchFormValue("applicationNo", null);
@@ -11139,8 +11309,8 @@ const Inbox = ({
11139
11309
  });
11140
11310
  };
11141
11311
  const onFilterFormReset = setFilterFormValue => {
11142
- setFilterFormValue("moduleName", "bpa-services");
11143
- setFilterFormValue("applicationStatus", "");
11312
+ setFilterFormValue("moduleName", "ndc-services");
11313
+ setFilterFormValue("applicationStatus", []);
11144
11314
  setFilterFormValue("locality", []);
11145
11315
  setFilterFormValue("assignee", "ASSIGNED_TO_ALL");
11146
11316
  setFilterFormValue("applicationType", []);
@@ -11173,6 +11343,26 @@ const Inbox = ({
11173
11343
  }
11174
11344
  });
11175
11345
  };
11346
+ const onNextPage = () => {
11347
+ var _formState$tableForm, _formState$tableForm2;
11348
+ return dispatch({
11349
+ action: "mutateTableForm",
11350
+ data: {
11351
+ ...formState.tableForm,
11352
+ offset: parseInt((_formState$tableForm = formState.tableForm) === null || _formState$tableForm === void 0 ? void 0 : _formState$tableForm.offset) + parseInt((_formState$tableForm2 = formState.tableForm) === null || _formState$tableForm2 === void 0 ? void 0 : _formState$tableForm2.limit)
11353
+ }
11354
+ });
11355
+ };
11356
+ const onPrevPage = () => {
11357
+ var _formState$tableForm3, _formState$tableForm4;
11358
+ return dispatch({
11359
+ action: "mutateTableForm",
11360
+ data: {
11361
+ ...formState.tableForm,
11362
+ offset: parseInt((_formState$tableForm3 = formState.tableForm) === null || _formState$tableForm3 === void 0 ? void 0 : _formState$tableForm3.offset) - parseInt((_formState$tableForm4 = formState.tableForm) === null || _formState$tableForm4 === void 0 ? void 0 : _formState$tableForm4.limit)
11363
+ }
11364
+ });
11365
+ };
11176
11366
  const onSortingByData = e => {
11177
11367
  if (e.length > 0) {
11178
11368
  const [{
@@ -11209,17 +11399,54 @@ const Inbox = ({
11209
11399
  data: localitiesForEmployeesCurrentTenant,
11210
11400
  isLoading: loadingLocalitiesForEmployeesCurrentTenant
11211
11401
  } = Digit.Hooks.useBoundaryLocalities(tenantId, "revenue", {}, t);
11212
- const handleFilter = filterStatus => {
11213
- setFilter(filterStatus);
11214
- };
11402
+ const {
11403
+ register: registerFilterFormField,
11404
+ control: controlFilterForm,
11405
+ handleSubmit: handleFilterFormSubmit,
11406
+ setValue: setFilterFormValue,
11407
+ getValues: getFilterFormValue,
11408
+ reset: resetFilterForm
11409
+ } = useForm({
11410
+ defaultValues: {
11411
+ ...filterFormDefaultValues
11412
+ }
11413
+ });
11414
+ const handleFilter = useCallback(filterData => {
11415
+ var _filterData$applicati, _formState$filterForm, _formState$filterForm2;
11416
+ if (filterData.applicationStatus) {
11417
+ setFilterFormValue("applicationStatus", filterData.applicationStatus.map(item => item.code || item));
11418
+ }
11419
+ if (filterData.assignee) {
11420
+ setFilterFormValue("assignee", filterData.assignee);
11421
+ }
11422
+ dispatch({
11423
+ action: "mutateFilterForm",
11424
+ data: {
11425
+ ...(formState === null || formState === void 0 ? void 0 : formState.filterForm),
11426
+ applicationStatus: ((_filterData$applicati = filterData.applicationStatus) === null || _filterData$applicati === void 0 ? void 0 : _filterData$applicati.map(item => item.code || item)) || (formState === null || formState === void 0 ? void 0 : (_formState$filterForm = formState.filterForm) === null || _formState$filterForm === void 0 ? void 0 : _formState$filterForm.applicationStatus) || [],
11427
+ assignee: filterData.assignee || (formState === null || formState === void 0 ? void 0 : (_formState$filterForm2 = formState.filterForm) === null || _formState$filterForm2 === void 0 ? void 0 : _formState$filterForm2.assignee) || "ASSIGNED_TO_ALL"
11428
+ }
11429
+ });
11430
+ }, [formState === null || formState === void 0 ? void 0 : formState.filterForm, setFilterFormValue]);
11431
+ const prevFilterRef = useRef("");
11432
+ const searchDebounceRef = useRef(null);
11433
+ const hasInitializedFilterForm = useRef(false);
11434
+ useEffect(() => {
11435
+ if (formState !== null && formState !== void 0 && formState.filterForm) {
11436
+ setFilterFormValue("assignee", formState.filterForm.assignee || "ASSIGNED_TO_ALL");
11437
+ setFilterFormValue("applicationStatus", formState.filterForm.applicationStatus || []);
11438
+ setFilterFormValue("moduleName", formState.filterForm.moduleName || "ndc-services");
11439
+ }
11440
+ }, [formState === null || formState === void 0 ? void 0 : (_formState$filterForm3 = formState.filterForm) === null || _formState$filterForm3 === void 0 ? void 0 : _formState$filterForm3.assignee, formState === null || formState === void 0 ? void 0 : (_formState$filterForm4 = formState.filterForm) === null || _formState$filterForm4 === void 0 ? void 0 : _formState$filterForm4.applicationStatus, formState === null || formState === void 0 ? void 0 : (_formState$filterForm5 = formState.filterForm) === null || _formState$filterForm5 === void 0 ? void 0 : _formState$filterForm5.moduleName, setFilterFormValue]);
11215
11441
  const {
11216
11442
  isLoading: isInboxLoading,
11217
11443
  data
11218
11444
  } = Digit.Hooks.ndc.useInbox({
11219
11445
  tenantId,
11220
11446
  filters: {
11221
- ...formState,
11222
- getFilter
11447
+ filterForm: (formState === null || formState === void 0 ? void 0 : formState.filterForm) || filterFormDefaultValues,
11448
+ searchForm: (formState === null || formState === void 0 ? void 0 : formState.searchForm) || searchFormDefaultValues,
11449
+ tableForm: (formState === null || formState === void 0 ? void 0 : formState.tableForm) || tableOrderFormDefaultValues
11223
11450
  }
11224
11451
  });
11225
11452
  const [table, setTable] = useState([]);
@@ -11245,7 +11472,7 @@ const Inbox = ({
11245
11472
  registerRef,
11246
11473
  searchFormState,
11247
11474
  searchFieldComponents
11248
- }) => /*#__PURE__*/React.createElement(SearchFormFieldsComponents, {
11475
+ }) => /*#__PURE__*/React.createElement(NewSearchFormFieldsComponent, {
11249
11476
  registerRef,
11250
11477
  searchFormState,
11251
11478
  searchFieldComponents
@@ -11255,7 +11482,7 @@ const Inbox = ({
11255
11482
  controlFilterForm,
11256
11483
  setFilterFormValue,
11257
11484
  getFilterFormValue
11258
- }) => /*#__PURE__*/React.createElement(FilterFormFieldsComponent, Object.assign({}, {
11485
+ }) => /*#__PURE__*/React.createElement(NewFilterFormFieldsComponent, Object.assign({}, {
11259
11486
  statuses,
11260
11487
  isInboxLoading,
11261
11488
  registerRef,
@@ -11308,7 +11535,7 @@ const Inbox = ({
11308
11535
  resetFilterFormDefaultValues: filterFormDefaultValues,
11309
11536
  onFilterFormReset
11310
11537
  };
11311
- const propsForInboxTable = useInboxTableConfig({
11538
+ const propsForInboxTable = useNewInboxTableConfig({
11312
11539
  ...{
11313
11540
  parentRoute,
11314
11541
  onPageSizeChange,
@@ -11319,7 +11546,7 @@ const Inbox = ({
11319
11546
  onSortingByData
11320
11547
  }
11321
11548
  });
11322
- const propsForInboxMobileCards = useInboxMobileCardsData({
11549
+ const propsForInboxMobileCards = useNewInboxMobileCardsData({
11323
11550
  parentRoute,
11324
11551
  table
11325
11552
  });
@@ -11328,18 +11555,689 @@ const Inbox = ({
11328
11555
  sortFormDefaultValues: formState === null || formState === void 0 ? void 0 : formState.tableForm,
11329
11556
  onSortFormReset
11330
11557
  };
11331
- return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Header, null, t("ES_COMMON_INBOX"), totalCount ? /*#__PURE__*/React.createElement("p", {
11332
- className: "inbox-count"
11558
+ const resolvedTableColumns = tableColumns || (propsForInboxTable === null || propsForInboxTable === void 0 ? void 0 : propsForInboxTable.columns);
11559
+ useEffect(() => {
11560
+ const serialized = JSON.stringify((formState === null || formState === void 0 ? void 0 : formState.filterForm) || {});
11561
+ if (prevFilterRef.current === serialized) return;
11562
+ prevFilterRef.current = serialized;
11563
+ }, [formState]);
11564
+ useEffect(() => {
11565
+ if (searchDebounceRef.current) clearTimeout(searchDebounceRef.current);
11566
+ searchDebounceRef.current = setTimeout(() => {
11567
+ const value = String(topBarSearch || "").trim();
11568
+ const nextSearchForm = value ? {
11569
+ applicationNo: value
11570
+ } : {};
11571
+ dispatch({
11572
+ action: "mutateTableForm",
11573
+ data: {
11574
+ ...tableOrderFormDefaultValues
11575
+ }
11576
+ });
11577
+ dispatch({
11578
+ action: "mutateSearchForm",
11579
+ data: nextSearchForm
11580
+ });
11581
+ }, 400);
11582
+ return () => clearTimeout(searchDebounceRef.current);
11583
+ }, [topBarSearch, tableOrderFormDefaultValues]);
11584
+ const onResetFilterForm = () => {
11585
+ onFilterFormReset(setFilterFormValue);
11586
+ };
11587
+ const normalizeStatus = useCallback(value => String(value || "").replace(/[\s-_]+/g, "").toUpperCase(), []);
11588
+ const onStatusTabClick = useCallback((label, statusCode) => {
11589
+ setActiveStatusTab(statusCode || label);
11590
+ if (label === "CLEAR") {
11591
+ setTopBarSearch("");
11592
+ return;
11593
+ }
11594
+ if (label === "ALL") {
11595
+ setFilterFormValue("applicationStatus", [], {
11596
+ shouldDirty: true,
11597
+ shouldTouch: true
11598
+ });
11599
+ handleFilterFormSubmit(onFilterFormSubmit)();
11600
+ return;
11601
+ }
11602
+ const resolvedCode = statusCode || label;
11603
+ setFilterFormValue("applicationStatus", [resolvedCode], {
11604
+ shouldDirty: true,
11605
+ shouldTouch: true
11606
+ });
11607
+ handleFilterFormSubmit(onFilterFormSubmit)();
11608
+ }, [handleFilterFormSubmit, onFilterFormSubmit, setFilterFormValue]);
11609
+ useEffect(() => {
11610
+ if (hasInitializedFilterForm.current) return;
11611
+ if (resetFilterForm && formState) {
11612
+ resetFilterForm(formState === null || formState === void 0 ? void 0 : formState.filterForm);
11613
+ hasInitializedFilterForm.current = true;
11614
+ }
11615
+ }, [formState, resetFilterForm]);
11616
+ const isMobile = window.Digit.Utils.browser.isMobile();
11617
+ if (isMobile) {
11618
+ return /*#__PURE__*/React.createElement("div", {
11619
+ className: "ndc-new-inbox"
11620
+ }, /*#__PURE__*/React.createElement(InboxComposer, _extends({
11621
+ isInboxLoading,
11622
+ PropsForInboxLinks
11623
+ }, propsForSearchForm, propsForFilterForm, propsForMobileSortForm, {
11624
+ propsForInboxTable,
11625
+ propsForInboxMobileCards,
11626
+ formState
11627
+ })));
11628
+ }
11629
+ return /*#__PURE__*/React.createElement("div", {
11630
+ className: "ndc-new-inbox"
11631
+ }, /*#__PURE__*/React.createElement("style", null, `
11632
+ .ndc-new-inbox {
11633
+ margin-top: 32px;
11634
+ padding: 20px;
11635
+ background: #f8fafc;
11636
+ border-radius: 12px;
11637
+ }
11638
+ .ndc-new-inbox .ndc-new-header {
11639
+ display: flex;
11640
+ align-items: center;
11641
+ gap: 10px;
11642
+ font-size: 24px;
11643
+ font-weight: 700;
11644
+ margin-bottom: 12px;
11645
+ }
11646
+ .ndc-new-inbox .ndc-new-count-pill {
11647
+ display: inline-flex;
11648
+ align-items: center;
11649
+ justify-content: center;
11650
+ min-width: 28px;
11651
+ height: 28px;
11652
+ padding: 0 8px;
11653
+ border-radius: 999px;
11654
+ background: #2563eb;
11655
+ color: #ffffff;
11656
+ font-size: 12px;
11657
+ font-weight: 700;
11658
+ }
11659
+
11660
+ .ndc-new-inbox .ndc-new-filter-card-grid {
11661
+ display: grid;
11662
+ grid-template-columns: repeat(6, 1fr);
11663
+ gap: 14px;
11664
+ }
11665
+ .ndc-new-inbox .ndc-new-filter-option-card {
11666
+ background: #f8fafc;
11667
+ border: 1px solid #e5e7eb;
11668
+ border-radius: 12px;
11669
+ padding: 16px;
11670
+ min-height: 88px;
11671
+ text-align: left;
11672
+ cursor: pointer;
11673
+ transition: all 0.2s ease;
11674
+ position: relative;
11675
+ overflow: hidden;
11676
+ }
11677
+ .ndc-new-inbox .ndc-new-filter-option-card.active {
11678
+ background: #e0f2fe;
11679
+ border-color: #38bdf8;
11680
+ box-shadow: 0 4px 12px rgba(2, 132, 199, 0.18);
11681
+ }
11682
+ .ndc-new-inbox .ndc-new-filter-option-title {
11683
+ font-weight: 700;
11684
+ font-size: 14px;
11685
+ }
11686
+ .ndc-new-inbox .ndc-new-filter-option-subtitle {
11687
+ font-size: 12px;
11688
+ margin-top: 6px;
11689
+ color: white;
11690
+ }
11691
+ .ndc-new-inbox .ndc-new-filter-status-grid {
11692
+ display: grid;
11693
+ grid-template-columns: repeat(6, 1fr);
11694
+ gap: 14px;
11695
+ }
11696
+ .ndc-new-inbox .ndc-new-filter-status-card {
11697
+ background: #ffffff;
11698
+ border: 1px solid #e5e7eb;
11699
+ border-radius: 12px;
11700
+ padding: 16px;
11701
+ min-height: 88px;
11702
+ text-align: left;
11703
+ cursor: pointer;
11704
+ transition: all 0.2s ease;
11705
+ width: 100%;
11706
+ box-sizing: border-box;
11707
+ position: relative;
11708
+ overflow: hidden;
11709
+ }
11710
+ .ndc-new-inbox .ndc-new-filter-status-card.active {
11711
+ background: #e0f2fe;
11712
+ border-color: #38bdf8;
11713
+ box-shadow: 0 4px 12px rgba(2, 132, 199, 0.18);
11714
+ }
11715
+ .ndc-new-inbox .ndc-new-filter-status-title {
11716
+ font-weight: 700;
11717
+ font-size: 14px;
11718
+ }
11719
+ .ndc-new-inbox .ndc-new-filter-status-count {
11720
+ font-size: 22px;
11721
+ font-weight: 700;
11722
+ margin-top: 8px;
11723
+ color: inherit;
11724
+ }
11725
+ .ndc-new-inbox .ndc-new-filter-card-icon {
11726
+ position: absolute;
11727
+ top: 12px;
11728
+ right: 12px;
11729
+ width: 36px;
11730
+ height: 36px;
11731
+ border-radius: 999px;
11732
+ background: rgba(255, 255, 255, 0.2);
11733
+ display: inline-flex;
11734
+ align-items: center;
11735
+ justify-content: center;
11736
+ color: #ffffff;
11737
+ font-size: 16px;
11738
+ }
11739
+ .ndc-new-inbox .ndc-new-filter-card-check {
11740
+ position: absolute;
11741
+ top: 10px;
11742
+ left: 12px;
11743
+ width: 22px;
11744
+ height: 22px;
11745
+ border-radius: 999px;
11746
+ display: inline-flex;
11747
+ align-items: center;
11748
+ justify-content: center;
11749
+ font-size: 12px;
11750
+ font-weight: 700;
11751
+ background: rgba(255, 255, 255, 0.9);
11752
+ color: #111827;
11753
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
11754
+ }
11755
+ .ndc-new-inbox .ndc-new-filter-card {
11756
+ color: #ffffff;
11757
+ border-color: transparent;
11758
+ }
11759
+ .ndc-new-inbox .ndc-new-filter-card.primary {
11760
+ background: #2563eb;
11761
+ }
11762
+ .ndc-new-inbox .ndc-new-filter-card.success {
11763
+ background: #16a34a;
11764
+ }
11765
+ .ndc-new-inbox .ndc-new-filter-card.warning {
11766
+ background: #ea580c;
11767
+ }
11768
+ .ndc-new-inbox .ndc-new-filter-card.info {
11769
+ background: #7c3aed;
11770
+ }
11771
+ .ndc-new-inbox .ndc-new-filter-card.danger {
11772
+ background: #dc2626;
11773
+ }
11774
+ .ndc-new-inbox .ndc-new-filter-card.indigo {
11775
+ background: #4f46e5;
11776
+ }
11777
+ .ndc-new-inbox .ndc-new-filter-card.teal {
11778
+ background: #0f766e;
11779
+ }
11780
+ .ndc-new-inbox .ndc-new-filter-card.pink {
11781
+ background: #db2777;
11782
+ }
11783
+ .ndc-new-inbox .ndc-new-filter-card.amber {
11784
+ background: #d97706;
11785
+ }
11786
+ .ndc-new-inbox .ndc-new-filter-card.slate {
11787
+ background: #475569;
11788
+ }
11789
+ .ndc-new-inbox .ndc-new-filter-card.active {
11790
+ box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
11791
+ transform: translateY(-1px);
11792
+ }
11793
+ .ndc-new-inbox .ndc-new-filter-show-more {
11794
+ margin-top: 12px;
11795
+ cursor: pointer;
11796
+ font-weight: 600;
11797
+ font-size: 12px;
11798
+ color: #2563eb;
11799
+ display: inline-flex;
11800
+ align-items: center;
11801
+ gap: 6px;
11802
+ transition: all 0.2s ease;
11803
+ }
11804
+ .ndc-new-inbox .ndc-new-filter-show-more-icon {
11805
+ width: 28px;
11806
+ height: 28px;
11807
+ border-radius: 999px;
11808
+ display: inline-flex;
11809
+ align-items: center;
11810
+ justify-content: center;
11811
+ font-size: 12px;
11812
+ color: #457fff;
11813
+ background: #eff6ff;
11814
+ }
11815
+ .ndc-new-inbox .ndc-new-filter-show-more:hover {
11816
+ background: #eff6ff;
11817
+ border-color: #bfdbfe;
11818
+ }
11819
+ .ndc-new-inbox .ndc-new-layout {
11820
+ display: block;
11821
+ }
11822
+ .ndc-new-inbox .filter-card .heading {
11823
+ display: none;
11824
+ }
11825
+ .ndc-new-inbox .filter-card .submit-bar,
11826
+ .ndc-new-inbox .filter-card button[type="submit"] {
11827
+ display: none;
11828
+ }
11829
+ .ndc-new-inbox .ndc-new-top-filters {
11830
+ margin: 12px 0 16px;
11831
+ background: #ffffff;
11832
+ border: 1px solid #e2e8f0;
11833
+ border-radius: 16px;
11834
+ padding: 18px;
11835
+ box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
11836
+ }
11837
+ .ndc-new-inbox .ndc-new-inbox-filter-card {
11838
+ margin: 0;
11839
+ }
11840
+ .ndc-new-inbox .ndc-new-filter-card-grid {
11841
+ grid-template-columns: repeat(6, 1fr);
11842
+ }
11843
+ .ndc-new-inbox .ndc-new-filter-status-grid {
11844
+ grid-template-columns: repeat(6, 1fr);
11845
+ }
11846
+ @media (max-width: 1400px) {
11847
+ .ndc-new-inbox .ndc-new-filter-card-grid,
11848
+ .ndc-new-inbox .ndc-new-filter-status-grid {
11849
+ grid-template-columns: repeat(4, minmax(140px, 1fr));
11850
+ }
11851
+ }
11852
+ @media (max-width: 1100px) {
11853
+ .ndc-new-inbox .ndc-new-filter-card-grid,
11854
+ .ndc-new-inbox .ndc-new-filter-status-grid {
11855
+ grid-template-columns: repeat(3, minmax(140px, 1fr));
11856
+ }
11857
+ }
11858
+ @media (max-width: 900px) {
11859
+ .ndc-new-inbox .ndc-new-filter-card-grid,
11860
+ .ndc-new-inbox .ndc-new-filter-status-grid {
11861
+ grid-template-columns: repeat(2, minmax(140px, 1fr));
11862
+ }
11863
+ }
11864
+ @media (max-width: 640px) {
11865
+ .ndc-new-inbox .ndc-new-filter-card-grid,
11866
+ .ndc-new-inbox .ndc-new-filter-status-grid {
11867
+ grid-template-columns: 1fr;
11868
+ }
11869
+ }
11870
+ .ndc-new-inbox .ndc-new-table-card {
11871
+ margin-top: 16px;
11872
+ background: #ffffff;
11873
+ border: 1px solid #e2e8f0;
11874
+ border-radius: 16px;
11875
+ box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
11876
+ overflow: hidden;
11877
+ }
11878
+ .ndc-new-inbox .ndc-new-table-topbar {
11879
+ display: flex;
11880
+ align-items: center;
11881
+ justify-content: space-between;
11882
+ gap: 16px;
11883
+ padding: 16px;
11884
+ border-radius: 16px;
11885
+ border: 1px solid #e2e8f0;
11886
+ background: #ffffff;
11887
+ box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
11888
+ }
11889
+ .ndc-new-inbox .ndc-new-tabs {
11890
+ display: flex;
11891
+ gap: 8px;
11892
+ flex-wrap: nowrap;
11893
+ overflow-x: auto;
11894
+ max-width: calc(100% - 280px);
11895
+ padding-bottom: 4px;
11896
+ scrollbar-width: none;
11897
+ }
11898
+ .ndc-new-inbox .ndc-new-tabs::-webkit-scrollbar {
11899
+ width: 0;
11900
+ height: 0;
11901
+ }
11902
+ .ndc-new-inbox .ndc-new-tab {
11903
+ padding: 6px 10px;
11904
+ border-radius: 999px;
11905
+ border: 1px solid #e5e7eb;
11906
+ background: #f8fafc;
11907
+ font-weight: 600;
11908
+ font-size: 11px;
11909
+ cursor: pointer;
11910
+ white-space: nowrap;
11911
+ }
11912
+ .ndc-new-inbox .ndc-new-tab.active {
11913
+ background: #2563eb;
11914
+ color: #ffffff;
11915
+ border-color: #2563eb;
11916
+ box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
11917
+ }
11918
+ .ndc-new-inbox .ndc-new-search {
11919
+ display: flex;
11920
+ align-items: center;
11921
+ gap: 8px;
11922
+ padding: 10px 14px;
11923
+ border: 1px solid #e2e8f0;
11924
+ border-radius: 10px;
11925
+ min-width: 260px;
11926
+ background: #f8fafc;
11927
+ color: #6b7280;
11928
+ font-size: 12px;
11929
+ }
11930
+ .ndc-new-inbox .ndc-new-search input {
11931
+ border: none;
11932
+ outline: none;
11933
+ background: transparent;
11934
+ width: 100%;
11935
+ font-size: 12px;
11936
+ color: #111827;
11937
+ }
11938
+ .ndc-new-inbox .ndc-new-table-header {
11939
+ padding: 18px 20px;
11940
+ font-size: 18px;
11941
+ font-weight: 700;
11942
+ border-bottom: 1px solid #e2e8f0;
11943
+ }
11944
+ .ndc-new-inbox .ndc-new-table-wrapper {
11945
+ display: block;
11946
+ overflow-x: auto;
11947
+ }
11948
+ .ndc-new-inbox .ndc-new-table {
11949
+ width: 100%;
11950
+ border-collapse: collapse;
11951
+ }
11952
+ .ndc-new-inbox .ndc-new-table th {
11953
+ text-align: left;
11954
+ font-size: 12px;
11955
+ letter-spacing: 0.08em;
11956
+ color: #6b7280;
11957
+ padding: 14px 20px;
11958
+ background: #f8fafc;
11959
+ border-bottom: 1px solid #e2e8f0;
11960
+ }
11961
+ .ndc-new-inbox .ndc-new-table td {
11962
+ padding: 16px 20px;
11963
+ border-bottom: 1px solid #eef2f7;
11964
+ font-size: 14px;
11965
+ color: #334155;
11966
+ }
11967
+ .ndc-new-inbox .ndc-new-cell-stack {
11968
+ display: flex;
11969
+ flex-direction: column;
11970
+ gap: 4px;
11971
+ }
11972
+ .ndc-new-inbox .ndc-new-cell-primary {
11973
+ font-weight: 600;
11974
+ color: #111827;
11975
+ }
11976
+ .ndc-new-inbox .ndc-new-cell-secondary {
11977
+ font-size: 12px;
11978
+ color: #64748b;
11979
+ }
11980
+ .ndc-new-inbox .ndc-new-row.pending {
11981
+ background: #fff7ed;
11982
+ }
11983
+ .ndc-new-inbox .ndc-new-row.rejected {
11984
+ background: #fef2f2;
11985
+ }
11986
+ .ndc-new-inbox .ndc-new-row.approved {
11987
+ background: #f0fdf4;
11988
+ }
11989
+ .ndc-new-inbox .ndc-new-table-app {
11990
+ font-weight: 600;
11991
+ color: #111827;
11992
+ }
11993
+ .ndc-new-inbox .ndc-new-table-action {
11994
+ text-align: left;
11995
+ white-space: nowrap;
11996
+ }
11997
+ .ndc-new-inbox .ndc-new-status-pill {
11998
+ display: inline-flex;
11999
+ align-items: center;
12000
+ gap: 6px;
12001
+ padding: 4px 10px;
12002
+ border-radius: 999px;
12003
+ font-size: 12px;
12004
+ font-weight: 600;
12005
+ background: #e2e8f0;
12006
+ color: #111827;
12007
+ border: 1px solid transparent;
12008
+ }
12009
+ .ndc-new-inbox .ndc-new-status-pill.approved {
12010
+ background: #f0fdf4;
12011
+ color: #15803d;
12012
+ border-color: #86efac;
12013
+ }
12014
+ .ndc-new-inbox .ndc-new-status-pill.rejected {
12015
+ background: #fef2f2;
12016
+ color: #b91c1c;
12017
+ border-color: #fecaca;
12018
+ }
12019
+ .ndc-new-inbox .ndc-new-status-pill.forwarded {
12020
+ background: #eff6ff;
12021
+ color: #1d4ed8;
12022
+ border-color: #bfdbfe;
12023
+ }
12024
+ .ndc-new-inbox .ndc-new-status-pill.in-progress {
12025
+ background: #dbeafe;
12026
+ color: #1d4ed8;
12027
+ }
12028
+ .ndc-new-inbox .ndc-new-status-pill.pending {
12029
+ background: #ffedd5;
12030
+ color: #c2410c;
12031
+ }
12032
+ .ndc-new-inbox .ndc-new-status-pill.new {
12033
+ background: #f3f4f6;
12034
+ color: #111827;
12035
+ }
12036
+ .ndc-new-inbox .ndc-new-icon {
12037
+ display: inline-flex;
12038
+ align-items: center;
12039
+ justify-content: center;
12040
+ width: 28px;
12041
+ height: 28px;
12042
+ margin-left: 8px;
12043
+ border-radius: 50%;
12044
+ border: 1px solid #e5e7eb;
12045
+ color: #94a3b8;
12046
+ }
12047
+ .ndc-new-inbox .ndc-new-action-group {
12048
+ display: inline-flex;
12049
+ align-items: center;
12050
+ gap: 8px;
12051
+ }
12052
+ .ndc-new-inbox .ndc-new-icon-link {
12053
+ text-decoration: none;
12054
+ }
12055
+ .ndc-new-inbox .ndc-new-app-link {
12056
+ color: #2563eb;
12057
+ text-decoration: none;
12058
+ }
12059
+ .ndc-new-inbox .ndc-new-app-link:hover {
12060
+ text-decoration: underline;
12061
+ }
12062
+ .ndc-new-inbox .ndc-new-pagination {
12063
+ display: flex;
12064
+ align-items: center;
12065
+ justify-content: flex-end;
12066
+ gap: 12px;
12067
+ padding: 12px 20px 18px;
12068
+ border-top: 1px solid #eef2f7;
12069
+ font-size: 12px;
12070
+ color: #6b7280;
12071
+ }
12072
+ .ndc-new-inbox .ndc-new-pagination button {
12073
+ border: 1px solid #e5e7eb;
12074
+ background: #ffffff;
12075
+ border-radius: 8px;
12076
+ padding: 4px 8px;
12077
+ cursor: pointer;
12078
+ }
12079
+ .ndc-new-inbox .ndc-new-pagination button:disabled {
12080
+ opacity: 0.5;
12081
+ cursor: not-allowed;
12082
+ }
12083
+ .ndc-new-inbox .ndc-new-pagination select {
12084
+ border: 1px solid #e5e7eb;
12085
+ border-radius: 8px;
12086
+ padding: 4px 8px;
12087
+ background: #ffffff;
12088
+ }
12089
+ @media (max-width: 768px) {
12090
+ .ndc-new-inbox .ndc-new-top-filters {
12091
+ padding: 0;
12092
+ }
12093
+ .ndc-new-inbox .ndc-new-table-topbar {
12094
+ flex-wrap: wrap;
12095
+ }
12096
+ .ndc-new-inbox .ndc-new-tabs {
12097
+ max-width: 100%;
12098
+ overflow-x: visible;
12099
+ flex-wrap: wrap;
12100
+ }
12101
+ .ndc-new-inbox .ndc-new-search {
12102
+ width: 100%;
12103
+ min-width: 0;
12104
+ }
12105
+ .ndc-new-inbox .ndc-new-table-header {
12106
+ font-size: 16px;
12107
+ padding: 14px 16px;
12108
+ }
12109
+ .ndc-new-inbox .ndc-new-table th,
12110
+ .ndc-new-inbox .ndc-new-table td {
12111
+ padding: 12px 14px;
12112
+ font-size: 12px;
12113
+ }
12114
+ .ndc-new-inbox .ndc-new-status-pill {
12115
+ font-size: 11px;
12116
+ padding: 3px 8px;
12117
+ }
12118
+ }
12119
+ .ndc-new-inbox .ndc-new-tab-count {
12120
+ margin-left: 6px;
12121
+ padding: 2px 6px;
12122
+ border-radius: 999px;
12123
+ background: #e2e8f0;
12124
+ color: #475569;
12125
+ font-size: 11px;
12126
+ font-weight: 700;
12127
+ }
12128
+ .ndc-new-inbox .ndc-new-tab.active .ndc-new-tab-count {
12129
+ background: rgba(255, 255, 255, 0.2);
12130
+ color: #ffffff;
12131
+ }
12132
+ `), /*#__PURE__*/React.createElement("div", {
12133
+ className: "ndc-new-header"
12134
+ }, /*#__PURE__*/React.createElement("span", null, t("NDC Inbox")), totalCount ? /*#__PURE__*/React.createElement("span", {
12135
+ className: "ndc-new-count-pill"
11333
12136
  }, totalCount) : null), /*#__PURE__*/React.createElement("div", {
11334
- className: "NDCSection"
11335
- }, /*#__PURE__*/React.createElement(InboxComposer, _extends({
11336
- isInboxLoading,
11337
- PropsForInboxLinks
11338
- }, propsForSearchForm, propsForFilterForm, propsForMobileSortForm, {
11339
- propsForInboxTable,
11340
- propsForInboxMobileCards,
11341
- formState
11342
- }))));
12137
+ className: "ndc-new-layout"
12138
+ }, /*#__PURE__*/React.createElement("div", {
12139
+ className: "ndc-new-top-filters"
12140
+ }, /*#__PURE__*/React.createElement(FilterForm, {
12141
+ onSubmit: onFilterFormSubmit,
12142
+ handleSubmit: handleFilterFormSubmit,
12143
+ id: "filter-form",
12144
+ onResetFilterForm: onResetFilterForm
12145
+ }, /*#__PURE__*/React.createElement(NewFilterFormFieldsComponent, Object.assign({
12146
+ registerRef: registerFilterFormField
12147
+ }, {
12148
+ controlFilterForm,
12149
+ handleFilterFormSubmit,
12150
+ setFilterFormValue,
12151
+ getFilterFormValue,
12152
+ statuses
12153
+ }, {
12154
+ handleFilter: handleFilter
12155
+ })))), /*#__PURE__*/React.createElement("div", {
12156
+ className: "ndc-new-table-topbar"
12157
+ }, /*#__PURE__*/React.createElement("div", {
12158
+ className: "ndc-new-tabs"
12159
+ }, /*#__PURE__*/React.createElement("button", {
12160
+ type: "button",
12161
+ className: `ndc-new-tab ${activeStatusTab === "ALL" ? "active" : ""}`,
12162
+ onClick: () => onStatusTabClick("ALL")
12163
+ }, t("ALL"), /*#__PURE__*/React.createElement("span", {
12164
+ className: "ndc-new-tab-count"
12165
+ }, totalCount || 0)), (statuses || []).map(status => /*#__PURE__*/React.createElement("button", {
12166
+ key: status === null || status === void 0 ? void 0 : status.applicationstatus,
12167
+ type: "button",
12168
+ className: `ndc-new-tab ${activeStatusTab === (status === null || status === void 0 ? void 0 : status.applicationstatus) ? "active" : ""}`,
12169
+ onClick: () => onStatusTabClick(status === null || status === void 0 ? void 0 : status.applicationstatus, status === null || status === void 0 ? void 0 : status.applicationstatus)
12170
+ }, t(status === null || status === void 0 ? void 0 : status.applicationstatus), /*#__PURE__*/React.createElement("span", {
12171
+ className: "ndc-new-tab-count"
12172
+ }, (status === null || status === void 0 ? void 0 : status.count) ?? 0))), /*#__PURE__*/React.createElement("button", {
12173
+ type: "button",
12174
+ className: `ndc-new-tab ${activeStatusTab === "CLEAR" ? "active" : ""}`,
12175
+ onClick: () => onStatusTabClick("CLEAR")
12176
+ }, t("CLEAR"))), /*#__PURE__*/React.createElement("div", {
12177
+ className: "ndc-new-search"
12178
+ }, /*#__PURE__*/React.createElement("span", {
12179
+ "aria-hidden": "true"
12180
+ }, /*#__PURE__*/React.createElement("svg", {
12181
+ width: "16",
12182
+ height: "16",
12183
+ viewBox: "0 0 24 24",
12184
+ fill: "none",
12185
+ xmlns: "http://www.w3.org/2000/svg"
12186
+ }, /*#__PURE__*/React.createElement("circle", {
12187
+ cx: "11",
12188
+ cy: "11",
12189
+ r: "7",
12190
+ stroke: "#6B7280",
12191
+ strokeWidth: "2"
12192
+ }), /*#__PURE__*/React.createElement("line", {
12193
+ x1: "16.65",
12194
+ y1: "16.65",
12195
+ x2: "21",
12196
+ y2: "21",
12197
+ stroke: "#6B7280",
12198
+ strokeWidth: "2",
12199
+ strokeLinecap: "round"
12200
+ }))), /*#__PURE__*/React.createElement("input", {
12201
+ type: "text",
12202
+ value: topBarSearch,
12203
+ onChange: e => setTopBarSearch(e.target.value),
12204
+ placeholder: "Search by application no..."
12205
+ }))), isInboxLoading ? /*#__PURE__*/React.createElement(Loader$1, null) : (table === null || table === void 0 ? void 0 : table.length) < 1 ? /*#__PURE__*/React.createElement(Card, {
12206
+ className: "margin-unset text-align-center"
12207
+ }, t("CS_MYAPPLICATIONS_NO_APPLICATION")) : /*#__PURE__*/React.createElement("div", {
12208
+ className: "ndc-new-table-card"
12209
+ }, /*#__PURE__*/React.createElement("div", {
12210
+ className: "ndc-new-table-header"
12211
+ }, t("Assigned Applications")), /*#__PURE__*/React.createElement(Table, Object.assign({
12212
+ className: "ndc-new-table",
12213
+ customTableWrapperClassName: "ndc-new-table-wrapper",
12214
+ isPaginationRequired: false
12215
+ }, propsForInboxTable, {
12216
+ columns: resolvedTableColumns,
12217
+ getRowProps: propsForInboxTable === null || propsForInboxTable === void 0 ? void 0 : propsForInboxTable.getRowProps
12218
+ }))), totalCount > 0 ? /*#__PURE__*/React.createElement("div", {
12219
+ className: "ndc-new-pagination"
12220
+ }, t("CS_COMMON_ROWS_PER_PAGE"), ":", /*#__PURE__*/React.createElement("select", {
12221
+ value: (_formState$tableForm5 = formState.tableForm) === null || _formState$tableForm5 === void 0 ? void 0 : _formState$tableForm5.limit,
12222
+ onChange: onPageSizeChange
12223
+ }, [10, 20, 30, 40, 50].map(pageSize => /*#__PURE__*/React.createElement("option", {
12224
+ key: pageSize,
12225
+ value: pageSize
12226
+ }, pageSize))), /*#__PURE__*/React.createElement("span", null, ((_formState$tableForm6 = formState.tableForm) === null || _formState$tableForm6 === void 0 ? void 0 : _formState$tableForm6.offset) + 1, "-", Math.min(((_formState$tableForm7 = formState.tableForm) === null || _formState$tableForm7 === void 0 ? void 0 : _formState$tableForm7.offset) + ((_formState$tableForm8 = formState.tableForm) === null || _formState$tableForm8 === void 0 ? void 0 : _formState$tableForm8.limit), totalCount), " of ", totalCount), /*#__PURE__*/React.createElement("button", {
12227
+ onClick: onPrevPage,
12228
+ disabled: ((_formState$tableForm9 = formState.tableForm) === null || _formState$tableForm9 === void 0 ? void 0 : _formState$tableForm9.offset) <= 0
12229
+ }, "\u2039"), /*#__PURE__*/React.createElement("button", {
12230
+ onClick: onNextPage,
12231
+ disabled: ((_formState$tableForm0 = formState.tableForm) === null || _formState$tableForm0 === void 0 ? void 0 : _formState$tableForm0.offset) + ((_formState$tableForm1 = formState.tableForm) === null || _formState$tableForm1 === void 0 ? void 0 : _formState$tableForm1.limit) >= totalCount
12232
+ }, "\u203A")) : null));
12233
+ };
12234
+
12235
+ const Inbox = ({
12236
+ parentRoute
12237
+ }) => {
12238
+ return /*#__PURE__*/React.createElement(NewNDCInbox, {
12239
+ parentRoute: parentRoute
12240
+ });
11343
12241
  };
11344
12242
 
11345
12243
  const SearchFormFieldsComponent = props => {
@@ -12708,14 +13606,25 @@ function SelectNDCReason({
12708
13606
  }, [ndcReason]);
12709
13607
  useEffect(() => {
12710
13608
  if (apiDataCheck && (ndcReasonOptions === null || ndcReasonOptions === void 0 ? void 0 : ndcReasonOptions.length) > 0) {
13609
+ var _formData$NDCReason;
12711
13610
  console.log("check apiDataCheck", apiDataCheck);
12712
13611
  const matchedOption = ndcReasonOptions.find(opt => {
12713
13612
  var _apiDataCheck$;
12714
13613
  return (opt === null || opt === void 0 ? void 0 : opt.code) === (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$ = apiDataCheck[0]) === null || _apiDataCheck$ === void 0 ? void 0 : _apiDataCheck$.reason);
12715
13614
  });
12716
- if (matchedOption) {
12717
- setNDCReason(matchedOption);
12718
- setValue("NDCReason", matchedOption);
13615
+ if (matchedOption && (lodash.isEmpty(formData === null || formData === void 0 ? void 0 : formData.NDCReason) || !(formData !== null && formData !== void 0 && (_formData$NDCReason = formData.NDCReason) !== null && _formData$NDCReason !== void 0 && _formData$NDCReason.code))) {
13616
+ let updatedOption = {
13617
+ ...matchedOption
13618
+ };
13619
+ if (matchedOption.code === "OTHERS") {
13620
+ var _apiDataCheck$2, _apiDataCheck$2$NdcDe, _ptDetail$additionalD;
13621
+ const ptDetail = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$2 = apiDataCheck[0]) === null || _apiDataCheck$2 === void 0 ? void 0 : (_apiDataCheck$2$NdcDe = _apiDataCheck$2.NdcDetails) === null || _apiDataCheck$2$NdcDe === void 0 ? void 0 : _apiDataCheck$2$NdcDe.find(detail => detail.businessService === "PT");
13622
+ if (ptDetail !== null && ptDetail !== void 0 && (_ptDetail$additionalD = ptDetail.additionalDetails) !== null && _ptDetail$additionalD !== void 0 && _ptDetail$additionalD.reason) {
13623
+ updatedOption.reason = ptDetail.additionalDetails.reason;
13624
+ }
13625
+ }
13626
+ setNDCReason(updatedOption);
13627
+ setValue("NDCReason", updatedOption);
12719
13628
  }
12720
13629
  }
12721
13630
  }, [apiDataCheck, ndcReasonOptions]);
@@ -12779,7 +13688,7 @@ const PropertyDetailsForm$1 = ({
12779
13688
  formState,
12780
13689
  clearErrors
12781
13690
  }) => {
12782
- var _formData$cpt, _formData$cpt$details, _checkApiDataCheck$Ap, _formData$cpt4, _Digit, _Digit$ComponentRegis, _formData$cpt5, _apiDataCheck$7, _propertyDetails$wate, _propertyDetails$sewe, _formData$cpt6, _formData$cpt6$detail;
13691
+ var _formData$cpt, _formData$cpt$details, _checkApiDataCheck$Ap, _formData$cpt4, _Digit, _Digit$ComponentRegis, _formData$cpt5, _apiDataCheck$8, _propertyDetails$wate, _propertyDetails$sewe, _formData$cpt6, _formData$cpt6$detail;
12783
13692
  const {
12784
13693
  control,
12785
13694
  formState: localFormState,
@@ -12870,7 +13779,7 @@ const PropertyDetailsForm$1 = ({
12870
13779
  }
12871
13780
  }];
12872
13781
  useEffect(() => {
12873
- var _formData$cpt3, _formData$cpt3$detail, _ownerForName$map, _ownerForName$map$fil, _apiDataCheck$, _apiDataCheck$$owners, _apiDataCheck$$owners2, _formData$PropertyDet, _formData$PropertyDet2, _formData$PropertyDet3;
13782
+ var _formData$cpt3, _formData$cpt3$detail, _ownerForName$map, _ownerForName$map$fil, _apiDataCheck$, _apiDataCheck$$owners, _apiDataCheck$$owners2, _formData$PropertyDet, _formData$PropertyDet2, _formData$PropertyDet3, _apiDataCheck$2, _apiDataCheck$2$NdcDe, _ptDetail$additionalD, _formData$PropertyDet4;
12874
13783
  const ownerForName = (formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : (_formData$cpt3$detail = _formData$cpt3.details) === null || _formData$cpt3$detail === void 0 ? void 0 : _formData$cpt3$detail.owners) || [];
12875
13784
  const ownerNames = ownerForName === null || ownerForName === void 0 ? void 0 : (_ownerForName$map = ownerForName.map(owner => owner === null || owner === void 0 ? void 0 : owner.name)) === null || _ownerForName$map === void 0 ? void 0 : (_ownerForName$map$fil = _ownerForName$map.filter(Boolean)) === null || _ownerForName$map$fil === void 0 ? void 0 : _ownerForName$map$fil.join(", ");
12876
13785
  const ownerObj = selectedRow;
@@ -12891,6 +13800,10 @@ const PropertyDetailsForm$1 = ({
12891
13800
  isLoading: false,
12892
13801
  billData: (formData === null || formData === void 0 ? void 0 : (_formData$PropertyDet2 = formData.PropertyDetails) === null || _formData$PropertyDet2 === void 0 ? void 0 : (_formData$PropertyDet3 = _formData$PropertyDet2.propertyBillData) === null || _formData$PropertyDet3 === void 0 ? void 0 : _formData$PropertyDet3.billData) || {}
12893
13802
  };
13803
+ const ptDetail = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$2 = apiDataCheck[0]) === null || _apiDataCheck$2 === void 0 ? void 0 : (_apiDataCheck$2$NdcDe = _apiDataCheck$2.NdcDetails) === null || _apiDataCheck$2$NdcDe === void 0 ? void 0 : _apiDataCheck$2$NdcDe.find(detail => detail.businessService === "PT");
13804
+ if (ptDetail !== null && ptDetail !== void 0 && (_ptDetail$additionalD = ptDetail.additionalDetails) !== null && _ptDetail$additionalD !== void 0 && _ptDetail$additionalD.remarks && !(formData !== null && formData !== void 0 && (_formData$PropertyDet4 = formData.PropertyDetails) !== null && _formData$PropertyDet4 !== void 0 && _formData$PropertyDet4.remarks)) {
13805
+ combinedObject.remarks = ptDetail.additionalDetails.remarks;
13806
+ }
12894
13807
  setPropertyDetails(prev => {
12895
13808
  return {
12896
13809
  ...prev,
@@ -12899,11 +13812,11 @@ const PropertyDetailsForm$1 = ({
12899
13812
  });
12900
13813
  }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt4 = formData.cpt) === null || _formData$cpt4 === void 0 ? void 0 : _formData$cpt4.details, apiDataCheck, selectedRow]);
12901
13814
  useEffect(() => {
12902
- var _apiDataCheck$2;
13815
+ var _apiDataCheck$3;
12903
13816
  let waterConnection;
12904
- if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$2 = apiDataCheck[0]) !== null && _apiDataCheck$2 !== void 0 && _apiDataCheck$2.NdcDetails) {
12905
- var _apiDataCheck$3, _apiDataCheck$3$NdcDe;
12906
- const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$3 = apiDataCheck[0]) === null || _apiDataCheck$3 === void 0 ? void 0 : (_apiDataCheck$3$NdcDe = _apiDataCheck$3.NdcDetails) === null || _apiDataCheck$3$NdcDe === void 0 ? void 0 : _apiDataCheck$3$NdcDe.filter(item => {
13817
+ if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$3 = apiDataCheck[0]) !== null && _apiDataCheck$3 !== void 0 && _apiDataCheck$3.NdcDetails) {
13818
+ var _apiDataCheck$4, _apiDataCheck$4$NdcDe;
13819
+ const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$4 = apiDataCheck[0]) === null || _apiDataCheck$4 === void 0 ? void 0 : (_apiDataCheck$4$NdcDe = _apiDataCheck$4.NdcDetails) === null || _apiDataCheck$4$NdcDe === void 0 ? void 0 : _apiDataCheck$4$NdcDe.filter(item => {
12907
13820
  return item.businessService == "WS";
12908
13821
  });
12909
13822
  waterConnection = (resData === null || resData === void 0 ? void 0 : resData.map(item => ({
@@ -12928,11 +13841,11 @@ const PropertyDetailsForm$1 = ({
12928
13841
  }));
12929
13842
  }, [waterConnectionData, apiDataCheck]);
12930
13843
  useEffect(() => {
12931
- var _apiDataCheck$4;
13844
+ var _apiDataCheck$5;
12932
13845
  let sewerageConnection;
12933
- if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$4 = apiDataCheck[0]) !== null && _apiDataCheck$4 !== void 0 && _apiDataCheck$4.NdcDetails) {
12934
- var _apiDataCheck$5, _apiDataCheck$5$NdcDe;
12935
- const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$5 = apiDataCheck[0]) === null || _apiDataCheck$5 === void 0 ? void 0 : (_apiDataCheck$5$NdcDe = _apiDataCheck$5.NdcDetails) === null || _apiDataCheck$5$NdcDe === void 0 ? void 0 : _apiDataCheck$5$NdcDe.filter(item => {
13846
+ if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$5 = apiDataCheck[0]) !== null && _apiDataCheck$5 !== void 0 && _apiDataCheck$5.NdcDetails) {
13847
+ var _apiDataCheck$6, _apiDataCheck$6$NdcDe;
13848
+ const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$6 = apiDataCheck[0]) === null || _apiDataCheck$6 === void 0 ? void 0 : (_apiDataCheck$6$NdcDe = _apiDataCheck$6.NdcDetails) === null || _apiDataCheck$6$NdcDe === void 0 ? void 0 : _apiDataCheck$6$NdcDe.filter(item => {
12936
13849
  return item.businessService == "SW";
12937
13850
  });
12938
13851
  sewerageConnection = (resData === null || resData === void 0 ? void 0 : resData.map(item => ({
@@ -13216,8 +14129,8 @@ const PropertyDetailsForm$1 = ({
13216
14129
  useEffect(() => {
13217
14130
  var _checkApiDataCheck$Ap2;
13218
14131
  if (checkApiDataCheck !== null && checkApiDataCheck !== void 0 && (_checkApiDataCheck$Ap2 = checkApiDataCheck.Applications) !== null && _checkApiDataCheck$Ap2 !== void 0 && _checkApiDataCheck$Ap2[0] || apiDataCheck !== null && apiDataCheck !== void 0 && apiDataCheck[0]) {
13219
- var _checkApiDataCheck$Ap3, _checkApiDataCheck$Ap4, _apiDataCheck$6;
13220
- const checkOwners = (checkApiDataCheck === null || checkApiDataCheck === void 0 ? void 0 : (_checkApiDataCheck$Ap3 = checkApiDataCheck.Applications) === null || _checkApiDataCheck$Ap3 === void 0 ? void 0 : (_checkApiDataCheck$Ap4 = _checkApiDataCheck$Ap3[0]) === null || _checkApiDataCheck$Ap4 === void 0 ? void 0 : _checkApiDataCheck$Ap4.owners) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$6 = apiDataCheck[0]) === null || _apiDataCheck$6 === void 0 ? void 0 : _apiDataCheck$6.owners);
14132
+ var _checkApiDataCheck$Ap3, _checkApiDataCheck$Ap4, _apiDataCheck$7;
14133
+ const checkOwners = (checkApiDataCheck === null || checkApiDataCheck === void 0 ? void 0 : (_checkApiDataCheck$Ap3 = checkApiDataCheck.Applications) === null || _checkApiDataCheck$Ap3 === void 0 ? void 0 : (_checkApiDataCheck$Ap4 = _checkApiDataCheck$Ap3[0]) === null || _checkApiDataCheck$Ap4 === void 0 ? void 0 : _checkApiDataCheck$Ap4.owners) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$7 = apiDataCheck[0]) === null || _apiDataCheck$7 === void 0 ? void 0 : _apiDataCheck$7.owners);
13221
14134
  const filterRow = checkOwners === null || checkOwners === void 0 ? void 0 : checkOwners.find(owner => owner === null || owner === void 0 ? void 0 : owner.isPrimaryOwner);
13222
14135
  console.log("filterRow===", filterRow);
13223
14136
  setSelectedRow(filterRow);
@@ -13227,7 +14140,7 @@ const PropertyDetailsForm$1 = ({
13227
14140
  style: {
13228
14141
  marginBottom: "16px"
13229
14142
  }
13230
- }, ((formData === null || formData === void 0 ? void 0 : (_formData$cpt5 = formData.cpt) === null || _formData$cpt5 === void 0 ? void 0 : _formData$cpt5.details) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$7 = apiDataCheck[0]) === null || _apiDataCheck$7 === void 0 ? void 0 : _apiDataCheck$7.NdcDetails)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
14143
+ }, ((formData === null || formData === void 0 ? void 0 : (_formData$cpt5 = formData.cpt) === null || _formData$cpt5 === void 0 ? void 0 : _formData$cpt5.details) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$8 = apiDataCheck[0]) === null || _apiDataCheck$8 === void 0 ? void 0 : _apiDataCheck$8.NdcDetails)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
13231
14144
  style: {
13232
14145
  marginTop: "40px"
13233
14146
  }
@@ -13242,7 +14155,7 @@ const PropertyDetailsForm$1 = ({
13242
14155
  width: "100%"
13243
14156
  }
13244
14157
  }, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$wate = propertyDetails.waterConnection) === null || _propertyDetails$wate === void 0 ? void 0 : _propertyDetails$wate.map((item, index) => {
13245
- var _apiDataCheck$8, _item$billData, _item$billData2, _item$billData3, _item$billData4;
14158
+ var _apiDataCheck$9, _item$billData, _item$billData2, _item$billData3, _item$billData4;
13246
14159
  return /*#__PURE__*/React.createElement("div", {
13247
14160
  className: "ndc_property_search",
13248
14161
  key: index,
@@ -13283,7 +14196,7 @@ const PropertyDetailsForm$1 = ({
13283
14196
  alignItems: "center",
13284
14197
  gap: "12px"
13285
14198
  }
13286
- }, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$8 = apiDataCheck[0]) !== null && _apiDataCheck$8 !== void 0 && _apiDataCheck$8.NdcDetails) && (item === null || item === void 0 ? void 0 : item.connectionNo) && !(item !== null && item !== void 0 && (_item$billData = item.billData) !== null && _item$billData !== void 0 && _item$billData.id) && (item === null || item === void 0 ? void 0 : (_item$billData2 = item.billData) === null || _item$billData2 === void 0 ? void 0 : _item$billData2.totalAmount) != 0 && /*#__PURE__*/React.createElement("button", {
14199
+ }, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$9 = apiDataCheck[0]) !== null && _apiDataCheck$9 !== void 0 && _apiDataCheck$9.NdcDetails) && (item === null || item === void 0 ? void 0 : item.connectionNo) && !(item !== null && item !== void 0 && (_item$billData = item.billData) !== null && _item$billData !== void 0 && _item$billData.id) && (item === null || item === void 0 ? void 0 : (_item$billData2 = item.billData) === null || _item$billData2 === void 0 ? void 0 : _item$billData2.totalAmount) != 0 && /*#__PURE__*/React.createElement("button", {
13287
14200
  className: "submit-bar",
13288
14201
  type: "button",
13289
14202
  style: {
@@ -13350,7 +14263,7 @@ const PropertyDetailsForm$1 = ({
13350
14263
  width: "100%"
13351
14264
  }
13352
14265
  }, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$sewe = propertyDetails.sewerageConnection) === null || _propertyDetails$sewe === void 0 ? void 0 : _propertyDetails$sewe.map((item, index) => {
13353
- var _apiDataCheck$9, _item$billData5, _item$billData6, _item$billData7, _item$billData8;
14266
+ var _apiDataCheck$0, _item$billData5, _item$billData6, _item$billData7, _item$billData8;
13354
14267
  return /*#__PURE__*/React.createElement("div", {
13355
14268
  className: "ndc_property_search",
13356
14269
  key: index,
@@ -13391,7 +14304,7 @@ const PropertyDetailsForm$1 = ({
13391
14304
  alignItems: "center",
13392
14305
  gap: "12px"
13393
14306
  }
13394
- }, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$9 = apiDataCheck[0]) !== null && _apiDataCheck$9 !== void 0 && _apiDataCheck$9.NdcDetails) && (item === null || item === void 0 ? void 0 : item.connectionNo) && !(item !== null && item !== void 0 && (_item$billData5 = item.billData) !== null && _item$billData5 !== void 0 && _item$billData5.id) && (item === null || item === void 0 ? void 0 : (_item$billData6 = item.billData) === null || _item$billData6 === void 0 ? void 0 : _item$billData6.totalAmount) != 0 && /*#__PURE__*/React.createElement("button", {
14307
+ }, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$0 = apiDataCheck[0]) !== null && _apiDataCheck$0 !== void 0 && _apiDataCheck$0.NdcDetails) && (item === null || item === void 0 ? void 0 : item.connectionNo) && !(item !== null && item !== void 0 && (_item$billData5 = item.billData) !== null && _item$billData5 !== void 0 && _item$billData5.id) && (item === null || item === void 0 ? void 0 : (_item$billData6 = item.billData) === null || _item$billData6 === void 0 ? void 0 : _item$billData6.totalAmount) != 0 && /*#__PURE__*/React.createElement("button", {
13395
14308
  className: "submit-bar",
13396
14309
  type: "button",
13397
14310
  style: {
@@ -14621,7 +15534,7 @@ const PayWSBillModal = ({
14621
15534
  d: "M0 0h24v24H0V0z",
14622
15535
  fill: "none"
14623
15536
  }), /*#__PURE__*/React.createElement("path", {
14624
- d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 \r 17.59 19 19 17.59 13.41 12 19 6.41z"
15537
+ d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
14625
15538
  }));
14626
15539
  const CloseBtn = ({
14627
15540
  onClick
@@ -15241,7 +16154,7 @@ const NDCNewFormSummaryStepThreeEmployee = ({
15241
16154
  }
15242
16155
  };
15243
16156
  function mapToNDCPayload(inputData, actionStatus) {
15244
- var _Digit$UserService$ge, _ref, _inputData$apiData, _inputData$apiData$Ap, _inputData$apiData$Ap2, _formData$responseDat, _formData$apiData, _formData$apiData$App, _inputData$DocummentD, _inputData$DocummentD2;
16157
+ var _Digit$UserService$ge, _ref, _inputData$apiData, _inputData$apiData$Ap, _inputData$apiData$Ap2, _formData$responseDat, _formData$apiData, _formData$apiData$App, _baseApplication$NdcD, _formData$NDCDetails4, _formData$NDCDetails5, _inputData$DocummentD, _inputData$DocummentD2;
15245
16158
  const applicant = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
15246
16159
  console.log("checkFormData", formData);
15247
16160
  const owners = (_ref = (inputData === null || inputData === void 0 ? void 0 : (_inputData$apiData = inputData.apiData) === null || _inputData$apiData === void 0 ? void 0 : (_inputData$apiData$Ap = _inputData$apiData.Applications) === null || _inputData$apiData$Ap === void 0 ? void 0 : (_inputData$apiData$Ap2 = _inputData$apiData$Ap[0]) === null || _inputData$apiData$Ap2 === void 0 ? void 0 : _inputData$apiData$Ap2.owners) || []) === null || _ref === void 0 ? void 0 : _ref.map(({
@@ -15256,7 +16169,21 @@ const NDCNewFormSummaryStepThreeEmployee = ({
15256
16169
  action: actionStatus
15257
16170
  },
15258
16171
  owners: owners,
15259
- NdcDetails: baseApplication === null || baseApplication === void 0 ? void 0 : baseApplication.NdcDetails,
16172
+ NdcDetails: baseApplication === null || baseApplication === void 0 ? void 0 : (_baseApplication$NdcD = baseApplication.NdcDetails) === null || _baseApplication$NdcD === void 0 ? void 0 : _baseApplication$NdcD.map(detail => {
16173
+ if (detail.businessService === "PT") {
16174
+ var _formData$NDCDetails, _formData$NDCDetails$, _formData$NDCDetails2, _formData$NDCDetails3;
16175
+ return {
16176
+ ...detail,
16177
+ additionalDetails: {
16178
+ ...detail.additionalDetails,
16179
+ reason: formData === null || formData === void 0 ? void 0 : (_formData$NDCDetails = formData.NDCDetails) === null || _formData$NDCDetails === void 0 ? void 0 : (_formData$NDCDetails$ = _formData$NDCDetails.NDCReason) === null || _formData$NDCDetails$ === void 0 ? void 0 : _formData$NDCDetails$.reason,
16180
+ remarks: formData === null || formData === void 0 ? void 0 : (_formData$NDCDetails2 = formData.NDCDetails) === null || _formData$NDCDetails2 === void 0 ? void 0 : (_formData$NDCDetails3 = _formData$NDCDetails2.PropertyDetails) === null || _formData$NDCDetails3 === void 0 ? void 0 : _formData$NDCDetails3.remarks
16181
+ }
16182
+ };
16183
+ }
16184
+ return detail;
16185
+ }),
16186
+ reason: formData === null || formData === void 0 ? void 0 : (_formData$NDCDetails4 = formData.NDCDetails) === null || _formData$NDCDetails4 === void 0 ? void 0 : (_formData$NDCDetails5 = _formData$NDCDetails4.NDCReason) === null || _formData$NDCDetails5 === void 0 ? void 0 : _formData$NDCDetails5.code,
15260
16187
  Documents: []
15261
16188
  };
15262
16189
  ((inputData === null || inputData === void 0 ? void 0 : (_inputData$DocummentD = inputData.DocummentDetails) === null || _inputData$DocummentD === void 0 ? void 0 : (_inputData$DocummentD2 = _inputData$DocummentD.documents) === null || _inputData$DocummentD2 === void 0 ? void 0 : _inputData$DocummentD2.documents) || []).forEach(doc => {