@djb25/digit-ui-module-common 1.0.5 → 1.0.7

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,4 +1,4 @@
1
- import { Loader, Card, RadioButtons, MobileNumber, TextInput, CheckBox, CitizenConsentForm, SubmitBar, KeyNote, Header, Toast, CardSubHeader, CardLabel, CardSectionHeader, InfoBanner, Banner, CardText, StatusTable, Row, DownloadPrefixIcon, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, DatePicker, SearchIconSvg, CardLabelError, Dropdown, FormComposer, ActionBar, Menu } from '@djb25/digit-ui-react-components';
1
+ import { Loader, Card, RadioButtons, MobileNumber, TextInput, CheckBox, CitizenConsentForm, SubmitBar, KeyNote, Header, Toast, CardSubHeader, CardLabel, CardSectionHeader, InfoBanner, Banner, CardText, StatusTable, Row, DownloadPrefixIcon, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, DatePicker, LabelFieldPair, SearchIconSvg, CardLabelError, Dropdown, VerticalTimeline, FormComposer, ActionBar, Menu, LayoutWrapper } from '@djb25/digit-ui-react-components';
2
2
  import React, { useState, useEffect, useMemo, Fragment } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useHistory, useLocation, useParams, Link, useRouteMatch, Switch, Route } from 'react-router-dom';
@@ -2868,6 +2868,8 @@ const CitizenPayment = _ref => {
2868
2868
  moduleCode = _ref.moduleCode;
2869
2869
  const _useRouteMatch = useRouteMatch(),
2870
2870
  currentPath = _useRouteMatch.path;
2871
+ const _useLocation = useLocation(),
2872
+ routerState = _useLocation.state;
2871
2873
  const commonProps = {
2872
2874
  stateCode,
2873
2875
  cityCode,
@@ -2906,7 +2908,33 @@ const CitizenPayment = _ref => {
2906
2908
  show: pathname.includes("/failure")
2907
2909
  }];
2908
2910
  const getDynamicBreadcrumbs = () => {
2909
- return crumbs.filter(crumb => crumb.show);
2911
+ let activeCrumbs = crumbs.filter(crumb => crumb.show);
2912
+ const isWNS = pathname.includes("/WS") || pathname.includes("/SW") || window.location.search.includes("workflow=WNS");
2913
+ if (isWNS) {
2914
+ activeCrumbs.splice(1, 0, {
2915
+ path: "/digit-ui/citizen/ws-home",
2916
+ label: t("ES_TITLE_WATER_AND_SEWERAGE"),
2917
+ show: true
2918
+ });
2919
+ if (routerState !== null && routerState !== void 0 && routerState.fromMyApplications || routerState !== null && routerState !== void 0 && routerState.fromApplicationDetails) {
2920
+ activeCrumbs.splice(2, 0, {
2921
+ path: "/digit-ui/citizen/ws/my-applications",
2922
+ label: t("CS_HOME_MY_APPLICATIONS"),
2923
+ show: true
2924
+ });
2925
+ }
2926
+ if (routerState !== null && routerState !== void 0 && routerState.fromApplicationDetails) {
2927
+ activeCrumbs.splice(3, 0, {
2928
+ label: t("WS_APPLICATION_DETAILS_HEADER"),
2929
+ show: true,
2930
+ onClick: () => window.history.back()
2931
+ });
2932
+ }
2933
+ }
2934
+ if (activeCrumbs.length > 0) {
2935
+ activeCrumbs[activeCrumbs.length - 1].path = "";
2936
+ }
2937
+ return activeCrumbs;
2910
2938
  };
2911
2939
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement("div", {
2912
2940
  className: "ground-container employee-app-container form-container"
@@ -3028,6 +3056,7 @@ const useCashPaymentDetails = (props, t) => {
3028
3056
  body: [{
3029
3057
  withoutLabel: true,
3030
3058
  type: "custom",
3059
+ colSpan: "span 2",
3031
3060
  populators: {
3032
3061
  name: "ManualRecieptDetails",
3033
3062
  customProps: {},
@@ -3089,6 +3118,7 @@ const useCardPaymentDetails = (props, t) => {
3089
3118
  body: [{
3090
3119
  withoutLabel: true,
3091
3120
  type: "custom",
3121
+ colSpan: "span 2",
3092
3122
  populators: {
3093
3123
  name: "paymentModeDetails",
3094
3124
  customProps: {},
@@ -3132,54 +3162,26 @@ const CardDetailsComponent = _ref => {
3132
3162
  });
3133
3163
  }
3134
3164
  }, [last4Digits, transactionNumber, reTransanctionNumber]);
3135
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
3136
- className: "label-field-pair"
3137
- }, /*#__PURE__*/React.createElement("h2", {
3138
- className: "card-label"
3139
- }, t("NOC_PAYMENT_CARD_LAST_DIGITS_LABEL") + " *"), /*#__PURE__*/React.createElement("div", {
3140
- className: "field"
3141
- }, /*#__PURE__*/React.createElement("div", {
3142
- className: "field-container"
3143
- }, /*#__PURE__*/React.createElement("input", {
3144
- className: "employee-card-input",
3165
+ return /*#__PURE__*/React.createElement("div", {
3166
+ className: "formcomposer-section-grid"
3167
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("NOC_PAYMENT_CARD_LAST_DIGITS_LABEL") + " *"), /*#__PURE__*/React.createElement(TextInput, {
3145
3168
  value: last4Digits,
3146
- type: "text",
3147
3169
  name: "instrumentNumber",
3148
3170
  maxLength: "4",
3149
3171
  minLength: "4",
3150
3172
  required: true,
3151
3173
  onChange: e => setLast4Digits(e.target.value)
3152
- })))), /*#__PURE__*/React.createElement("div", {
3153
- className: "label-field-pair"
3154
- }, /*#__PURE__*/React.createElement("h2", {
3155
- className: "card-label"
3156
- }, t("NOC_PAYMENT_TRANS_NO_LABEL") + " *"), /*#__PURE__*/React.createElement("div", {
3157
- className: "field"
3158
- }, /*#__PURE__*/React.createElement("div", {
3159
- className: "field-container"
3160
- }, /*#__PURE__*/React.createElement("input", {
3161
- className: "employee-card-input",
3174
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("NOC_PAYMENT_TRANS_NO_LABEL") + " *"), /*#__PURE__*/React.createElement(TextInput, {
3162
3175
  value: transactionNumber,
3163
- type: "text",
3164
3176
  name: "instrumentNumber",
3165
3177
  required: true,
3166
3178
  onChange: e => setTransactionNumber(e.target.value)
3167
- })))), /*#__PURE__*/React.createElement("div", {
3168
- className: "label-field-pair"
3169
- }, /*#__PURE__*/React.createElement("h2", {
3170
- className: "card-label"
3171
- }, t("NOC_PAYMENT_RENTR_TRANS_LABEL") + " *"), /*#__PURE__*/React.createElement("div", {
3172
- className: "field"
3173
- }, /*#__PURE__*/React.createElement("div", {
3174
- className: "field-container"
3175
- }, /*#__PURE__*/React.createElement("input", {
3176
- className: "employee-card-input",
3179
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("NOC_PAYMENT_RENTR_TRANS_LABEL") + " *"), /*#__PURE__*/React.createElement(TextInput, {
3177
3180
  value: reTransanctionNumber,
3178
- type: "text",
3179
3181
  name: "instrumentNumber",
3180
3182
  required: true,
3181
3183
  onChange: e => setReTransanctionNumber(e.target.value)
3182
- })))));
3184
+ })));
3183
3185
  };
3184
3186
 
3185
3187
  const useChequeDetails = (props, t) => {
@@ -3189,6 +3191,7 @@ const useChequeDetails = (props, t) => {
3189
3191
  body: [{
3190
3192
  withoutLabel: true,
3191
3193
  type: "custom",
3194
+ colSpan: "span 2",
3192
3195
  populators: {
3193
3196
  name: "paymentModeDetails",
3194
3197
  customProps: {},
@@ -3278,92 +3281,46 @@ const ChequeDetailsComponent = props => {
3278
3281
  setIfscCodeError("");
3279
3282
  };
3280
3283
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
3281
- className: "label-field-pair"
3282
- }, /*#__PURE__*/React.createElement("h2", {
3283
- className: "card-label"
3284
- }, t("PAYMENT_CHQ_NO_LABEL"), " *"), /*#__PURE__*/React.createElement("div", {
3285
- className: "field"
3286
- }, /*#__PURE__*/React.createElement("div", {
3287
- className: "field-container"
3288
- }, /*#__PURE__*/React.createElement("input", {
3289
- className: "employee-card-input",
3284
+ className: "formcomposer-section-grid"
3285
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_CHQ_NO_LABEL") + " *"), /*#__PURE__*/React.createElement(TextInput, {
3290
3286
  value: instrumentNumber,
3291
- type: "text",
3292
- name: "instrumentNumber",
3293
3287
  onChange: e => setChequeNo(e.target.value),
3288
+ name: "instrumentNumber",
3294
3289
  required: true
3295
- })))), /*#__PURE__*/React.createElement("div", {
3296
- className: "label-field-pair"
3297
- }, /*#__PURE__*/React.createElement("h2", {
3298
- className: "card-label"
3299
- }, t("PAYMENT_CHEQUE_DATE_LABEL"), " *"), /*#__PURE__*/React.createElement("div", {
3300
- className: "field"
3301
- }, /*#__PURE__*/React.createElement("div", {
3302
- className: "field-container"
3303
- }, /*#__PURE__*/React.createElement(DatePicker, {
3290
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_CHEQUE_DATE_LABEL") + " *"), /*#__PURE__*/React.createElement(DatePicker, {
3304
3291
  isRequired: true,
3305
3292
  date: instrumentDate,
3306
3293
  onChange: d => {
3307
3294
  setChequeDate(d);
3308
3295
  }
3309
- })))),
3310
- /*#__PURE__*/
3311
- React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
3312
- className: "label-field-pair"
3313
- }, /*#__PURE__*/React.createElement("h2", {
3314
- className: "card-label"
3315
- }, t("PAYMENT_IFSC_CODE_LABEL"), " *"), /*#__PURE__*/React.createElement("div", {
3296
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_IFSC_CODE_LABEL") + " *"), /*#__PURE__*/React.createElement("div", {
3316
3297
  className: "field"
3317
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
3298
+ }, /*#__PURE__*/React.createElement("div", {
3318
3299
  className: "cheque-date"
3319
3300
  }, /*#__PURE__*/React.createElement("input", {
3320
3301
  value: ifscCode,
3321
3302
  type: "text",
3322
3303
  onChange: handleIFSCChange,
3323
- minlength: "11",
3324
- maxlength: "11",
3304
+ minLength: "11",
3305
+ maxLength: "11",
3325
3306
  required: true
3326
3307
  }), /*#__PURE__*/React.createElement("button", {
3327
3308
  type: "button",
3328
3309
  onClick: setBankDetailsFromIFSC
3329
- }, /*#__PURE__*/React.createElement(SearchIconSvg, null)))))), ifscCodeError && /*#__PURE__*/React.createElement(CardLabelError, {
3310
+ }, /*#__PURE__*/React.createElement(SearchIconSvg, null))), ifscCodeError && /*#__PURE__*/React.createElement(CardLabelError, {
3330
3311
  style: {
3331
- width: "70%",
3332
- marginLeft: "30%",
3333
3312
  fontSize: "12px",
3334
3313
  marginTop: "-21px"
3335
3314
  }
3336
- }, ifscCodeError), /*#__PURE__*/React.createElement("div", {
3337
- className: "label-field-pair"
3338
- }, /*#__PURE__*/React.createElement("h2", {
3339
- className: "card-label"
3340
- }, t("PAYMENT_BANK_NAME_LABEL")), /*#__PURE__*/React.createElement("div", {
3341
- className: "field"
3342
- }, /*#__PURE__*/React.createElement("div", {
3343
- className: "field-container"
3344
- }, /*#__PURE__*/React.createElement("input", {
3345
- className: "employee-card-input",
3315
+ }, ifscCodeError))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_BANK_NAME_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
3346
3316
  value: bankName,
3347
- type: "text",
3348
- className: "employee-card-input",
3349
3317
  readOnly: true,
3350
3318
  disabled: true
3351
- })))), /*#__PURE__*/React.createElement("div", {
3352
- className: "label-field-pair"
3353
- }, /*#__PURE__*/React.createElement("h2", {
3354
- className: "card-label"
3355
- }, t("PAYMENT_BANK_BRANCH_LABEL")), /*#__PURE__*/React.createElement("div", {
3356
- className: "field"
3357
- }, /*#__PURE__*/React.createElement("div", {
3358
- className: "field-container"
3359
- }, /*#__PURE__*/React.createElement("input", {
3360
- className: "employee-card-input",
3319
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_BANK_BRANCH_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
3361
3320
  value: bankBranch,
3362
- type: "text",
3363
- className: "employee-card-input",
3364
3321
  readOnly: true,
3365
3322
  disabled: true
3366
- }))))));
3323
+ }))));
3367
3324
  };
3368
3325
 
3369
3326
  function listCacheClear() {
@@ -4905,7 +4862,6 @@ const BillDetails$1 = _ref => {
4905
4862
  };
4906
4863
  const config = BillDetailsKeyNoteConfig()[ModuleWorkflow ? ModuleWorkflow : businessService];
4907
4864
  const getAdvanceAmountPaid = (applicationData === null || applicationData === void 0 ? void 0 : applicationData.applicationStatus) === "DSO_INPROGRESS";
4908
- console.log(bill, "bill");
4909
4865
  const renderArrearDetailsForWNS = () => {
4910
4866
  var _yearWiseBills$filter, _yearWiseBills$filter2, _yearWiseBills$filter3, _yearWiseBills$filter4, _yearWiseBills$filter5;
4911
4867
  return /*#__PURE__*/React.createElement("table", {
@@ -5515,10 +5471,17 @@ const CollectPayment = props => {
5515
5471
  timerValues: state === null || state === void 0 ? void 0 : state.timerValue,
5516
5472
  t: t,
5517
5473
  SlotSearchData: state === null || state === void 0 ? void 0 : state.SlotSearchData
5518
- }))), /*#__PURE__*/React.createElement(FormComposer, {
5519
- cardStyle: {
5520
- paddingBottom: "100px"
5521
- },
5474
+ }))), /*#__PURE__*/React.createElement("div", {
5475
+ className: "employee-form-section-wrapper"
5476
+ }, /*#__PURE__*/React.createElement(VerticalTimeline, {
5477
+ config: [{
5478
+ timeLine: [{
5479
+ actions: t("PAYMENT_COLLECT_LABEL"),
5480
+ currentStep: 1
5481
+ }]
5482
+ }],
5483
+ showFinalStep: false
5484
+ }), /*#__PURE__*/React.createElement(FormComposer, {
5522
5485
  label: t("PAYMENT_COLLECT_LABEL"),
5523
5486
  config: getFormConfig(),
5524
5487
  onSubmit: onSubmit,
@@ -5538,7 +5501,7 @@ const CollectPayment = props => {
5538
5501
  style: {
5539
5502
  maxWidth: "670px"
5540
5503
  }
5541
- }));
5504
+ })));
5542
5505
  };
5543
5506
 
5544
5507
  const convertEpochToDate$1 = dateEpoch => {
@@ -6953,24 +6916,38 @@ const EmployeePayment = _ref => {
6953
6916
  let crumbs = [{
6954
6917
  icon: HomeIcon,
6955
6918
  path: "/digit-ui/employee"
6956
- }, {
6957
- label: t("ES_COMMON_HOME"),
6958
- path: "/digit-ui/employee"
6959
6919
  }];
6960
- if (pathname.includes("/fsm/home")) {
6920
+ if (pathname.includes("/payment/collect")) {
6921
+ crumbs.push({
6922
+ label: t("PAYMENT_COLLECT_LABEL"),
6923
+ path: ""
6924
+ });
6925
+ } else if (pathname.includes("/payment/success")) {
6961
6926
  crumbs.push({
6962
- label: t("ES_TITLE_FSM"),
6963
- path: "/digit-ui/employee/fsm/home"
6927
+ label: t("CS_PAYMENT_SUCCESSFUL"),
6928
+ path: ""
6964
6929
  });
6965
- } else if (pathname.includes("/fsm/inbox")) {
6930
+ } else if (pathname.includes("/payment/failure")) {
6966
6931
  crumbs.push({
6967
- label: t("ES_TITLE_INBOX"),
6968
- path: "/digit-ui/employee/fsm/inbox"
6932
+ label: t("CS_PAYMENT_FAILED"),
6933
+ path: ""
6969
6934
  });
6935
+ } else {
6936
+ if (pathname.includes("/fsm/home")) {
6937
+ crumbs.push({
6938
+ label: t("ES_TITLE_FSM"),
6939
+ path: "/digit-ui/employee/fsm/home"
6940
+ });
6941
+ } else if (pathname.includes("/fsm/inbox")) {
6942
+ crumbs.push({
6943
+ label: t("ES_TITLE_INBOX"),
6944
+ path: "/digit-ui/employee/fsm/inbox"
6945
+ });
6946
+ }
6970
6947
  }
6971
6948
  return crumbs;
6972
6949
  };
6973
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement("div", {
6950
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
6974
6951
  className: "ground-container employee-app-container form-container"
6975
6952
  }, /*#__PURE__*/React.createElement(ModuleHeader, {
6976
6953
  leftContent: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArrowLeft, {
@@ -6982,17 +6959,19 @@ const EmployeePayment = _ref => {
6982
6959
  className: "employee-form"
6983
6960
  }, /*#__PURE__*/React.createElement("div", {
6984
6961
  className: "employee-form-content"
6985
- }, /*#__PURE__*/React.createElement(PrivateRoute, {
6962
+ }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
6986
6963
  path: currentPath + "/collect/:businessService/:consumerCode"
6964
+ }, /*#__PURE__*/React.createElement(LayoutWrapper, {
6965
+ layoutClass: "action"
6987
6966
  }, /*#__PURE__*/React.createElement(CollectPayment, _extends({}, commonProps, {
6988
6967
  basePath: currentPath
6989
- }))), /*#__PURE__*/React.createElement(PrivateRoute, {
6968
+ })))), /*#__PURE__*/React.createElement(PrivateRoute, {
6990
6969
  path: currentPath + "/success/:businessService/:receiptNumber/:consumerCode"
6991
6970
  }, /*#__PURE__*/React.createElement(SuccessfulPayment$1, commonProps)), /*#__PURE__*/React.createElement(PrivateRoute, {
6992
6971
  path: currentPath + "/integration/:moduleName/:pageName"
6993
6972
  }, /*#__PURE__*/React.createElement(IFrameInterface, commonProps)), /*#__PURE__*/React.createElement(PrivateRoute, {
6994
6973
  path: currentPath + "/failure"
6995
- }, /*#__PURE__*/React.createElement(FailedPayment$1, commonProps))))))));
6974
+ }, /*#__PURE__*/React.createElement(FailedPayment$1, commonProps)))))));
6996
6975
  };
6997
6976
 
6998
6977
  const PaymentModule = _ref => {