Skip to content

Commit

Permalink
Master dev sync 19 (#428)
Browse files Browse the repository at this point in the history
* Sm 3833 (#417)

* SM-3883 resolving dso search

* SM-3883 WF timeline fixes for comments

* SM-3883 WF timeline fixes for comments

---------

Co-authored-by: nabeelmd-eGov <nabeel.md@egovernments.com>

* SM-3883 dso issue fix

* Merge pull request #418 from egovernments/SM-3883

SM-3883 dso issue fix

* SM-3833: logout harcoded fix, comment timeline fix

* SM-3839: TQM PDF download

* SM-3839: TQM PDF download

* Merge pull request #423 from egovernments/SM-3833-dev

SM-3833: logout harcoded fix, comment timeline fix

* SM-3833 reverting core version

* Merge pull request #426 from egovernments/SM-3833-dev

SM-3833 reverting core version

---------

Co-authored-by: nabeelmd-eGov <94039229+nabeelmd-eGov@users.noreply.github.com>
Co-authored-by: nabeelmd-eGov <nabeel.md@egovernments.com>
  • Loading branch information
3 people authored Jan 19, 2024
1 parent 2852739 commit eafb45a
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export const FSMInboxConfig = {
},
filter: {
uiConfig: {
formClassName: "filter",
type: "filter",
headerStyle: null,
primaryLabel: "Filter",
Expand All @@ -164,10 +165,6 @@ export const FSMInboxConfig = {
defaultValues: {
status: "",
locality: [],
assignee: {
code: "ASSIGNED_TO_ME",
name: "ASSIGNED_TO_ME",
},
},
fields: [
// {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,10 @@ const ApplicationDetails = (props) => {

const { data: paymentsHistory } = Digit.Hooks.fsm.usePaymentHistory(tenantId, applicationNumber);

const { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.fsm.useApplicationDetail(
t,
tenantId,
applicationNumber,
{},
props.userType
);
const { isLoading: isDataLoading, isSuccess, data: applicationData } = Digit.Hooks.fsm.useSearch(
tenantId,
{ applicationNos: applicationNumber },
{ staleTime: Infinity }
);
const { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, applicationNumber, {}, props.userType);
const { isLoading: isDataLoading, isSuccess, data: applicationData } = Digit.Hooks.fsm.useSearch(tenantId, { applicationNos: applicationNumber }, { staleTime: Infinity });

const {
isLoading: updatingApplication,
isError: updateApplicationError,
data: updateResponse,
error: updateError,
mutate,
} = Digit.Hooks.fsm.useApplicationActions(tenantId);
const { isLoading: updatingApplication, isError: updateApplicationError, data: updateResponse, error: updateError, mutate } = Digit.Hooks.fsm.useApplicationActions(tenantId);

const workflowDetails = Digit.Hooks.useWorkflowDetails({
tenantId: applicationDetails?.tenantId || tenantId,
Expand All @@ -84,9 +68,7 @@ const ApplicationDetails = (props) => {
? "PAY_LATER_SERVICE"
: applicationData?.advanceAmount > 0
? "FSM_ADVANCE_PAY_SERVICE"
: applicationData?.paymentPreference === null &&
applicationData?.additionalDetails?.tripAmount === 0 &&
applicationData?.advanceAmount === null
: applicationData?.paymentPreference === null && applicationData?.additionalDetails?.tripAmount === 0 && applicationData?.advanceAmount === null
? "FSM_ZERO_PAY_SERVICE"
: "FSM",
role: DSO ? "FSM_DSO" : "FSM_EMPLOYEE",
Expand Down Expand Up @@ -187,7 +169,8 @@ const ApplicationDetails = (props) => {
checkpoint.status === "PENDING_APPL_FEE_PAYMENT" ||
checkpoint.status === "DSO_REJECTED" ||
checkpoint.status === "CANCELED" ||
checkpoint.status === "REJECTED"
checkpoint.status === "REJECTED" ||
(checkpoint.status === "PENDING_DSO_APPROVAL" && checkpoint.performedAction === "SENDBACK")
) {
const caption = {
date: checkpoint?.auditDetails?.created,
Expand Down Expand Up @@ -294,7 +277,7 @@ const ApplicationDetails = (props) => {
optionsClassName={"employee-options-btn-className"}
options={dowloadOptions}
displayOptions={isDisplayDownloadMenu}
setShowOptions = {()=>{}}
setShowOptions={() => {}}
// displayOptions={showOptions}
// options={dowloadOptions}
/>
Expand Down Expand Up @@ -361,9 +344,7 @@ const ApplicationDetails = (props) => {
{(workflowDetails?.isLoading || isDataLoading) && <Loader />}
{!workflowDetails?.isLoading && !isDataLoading && (
<Fragment>
<CardSectionHeader style={{ marginBottom: "16px", marginTop: "32px" }}>
{t("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")}
</CardSectionHeader>
<CardSectionHeader style={{ marginBottom: "16px", marginTop: "32px" }}>{t("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")}</CardSectionHeader>
{workflowDetails?.data?.timeline && workflowDetails?.data?.timeline?.length === 1 ? (
<CheckPoint
isCompleted={true}
Expand Down Expand Up @@ -411,25 +392,15 @@ const ApplicationDetails = (props) => {
onClose={closeToast}
/>
)}
{!workflowDetails?.isLoading &&
workflowDetails?.data?.nextActions?.length === 1 &&
workflowDetails?.data?.nextActions?.[0]?.action !== "RATE" && (
<ActionBar style={{ zIndex: "19" }}>
<SubmitBar
label={t(`ES_FSM_${workflowDetails?.data?.nextActions[0].action}`)}
onSubmit={() => onActionSelect(workflowDetails?.data?.nextActions[0].action)}
/>
</ActionBar>
)}
{!workflowDetails?.isLoading && workflowDetails?.data?.nextActions?.length === 1 && workflowDetails?.data?.nextActions?.[0]?.action !== "RATE" && (
<ActionBar style={{ zIndex: "19" }}>
<SubmitBar label={t(`ES_FSM_${workflowDetails?.data?.nextActions[0].action}`)} onSubmit={() => onActionSelect(workflowDetails?.data?.nextActions[0].action)} />
</ActionBar>
)}
{!workflowDetails?.isLoading && workflowDetails?.data?.nextActions?.length > 1 && (
<ActionBar style={{ zIndex: "19" }}>
{displayMenu && workflowDetails?.data?.nextActions ? (
<Menu
localeKeyPrefix={"ES_FSM"}
options={workflowDetails?.data?.nextActions.map((action) => action.action)}
t={t}
onSelect={onActionSelect}
/>
<Menu localeKeyPrefix={"ES_FSM"} options={workflowDetails?.data?.nextActions.map((action) => action.action)} t={t} onSelect={onActionSelect} />
) : null}
<SubmitBar label={t("ES_COMMON_TAKE_ACTION")} onSubmit={() => setDisplayMenu(!displayMenu)} />
</ActionBar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const EditVendor = ({ parentUrl, heading }) => {
const [defaultValues, setDefaultValues] = useState({});
const [dsoDetails, setDsoDetails] = useState({});
const queryClient = useQueryClient();
const { t } = useTranslation();

const [mutationHappened, setMutationHappened, clear] = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false);
const [errorInfo, setErrorInfo, clearError] = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false);
Expand Down Expand Up @@ -74,7 +75,6 @@ const EditVendor = ({ parentUrl, heading }) => {
}
}, [dsoData]);

const { t } = useTranslation();
const history = useHistory();

const Config = VendorConfig(t, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ export const FsmBreadCrumb = ({ location }) => {
{ content: t("ES_TITLE_APPLICATION_DETAILS"), show: isApplicationDetails },
{ content: t("ES_TITLE_VEHICLE_LOG"), show: isVehicleLog },
{
path: `/${window?.contextPath}/employee/fsm/registry/vendor-details/` + id,
path: isVendorDetails ? null : `/${window?.contextPath}/employee/fsm/registry/vendor-details/` + id,
content: t("ES_TITLE_VENDOR_DETAILS"),
show: isRegistry && (isVendorDetails || isVendorEdit),
},
{
path: `/${window?.contextPath}/employee/fsm/registry/vehicle-details/` + id,
path: isVehicleDetails ? null : `/${window?.contextPath}/employee/fsm/registry/vehicle-details/` + id,
content: t("ES_TITLE_VEHICLE_DETAILS"),
show: isRegistry && (isVehicleDetails || isVehicleEdit),
},
{
path: `/${window?.contextPath}/employee/fsm/registry/driver-details/` + id,
path: isDriverDetails ? null : `/${window?.contextPath}/employee/fsm/registry/driver-details/` + id,
content: t("ES_TITLE_DRIVER_DETAILS"),
show: isRegistry && (isDriverDetails || isDriverEdit),
},
Expand Down Expand Up @@ -299,4 +299,4 @@ const EmployeeApp = ({ path, url, userType }) => {
);
};

export default EmployeeApp;
export default EmployeeApp;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { Link, useHistory } from "react-router-dom";
import { Header, Loader, Toast, ViewComposer } from "@egovernments/digit-ui-react-components";
import { Header, Loader, MultiLink, Toast, ViewComposer } from "@egovernments/digit-ui-react-components";

const TQMSummary = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -52,6 +52,7 @@ const TQMSummary = () => {
}
: {},
],
isWorkflowComplete: data?.workflowStatus?.processInstances?.[0]?.state?.isTerminateState,
}),
};

Expand All @@ -65,10 +66,35 @@ const TQMSummary = () => {
history.goBack();
}

const handleDownloadPdf = async () => {
try {
const respo = await Digit.CustomService.getResponse({
url: "/pqm-service/v1/_downloadPdf",
params: {
testId: id,
},
});
if (respo?.filestoreIds?.[0]) {
const pdfDownload = await Digit.UploadServices.Filefetch(respo?.filestoreIds, tenantId);
window.open(pdfDownload?.data?.fileStoreIds?.[0]?.url, "_blank");
}
} catch (err) {
console.error(err);
}
};

return (
<React.Fragment>
<div className="cardHeaderWithOptions">
<Header>{t("ES_TQM_SUMMARY_HEADING")}</Header>
{testData?.isWorkflowComplete ? (
<MultiLink
className="multilinkWrapper employee-mulitlink-main-div"
onHeadClick={handleDownloadPdf}
style={{ marginTop: "10px" }}
downloadBtnClassName={"employee-download-btn-className"}
/>
) : null}
</div>

{!isLoading && <ViewComposer data={testData} isLoading={isLoading} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,5 +247,6 @@ export const searchTestResultData = async ({ t, id, type, tenantId }) => {
: null,
wfStatus: testResponse?.wfStatus,
testResponse,
workflowStatus: workflowData
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ export const viewTestSummary = async ({ tenantId, t, id }) => {
}
: null,
testResponse: testResponse,
workflowStatus: workflowData
};
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Fragment } from "react";
import { ViewComposer, Header, Loader } from "@egovernments/digit-ui-react-components";
import { ViewComposer, Header, Loader, MultiLink } from "@egovernments/digit-ui-react-components";
import { useTranslation } from "react-i18next";
import { useLocation } from "react-router-dom";

Expand Down Expand Up @@ -94,19 +94,47 @@ function ViewTestResults() {
],
},
],
isWorkflowComplete: data?.workflowStatus?.processInstances?.[0]?.state?.isTerminateState,
}),
staleTime: 0,
cacheTime: 0,
},
});

const handleDownloadPdf = async () => {
try {
const respo = await Digit.CustomService.getResponse({
url: "/pqm-service/v1/_downloadPdf",
params: {
testId: id,
},
});
if (respo?.filestoreIds?.[0]) {
const pdfDownload = await Digit.UploadServices.Filefetch(respo?.filestoreIds, tenantId);
window.open(pdfDownload?.data?.fileStoreIds?.[0]?.url, "_blank");
}
} catch (err) {
console.error(err);
}
};

if (isLoading) {
return <Loader />;
}

return (
<>
<Header> {t("ES_TQM_TEST_RESULTS_DETAILS_HEADER")} </Header>
<div style={{display: "flex", justifyContent: "space-between"}}>
<Header> {t("ES_TQM_TEST_RESULTS_DETAILS_HEADER")} </Header>
{testData?.isWorkflowComplete ? (
<MultiLink
className="multilinkWrapper employee-mulitlink-main-div"
onHeadClick={handleDownloadPdf}
style={{ marginTop: "10px" }}
downloadBtnClassName={"employee-download-btn-className"}
/>
) : null}
</div>
{!isLoading && <ViewComposer data={testData} isLoading={isLoading} />}
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const SearchComponent = ({ uiConfig, header = "", screenType = "search", fullCon
<form onSubmit={handleSubmit(onSubmit)} onKeyDown={(e) => checkKeyDown(e)}>
<div>
{uiConfig?.showFormInstruction && <p className="search-instruction-header">{t(uiConfig?.showFormInstruction)}</p>}
<div className={`search-field-wrapper ${screenType} ${uiConfig?.formClassName?uiConfig?.formClassName:""}`}>
<div className={`search-field-wrapper ${screenType} ${uiConfig?.formClassName ? uiConfig?.formClassName:""}`}>
<RenderFormFields
// fields={uiConfig?.fields}
fields={activeLink ? allUiConfigs?.filter(uiConf => activeLink?.name === uiConf.uiConfig.navLink)?.[0]?.uiConfig?.fields : uiConfig?.fields}
Expand Down

0 comments on commit eafb45a

Please sign in to comment.