@djb25/digit-ui-module-wt 1.0.59 → 1.0.61

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.
@@ -2876,6 +2876,28 @@ const InboxLinks = ({
2876
2876
  const fieldComponents = {
2877
2877
  mobileNumber: MobileNumber
2878
2878
  };
2879
+ const FIXED_POINT_ADVANCED_FIELDS = ["vendorName", "vehicleName", "driverName", "fillingPointId"];
2880
+ const normalizeValue = value => {
2881
+ if (value === undefined || value === null) return "";
2882
+ return String(value);
2883
+ };
2884
+ const getVendorLabel = vendor => (vendor === null || vendor === void 0 ? void 0 : vendor.name) || (vendor === null || vendor === void 0 ? void 0 : vendor.vendor_id) || "";
2885
+ const getVehicleLabel = vehicle => (vehicle === null || vehicle === void 0 ? void 0 : vehicle.registrationNumber) || (vehicle === null || vehicle === void 0 ? void 0 : vehicle.name) || (vehicle === null || vehicle === void 0 ? void 0 : vehicle.type) || "";
2886
+ const getDriverLabel = driver => {
2887
+ var _driver$owner;
2888
+ return (driver === null || driver === void 0 ? void 0 : driver.name) || (driver === null || driver === void 0 ? void 0 : (_driver$owner = driver.owner) === null || _driver$owner === void 0 ? void 0 : _driver$owner.name) || (driver === null || driver === void 0 ? void 0 : driver.licenseNumber) || "";
2889
+ };
2890
+ const getFillingPointLabel = fillingPoint => (fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.fillingPointName) || (fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.name) || "";
2891
+ const getFillingPointValue = fillingPoint => typeof fillingPoint === "object" ? (fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.id) || (fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.fillingPointId) || (fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.bookingId) || "" : normalizeValue(fillingPoint);
2892
+ const findSelectedOption = (options = [], value, getLabel, extraKeys = []) => {
2893
+ if (!value) return null;
2894
+ const selectedValues = typeof value === "object" ? [getLabel(value), ...extraKeys.map(key => value === null || value === void 0 ? void 0 : value[key])] : [value];
2895
+ const normalizedSelectedValues = selectedValues.map(normalizeValue).filter(Boolean);
2896
+ return options.find(option => {
2897
+ const optionValues = [getLabel(option), ...extraKeys.map(key => option === null || option === void 0 ? void 0 : option[key])].map(normalizeValue).filter(Boolean);
2898
+ return optionValues.some(optionValue => normalizedSelectedValues.includes(optionValue));
2899
+ }) || (typeof value === "object" ? value : null);
2900
+ };
2879
2901
  const SearchApplication = ({
2880
2902
  onSearch,
2881
2903
  type,
@@ -2886,7 +2908,7 @@ const SearchApplication = ({
2886
2908
  defaultSearchParams,
2887
2909
  clearSearch: _clearSearch
2888
2910
  }) => {
2889
- var _searchParams$service, _searchFields$filter;
2911
+ var _searchFields$filter;
2890
2912
  const {
2891
2913
  t
2892
2914
  } = useTranslation();
@@ -2916,16 +2938,34 @@ const SearchApplication = ({
2916
2938
  if (searchFields !== null && searchFields !== void 0 && searchFields.find(e => e.name === "locality") && !(form !== null && form !== void 0 && (_form$locality = form.locality) !== null && _form$locality !== void 0 && _form$locality.code)) isEmpty = true;
2917
2939
  return isEmpty;
2918
2940
  };
2919
- const mobileView = innerWidth <= 640;
2941
+ const mobileView = window.innerWidth <= 640;
2920
2942
  const onSubmitInput = data => {
2943
+ const updatedData = {
2944
+ ...data
2945
+ };
2921
2946
  if (!data.mobileNumber) {
2922
- delete data.mobileNumber;
2923
- }
2924
- data.delete = [];
2947
+ delete updatedData.mobileNumber;
2948
+ }
2949
+ if (isFixedPoint) {
2950
+ const vendorName = typeof updatedData.vendorName === "object" ? getVendorLabel(updatedData.vendorName) : normalizeValue(updatedData.vendorName);
2951
+ const vehicleName = typeof updatedData.vehicleName === "object" ? getVehicleLabel(updatedData.vehicleName) : normalizeValue(updatedData.vehicleName);
2952
+ const driverName = typeof updatedData.driverName === "object" ? getDriverLabel(updatedData.driverName) : normalizeValue(updatedData.driverName);
2953
+ const fillingPointId = typeof updatedData.fillingPointId === "object" ? getFillingPointValue(updatedData.fillingPointId) : normalizeValue(updatedData.fillingPointId);
2954
+ if (vendorName) updatedData.vendorName = vendorName;else delete updatedData.vendorName;
2955
+ if (vehicleName) updatedData.vehicleName = vehicleName;else delete updatedData.vehicleName;
2956
+ if (driverName) updatedData.driverName = driverName;else delete updatedData.driverName;
2957
+ if (fillingPointId) updatedData.fillingPointId = fillingPointId;else delete updatedData.fillingPointId;
2958
+ }
2959
+ updatedData.delete = [];
2925
2960
  searchFields.forEach(field => {
2926
- if (!data[field.name]) data.delete.push(field.name);
2961
+ if (!updatedData[field.name]) updatedData.delete.push(field.name);
2927
2962
  });
2928
- onSearch(data);
2963
+ if (isFixedPoint) {
2964
+ FIXED_POINT_ADVANCED_FIELDS.forEach(fieldName => {
2965
+ if (!updatedData[fieldName]) updatedData.delete.push(fieldName);
2966
+ });
2967
+ }
2968
+ onSearch(updatedData);
2929
2969
  if (type === "mobile") {
2930
2970
  onClose();
2931
2971
  }
@@ -2935,6 +2975,11 @@ const SearchApplication = ({
2935
2975
  ...acc,
2936
2976
  [field === null || field === void 0 ? void 0 : field.name]: ""
2937
2977
  }), {});
2978
+ if (isFixedPoint) {
2979
+ FIXED_POINT_ADVANCED_FIELDS.forEach(fieldName => {
2980
+ resetValues[fieldName] = "";
2981
+ });
2982
+ }
2938
2983
  reset(resetValues);
2939
2984
  if (isInboxPage) {
2940
2985
  const _newParams = {
@@ -2944,6 +2989,11 @@ const SearchApplication = ({
2944
2989
  searchFields.forEach(e => {
2945
2990
  _newParams.delete.push(e === null || e === void 0 ? void 0 : e.name);
2946
2991
  });
2992
+ if (isFixedPoint) {
2993
+ FIXED_POINT_ADVANCED_FIELDS.forEach(fieldName => {
2994
+ _newParams.delete.push(fieldName);
2995
+ });
2996
+ }
2947
2997
  onSearch({
2948
2998
  ..._newParams
2949
2999
  });
@@ -2963,7 +3013,7 @@ const SearchApplication = ({
2963
3013
  onClick: clearSearch
2964
3014
  }, t("ES_COMMON_CLEAR_SEARCH"));
2965
3015
  };
2966
- const isFixedPoint = searchParams === null || searchParams === void 0 ? void 0 : (_searchParams$service = searchParams.services) === null || _searchParams$service === void 0 ? void 0 : _searchParams$service.includes("watertanker-fixedpoint");
3016
+ const isFixedPoint = window.location.href.includes("fixed-point");
2967
3017
  const {
2968
3018
  data: fillingPointsData
2969
3019
  } = Digit.Hooks.wt.useFillPointSearch({
@@ -2975,6 +3025,57 @@ const SearchApplication = ({
2975
3025
  enabled: !!isFixedPoint
2976
3026
  });
2977
3027
  const fillingPoints = (fillingPointsData === null || fillingPointsData === void 0 ? void 0 : fillingPointsData.fillingPoints) || [];
3028
+ const fillingPointOptions = useMemo(() => fillingPoints.map(fillingPoint => ({
3029
+ ...fillingPoint,
3030
+ name: getFillingPointLabel(fillingPoint) || "NA"
3031
+ })), [fillingPoints]);
3032
+ const selectedFillingPoint = useMemo(() => findSelectedOption(fillingPointOptions, form === null || form === void 0 ? void 0 : form.fillingPointId, getFillingPointLabel, ["id", "fillingPointId", "bookingId", "name"]), [fillingPointOptions, form === null || form === void 0 ? void 0 : form.fillingPointId]);
3033
+ const selectedFillingPointId = getFillingPointValue(selectedFillingPoint || (form === null || form === void 0 ? void 0 : form.fillingPointId));
3034
+ const {
3035
+ data: vendorData
3036
+ } = Digit.Hooks.fsm.useVendorSearch({
3037
+ tenantId: Digit.ULBService.getCurrentTenantId(),
3038
+ filters: {
3039
+ limit: 1000,
3040
+ ...(selectedFillingPointId ? {
3041
+ fillingPointId: selectedFillingPointId
3042
+ } : {})
3043
+ },
3044
+ config: {
3045
+ enabled: !!isFixedPoint
3046
+ }
3047
+ });
3048
+ const vendorOptions = useMemo(() => ((vendorData === null || vendorData === void 0 ? void 0 : vendorData.vendor) || []).map(vendor => ({
3049
+ ...vendor,
3050
+ name: getVendorLabel(vendor) || "NA"
3051
+ })), [vendorData]);
3052
+ const selectedVendor = useMemo(() => findSelectedOption(vendorOptions, form === null || form === void 0 ? void 0 : form.vendorName, getVendorLabel, ["id", "vendor_id", "name"]), [vendorOptions, form === null || form === void 0 ? void 0 : form.vendorName]);
3053
+ const allVehicleOptions = useMemo(() => vendorOptions.flatMap(vendor => ((vendor === null || vendor === void 0 ? void 0 : vendor.vehicles) || []).map(vehicle => ({
3054
+ ...vehicle,
3055
+ name: getVehicleLabel(vehicle) || "NA",
3056
+ vendorId: vendor === null || vendor === void 0 ? void 0 : vendor.id
3057
+ }))), [vendorOptions]);
3058
+ const allDriverOptions = useMemo(() => vendorOptions.flatMap(vendor => ((vendor === null || vendor === void 0 ? void 0 : vendor.drivers) || []).map(driver => ({
3059
+ ...driver,
3060
+ name: getDriverLabel(driver) || "NA",
3061
+ vendorId: vendor === null || vendor === void 0 ? void 0 : vendor.id
3062
+ }))), [vendorOptions]);
3063
+ const vehicleOptions = useMemo(() => {
3064
+ if (!selectedVendor) return allVehicleOptions;
3065
+ return ((selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.vehicles) || []).map(vehicle => ({
3066
+ ...vehicle,
3067
+ name: getVehicleLabel(vehicle) || "NA",
3068
+ vendorId: selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.id
3069
+ }));
3070
+ }, [allVehicleOptions, selectedVendor]);
3071
+ const driverOptions = useMemo(() => {
3072
+ if (!selectedVendor) return allDriverOptions;
3073
+ return ((selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.drivers) || []).map(driver => ({
3074
+ ...driver,
3075
+ name: getDriverLabel(driver) || "NA",
3076
+ vendorId: selectedVendor === null || selectedVendor === void 0 ? void 0 : selectedVendor.id
3077
+ }));
3078
+ }, [allDriverOptions, selectedVendor]);
2978
3079
  return /*#__PURE__*/React.createElement("form", {
2979
3080
  id: "search-form",
2980
3081
  onSubmit: handleSubmit(onSubmitInput),
@@ -2983,7 +3084,138 @@ const SearchApplication = ({
2983
3084
  className: "complaint-header"
2984
3085
  }, /*#__PURE__*/React.createElement("h2", null, t("ES_COMMON_SEARCH_BY")), /*#__PURE__*/React.createElement("span", {
2985
3086
  onClick: onClose
2986
- }, /*#__PURE__*/React.createElement(CloseSvg, null))), /*#__PURE__*/React.createElement("div", {
3087
+ }, /*#__PURE__*/React.createElement(CloseSvg, null))), isFixedPoint ? /*#__PURE__*/React.createElement(CollapsibleCardPage, {
3088
+ title: t("WT_SEARCH_FILTERS_LABEL") || "Search Filters",
3089
+ defaultOpen: true,
3090
+ tabs: [t("WT_SMART_SEARCH"), t("WT_ADVANCED_SEARCH")],
3091
+ defaultTab: t("WT_SMART_SEARCH")
3092
+ }, activeTab => /*#__PURE__*/React.createElement("div", {
3093
+ className: "formcomposer-section-grid"
3094
+ }, activeTab === t("WT_SMART_SEARCH") && /*#__PURE__*/React.createElement(Fragment, null, searchFields === null || searchFields === void 0 ? void 0 : searchFields.map(input => {
3095
+ if (input.name !== "bookingNo" && input.name !== "mobileNumber") return null;
3096
+ return /*#__PURE__*/React.createElement("div", {
3097
+ key: input.name,
3098
+ className: "input-fields"
3099
+ }, /*#__PURE__*/React.createElement("span", {
3100
+ className: "mobile-input"
3101
+ }, /*#__PURE__*/React.createElement(Label, null, t(input.label) + ` ${input.isMendatory ? "*" : ""}`), !input.type ? /*#__PURE__*/React.createElement(Controller, {
3102
+ render: props => /*#__PURE__*/React.createElement(TextInput, {
3103
+ onChange: props.onChange,
3104
+ value: props.value
3105
+ }),
3106
+ name: input.name,
3107
+ control: control,
3108
+ defaultValue: ""
3109
+ }) : /*#__PURE__*/React.createElement(Controller, {
3110
+ render: props => {
3111
+ const Comp = fieldComponents === null || fieldComponents === void 0 ? void 0 : fieldComponents[input.type];
3112
+ return /*#__PURE__*/React.createElement(Comp, {
3113
+ formValue: form,
3114
+ setValue: setValue,
3115
+ onChange: props.onChange,
3116
+ value: props.value
3117
+ });
3118
+ },
3119
+ name: input.name,
3120
+ control: control,
3121
+ defaultValue: ""
3122
+ })));
3123
+ })), activeTab === t("WT_ADVANCED_SEARCH") && /*#__PURE__*/React.createElement(Fragment, null, searchFields === null || searchFields === void 0 ? void 0 : searchFields.map(input => /*#__PURE__*/React.createElement("div", {
3124
+ key: input.name,
3125
+ className: "input-fields"
3126
+ }, /*#__PURE__*/React.createElement("span", {
3127
+ className: "mobile-input"
3128
+ }, /*#__PURE__*/React.createElement(Label, null, t(input.label) + ` ${input.isMendatory ? "*" : ""}`), !input.type ? /*#__PURE__*/React.createElement(Controller, {
3129
+ render: props => /*#__PURE__*/React.createElement(TextInput, {
3130
+ onChange: props.onChange,
3131
+ value: props.value
3132
+ }),
3133
+ name: input.name,
3134
+ control: control,
3135
+ defaultValue: ""
3136
+ }) : /*#__PURE__*/React.createElement(Controller, {
3137
+ render: props => {
3138
+ const Comp = fieldComponents === null || fieldComponents === void 0 ? void 0 : fieldComponents[input.type];
3139
+ return /*#__PURE__*/React.createElement(Comp, {
3140
+ formValue: form,
3141
+ setValue: setValue,
3142
+ onChange: props.onChange,
3143
+ value: props.value
3144
+ });
3145
+ },
3146
+ name: input.name,
3147
+ control: control,
3148
+ defaultValue: ""
3149
+ })))), /*#__PURE__*/React.createElement("div", {
3150
+ className: "input-fields"
3151
+ }, /*#__PURE__*/React.createElement("span", {
3152
+ className: "mobile-input"
3153
+ }, /*#__PURE__*/React.createElement(Label, null, t("WT_FILLING_POINT")), /*#__PURE__*/React.createElement(Controller, {
3154
+ control: control,
3155
+ name: "fillingPointId",
3156
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
3157
+ selected: findSelectedOption(fillingPointOptions, props.value, getFillingPointLabel, ["id", "fillingPointId", "bookingId", "name"]),
3158
+ select: value => {
3159
+ props.onChange(value);
3160
+ setValue("vendorName", "");
3161
+ setValue("vehicleName", "");
3162
+ setValue("driverName", "");
3163
+ },
3164
+ onBlur: props.onBlur,
3165
+ option: fillingPointOptions,
3166
+ optionKey: "name",
3167
+ t: t
3168
+ })
3169
+ }))), /*#__PURE__*/React.createElement("div", {
3170
+ className: "input-fields"
3171
+ }, /*#__PURE__*/React.createElement("span", {
3172
+ className: "mobile-input"
3173
+ }, /*#__PURE__*/React.createElement(Label, null, t("WT_VENDOR_NAME")), /*#__PURE__*/React.createElement(Controller, {
3174
+ control: control,
3175
+ name: "vendorName",
3176
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
3177
+ selected: findSelectedOption(vendorOptions, props.value, getVendorLabel, ["id", "vendor_id", "name"]),
3178
+ select: value => {
3179
+ props.onChange(value);
3180
+ setValue("vehicleName", "");
3181
+ setValue("driverName", "");
3182
+ },
3183
+ onBlur: props.onBlur,
3184
+ option: vendorOptions,
3185
+ optionKey: "name",
3186
+ t: t
3187
+ })
3188
+ }))), /*#__PURE__*/React.createElement("div", {
3189
+ className: "input-fields"
3190
+ }, /*#__PURE__*/React.createElement("span", {
3191
+ className: "mobile-input"
3192
+ }, /*#__PURE__*/React.createElement(Label, null, t("WT_VEHICLE_NO")), /*#__PURE__*/React.createElement(Controller, {
3193
+ control: control,
3194
+ name: "vehicleName",
3195
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
3196
+ selected: findSelectedOption(vehicleOptions, props.value, getVehicleLabel, ["id", "registrationNumber", "name"]),
3197
+ select: props.onChange,
3198
+ onBlur: props.onBlur,
3199
+ option: vehicleOptions,
3200
+ optionKey: "name",
3201
+ t: t
3202
+ })
3203
+ }))), /*#__PURE__*/React.createElement("div", {
3204
+ className: "input-fields"
3205
+ }, /*#__PURE__*/React.createElement("span", {
3206
+ className: "mobile-input"
3207
+ }, /*#__PURE__*/React.createElement(Label, null, t("WT_DRIVER_NAME")), /*#__PURE__*/React.createElement(Controller, {
3208
+ control: control,
3209
+ name: "driverName",
3210
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
3211
+ selected: findSelectedOption(driverOptions, props.value, getDriverLabel, ["id", "ownerId", "licenseNumber", "name"]),
3212
+ select: props.onChange,
3213
+ onBlur: props.onBlur,
3214
+ option: driverOptions,
3215
+ optionKey: "name",
3216
+ t: t
3217
+ })
3218
+ })))))) : /*#__PURE__*/React.createElement("div", {
2987
3219
  className: "formcomposer-section-grid"
2988
3220
  }, searchFields === null || searchFields === void 0 ? void 0 : (_searchFields$filter = searchFields.filter(e => true)) === null || _searchFields$filter === void 0 ? void 0 : _searchFields$filter.map((input, index) => {
2989
3221
  var _formState$dirtyField, _formState$errors, _formState$errors$inp, _formState$errors2, _formState$errors2$in;
@@ -3025,22 +3257,7 @@ const SearchApplication = ({
3025
3257
  },
3026
3258
  className: "inbox-search-form-error"
3027
3259
  }, formState === null || formState === void 0 ? void 0 : (_formState$errors2 = formState.errors) === null || _formState$errors2 === void 0 ? void 0 : (_formState$errors2$in = _formState$errors2[input.name]) === null || _formState$errors2$in === void 0 ? void 0 : _formState$errors2$in.message) : null);
3028
- }), isFixedPoint && /*#__PURE__*/React.createElement("div", {
3029
- className: "input-fields"
3030
- }, /*#__PURE__*/React.createElement("span", {
3031
- className: "mobile-input"
3032
- }, /*#__PURE__*/React.createElement(Label, null, t("WT_FILLING_POINT")), /*#__PURE__*/React.createElement(Controller, {
3033
- control: control,
3034
- name: "fillingPointId",
3035
- render: props => /*#__PURE__*/React.createElement(Dropdown, {
3036
- selected: fillingPoints.find(fp => (fp.id || fp.fillingPointId || fp.bookingId) === props.value),
3037
- select: val => props.onChange((val === null || val === void 0 ? void 0 : val.id) || (val === null || val === void 0 ? void 0 : val.fillingPointId) || (val === null || val === void 0 ? void 0 : val.bookingId)),
3038
- onBlur: props.onBlur,
3039
- option: fillingPoints,
3040
- optionKey: "fillingPointName",
3041
- t: t
3042
- })
3043
- })))), /*#__PURE__*/React.createElement("div", {
3260
+ })), /*#__PURE__*/React.createElement("div", {
3044
3261
  className: "formcomposer-section-button"
3045
3262
  }, isInboxPage ? /*#__PURE__*/React.createElement("div", {
3046
3263
  className: "generic-button clear-search"
@@ -3050,6 +3267,7 @@ const SearchApplication = ({
3050
3267
  className: "generic-button",
3051
3268
  disabled: !!Object.keys(formState.errors).length || formValueEmpty(),
3052
3269
  label: t("ES_COMMON_SEARCH"),
3270
+ onClick: handleSubmit(onSubmitInput),
3053
3271
  submit: true,
3054
3272
  form: "search-form"
3055
3273
  })), (type === "mobile" || mobileView) && /*#__PURE__*/React.createElement(ActionBar, {
@@ -3065,6 +3283,7 @@ const SearchApplication = ({
3065
3283
  style: {
3066
3284
  flex: 1
3067
3285
  },
3286
+ onClick: handleSubmit(onSubmitInput),
3068
3287
  submit: true
3069
3288
  }))));
3070
3289
  };
@@ -3100,7 +3319,7 @@ const WTDesktopInbox = ({
3100
3319
  const [clearSearchCalled, setClearSearchCalled] = useState(false);
3101
3320
  const columns = React.useMemo(() => props.isSearch ? tableConfig.searchColumns(props) : tableConfig.inboxColumns(props) || [], []);
3102
3321
  const inboxCsvColumns = React.useMemo(() => {
3103
- var _columns$, _columns$2, _columns$3, _columns$4, _columns$find2;
3322
+ var _columns$, _columns$2, _columns$3, _columns$4, _columns$find3;
3104
3323
  const csvColumns = [{
3105
3324
  Header: (columns === null || columns === void 0 ? void 0 : (_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.Header) || t("WT_BOOKING_NO"),
3106
3325
  exportAccessor: row => {
@@ -3129,20 +3348,67 @@ const WTDesktopInbox = ({
3129
3348
  return t(`${prefix}_REVENUE_${row.searchData.localityCode}`);
3130
3349
  }
3131
3350
  }];
3132
- if (columns !== null && columns !== void 0 && columns.some(column => (column === null || column === void 0 ? void 0 : column.id) === "createdTime")) {
3351
+ if (columns !== null && columns !== void 0 && columns.some(column => (column === null || column === void 0 ? void 0 : column.id) === "fillingPoint")) {
3133
3352
  var _columns$find;
3134
3353
  csvColumns.push({
3135
- Header: (columns === null || columns === void 0 ? void 0 : (_columns$find = columns.find(column => (column === null || column === void 0 ? void 0 : column.id) === "createdTime")) === null || _columns$find === void 0 ? void 0 : _columns$find.Header) || t("CREATED_AT"),
3354
+ Header: (columns === null || columns === void 0 ? void 0 : (_columns$find = columns.find(column => (column === null || column === void 0 ? void 0 : column.id) === "fillingPoint")) === null || _columns$find === void 0 ? void 0 : _columns$find.Header) || t("Filling Point"),
3355
+ exportAccessor: row => {
3356
+ var _row$searchData7, _row$searchData7$fill, _row$searchData8;
3357
+ return (row === null || row === void 0 ? void 0 : (_row$searchData7 = row.searchData) === null || _row$searchData7 === void 0 ? void 0 : (_row$searchData7$fill = _row$searchData7.fillingPointMetadata) === null || _row$searchData7$fill === void 0 ? void 0 : _row$searchData7$fill.name) || (row === null || row === void 0 ? void 0 : (_row$searchData8 = row.searchData) === null || _row$searchData8 === void 0 ? void 0 : _row$searchData8.fillingPointName) || "-";
3358
+ }
3359
+ });
3360
+ }
3361
+ if (columns !== null && columns !== void 0 && columns.some(column => (column === null || column === void 0 ? void 0 : column.id) === "createdTime")) {
3362
+ var _columns$find2;
3363
+ csvColumns.push({
3364
+ Header: (columns === null || columns === void 0 ? void 0 : (_columns$find2 = columns.find(column => (column === null || column === void 0 ? void 0 : column.id) === "createdTime")) === null || _columns$find2 === void 0 ? void 0 : _columns$find2.Header) || t("CREATED_AT"),
3136
3365
  exportAccessor: row => getCreatedAtValue(row)
3137
3366
  });
3138
3367
  }
3139
3368
  csvColumns.push({
3140
- Header: (columns === null || columns === void 0 ? void 0 : (_columns$find2 = columns.find(column => (column === null || column === void 0 ? void 0 : column.id) === "applicationStatus")) === null || _columns$find2 === void 0 ? void 0 : _columns$find2.Header) || t("WT_STATUS"),
3369
+ Header: (columns === null || columns === void 0 ? void 0 : (_columns$find3 = columns.find(column => (column === null || column === void 0 ? void 0 : column.id) === "applicationStatus")) === null || _columns$find3 === void 0 ? void 0 : _columns$find3.Header) || t("WT_STATUS"),
3141
3370
  exportAccessor: row => {
3142
3371
  var _row$workflowData2, _row$workflowData2$st;
3143
3372
  return row !== null && row !== void 0 && (_row$workflowData2 = row.workflowData) !== null && _row$workflowData2 !== void 0 && (_row$workflowData2$st = _row$workflowData2.state) !== null && _row$workflowData2$st !== void 0 && _row$workflowData2$st.applicationStatus ? t(row.workflowData.state.applicationStatus) : "";
3144
3373
  }
3145
3374
  });
3375
+ if (columns !== null && columns !== void 0 && columns.some(column => (column === null || column === void 0 ? void 0 : column.id) === "vendorName")) {
3376
+ var _columns$find4;
3377
+ csvColumns.push({
3378
+ Header: (columns === null || columns === void 0 ? void 0 : (_columns$find4 = columns.find(column => (column === null || column === void 0 ? void 0 : column.id) === "vendorName")) === null || _columns$find4 === void 0 ? void 0 : _columns$find4.Header) || t("WT_VENDOR_NAME"),
3379
+ exportAccessor: row => {
3380
+ var _row$searchData9, _row$searchData9$vend, _row$searchData0;
3381
+ return (row === null || row === void 0 ? void 0 : (_row$searchData9 = row.searchData) === null || _row$searchData9 === void 0 ? void 0 : (_row$searchData9$vend = _row$searchData9.vendor) === null || _row$searchData9$vend === void 0 ? void 0 : _row$searchData9$vend.name) || (row === null || row === void 0 ? void 0 : (_row$searchData0 = row.searchData) === null || _row$searchData0 === void 0 ? void 0 : _row$searchData0.vendorName) || "-";
3382
+ }
3383
+ });
3384
+ }
3385
+ if (columns !== null && columns !== void 0 && columns.some(column => (column === null || column === void 0 ? void 0 : column.id) === "vehicleNumber")) {
3386
+ var _columns$find5;
3387
+ csvColumns.push({
3388
+ Header: (columns === null || columns === void 0 ? void 0 : (_columns$find5 = columns.find(column => (column === null || column === void 0 ? void 0 : column.id) === "vehicleNumber")) === null || _columns$find5 === void 0 ? void 0 : _columns$find5.Header) || t("WT_VEHICLE_NO"),
3389
+ exportAccessor: row => {
3390
+ var _searchData$vendor, _searchData$vendor$ve;
3391
+ const searchData = row === null || row === void 0 ? void 0 : row.searchData;
3392
+ const mappedVehicle = (searchData === null || searchData === void 0 ? void 0 : searchData.vehicle) || (searchData === null || searchData === void 0 ? void 0 : (_searchData$vendor = searchData.vendor) === null || _searchData$vendor === void 0 ? void 0 : (_searchData$vendor$ve = _searchData$vendor.vehicles) === null || _searchData$vendor$ve === void 0 ? void 0 : _searchData$vendor$ve.find(vehicle => (vehicle === null || vehicle === void 0 ? void 0 : vehicle.id) === (searchData === null || searchData === void 0 ? void 0 : searchData.vehicleId)));
3393
+ return (mappedVehicle === null || mappedVehicle === void 0 ? void 0 : mappedVehicle.registrationNumber) || (mappedVehicle === null || mappedVehicle === void 0 ? void 0 : mappedVehicle.name) || (mappedVehicle === null || mappedVehicle === void 0 ? void 0 : mappedVehicle.type) || (searchData === null || searchData === void 0 ? void 0 : searchData.vehicleName) || (searchData === null || searchData === void 0 ? void 0 : searchData.vehicleRegistrationNo) || "-";
3394
+ }
3395
+ });
3396
+ }
3397
+ if (columns !== null && columns !== void 0 && columns.some(column => (column === null || column === void 0 ? void 0 : column.id) === "driverName")) {
3398
+ var _columns$find6;
3399
+ csvColumns.push({
3400
+ Header: (columns === null || columns === void 0 ? void 0 : (_columns$find6 = columns.find(column => (column === null || column === void 0 ? void 0 : column.id) === "driverName")) === null || _columns$find6 === void 0 ? void 0 : _columns$find6.Header) || t("WT_DRIVER_NAME"),
3401
+ exportAccessor: row => {
3402
+ var _searchData$vendor2, _searchData$vendor2$d, _mappedDriver$owner;
3403
+ const searchData = row === null || row === void 0 ? void 0 : row.searchData;
3404
+ const mappedDriver = (searchData === null || searchData === void 0 ? void 0 : searchData.driver) || (searchData === null || searchData === void 0 ? void 0 : (_searchData$vendor2 = searchData.vendor) === null || _searchData$vendor2 === void 0 ? void 0 : (_searchData$vendor2$d = _searchData$vendor2.drivers) === null || _searchData$vendor2$d === void 0 ? void 0 : _searchData$vendor2$d.find(driver => {
3405
+ var _driver$owner;
3406
+ return (driver === null || driver === void 0 ? void 0 : driver.id) === (searchData === null || searchData === void 0 ? void 0 : searchData.driverId) || (driver === null || driver === void 0 ? void 0 : driver.ownerId) === (searchData === null || searchData === void 0 ? void 0 : searchData.driverId) || (driver === null || driver === void 0 ? void 0 : (_driver$owner = driver.owner) === null || _driver$owner === void 0 ? void 0 : _driver$owner.uuid) === (searchData === null || searchData === void 0 ? void 0 : searchData.driverId);
3407
+ }));
3408
+ return (mappedDriver === null || mappedDriver === void 0 ? void 0 : mappedDriver.name) || (mappedDriver === null || mappedDriver === void 0 ? void 0 : (_mappedDriver$owner = mappedDriver.owner) === null || _mappedDriver$owner === void 0 ? void 0 : _mappedDriver$owner.name) || (searchData === null || searchData === void 0 ? void 0 : searchData.driverName) || "-";
3409
+ }
3410
+ });
3411
+ }
3146
3412
  return csvColumns;
3147
3413
  }, [columns, getCreatedAtValue, t]);
3148
3414
  let result;
@@ -3759,6 +4025,18 @@ const Inbox = ({
3759
4025
  if (searchParams !== null && searchParams !== void 0 && searchParams.bookingNo) {
3760
4026
  moduleSearchCriteria.bookingNo = searchParams.bookingNo;
3761
4027
  }
4028
+ if (searchParams !== null && searchParams !== void 0 && searchParams.vendorName) {
4029
+ moduleSearchCriteria.vendorName = searchParams.vendorName;
4030
+ }
4031
+ if (searchParams !== null && searchParams !== void 0 && searchParams.vehicleName) {
4032
+ moduleSearchCriteria.vehicleName = searchParams.vehicleName;
4033
+ }
4034
+ if (searchParams !== null && searchParams !== void 0 && searchParams.driverName) {
4035
+ moduleSearchCriteria.driverName = searchParams.driverName;
4036
+ }
4037
+ if (searchParams !== null && searchParams !== void 0 && searchParams.fillingPointId) {
4038
+ moduleSearchCriteria.fillingPointId = searchParams.fillingPointId;
4039
+ }
3762
4040
  if (Array.isArray(searchParams === null || searchParams === void 0 ? void 0 : searchParams.locality) && searchParams.locality.length > 0) {
3763
4041
  moduleSearchCriteria.locality = searchParams.locality.map(item => String((item === null || item === void 0 ? void 0 : item.code) || "").split("_").pop()).filter(Boolean);
3764
4042
  }
@@ -9912,7 +10190,7 @@ const EmployeeApp = ({
9912
10190
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
9913
10191
  path: `${path}/booking-details/:id`,
9914
10192
  component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
9915
- layoutClass: "normal"
10193
+ layoutClass: "action"
9916
10194
  }, /*#__PURE__*/React.createElement(ApplicationDetails, Object.assign({}, props, {
9917
10195
  parentRoute: path
9918
10196
  })))
@@ -16964,6 +17242,23 @@ const getLocalityTranslation = (localityCode, tenantId, t) => {
16964
17242
  const prefix = tenant.replace(".", "_").toUpperCase();
16965
17243
  return t(`${prefix}_REVENUE_${localityCode}`);
16966
17244
  };
17245
+ const getVendorNameFromSearchData = searchData => {
17246
+ var _searchData$vendor;
17247
+ return (searchData === null || searchData === void 0 ? void 0 : (_searchData$vendor = searchData.vendor) === null || _searchData$vendor === void 0 ? void 0 : _searchData$vendor.name) || (searchData === null || searchData === void 0 ? void 0 : searchData.vendorName) || "-";
17248
+ };
17249
+ const getVehicleNameFromSearchData = searchData => {
17250
+ var _searchData$vendor2, _searchData$vendor2$v;
17251
+ const mappedVehicle = (searchData === null || searchData === void 0 ? void 0 : searchData.vehicle) || (searchData === null || searchData === void 0 ? void 0 : (_searchData$vendor2 = searchData.vendor) === null || _searchData$vendor2 === void 0 ? void 0 : (_searchData$vendor2$v = _searchData$vendor2.vehicles) === null || _searchData$vendor2$v === void 0 ? void 0 : _searchData$vendor2$v.find(vehicle => (vehicle === null || vehicle === void 0 ? void 0 : vehicle.id) === (searchData === null || searchData === void 0 ? void 0 : searchData.vehicleId)));
17252
+ return (mappedVehicle === null || mappedVehicle === void 0 ? void 0 : mappedVehicle.registrationNumber) || (mappedVehicle === null || mappedVehicle === void 0 ? void 0 : mappedVehicle.name) || (mappedVehicle === null || mappedVehicle === void 0 ? void 0 : mappedVehicle.type) || (searchData === null || searchData === void 0 ? void 0 : searchData.vehicleName) || (searchData === null || searchData === void 0 ? void 0 : searchData.vehicleRegistrationNo) || "-";
17253
+ };
17254
+ const getDriverNameFromSearchData = searchData => {
17255
+ var _searchData$vendor3, _searchData$vendor3$d, _mappedDriver$owner;
17256
+ const mappedDriver = (searchData === null || searchData === void 0 ? void 0 : searchData.driver) || (searchData === null || searchData === void 0 ? void 0 : (_searchData$vendor3 = searchData.vendor) === null || _searchData$vendor3 === void 0 ? void 0 : (_searchData$vendor3$d = _searchData$vendor3.drivers) === null || _searchData$vendor3$d === void 0 ? void 0 : _searchData$vendor3$d.find(driver => {
17257
+ var _driver$owner;
17258
+ return (driver === null || driver === void 0 ? void 0 : driver.id) === (searchData === null || searchData === void 0 ? void 0 : searchData.driverId) || (driver === null || driver === void 0 ? void 0 : driver.ownerId) === (searchData === null || searchData === void 0 ? void 0 : searchData.driverId) || (driver === null || driver === void 0 ? void 0 : (_driver$owner = driver.owner) === null || _driver$owner === void 0 ? void 0 : _driver$owner.uuid) === (searchData === null || searchData === void 0 ? void 0 : searchData.driverId);
17259
+ }));
17260
+ return (mappedDriver === null || mappedDriver === void 0 ? void 0 : mappedDriver.name) || (mappedDriver === null || mappedDriver === void 0 ? void 0 : (_mappedDriver$owner = mappedDriver.owner) === null || _mappedDriver$owner === void 0 ? void 0 : _mappedDriver$owner.name) || (searchData === null || searchData === void 0 ? void 0 : searchData.driverName) || "-";
17261
+ };
16967
17262
  const TableConfig = t => ({
16968
17263
  WT: {
16969
17264
  inboxColumns: props => [{
@@ -17079,7 +17374,40 @@ const TableConfig = t => ({
17079
17374
  var _original$workflowDat, _original$workflowDat2;
17080
17375
  return GetMobCell(t(`ES_WT_COMMON_STATUS_${original === null || original === void 0 ? void 0 : (_original$workflowDat = original.workflowData) === null || _original$workflowDat === void 0 ? void 0 : (_original$workflowDat2 = _original$workflowDat.state) === null || _original$workflowDat2 === void 0 ? void 0 : _original$workflowDat2["applicationStatus"]}`));
17081
17376
  }
17082
- }],
17377
+ }, ...(window.location.href.includes("fixed-point") ? [{
17378
+ Header: t("WT_VENDOR_NAME"),
17379
+ id: "vendorName",
17380
+ accessor: row => getVendorNameFromSearchData(row === null || row === void 0 ? void 0 : row.searchData),
17381
+ Cell: ({
17382
+ row
17383
+ }) => {
17384
+ var _row$original9;
17385
+ return GetCell(getVendorNameFromSearchData(row === null || row === void 0 ? void 0 : (_row$original9 = row.original) === null || _row$original9 === void 0 ? void 0 : _row$original9.searchData));
17386
+ },
17387
+ mobileCell: original => GetMobCell(getVendorNameFromSearchData(original === null || original === void 0 ? void 0 : original.searchData))
17388
+ }, {
17389
+ Header: t("WT_VEHICLE_NO"),
17390
+ id: "vehicleNumber",
17391
+ accessor: row => getVehicleNameFromSearchData(row === null || row === void 0 ? void 0 : row.searchData),
17392
+ Cell: ({
17393
+ row
17394
+ }) => {
17395
+ var _row$original0;
17396
+ return GetCell(getVehicleNameFromSearchData(row === null || row === void 0 ? void 0 : (_row$original0 = row.original) === null || _row$original0 === void 0 ? void 0 : _row$original0.searchData));
17397
+ },
17398
+ mobileCell: original => GetMobCell(getVehicleNameFromSearchData(original === null || original === void 0 ? void 0 : original.searchData))
17399
+ }, {
17400
+ Header: t("WT_DRIVER_NAME"),
17401
+ id: "driverName",
17402
+ accessor: row => getDriverNameFromSearchData(row === null || row === void 0 ? void 0 : row.searchData),
17403
+ Cell: ({
17404
+ row
17405
+ }) => {
17406
+ var _row$original1;
17407
+ return GetCell(getDriverNameFromSearchData(row === null || row === void 0 ? void 0 : (_row$original1 = row.original) === null || _row$original1 === void 0 ? void 0 : _row$original1.searchData));
17408
+ },
17409
+ mobileCell: original => GetMobCell(getDriverNameFromSearchData(original === null || original === void 0 ? void 0 : original.searchData))
17410
+ }] : [])],
17083
17411
  serviceRequestIdKey: original => {
17084
17412
  var _original$t, _original$t$props;
17085
17413
  return original === null || original === void 0 ? void 0 : (_original$t = original[t("WT_INBOX_UNIQUE_BOOKING_NO")]) === null || _original$t === void 0 ? void 0 : (_original$t$props = _original$t.props) === null || _original$t$props === void 0 ? void 0 : _original$t$props.children;
@@ -17096,12 +17424,12 @@ const TableConfig = t => ({
17096
17424
  Cell: ({
17097
17425
  row
17098
17426
  }) => {
17099
- var _row$original9, _row$original9$search, _row$original0, _row$original0$search;
17427
+ var _row$original10, _row$original10$searc, _row$original11, _row$original11$searc;
17100
17428
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
17101
17429
  className: "link"
17102
17430
  }, /*#__PURE__*/React.createElement(Link, {
17103
- to: `${props.parentRoute}/booking-details/` + `${row === null || row === void 0 ? void 0 : (_row$original9 = row.original) === null || _row$original9 === void 0 ? void 0 : (_row$original9$search = _row$original9.searchData) === null || _row$original9$search === void 0 ? void 0 : _row$original9$search["bookingNo"]}`
17104
- }, (_row$original0 = row.original) === null || _row$original0 === void 0 ? void 0 : (_row$original0$search = _row$original0.searchData) === null || _row$original0$search === void 0 ? void 0 : _row$original0$search["bookingNo"])));
17431
+ to: `${props.parentRoute}/booking-details/` + `${row === null || row === void 0 ? void 0 : (_row$original10 = row.original) === null || _row$original10 === void 0 ? void 0 : (_row$original10$searc = _row$original10.searchData) === null || _row$original10$searc === void 0 ? void 0 : _row$original10$searc["bookingNo"]}`
17432
+ }, (_row$original11 = row.original) === null || _row$original11 === void 0 ? void 0 : (_row$original11$searc = _row$original11.searchData) === null || _row$original11$searc === void 0 ? void 0 : _row$original11$searc["bookingNo"])));
17105
17433
  },
17106
17434
  mobileCell: original => {
17107
17435
  var _original$searchData1;
@@ -17147,8 +17475,8 @@ const TableConfig = t => ({
17147
17475
  Cell: ({
17148
17476
  row
17149
17477
  }) => {
17150
- var _row$original1, _row$original1$search, _row$original10, _row$original10$searc;
17151
- return GetCell(getLocalityTranslation((_row$original1 = row.original) === null || _row$original1 === void 0 ? void 0 : (_row$original1$search = _row$original1.searchData) === null || _row$original1$search === void 0 ? void 0 : _row$original1$search["localityCode"], (_row$original10 = row.original) === null || _row$original10 === void 0 ? void 0 : (_row$original10$searc = _row$original10.searchData) === null || _row$original10$searc === void 0 ? void 0 : _row$original10$searc.tenantId, t));
17478
+ var _row$original12, _row$original12$searc, _row$original13, _row$original13$searc;
17479
+ return GetCell(getLocalityTranslation((_row$original12 = row.original) === null || _row$original12 === void 0 ? void 0 : (_row$original12$searc = _row$original12.searchData) === null || _row$original12$searc === void 0 ? void 0 : _row$original12$searc["localityCode"], (_row$original13 = row.original) === null || _row$original13 === void 0 ? void 0 : (_row$original13$searc = _row$original13.searchData) === null || _row$original13$searc === void 0 ? void 0 : _row$original13$searc.tenantId, t));
17152
17480
  },
17153
17481
  mobileCell: original => {
17154
17482
  var _original$searchData14, _original$searchData15;
@@ -17164,8 +17492,8 @@ const TableConfig = t => ({
17164
17492
  Cell: ({
17165
17493
  row
17166
17494
  }) => {
17167
- var _row$original12, _row$original12$workf, _row$original12$workf2;
17168
- return GetCell(t(`${row === null || row === void 0 ? void 0 : (_row$original12 = row.original) === null || _row$original12 === void 0 ? void 0 : (_row$original12$workf = _row$original12.workflowData) === null || _row$original12$workf === void 0 ? void 0 : (_row$original12$workf2 = _row$original12$workf.state) === null || _row$original12$workf2 === void 0 ? void 0 : _row$original12$workf2["applicationStatus"]}`));
17495
+ var _row$original15, _row$original15$workf, _row$original15$workf2;
17496
+ return GetCell(t(`${row === null || row === void 0 ? void 0 : (_row$original15 = row.original) === null || _row$original15 === void 0 ? void 0 : (_row$original15$workf = _row$original15.workflowData) === null || _row$original15$workf === void 0 ? void 0 : (_row$original15$workf2 = _row$original15$workf.state) === null || _row$original15$workf2 === void 0 ? void 0 : _row$original15$workf2["applicationStatus"]}`));
17169
17497
  },
17170
17498
  mobileCell: original => {
17171
17499
  var _original$workflowDat3, _original$workflowDat4;
@@ -17188,12 +17516,12 @@ const TableConfig = t => ({
17188
17516
  Cell: ({
17189
17517
  row
17190
17518
  }) => {
17191
- var _row$original13, _row$original13$searc, _row$original14, _row$original14$searc;
17519
+ var _row$original16, _row$original16$searc, _row$original17, _row$original17$searc;
17192
17520
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
17193
17521
  className: "link"
17194
17522
  }, /*#__PURE__*/React.createElement(Link, {
17195
- to: `${props.parentRoute}/booking-details/` + `${row === null || row === void 0 ? void 0 : (_row$original13 = row.original) === null || _row$original13 === void 0 ? void 0 : (_row$original13$searc = _row$original13.searchData) === null || _row$original13$searc === void 0 ? void 0 : _row$original13$searc["bookingNo"]}`
17196
- }, (_row$original14 = row.original) === null || _row$original14 === void 0 ? void 0 : (_row$original14$searc = _row$original14.searchData) === null || _row$original14$searc === void 0 ? void 0 : _row$original14$searc["bookingNo"])));
17523
+ to: `${props.parentRoute}/booking-details/` + `${row === null || row === void 0 ? void 0 : (_row$original16 = row.original) === null || _row$original16 === void 0 ? void 0 : (_row$original16$searc = _row$original16.searchData) === null || _row$original16$searc === void 0 ? void 0 : _row$original16$searc["bookingNo"]}`
17524
+ }, (_row$original17 = row.original) === null || _row$original17 === void 0 ? void 0 : (_row$original17$searc = _row$original17.searchData) === null || _row$original17$searc === void 0 ? void 0 : _row$original17$searc["bookingNo"])));
17197
17525
  },
17198
17526
  mobileCell: original => {
17199
17527
  var _original$searchData16;
@@ -17239,8 +17567,8 @@ const TableConfig = t => ({
17239
17567
  Cell: ({
17240
17568
  row
17241
17569
  }) => {
17242
- var _row$original15, _row$original15$searc, _row$original16, _row$original16$searc;
17243
- return GetCell(getLocalityTranslation((_row$original15 = row.original) === null || _row$original15 === void 0 ? void 0 : (_row$original15$searc = _row$original15.searchData) === null || _row$original15$searc === void 0 ? void 0 : _row$original15$searc["localityCode"], (_row$original16 = row.original) === null || _row$original16 === void 0 ? void 0 : (_row$original16$searc = _row$original16.searchData) === null || _row$original16$searc === void 0 ? void 0 : _row$original16$searc.tenantId, t));
17570
+ var _row$original18, _row$original18$searc, _row$original19, _row$original19$searc;
17571
+ return GetCell(getLocalityTranslation((_row$original18 = row.original) === null || _row$original18 === void 0 ? void 0 : (_row$original18$searc = _row$original18.searchData) === null || _row$original18$searc === void 0 ? void 0 : _row$original18$searc["localityCode"], (_row$original19 = row.original) === null || _row$original19 === void 0 ? void 0 : (_row$original19$searc = _row$original19.searchData) === null || _row$original19$searc === void 0 ? void 0 : _row$original19$searc.tenantId, t));
17244
17572
  },
17245
17573
  mobileCell: original => {
17246
17574
  var _original$searchData21, _original$searchData22;
@@ -17256,8 +17584,8 @@ const TableConfig = t => ({
17256
17584
  Cell: ({
17257
17585
  row
17258
17586
  }) => {
17259
- var _row$original18, _row$original18$workf, _row$original18$workf2;
17260
- return GetCell(t(`${row === null || row === void 0 ? void 0 : (_row$original18 = row.original) === null || _row$original18 === void 0 ? void 0 : (_row$original18$workf = _row$original18.workflowData) === null || _row$original18$workf === void 0 ? void 0 : (_row$original18$workf2 = _row$original18$workf.state) === null || _row$original18$workf2 === void 0 ? void 0 : _row$original18$workf2["applicationStatus"]}`));
17587
+ var _row$original21, _row$original21$workf, _row$original21$workf2;
17588
+ return GetCell(t(`${row === null || row === void 0 ? void 0 : (_row$original21 = row.original) === null || _row$original21 === void 0 ? void 0 : (_row$original21$workf = _row$original21.workflowData) === null || _row$original21$workf === void 0 ? void 0 : (_row$original21$workf2 = _row$original21$workf.state) === null || _row$original21$workf2 === void 0 ? void 0 : _row$original21$workf2["applicationStatus"]}`));
17261
17589
  },
17262
17590
  mobileCell: original => {
17263
17591
  var _original$workflowDat5, _original$workflowDat6;
@@ -17380,6 +17708,7 @@ const Filter = ({
17380
17708
  status: null,
17381
17709
  applicationStatus: null,
17382
17710
  fromDate: "",
17711
+ toDate: "",
17383
17712
  fillingPointId: null,
17384
17713
  fillingPoint: null
17385
17714
  };
@@ -17464,11 +17793,56 @@ const Filter = ({
17464
17793
  style: {
17465
17794
  marginTop: "16px"
17466
17795
  }
17467
- }, /*#__PURE__*/React.createElement("label", null, t("DATE")), /*#__PURE__*/React.createElement(DatePicker, {
17468
- date: _searchParams === null || _searchParams === void 0 ? void 0 : _searchParams.fromDate,
17469
- onChange: date => localParamChange({
17470
- fromDate: date
17471
- }),
17796
+ }, /*#__PURE__*/React.createElement("label", null, t("FROM_DATE")), /*#__PURE__*/React.createElement(DatePicker, {
17797
+ date: typeof (_searchParams === null || _searchParams === void 0 ? void 0 : _searchParams.fromDate) === "number" ? (() => {
17798
+ const d = new Date(_searchParams.fromDate);
17799
+ const y = d.getFullYear();
17800
+ const m = String(d.getMonth() + 1).padStart(2, "0");
17801
+ const day = String(d.getDate()).padStart(2, "0");
17802
+ return `${y}-${m}-${day}`;
17803
+ })() : _searchParams === null || _searchParams === void 0 ? void 0 : _searchParams.fromDate,
17804
+ onChange: date => {
17805
+ if (date) {
17806
+ const dateParts = date.split("-");
17807
+ const fromDateObj = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
17808
+ fromDateObj.setHours(0, 0, 0, 0);
17809
+ localParamChange({
17810
+ fromDate: fromDateObj.getTime()
17811
+ });
17812
+ } else {
17813
+ localParamChange({
17814
+ fromDate: ""
17815
+ });
17816
+ }
17817
+ },
17818
+ max: new Date().toISOString().split("T")[0]
17819
+ })), /*#__PURE__*/React.createElement("div", {
17820
+ className: "search-field-wrapper",
17821
+ style: {
17822
+ marginTop: "16px"
17823
+ }
17824
+ }, /*#__PURE__*/React.createElement("label", null, t("TO_DATE")), /*#__PURE__*/React.createElement(DatePicker, {
17825
+ date: typeof (_searchParams === null || _searchParams === void 0 ? void 0 : _searchParams.toDate) === "number" ? (() => {
17826
+ const d = new Date(_searchParams.toDate);
17827
+ const y = d.getFullYear();
17828
+ const m = String(d.getMonth() + 1).padStart(2, "0");
17829
+ const day = String(d.getDate()).padStart(2, "0");
17830
+ return `${y}-${m}-${day}`;
17831
+ })() : _searchParams === null || _searchParams === void 0 ? void 0 : _searchParams.toDate,
17832
+ onChange: date => {
17833
+ if (date) {
17834
+ const dateParts = date.split("-");
17835
+ const toDateObj = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
17836
+ toDateObj.setHours(23, 59, 59, 999);
17837
+ localParamChange({
17838
+ toDate: toDateObj.getTime()
17839
+ });
17840
+ } else {
17841
+ localParamChange({
17842
+ toDate: ""
17843
+ });
17844
+ }
17845
+ },
17472
17846
  max: new Date().toISOString().split("T")[0]
17473
17847
  })), /*#__PURE__*/React.createElement("div", {
17474
17848
  className: "tag-container hide-x-scrollbar"
@@ -22984,10 +23358,11 @@ function PropertyDocuments({
22984
23358
  const [filesArray, setFilesArray] = useState(() => []);
22985
23359
  const tenantId = Digit.ULBService.getCurrentTenantId();
22986
23360
  const [pdfFiles, setPdfFiles] = useState({});
23361
+ const [modalFile, setModalFile] = useState(null);
22987
23362
  useEffect(() => {
22988
23363
  var _acc;
22989
23364
  let acc = [];
22990
- documents === null || documents === void 0 ? void 0 : documents.forEach((element, index, array) => {
23365
+ documents === null || documents === void 0 ? void 0 : documents.forEach(element => {
22991
23366
  acc = [...acc, ...(element.values ? element.values : [])];
22992
23367
  });
22993
23368
  setFilesArray((_acc = acc) === null || _acc === void 0 ? void 0 : _acc.map(value => value === null || value === void 0 ? void 0 : value.fileStoreId));
@@ -23005,12 +23380,170 @@ function PropertyDocuments({
23005
23380
  }
23006
23381
  }, [filesArray]);
23007
23382
  const checkLocation = window.location.href.includes("employee/tl") || window.location.href.includes("/obps") || window.location.href.includes("employee/ws");
23383
+ const isWSLocation = window.location.href.includes("employee/ws");
23008
23384
  const isStakeholderApplication = window.location.href.includes("stakeholder");
23385
+ const getDocSubType = documentType => {
23386
+ if (!documentType) return "";
23387
+ const parts = documentType.split(".");
23388
+ const last = parts[parts.length - 1] || "";
23389
+ return last.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
23390
+ };
23391
+ const renderModal = () => {
23392
+ if (!modalFile) return null;
23393
+ const isPdf = modalFile.toLowerCase().includes(".pdf") || modalFile.toLowerCase().includes("pdf");
23394
+ return /*#__PURE__*/React.createElement(Modal, {
23395
+ headerBarMain: /*#__PURE__*/React.createElement("h1", {
23396
+ className: "heading-m"
23397
+ }, "Document Preview"),
23398
+ headerBarEnd: /*#__PURE__*/React.createElement("div", {
23399
+ onClick: () => setModalFile(null),
23400
+ style: {
23401
+ cursor: "pointer",
23402
+ padding: "5px",
23403
+ marginTop: "-5px"
23404
+ }
23405
+ }, /*#__PURE__*/React.createElement("svg", {
23406
+ xmlns: "http://www.w3.org/2000/svg",
23407
+ viewBox: "0 0 24 24",
23408
+ fill: "#000000",
23409
+ width: "24px",
23410
+ height: "24px"
23411
+ }, /*#__PURE__*/React.createElement("path", {
23412
+ d: "M0 0h24v24H0V0z",
23413
+ fill: "none"
23414
+ }), /*#__PURE__*/React.createElement("path", {
23415
+ 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"
23416
+ }))),
23417
+ hideSubmit: true,
23418
+ popupStyles: {
23419
+ maxWidth: "80vw",
23420
+ width: "100%"
23421
+ },
23422
+ popupModuleMianStyles: {
23423
+ display: "flex",
23424
+ justifyContent: "center",
23425
+ alignItems: "center",
23426
+ padding: "0",
23427
+ overflowY: "hidden"
23428
+ }
23429
+ }, isPdf ? /*#__PURE__*/React.createElement("iframe", {
23430
+ src: modalFile,
23431
+ title: "Document Preview",
23432
+ style: {
23433
+ width: "100%",
23434
+ height: "80vh",
23435
+ border: "none",
23436
+ display: "block"
23437
+ }
23438
+ }) : /*#__PURE__*/React.createElement("img", {
23439
+ src: modalFile,
23440
+ alt: "Document Preview",
23441
+ style: {
23442
+ maxWidth: "100%",
23443
+ maxHeight: "80vh",
23444
+ objectFit: "contain",
23445
+ display: "block"
23446
+ }
23447
+ }));
23448
+ };
23449
+ const renderDocumentRow = (value, index) => {
23450
+ var _pdfFiles$value$fileS;
23451
+ const fileUrl = (_pdfFiles$value$fileS = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS === void 0 ? void 0 : _pdfFiles$value$fileS.split(",")[0];
23452
+ const docSubType = getDocSubType(value === null || value === void 0 ? void 0 : value.documentType);
23453
+ const docUid = (value === null || value === void 0 ? void 0 : value.documentUid) || "";
23454
+ const isPhoto = value === null || value === void 0 ? void 0 : value.isPhoto;
23455
+ let typeLabel = "";
23456
+ let numLabel = "";
23457
+ let uploadLabel = "";
23458
+ if (value.title === "WS_IDENTITY_PROOF") {
23459
+ typeLabel = "Identity Proof*";
23460
+ numLabel = "Identity Proof Document Number";
23461
+ uploadLabel = "Upload Identity Proof Document*";
23462
+ } else if (value.title === "WS_OWNERSHIP_PROOF") {
23463
+ typeLabel = "Ownership Proof*";
23464
+ numLabel = "Ownership Proof Document Number";
23465
+ uploadLabel = "Upload Ownership Proof*";
23466
+ } else if (value.title === "WS_OTHER_DOCUMENTS") {
23467
+ typeLabel = "Other Documents*";
23468
+ numLabel = "Other Document Number";
23469
+ uploadLabel = "Upload Other Documents*";
23470
+ } else if (value.title === "WS_APPLICANT_PHOTO") {
23471
+ uploadLabel = "Upload Applicant Photo*";
23472
+ } else {
23473
+ typeLabel = ((value === null || value === void 0 ? void 0 : value.categoryLabel) || "Document") + "*";
23474
+ numLabel = "Document Number";
23475
+ uploadLabel = "Upload Document*";
23476
+ }
23477
+ return /*#__PURE__*/React.createElement("div", {
23478
+ key: index,
23479
+ style: {
23480
+ marginBottom: "24px"
23481
+ }
23482
+ }, /*#__PURE__*/React.createElement(StatusTable, null, !isPhoto && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
23483
+ label: typeLabel,
23484
+ text: docSubType || t("NA")
23485
+ }), /*#__PURE__*/React.createElement(Row, {
23486
+ label: numLabel,
23487
+ text: docUid || t("NA")
23488
+ })), /*#__PURE__*/React.createElement(Row, {
23489
+ label: uploadLabel,
23490
+ text: /*#__PURE__*/React.createElement("div", {
23491
+ style: {
23492
+ display: "flex",
23493
+ alignItems: "center",
23494
+ gap: "16px"
23495
+ }
23496
+ }, isPhoto ? fileUrl ? /*#__PURE__*/React.createElement("div", {
23497
+ style: {
23498
+ position: "relative"
23499
+ }
23500
+ }, /*#__PURE__*/React.createElement("img", {
23501
+ src: fileUrl,
23502
+ alt: "Applicant Photo",
23503
+ style: {
23504
+ width: "100px",
23505
+ height: "100px",
23506
+ objectFit: "cover",
23507
+ borderRadius: "4px",
23508
+ border: "1px solid #ccc"
23509
+ }
23510
+ })) : /*#__PURE__*/React.createElement("div", {
23511
+ style: {
23512
+ fontSize: "14px",
23513
+ color: "#505A5F"
23514
+ }
23515
+ }, t("NA")) : /*#__PURE__*/React.createElement("div", {
23516
+ onClick: () => {
23517
+ if (fileUrl) setModalFile(fileUrl);
23518
+ },
23519
+ disabled: !fileUrl,
23520
+ style: {
23521
+ cursor: "pointer"
23522
+ }
23523
+ }, /*#__PURE__*/React.createElement(ViewsIcon, null)), !isPhoto && /*#__PURE__*/React.createElement("label", {
23524
+ style: {
23525
+ display: "flex",
23526
+ alignItems: "center",
23527
+ gap: "8px",
23528
+ fontSize: "14px",
23529
+ color: "#0B0C0C",
23530
+ margin: 0
23531
+ }
23532
+ }, /*#__PURE__*/React.createElement("input", {
23533
+ type: "checkbox",
23534
+ style: {
23535
+ width: "18px",
23536
+ height: "18px",
23537
+ accentColor: "#F47738"
23538
+ }
23539
+ }), "Check Verified"))
23540
+ })));
23541
+ };
23009
23542
  return /*#__PURE__*/React.createElement("div", {
23010
23543
  style: {
23011
23544
  marginTop: "19px"
23012
23545
  }
23013
- }, !isStakeholderApplication && (documents === null || documents === void 0 ? void 0 : documents.map((document, index) => {
23546
+ }, renderModal(), !isStakeholderApplication && (documents === null || documents === void 0 ? void 0 : documents.map((document, index) => {
23014
23547
  var _document$values;
23015
23548
  return /*#__PURE__*/React.createElement(React.Fragment, {
23016
23549
  key: index
@@ -23018,7 +23551,7 @@ function PropertyDocuments({
23018
23551
  style: checkLocation ? {
23019
23552
  marginTop: "32px",
23020
23553
  marginBottom: "18px",
23021
- color: "#0B0C0C, 100%",
23554
+ color: "#0B0C0C",
23022
23555
  fontSize: "24px",
23023
23556
  lineHeight: "30px"
23024
23557
  } : {
@@ -23027,17 +23560,21 @@ function PropertyDocuments({
23027
23560
  color: "#505A5F",
23028
23561
  fontSize: "24px"
23029
23562
  }
23030
- }, t(document === null || document === void 0 ? void 0 : document.title)) : null, /*#__PURE__*/React.createElement("div", {
23563
+ }, t(document === null || document === void 0 ? void 0 : document.title)) : null, isWSLocation ? /*#__PURE__*/React.createElement("div", {
23564
+ style: {
23565
+ marginTop: "8px"
23566
+ }
23567
+ }, document !== null && document !== void 0 && document.values && (document === null || document === void 0 ? void 0 : document.values.length) > 0 ? document.values.map((value, idx) => renderDocumentRow(value, idx)) : !window.location.href.includes("citizen") && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, t("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))) : /*#__PURE__*/React.createElement("div", {
23031
23568
  style: {
23032
23569
  display: "flex",
23033
23570
  flexWrap: "wrap",
23034
23571
  justifyContent: "flex-start"
23035
23572
  }
23036
23573
  }, document !== null && document !== void 0 && document.values && (document === null || document === void 0 ? void 0 : document.values.length) > 0 ? document === null || document === void 0 ? void 0 : (_document$values = document.values) === null || _document$values === void 0 ? void 0 : _document$values.map((value, index) => {
23037
- var _pdfFiles$value$fileS, _value$documentType;
23574
+ var _pdfFiles$value$fileS2, _value$documentType;
23038
23575
  return /*#__PURE__*/React.createElement("a", {
23039
23576
  target: "_",
23040
- href: (_pdfFiles$value$fileS = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS === void 0 ? void 0 : _pdfFiles$value$fileS.split(",")[0],
23577
+ href: (_pdfFiles$value$fileS2 = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS2 === void 0 ? void 0 : _pdfFiles$value$fileS2.split(",")[0],
23041
23578
  style: {
23042
23579
  minWidth: "80px",
23043
23580
  marginRight: "10px",
@@ -23084,10 +23621,10 @@ function PropertyDocuments({
23084
23621
  fontSize: "24px"
23085
23622
  }
23086
23623
  }, t(document === null || document === void 0 ? void 0 : document.title)) : null, /*#__PURE__*/React.createElement("div", null, document !== null && document !== void 0 && document.values && (document === null || document === void 0 ? void 0 : document.values.length) > 0 ? document === null || document === void 0 ? void 0 : (_document$values2 = document.values) === null || _document$values2 === void 0 ? void 0 : _document$values2.map((value, index) => {
23087
- var _pdfFiles$value$fileS2;
23624
+ var _pdfFiles$value$fileS3;
23088
23625
  return /*#__PURE__*/React.createElement("a", {
23089
23626
  target: "_",
23090
- href: (_pdfFiles$value$fileS2 = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS2 === void 0 ? void 0 : _pdfFiles$value$fileS2.split(",")[0],
23627
+ href: (_pdfFiles$value$fileS3 = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS3 === void 0 ? void 0 : _pdfFiles$value$fileS3.split(",")[0],
23091
23628
  style: {
23092
23629
  minWidth: svgStyles !== null && svgStyles !== void 0 && svgStyles.minWidth ? svgStyles === null || svgStyles === void 0 ? void 0 : svgStyles.minWidth : "160px",
23093
23630
  marginRight: "20px"
@@ -23850,12 +24387,11 @@ const WSAdditonalDetails = ({
23850
24387
  wsAdditionalDetails,
23851
24388
  oldValue
23852
24389
  }) => {
23853
- var _wsAdditionalDetails$, _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4;
24390
+ var _wsAdditionalDetails$;
23854
24391
  const {
23855
24392
  t
23856
24393
  } = useTranslation();
23857
24394
  let filters = getQueryStringParams(location.search);
23858
- const isModify = filters === null || filters === void 0 ? void 0 : filters.mode;
23859
24395
  var {
23860
24396
  connectionDetails,
23861
24397
  plumberDetails,
@@ -23884,50 +24420,6 @@ const WSAdditonalDetails = ({
23884
24420
  label: `${t(`${value.title}`)}`,
23885
24421
  text: value !== null && value !== void 0 && value.oldValue ? value === null || value === void 0 ? void 0 : value.oldValue : value !== null && value !== void 0 && value.value ? value === null || value === void 0 ? void 0 : value.value : ""
23886
24422
  }));
23887
- })))), (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$2 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$2 === void 0 ? void 0 : _wsAdditionalDetails$2.plumberDetails) && isModify != "MODIFY" && /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(CardSubHeader, {
23888
- style: cardSubHeaderStyles()
23889
- }, t("WS_COMMON_PLUMBER_DETAILS")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
23890
- className: "plumber-details-new-value-wrapper"
23891
- }, plumberDetails === null || plumberDetails === void 0 ? void 0 : plumberDetails.map((value, index) => {
23892
- return /*#__PURE__*/React.createElement(Row, {
23893
- className: "border-none",
23894
- key: `${value.title}`,
23895
- label: `${t(`${value.title}`)}`,
23896
- text: value !== null && value !== void 0 && value.oldValue ? value === null || value === void 0 ? void 0 : value.oldValue : value !== null && value !== void 0 && value.value ? value === null || value === void 0 ? void 0 : value.value : "",
23897
- privacy: value.privacy
23898
- });
23899
- })))), (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$3 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$3 === void 0 ? void 0 : _wsAdditionalDetails$3.roadCuttingDetails) && isModify != "MODIFY" && /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(CardSubHeader, {
23900
- style: cardSubHeaderStyles()
23901
- }, t("WS_ROAD_CUTTING_DETAILS")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
23902
- className: "plumber-details-new-value-wrapper"
23903
- }, roadCuttingDetails === null || roadCuttingDetails === void 0 ? void 0 : roadCuttingDetails.map((value, index) => {
23904
- var _value$values;
23905
- return /*#__PURE__*/React.createElement("div", {
23906
- key: index,
23907
- style: (roadCuttingDetails === null || roadCuttingDetails === void 0 ? void 0 : roadCuttingDetails.length) > 1 ? {
23908
- border: "1px solid #D6D5D4",
23909
- background: "#FAFAFA",
23910
- borderRadius: "4px",
23911
- padding: "10px 10px 0px 10px",
23912
- margin: "5px 0px"
23913
- } : {}
23914
- }, value === null || value === void 0 ? void 0 : (_value$values = value.values) === null || _value$values === void 0 ? void 0 : _value$values.map(roadValue => /*#__PURE__*/React.createElement(Row, {
23915
- className: "border-none",
23916
- key: `${roadValue.title}`,
23917
- label: `${t(`${roadValue.title}`)}`,
23918
- text: roadValue !== null && roadValue !== void 0 && roadValue.oldValue ? roadValue === null || roadValue === void 0 ? void 0 : roadValue.oldValue : roadValue !== null && roadValue !== void 0 && roadValue.value ? roadValue === null || roadValue === void 0 ? void 0 : roadValue.value : ""
23919
- })));
23920
- })))), (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$4 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$4 === void 0 ? void 0 : _wsAdditionalDetails$4.activationDetails) && /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(CardSubHeader, {
23921
- style: cardSubHeaderStyles()
23922
- }, t("WS_ACTIVATION_DETAILS")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
23923
- className: "plumber-details-new-value-wrapper"
23924
- }, activationDetails === null || activationDetails === void 0 ? void 0 : activationDetails.map((value, index) => {
23925
- return /*#__PURE__*/React.createElement(Row, {
23926
- className: "border-none",
23927
- key: `${value.title}`,
23928
- label: `${t(`${value.title}`)}`,
23929
- text: value !== null && value !== void 0 && value.oldValue ? value === null || value === void 0 ? void 0 : value.oldValue : value !== null && value !== void 0 && value.value ? value === null || value === void 0 ? void 0 : value.value : ""
23930
- });
23931
24423
  }))))));
23932
24424
  };
23933
24425