@mseva/digit-ui-module-challangeneration 1.0.21 → 1.0.22

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.
package/dist/index.js CHANGED
@@ -152,9 +152,6 @@ const ServiceCategory = _ref => {
152
152
  };
153
153
  Menu === null || Menu === void 0 ? void 0 : Menu.map((option, index) => {
154
154
  });
155
- if (isLoading) {
156
- return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
157
- }
158
155
  return /*#__PURE__*/React__default.createElement("div", {
159
156
  className: "status-container"
160
157
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -10006,6 +10003,7 @@ Loader.defaultProps = {
10006
10003
  };
10007
10004
 
10008
10005
  const MyChallanResult = _ref => {
10006
+ var _getChallanData$chall, _getChallanData$chall2, _getChallanData$chall3, _getChallanData$chall4;
10009
10007
  let {
10010
10008
  template,
10011
10009
  header,
@@ -10017,10 +10015,37 @@ const MyChallanResult = _ref => {
10017
10015
  const history = reactRouterDom.useHistory();
10018
10016
  const userInfo = Digit.UserService.getUser();
10019
10017
  const tenantId = localStorage.getItem("CITIZEN.CITY");
10018
+ const [filters, setFilters] = React.useState(null);
10020
10019
  const [loader, setLoader] = React.useState(false);
10021
10020
  const [getChallanData, setChallanData] = React.useState();
10022
- const fetchChallans = function (filters) {
10021
+ let filter = window.location.href.split("/").pop();
10022
+ let t1;
10023
+ let off;
10024
+ if (!isNaN(parseInt(filter))) {
10025
+ off = filter;
10026
+ t1 = parseInt(filter) + 50;
10027
+ } else {
10028
+ t1 = 4;
10029
+ }
10030
+ let initialFilters = !isNaN(parseInt(filter)) ? {
10031
+ limit: "50",
10032
+ sortOrder: "ASC",
10033
+ sortBy: "createdTime",
10034
+ offset: off,
10035
+ tenantId
10036
+ } : {
10037
+ limit: "10",
10038
+ sortOrder: "ASC",
10039
+ sortBy: "createdTime",
10040
+ offset: "0",
10041
+ tenantId
10042
+ };
10043
+ React.useEffect(() => {
10044
+ setFilters(initialFilters);
10045
+ }, [filter, tenantId]);
10046
+ const fetchChallans = function () {
10023
10047
  try {
10048
+ console.log("filters", filters);
10024
10049
  setLoader(true);
10025
10050
  const _temp = _catch(function () {
10026
10051
  return Promise.resolve(Digit.ChallanGenerationService.search({
@@ -10028,7 +10053,7 @@ const MyChallanResult = _ref => {
10028
10053
  filters
10029
10054
  })).then(function (responseData) {
10030
10055
  console.log("result", responseData);
10031
- setChallanData(responseData === null || responseData === void 0 ? void 0 : responseData.challans);
10056
+ setChallanData(responseData);
10032
10057
  setLoader(false);
10033
10058
  });
10034
10059
  }, function (error) {
@@ -10041,11 +10066,14 @@ const MyChallanResult = _ref => {
10041
10066
  }
10042
10067
  };
10043
10068
  React.useEffect(() => {
10044
- var _userInfo$info;
10045
- const filters = {};
10046
- filters.mobileNumber = userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$info = userInfo.info) === null || _userInfo$info === void 0 ? void 0 : _userInfo$info.mobileNumber;
10047
- fetchChallans(filters);
10048
- }, []);
10069
+ console.log("filters", filters);
10070
+ if (filters) fetchChallans();
10071
+ }, [filters]);
10072
+ const handleLoadMore = () => {
10073
+ setFilters(prev => _extends({}, prev, {
10074
+ limit: Number(prev.limit) + 5
10075
+ }));
10076
+ };
10049
10077
  const handleMakePayment = id => {
10050
10078
  history.push("/digit-ui/citizen/payment/collect/Challan_Generation/" + id + "/" + tenantId + "?tenantId=" + tenantId);
10051
10079
  };
@@ -10057,13 +10085,12 @@ const MyChallanResult = _ref => {
10057
10085
  style: {
10058
10086
  marginLeft: "8px"
10059
10087
  }
10060
- }, t(header), " (", getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.length, ")"), getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.map((bill, index) => {
10088
+ }, t(header), " (", getChallanData === null || getChallanData === void 0 ? void 0 : (_getChallanData$chall = getChallanData.challans) === null || _getChallanData$chall === void 0 ? void 0 : _getChallanData$chall.length, ")"), getChallanData === null || getChallanData === void 0 ? void 0 : (_getChallanData$chall2 = getChallanData.challans) === null || _getChallanData$chall2 === void 0 ? void 0 : _getChallanData$chall2.map((bill, index) => {
10061
10089
  var _bill$amount, _bill$amount$, _bill$feeWaiver, _bill$citizen;
10062
10090
  const checkAmount = Math.max((bill === null || bill === void 0 ? void 0 : (_bill$amount = bill.amount) === null || _bill$amount === void 0 ? void 0 : (_bill$amount$ = _bill$amount[0]) === null || _bill$amount$ === void 0 ? void 0 : _bill$amount$.amount) || 0, (bill === null || bill === void 0 ? void 0 : bill.challanAmount) || 0);
10063
10091
  const total = checkAmount != null ? checkAmount : 0;
10064
10092
  const waiver = (_bill$feeWaiver = bill === null || bill === void 0 ? void 0 : bill.feeWaiver) != null ? _bill$feeWaiver : 0;
10065
10093
  const finalAmount = total - waiver;
10066
- console.log("finalAmount", finalAmount);
10067
10094
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
10068
10095
  key: index
10069
10096
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.KeyNote, {
@@ -10091,7 +10118,24 @@ const MyChallanResult = _ref => {
10091
10118
  label: t("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),
10092
10119
  onSubmit: () => handleMakePayment(bill === null || bill === void 0 ? void 0 : bill.challanNo)
10093
10120
  })));
10094
- })), loader && /*#__PURE__*/React__default.createElement(Loader, {
10121
+ }), (getChallanData === null || getChallanData === void 0 ? void 0 : (_getChallanData$chall3 = getChallanData.challans) === null || _getChallanData$chall3 === void 0 ? void 0 : _getChallanData$chall3.length) === 0 && !loader && /*#__PURE__*/React__default.createElement("p", {
10122
+ style: {
10123
+ marginLeft: "16px",
10124
+ marginTop: "16px"
10125
+ }
10126
+ }, t("CHB_NO_APPLICATION_FOUND_MSG")), (getChallanData === null || getChallanData === void 0 ? void 0 : (_getChallanData$chall4 = getChallanData.challans) === null || _getChallanData$chall4 === void 0 ? void 0 : _getChallanData$chall4.length) !== 0 && (getChallanData === null || getChallanData === void 0 ? void 0 : getChallanData.totalCount) > t1 && /*#__PURE__*/React__default.createElement("div", {
10127
+ style: {
10128
+ marginLeft: "16px",
10129
+ marginTop: "16px"
10130
+ }
10131
+ }, /*#__PURE__*/React__default.createElement("span", {
10132
+ className: "link",
10133
+ style: {
10134
+ cursor: "pointer",
10135
+ color: "#007bff"
10136
+ },
10137
+ onClick: handleLoadMore
10138
+ }, t("CHB_LOAD_MORE_MSG")))), loader && /*#__PURE__*/React__default.createElement(Loader, {
10095
10139
  page: true
10096
10140
  }));
10097
10141
  };
@@ -12715,9 +12759,7 @@ const DesktopInbox = _ref => {
12715
12759
  }
12716
12760
  }];
12717
12761
  let result;
12718
- if (props.isLoading || props.isLoader) {
12719
- result = /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
12720
- } else if ((data === null || data === void 0 ? void 0 : data.length) === 0) {
12762
+ if ((data === null || data === void 0 ? void 0 : data.length) === 0) {
12721
12763
  result = /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
12722
12764
  style: {
12723
12765
  marginTop: 20
@@ -13319,6 +13361,8 @@ const Inbox = _ref => {
13319
13361
  filterComponent: filterComponent,
13320
13362
  isLoader: isLoader,
13321
13363
  statutes: data === null || data === void 0 ? void 0 : data.statuses
13364
+ }), hookLoading && /*#__PURE__*/React__default.createElement(Loader, {
13365
+ page: true
13322
13366
  }));
13323
13367
  }
13324
13368
  };
@@ -16285,7 +16329,13 @@ const ChallanStepperForm = () => {
16285
16329
  divider: true
16286
16330
  }, t("CREATE_CHALLAN")), /*#__PURE__*/React__default.createElement("form", {
16287
16331
  onSubmit: handleSubmit(onSubmit)
16288
- }, /*#__PURE__*/React__default.createElement("div", {
16332
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
16333
+ style: {
16334
+ fontWeight: "bold",
16335
+ paddingBottom: "30px",
16336
+ fontSize: "25px"
16337
+ }
16338
+ }, t("CHALLAN_OFFENDER_DETAILS")), /*#__PURE__*/React__default.createElement("div", {
16289
16339
  style: {
16290
16340
  width: "100%"
16291
16341
  }