forked from AOT-Technologies/forms-flow-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* application history and request * View Submission modified * reviewed timeline updated * padding * UI updation * fixed style * replaced bundle keyword by BUNDLED_FORM variable --------- Co-authored-by: AbijithS-aot <abijith.s@aot-technologies.com> Co-authored-by: Ajay krishna <ajay.k@aot-technologies.com>
- Loading branch information
1 parent
506f52f
commit 34f0eb5
Showing
11 changed files
with
416 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
forms-flow-web/src/components/Application/ApplicationTimeline.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import React from "react"; | ||
import { Typography } from "@material-ui/core"; | ||
import moment from "moment"; | ||
import { MULTITENANCY_ENABLED } from "../../constants/constants"; | ||
import { useSelector } from "react-redux"; | ||
|
||
function ApplicationTimeline({ applicationHistory }) { | ||
const tenantKey = useSelector((state) => state.tenants?.tenantId); | ||
const formName = useSelector((state) => state.form.form.title); | ||
const redirectUrl = MULTITENANCY_ENABLED ? `/tenant/${tenantKey}/` : "/"; | ||
function formatDate(dateString) { | ||
let dateObj = new Date(dateString); | ||
return moment(dateObj).format("DD/MM/YYYY"); | ||
} | ||
|
||
function formatTime(dateString) { | ||
let dateObj = new Date(dateString); | ||
return moment(dateObj).format("h:mm:ssa"); | ||
} | ||
|
||
const ptag = { | ||
margin: "0", | ||
}; | ||
const postiveStatus = ["New", "Submitted", "Completed","Reviewed"]; | ||
const negativeStatus = ["Rejected", "Returned"]; | ||
|
||
return ( | ||
<> | ||
<div className="circle-icon-container ml-2"> | ||
{applicationHistory.map((e, index) => ( | ||
<> | ||
<div className="circle-icon"> | ||
{postiveStatus.includes( | ||
e.applicationStatus || e.requestStatus | ||
) ? ( | ||
<i className="fa fa-check"></i> | ||
) : negativeStatus.includes( | ||
e.applicationStatus || e.requestStatus | ||
) ? ( | ||
<i className="fa fa-times"></i> | ||
) : ( | ||
"" | ||
)} | ||
</div> | ||
{index !== applicationHistory.length - 1 && ( | ||
<div className="line"></div> | ||
)} | ||
</> | ||
))} | ||
</div> | ||
<div className="d-flex flex-column" style={{ marginTop: "2px" }}> | ||
{applicationHistory.map((e, index) => { | ||
return ( | ||
<div | ||
key={index} | ||
className="ml-5 d-flex align-items-center" | ||
style={{ | ||
display: "flex", | ||
gap: "65px", | ||
marginTop: index !== 0 ? "25px" : "0", | ||
}} | ||
> | ||
<div style={{ width: "120px" }}> | ||
<Typography className="" style={ptag}> | ||
{" "} | ||
<span style={{ fontWeight: "bold" }}> | ||
{formatDate(e.created)} | ||
</span> | ||
<br></br> | ||
{formatTime(e.created)} | ||
</Typography> | ||
</div> | ||
<div style={{ flex: 1 , paddingBottom: "20px"}}> | ||
<Typography style={ptag}> | ||
<span style={{ fontWeight: "bold", marginRight: "1.5em" }}> | ||
{e.applicationStatus || e.requestStatus} | ||
</span>{" "} | ||
{formName}{" "} | ||
<span style={{ fontWeight: "bold", marginRight: "1.5em" }}> | ||
{e.submittedBy} | ||
</span> | ||
</Typography> | ||
</div> | ||
<div style={{ width: "150px", textAlign: "right" , paddingBottom: "20px" }}> | ||
<a | ||
href={`${redirectUrl}bundle/${e.formId}/submission/${e.submissionId}`} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
style={{ textDecoration: "underline" , fontSize: "12px" }} | ||
> | ||
View Submission <i className="fa fa-pencil-square-o mr-1"></i> | ||
</a> | ||
</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default ApplicationTimeline; |
62 changes: 62 additions & 0 deletions
62
forms-flow-web/src/components/Application/BundleHistory.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import { Tab, Tabs } from "@material-ui/core"; | ||
import ApplicationTimeline from "./ApplicationTimeline"; | ||
import RequestStatus from "./RequestStatus"; | ||
import { fetchApplicationAuditHistoryList } from "../../apiManager/services/applicationAuditServices"; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
|
||
const BundleHistory = ({ applicationId }) => { | ||
const dispatch = useDispatch(); | ||
const applicationHistory = useSelector((state) => state.bpmTasks.appHistory); | ||
const requests = useSelector((state) => state.bpmTasks?.request); | ||
useEffect(() => { | ||
dispatch(fetchApplicationAuditHistoryList(applicationId)); | ||
}, []); | ||
|
||
const [activeTab, setActiveTab] = useState(0); | ||
|
||
const handleChange = (event, newValue) => { | ||
setActiveTab(newValue); | ||
}; | ||
|
||
return ( | ||
<div className="history-panel"> | ||
<div | ||
style={{ height: "13rem", gap: "20px" }} | ||
className="border-right d-flex flex-column" | ||
> | ||
<div className="d-flex flex-column"> | ||
<Tabs | ||
orientation="vertical" | ||
variant="scrollable" | ||
value={activeTab} | ||
borderColor="primary" | ||
onChange={handleChange} | ||
indicatorColor="primary" | ||
> | ||
<Tab | ||
label="Application Status" | ||
value={0} | ||
style={{ textTransform: "capitalize" }} | ||
/> | ||
<Tab | ||
label="Request Status" | ||
value={1} | ||
disabled={!requests.length} | ||
style={{ textTransform: "capitalize" }} | ||
/> | ||
</Tabs> | ||
</div> | ||
</div> | ||
{activeTab == 0 ? ( | ||
<ApplicationTimeline applicationHistory={applicationHistory} /> | ||
) : requests.length ? ( | ||
<RequestStatus requests={requests} /> | ||
) : ( | ||
"" | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default BundleHistory; |
Oops, something went wrong.