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

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
  };
@@ -3759,6 +3978,18 @@ const Inbox = ({
3759
3978
  if (searchParams !== null && searchParams !== void 0 && searchParams.bookingNo) {
3760
3979
  moduleSearchCriteria.bookingNo = searchParams.bookingNo;
3761
3980
  }
3981
+ if (searchParams !== null && searchParams !== void 0 && searchParams.vendorName) {
3982
+ moduleSearchCriteria.vendorName = searchParams.vendorName;
3983
+ }
3984
+ if (searchParams !== null && searchParams !== void 0 && searchParams.vehicleName) {
3985
+ moduleSearchCriteria.vehicleName = searchParams.vehicleName;
3986
+ }
3987
+ if (searchParams !== null && searchParams !== void 0 && searchParams.driverName) {
3988
+ moduleSearchCriteria.driverName = searchParams.driverName;
3989
+ }
3990
+ if (searchParams !== null && searchParams !== void 0 && searchParams.fillingPointId) {
3991
+ moduleSearchCriteria.fillingPointId = searchParams.fillingPointId;
3992
+ }
3762
3993
  if (Array.isArray(searchParams === null || searchParams === void 0 ? void 0 : searchParams.locality) && searchParams.locality.length > 0) {
3763
3994
  moduleSearchCriteria.locality = searchParams.locality.map(item => String((item === null || item === void 0 ? void 0 : item.code) || "").split("_").pop()).filter(Boolean);
3764
3995
  }
@@ -16964,6 +17195,23 @@ const getLocalityTranslation = (localityCode, tenantId, t) => {
16964
17195
  const prefix = tenant.replace(".", "_").toUpperCase();
16965
17196
  return t(`${prefix}_REVENUE_${localityCode}`);
16966
17197
  };
17198
+ const getVendorNameFromSearchData = searchData => {
17199
+ var _searchData$vendor;
17200
+ 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) || "-";
17201
+ };
17202
+ const getVehicleNameFromSearchData = searchData => {
17203
+ var _searchData$vendor2, _searchData$vendor2$v;
17204
+ 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)));
17205
+ 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) || "-";
17206
+ };
17207
+ const getDriverNameFromSearchData = searchData => {
17208
+ var _searchData$vendor3, _searchData$vendor3$d, _mappedDriver$owner;
17209
+ 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 => {
17210
+ var _driver$owner;
17211
+ 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);
17212
+ }));
17213
+ 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) || "-";
17214
+ };
16967
17215
  const TableConfig = t => ({
16968
17216
  WT: {
16969
17217
  inboxColumns: props => [{
@@ -17079,7 +17327,40 @@ const TableConfig = t => ({
17079
17327
  var _original$workflowDat, _original$workflowDat2;
17080
17328
  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
17329
  }
17082
- }],
17330
+ }, ...(window.location.href.includes("fixed-point") ? [{
17331
+ Header: t("WT_VENDOR_NAME"),
17332
+ id: "vendorName",
17333
+ accessor: row => getVendorNameFromSearchData(row === null || row === void 0 ? void 0 : row.searchData),
17334
+ Cell: ({
17335
+ row
17336
+ }) => {
17337
+ var _row$original9;
17338
+ return GetCell(getVendorNameFromSearchData(row === null || row === void 0 ? void 0 : (_row$original9 = row.original) === null || _row$original9 === void 0 ? void 0 : _row$original9.searchData));
17339
+ },
17340
+ mobileCell: original => GetMobCell(getVendorNameFromSearchData(original === null || original === void 0 ? void 0 : original.searchData))
17341
+ }, {
17342
+ Header: t("WT_VEHICLE_NO"),
17343
+ id: "vehicleNumber",
17344
+ accessor: row => getVehicleNameFromSearchData(row === null || row === void 0 ? void 0 : row.searchData),
17345
+ Cell: ({
17346
+ row
17347
+ }) => {
17348
+ var _row$original0;
17349
+ return GetCell(getVehicleNameFromSearchData(row === null || row === void 0 ? void 0 : (_row$original0 = row.original) === null || _row$original0 === void 0 ? void 0 : _row$original0.searchData));
17350
+ },
17351
+ mobileCell: original => GetMobCell(getVehicleNameFromSearchData(original === null || original === void 0 ? void 0 : original.searchData))
17352
+ }, {
17353
+ Header: t("WT_DRIVER_NAME"),
17354
+ id: "driverName",
17355
+ accessor: row => getDriverNameFromSearchData(row === null || row === void 0 ? void 0 : row.searchData),
17356
+ Cell: ({
17357
+ row
17358
+ }) => {
17359
+ var _row$original1;
17360
+ return GetCell(getDriverNameFromSearchData(row === null || row === void 0 ? void 0 : (_row$original1 = row.original) === null || _row$original1 === void 0 ? void 0 : _row$original1.searchData));
17361
+ },
17362
+ mobileCell: original => GetMobCell(getDriverNameFromSearchData(original === null || original === void 0 ? void 0 : original.searchData))
17363
+ }] : [])],
17083
17364
  serviceRequestIdKey: original => {
17084
17365
  var _original$t, _original$t$props;
17085
17366
  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 +17377,12 @@ const TableConfig = t => ({
17096
17377
  Cell: ({
17097
17378
  row
17098
17379
  }) => {
17099
- var _row$original9, _row$original9$search, _row$original0, _row$original0$search;
17380
+ var _row$original10, _row$original10$searc, _row$original11, _row$original11$searc;
17100
17381
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
17101
17382
  className: "link"
17102
17383
  }, /*#__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"])));
17384
+ 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"]}`
17385
+ }, (_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
17386
  },
17106
17387
  mobileCell: original => {
17107
17388
  var _original$searchData1;
@@ -17147,8 +17428,8 @@ const TableConfig = t => ({
17147
17428
  Cell: ({
17148
17429
  row
17149
17430
  }) => {
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));
17431
+ var _row$original12, _row$original12$searc, _row$original13, _row$original13$searc;
17432
+ 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
17433
  },
17153
17434
  mobileCell: original => {
17154
17435
  var _original$searchData14, _original$searchData15;
@@ -17164,8 +17445,8 @@ const TableConfig = t => ({
17164
17445
  Cell: ({
17165
17446
  row
17166
17447
  }) => {
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"]}`));
17448
+ var _row$original15, _row$original15$workf, _row$original15$workf2;
17449
+ 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
17450
  },
17170
17451
  mobileCell: original => {
17171
17452
  var _original$workflowDat3, _original$workflowDat4;
@@ -17188,12 +17469,12 @@ const TableConfig = t => ({
17188
17469
  Cell: ({
17189
17470
  row
17190
17471
  }) => {
17191
- var _row$original13, _row$original13$searc, _row$original14, _row$original14$searc;
17472
+ var _row$original16, _row$original16$searc, _row$original17, _row$original17$searc;
17192
17473
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
17193
17474
  className: "link"
17194
17475
  }, /*#__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"])));
17476
+ 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"]}`
17477
+ }, (_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
17478
  },
17198
17479
  mobileCell: original => {
17199
17480
  var _original$searchData16;
@@ -17239,8 +17520,8 @@ const TableConfig = t => ({
17239
17520
  Cell: ({
17240
17521
  row
17241
17522
  }) => {
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));
17523
+ var _row$original18, _row$original18$searc, _row$original19, _row$original19$searc;
17524
+ 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
17525
  },
17245
17526
  mobileCell: original => {
17246
17527
  var _original$searchData21, _original$searchData22;
@@ -17256,8 +17537,8 @@ const TableConfig = t => ({
17256
17537
  Cell: ({
17257
17538
  row
17258
17539
  }) => {
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"]}`));
17540
+ var _row$original21, _row$original21$workf, _row$original21$workf2;
17541
+ 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
17542
  },
17262
17543
  mobileCell: original => {
17263
17544
  var _original$workflowDat5, _original$workflowDat6;
@@ -22984,10 +23265,11 @@ function PropertyDocuments({
22984
23265
  const [filesArray, setFilesArray] = useState(() => []);
22985
23266
  const tenantId = Digit.ULBService.getCurrentTenantId();
22986
23267
  const [pdfFiles, setPdfFiles] = useState({});
23268
+ const [modalFile, setModalFile] = useState(null);
22987
23269
  useEffect(() => {
22988
23270
  var _acc;
22989
23271
  let acc = [];
22990
- documents === null || documents === void 0 ? void 0 : documents.forEach((element, index, array) => {
23272
+ documents === null || documents === void 0 ? void 0 : documents.forEach(element => {
22991
23273
  acc = [...acc, ...(element.values ? element.values : [])];
22992
23274
  });
22993
23275
  setFilesArray((_acc = acc) === null || _acc === void 0 ? void 0 : _acc.map(value => value === null || value === void 0 ? void 0 : value.fileStoreId));
@@ -23005,12 +23287,170 @@ function PropertyDocuments({
23005
23287
  }
23006
23288
  }, [filesArray]);
23007
23289
  const checkLocation = window.location.href.includes("employee/tl") || window.location.href.includes("/obps") || window.location.href.includes("employee/ws");
23290
+ const isWSLocation = window.location.href.includes("employee/ws");
23008
23291
  const isStakeholderApplication = window.location.href.includes("stakeholder");
23292
+ const getDocSubType = documentType => {
23293
+ if (!documentType) return "";
23294
+ const parts = documentType.split(".");
23295
+ const last = parts[parts.length - 1] || "";
23296
+ return last.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
23297
+ };
23298
+ const renderModal = () => {
23299
+ if (!modalFile) return null;
23300
+ const isPdf = modalFile.toLowerCase().includes(".pdf") || modalFile.toLowerCase().includes("pdf");
23301
+ return /*#__PURE__*/React.createElement(Modal, {
23302
+ headerBarMain: /*#__PURE__*/React.createElement("h1", {
23303
+ className: "heading-m"
23304
+ }, "Document Preview"),
23305
+ headerBarEnd: /*#__PURE__*/React.createElement("div", {
23306
+ onClick: () => setModalFile(null),
23307
+ style: {
23308
+ cursor: "pointer",
23309
+ padding: "5px",
23310
+ marginTop: "-5px"
23311
+ }
23312
+ }, /*#__PURE__*/React.createElement("svg", {
23313
+ xmlns: "http://www.w3.org/2000/svg",
23314
+ viewBox: "0 0 24 24",
23315
+ fill: "#000000",
23316
+ width: "24px",
23317
+ height: "24px"
23318
+ }, /*#__PURE__*/React.createElement("path", {
23319
+ d: "M0 0h24v24H0V0z",
23320
+ fill: "none"
23321
+ }), /*#__PURE__*/React.createElement("path", {
23322
+ 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"
23323
+ }))),
23324
+ hideSubmit: true,
23325
+ popupStyles: {
23326
+ maxWidth: "80vw",
23327
+ width: "100%"
23328
+ },
23329
+ popupModuleMianStyles: {
23330
+ display: "flex",
23331
+ justifyContent: "center",
23332
+ alignItems: "center",
23333
+ padding: "0",
23334
+ overflowY: "hidden"
23335
+ }
23336
+ }, isPdf ? /*#__PURE__*/React.createElement("iframe", {
23337
+ src: modalFile,
23338
+ title: "Document Preview",
23339
+ style: {
23340
+ width: "100%",
23341
+ height: "80vh",
23342
+ border: "none",
23343
+ display: "block"
23344
+ }
23345
+ }) : /*#__PURE__*/React.createElement("img", {
23346
+ src: modalFile,
23347
+ alt: "Document Preview",
23348
+ style: {
23349
+ maxWidth: "100%",
23350
+ maxHeight: "80vh",
23351
+ objectFit: "contain",
23352
+ display: "block"
23353
+ }
23354
+ }));
23355
+ };
23356
+ const renderDocumentRow = (value, index) => {
23357
+ var _pdfFiles$value$fileS;
23358
+ const fileUrl = (_pdfFiles$value$fileS = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS === void 0 ? void 0 : _pdfFiles$value$fileS.split(",")[0];
23359
+ const docSubType = getDocSubType(value === null || value === void 0 ? void 0 : value.documentType);
23360
+ const docUid = (value === null || value === void 0 ? void 0 : value.documentUid) || "";
23361
+ const isPhoto = value === null || value === void 0 ? void 0 : value.isPhoto;
23362
+ let typeLabel = "";
23363
+ let numLabel = "";
23364
+ let uploadLabel = "";
23365
+ if (value.title === "WS_IDENTITY_PROOF") {
23366
+ typeLabel = "Identity Proof*";
23367
+ numLabel = "Identity Proof Document Number";
23368
+ uploadLabel = "Upload Identity Proof Document*";
23369
+ } else if (value.title === "WS_OWNERSHIP_PROOF") {
23370
+ typeLabel = "Ownership Proof*";
23371
+ numLabel = "Ownership Proof Document Number";
23372
+ uploadLabel = "Upload Ownership Proof*";
23373
+ } else if (value.title === "WS_OTHER_DOCUMENTS") {
23374
+ typeLabel = "Other Documents*";
23375
+ numLabel = "Other Document Number";
23376
+ uploadLabel = "Upload Other Documents*";
23377
+ } else if (value.title === "WS_APPLICANT_PHOTO") {
23378
+ uploadLabel = "Upload Applicant Photo*";
23379
+ } else {
23380
+ typeLabel = ((value === null || value === void 0 ? void 0 : value.categoryLabel) || "Document") + "*";
23381
+ numLabel = "Document Number";
23382
+ uploadLabel = "Upload Document*";
23383
+ }
23384
+ return /*#__PURE__*/React.createElement("div", {
23385
+ key: index,
23386
+ style: {
23387
+ marginBottom: "24px"
23388
+ }
23389
+ }, /*#__PURE__*/React.createElement(StatusTable, null, !isPhoto && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
23390
+ label: typeLabel,
23391
+ text: docSubType || t("NA")
23392
+ }), /*#__PURE__*/React.createElement(Row, {
23393
+ label: numLabel,
23394
+ text: docUid || t("NA")
23395
+ })), /*#__PURE__*/React.createElement(Row, {
23396
+ label: uploadLabel,
23397
+ text: /*#__PURE__*/React.createElement("div", {
23398
+ style: {
23399
+ display: "flex",
23400
+ alignItems: "center",
23401
+ gap: "16px"
23402
+ }
23403
+ }, isPhoto ? fileUrl ? /*#__PURE__*/React.createElement("div", {
23404
+ style: {
23405
+ position: "relative"
23406
+ }
23407
+ }, /*#__PURE__*/React.createElement("img", {
23408
+ src: fileUrl,
23409
+ alt: "Applicant Photo",
23410
+ style: {
23411
+ width: "100px",
23412
+ height: "100px",
23413
+ objectFit: "cover",
23414
+ borderRadius: "4px",
23415
+ border: "1px solid #ccc"
23416
+ }
23417
+ })) : /*#__PURE__*/React.createElement("div", {
23418
+ style: {
23419
+ fontSize: "14px",
23420
+ color: "#505A5F"
23421
+ }
23422
+ }, t("NA")) : /*#__PURE__*/React.createElement("div", {
23423
+ onClick: () => {
23424
+ if (fileUrl) setModalFile(fileUrl);
23425
+ },
23426
+ disabled: !fileUrl,
23427
+ style: {
23428
+ cursor: "pointer"
23429
+ }
23430
+ }, /*#__PURE__*/React.createElement(ViewsIcon, null)), !isPhoto && /*#__PURE__*/React.createElement("label", {
23431
+ style: {
23432
+ display: "flex",
23433
+ alignItems: "center",
23434
+ gap: "8px",
23435
+ fontSize: "14px",
23436
+ color: "#0B0C0C",
23437
+ margin: 0
23438
+ }
23439
+ }, /*#__PURE__*/React.createElement("input", {
23440
+ type: "checkbox",
23441
+ style: {
23442
+ width: "18px",
23443
+ height: "18px",
23444
+ accentColor: "#F47738"
23445
+ }
23446
+ }), "Check Verified"))
23447
+ })));
23448
+ };
23009
23449
  return /*#__PURE__*/React.createElement("div", {
23010
23450
  style: {
23011
23451
  marginTop: "19px"
23012
23452
  }
23013
- }, !isStakeholderApplication && (documents === null || documents === void 0 ? void 0 : documents.map((document, index) => {
23453
+ }, renderModal(), !isStakeholderApplication && (documents === null || documents === void 0 ? void 0 : documents.map((document, index) => {
23014
23454
  var _document$values;
23015
23455
  return /*#__PURE__*/React.createElement(React.Fragment, {
23016
23456
  key: index
@@ -23018,7 +23458,7 @@ function PropertyDocuments({
23018
23458
  style: checkLocation ? {
23019
23459
  marginTop: "32px",
23020
23460
  marginBottom: "18px",
23021
- color: "#0B0C0C, 100%",
23461
+ color: "#0B0C0C",
23022
23462
  fontSize: "24px",
23023
23463
  lineHeight: "30px"
23024
23464
  } : {
@@ -23027,17 +23467,21 @@ function PropertyDocuments({
23027
23467
  color: "#505A5F",
23028
23468
  fontSize: "24px"
23029
23469
  }
23030
- }, t(document === null || document === void 0 ? void 0 : document.title)) : null, /*#__PURE__*/React.createElement("div", {
23470
+ }, t(document === null || document === void 0 ? void 0 : document.title)) : null, isWSLocation ? /*#__PURE__*/React.createElement("div", {
23471
+ style: {
23472
+ marginTop: "8px"
23473
+ }
23474
+ }, 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
23475
  style: {
23032
23476
  display: "flex",
23033
23477
  flexWrap: "wrap",
23034
23478
  justifyContent: "flex-start"
23035
23479
  }
23036
23480
  }, 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;
23481
+ var _pdfFiles$value$fileS2, _value$documentType;
23038
23482
  return /*#__PURE__*/React.createElement("a", {
23039
23483
  target: "_",
23040
- href: (_pdfFiles$value$fileS = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS === void 0 ? void 0 : _pdfFiles$value$fileS.split(",")[0],
23484
+ href: (_pdfFiles$value$fileS2 = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS2 === void 0 ? void 0 : _pdfFiles$value$fileS2.split(",")[0],
23041
23485
  style: {
23042
23486
  minWidth: "80px",
23043
23487
  marginRight: "10px",
@@ -23084,10 +23528,10 @@ function PropertyDocuments({
23084
23528
  fontSize: "24px"
23085
23529
  }
23086
23530
  }, 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;
23531
+ var _pdfFiles$value$fileS3;
23088
23532
  return /*#__PURE__*/React.createElement("a", {
23089
23533
  target: "_",
23090
- href: (_pdfFiles$value$fileS2 = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS2 === void 0 ? void 0 : _pdfFiles$value$fileS2.split(",")[0],
23534
+ href: (_pdfFiles$value$fileS3 = pdfFiles[value.fileStoreId]) === null || _pdfFiles$value$fileS3 === void 0 ? void 0 : _pdfFiles$value$fileS3.split(",")[0],
23091
23535
  style: {
23092
23536
  minWidth: svgStyles !== null && svgStyles !== void 0 && svgStyles.minWidth ? svgStyles === null || svgStyles === void 0 ? void 0 : svgStyles.minWidth : "160px",
23093
23537
  marginRight: "20px"
@@ -23850,12 +24294,11 @@ const WSAdditonalDetails = ({
23850
24294
  wsAdditionalDetails,
23851
24295
  oldValue
23852
24296
  }) => {
23853
- var _wsAdditionalDetails$, _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4;
24297
+ var _wsAdditionalDetails$;
23854
24298
  const {
23855
24299
  t
23856
24300
  } = useTranslation();
23857
24301
  let filters = getQueryStringParams(location.search);
23858
- const isModify = filters === null || filters === void 0 ? void 0 : filters.mode;
23859
24302
  var {
23860
24303
  connectionDetails,
23861
24304
  plumberDetails,
@@ -23884,50 +24327,6 @@ const WSAdditonalDetails = ({
23884
24327
  label: `${t(`${value.title}`)}`,
23885
24328
  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
24329
  }));
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
24330
  }))))));
23932
24331
  };
23933
24332