Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SW fixes #382

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const getResponse = (data, vendorDetails = {}, tenantId) => {
{ title: "FSM_REGISTRY_APPLICANT_MOBILE_NO", value: data?.mobileNumber },
{ title: "ES_APPLICATION_DETAILS_LOCATION_PINCODE", value: data?.address?.[0]?.pincode },
{ title: "ES_APPLICATION_DETAILS_LOCATION_CITY", value: data?.address?.[0]?.city },
{ title: "CS_APPLICATION_DETAILS_MOHALLA", value: data?.address?.[0]?.locality?.code },
{ title: "CS_APPLICATION_DETAILS_MOHALLA", value: `${Digit.Utils.locale.getRevenueLocalityCode(data?.address?.[0]?.locality?.code, tenantId)}` },
{ title: "CS_APPLICATION_DETAILS_STREET", value: data?.address?.[0]?.street },
{ title: "ES_APPLICATION_DETAILS_LOCATION_DOOR", value: data?.address?.[0]?.doorNo },
{ title: "ES_APPLICATION_DETAILS_LOCATION_LANDMARK", value: data?.address?.[0]?.landmark },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ const AddWorker = ({ parentUrl, heading }) => {
const name = data?.name;
const mobileNumber = data?.SelectEmployeePhoneNumber?.mobileNumber;
const gender = data?.selectGender?.code;
const dob = new Date(`${data.dob}`).getTime() || new Date(`1/1/1970`).getTime();
const photograph = data?.documents?.img_measurement_book?.[0]?.[1]?.fileStoreId?.fileStoreId || null;
const dob = data.dob ? new Date(`${data.dob}`).getTime() : null;
const photograph = data?.documents?.img_photo?.[0]?.[1]?.fileStoreId?.fileStoreId || null;
const pincode = data?.pincode;
const city = data?.address?.city?.name;
const locality = data?.address?.locality?.code;
Expand Down Expand Up @@ -224,7 +224,7 @@ const AddWorker = ({ parentUrl, heading }) => {
},
onSuccess: async (data, variables) => {
// setShowToast({ key: "success", action: "ADD_WORKER" });
queryClient.invalidateQueries("FSM_WORKER_SEARCH");
// queryClient.invalidateQueries("FSM_WORKER_SEARCH");
// if (roleDetails?.some((entry) => entry.plant)) {
// try {
// const PlantCode = roleDetails
Expand Down Expand Up @@ -292,7 +292,7 @@ const AddWorker = ({ parentUrl, heading }) => {
onFormValueChange={onFormValueChange}
noBreakLine={true}
cardStyle={{
padding:"1rem 1.5rem"
padding: "1rem 1.5rem",
}}
/>
{showToast && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const WorkerDetails = (props) => {

mutateUpdateWorker(formData, {
onError: (error, variables) => {
setShowToast({ key: "error", action: error });
setShowToast({ key: "error", action: "DELETE_WORKER_FAILED" });
setTimeout(closeToast, 5000);
},
onSuccess: (data, variables) => {
Expand Down Expand Up @@ -204,7 +204,7 @@ const WorkerDetails = (props) => {

mutateVendor(formData, {
onError: (error, variables) => {
setShowToast({ key: "error", action: error });
setShowToast({ key: "error", action: "DELETE_VENDOR_FAILED" });
setTimeout(closeToast, 5000);
},
onSuccess: (data, variables) => {
Expand All @@ -231,7 +231,7 @@ const WorkerDetails = (props) => {
};
mutateVendor(formData, {
onError: (error, variables) => {
setShowToast({ key: "error", action: error });
setShowToast({ key: "error", action: "ADD_VENDOR_FAILED" });
refetch();
setTimeout(closeToast, 5000);
},
Expand Down Expand Up @@ -263,7 +263,7 @@ const WorkerDetails = (props) => {

mutateVendor(formData, {
onError: (error, variables) => {
setShowToast({ key: "error", action: error });
setShowToast({ key: "error", action: "EDIT_VENDOR_FAILED" });
setTimeout(closeToast, 5000);
},
onSuccess: (data, variables) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ export const FsmBreadCrumb = ({ location }) => {
const isNewVendor = location?.pathname?.includes("new-vendor");
const isNewVehicle = location?.pathname?.includes("new-vehicle");
const isNewDriver = location?.pathname?.includes("new-driver");
const isAddWorker = location?.pathname?.includes("new-worker");
const isEditWorker = location?.pathname?.includes("edit-worker");
const isWorkerDetails = location?.pathname?.includes("worker-details");

const [search, setSearch] = useState(false);
const [id, setId] = useState(false);

const searchParams = new URLSearchParams(location.search);
const paramId = searchParams.get("id");
useEffect(() => {
if (!search) {
setSearch(isSearch);
Expand All @@ -62,14 +66,16 @@ export const FsmBreadCrumb = ({ location }) => {
show: isFsm,
},
{
path: isRegistry
? `/${window?.contextPath}/employee/fsm/registry?selectedTabs=VENDOR`
: FSTPO
? `/${window?.contextPath}/employee/fsm/fstp-inbox`
: `/${window?.contextPath}/employee`,
path:
isVendorDetails || isVehicleDetails || isWorkerDetails
? `/${window?.contextPath}/employee/fsm/registry`
: FSTPO
? `/${window?.contextPath}/employee/fsm/fstp-inbox`
: `/${window?.contextPath}/employee`,
query: isVendorDetails ? "selectedTabs=VENDOR" : isVehicleDetails ? "selectedTabs=VEHICLE" : isWorkerDetails ? "selectedTabs=WORKER" : null,
content: isVehicleLog ? t("ES_TITLE_INBOX") : "FSM",
show: isFsm,
isBack: true
isBack: isVendorDetails || isVehicleDetails || isWorkerDetails ? false : true,
},
{
path: isNewApplication ? `/${window?.contextPath}/employee/fsm/new-application` : "",
Expand Down Expand Up @@ -108,9 +114,15 @@ export const FsmBreadCrumb = ({ location }) => {
content: t("ES_TITLE_DRIVER_DETAILS"),
show: isRegistry && (isDriverDetails || isDriverEdit),
},
{
path: `/${window?.contextPath}/employee/fsm/registry/worker-details`,
query: `id=${paramId}`,
content: t("ES_TITLE_WORKER_DETAILS"),
show: isRegistry && (isWorkerDetails || isEditWorker),
},
{
content: t("ES_TITLE_VENDOR_EDIT"),
show: isRegistry && (isVendorEdit || isVehicleEdit || isDriverEdit),
show: isRegistry && (isVendorEdit || isVehicleEdit || isDriverEdit || isEditWorker),
},
{
path: `/${window?.contextPath}/employee/fsm/modify-application/` + id,
Expand All @@ -124,8 +136,10 @@ export const FsmBreadCrumb = ({ location }) => {
? t("ES_FSM_REGISTRY_DETAILS_TYPE_VEHICLE")
: isNewDriver
? t("ES_FSM_REGISTRY_DETAILS_TYPE_DRIVER")
: isAddWorker
? t("ES_FSM_REGISTRY_DETAILS_TYPE_WORKER")
: null,
show: isRegistry && (isNewVendor || isNewVehicle || isNewDriver),
show: isRegistry && (isNewVendor || isNewVehicle || isNewDriver || isAddWorker),
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const testResultsConfig = ({ t, testDetailsData, testCriteriaData }) => {

const testParamConfig = testParams?.map((i) => {
return {
label: `${t(i?.i18nKey)} ${i?.unit !== "NA" || i?.unit === null ? t(i?.unit) : ""}` || "N/A",
label: `${t(i?.i18nKey)}` || "N/A",
isMandatory: true,
type: "text",
disable: false,
Expand Down