Skip to content

Commit

Permalink
SAN-629: Pre filled Vehicle Number for New Vehicle entry to reduce du…
Browse files Browse the repository at this point in the history
…plication of effor (#3566)

Co-authored-by: nabeelmd-eGov <[email protected]>
  • Loading branch information
2 people authored and gajendran.c committed Aug 4, 2022
1 parent cc1c0b5 commit 0fe291c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const FstpOperatorDetails = () => {

const workflowDetails = Digit.Hooks.useWorkflowDetails({
tenantId: tenantId,
id: applicationNos,
id: location.pathname.includes("fstp-operator-details") ? applicationNos : "",
moduleCode: "FSM_VEHICLE_TRIP",
role: "FSM_EMP_FSTPO"
});
Expand Down Expand Up @@ -201,13 +201,6 @@ const FstpOperatorDetails = () => {
};

const handleCreate = () => {
if (newVehicleNumber === null || newVehicleNumber?.trim()?.length === 0) {
setShowToast({ key: "error", action: `ES_FSTP_INVALID_VEHICLE_NUMBER` });
setTimeout(() => {
closeToast();
}, 2000);
return;
}
if (newDsoName === null || newDsoName?.trim()?.length === 0) {
setShowToast({ key: "error", action: `ES_FSTP_INVALID_DSO_NAME` });
setTimeout(() => {
Expand Down Expand Up @@ -260,7 +253,7 @@ const FstpOperatorDetails = () => {
temp.tripStartTime = tripStartTimestamp;
temp.tripEndTime = timeStamp;
temp.volumeCarried = wasteCollected;
temp.additionalDetails = { vehicleNumber: newVehicleNumber, dsoName: newDsoName, locality: newLocality, fileStoreId: uploadedFile, comments: comments };
temp.additionalDetails = { vehicleNumber: applicationNos, dsoName: newDsoName, locality: newLocality, fileStoreId: uploadedFile, comments: comments };
temp.businessService = "FSM_VEHICLE_TRIP";
temp.tripDetails = [{
tenantId: tenantId,
Expand Down Expand Up @@ -342,11 +335,7 @@ const FstpOperatorDetails = () => {
const vehicleData = [
{
title: `${t("ES_INBOX_VEHICLE_NO")} *`,
value: vehicle?.vehicle?.registrationNumber || <TextInput
//style={{ width: "40%" }}
onChange={(e) => onChangeVehicleNumber(e.target.value)}
value={newVehicleNumber}
/>,
value: vehicle?.vehicle?.registrationNumber || applicationNos,
},
{
title: `${t("ES_INBOX_DSO_NAME")} *`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const FstpServiceRequest = () => {
}

if (vehicleLog?.length === 0 && tripDetails?.length === 0 && isSuccess && !isSearchLoading && tripDetail?.length === 0 && !isVehiclesLoading) {
history.push("/digit-ui/employee/fsm/fstp/new-vehicle-entry");
history.push(`/digit-ui/employee/fsm/fstp/new-vehicle-entry/${vehicleNumber}`);
}

let citizenInfo = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const EmployeeApp = ({ path, url, userType }) => {
<PrivateRoute exact path={`${path}/fstp-add-vehicle`} component={() => <FstpAddVehicle />} />
<PrivateRoute exact path={`${path}/fstp-fsm-request/:id`} component={() => <FstpServiceRequest />} />
<PrivateRoute exact path={`${path}/home`} component={() => <ULBHomeCard module={module} />} />
<PrivateRoute path={`${path}/fstp/new-vehicle-entry`} component={FstpOperatorDetails} />
<PrivateRoute path={`${path}/fstp/new-vehicle-entry/:id`} component={FstpOperatorDetails} />
</div>
</React.Fragment>
</Switch>
Expand Down

0 comments on commit 0fe291c

Please sign in to comment.