Skip to content

Commit

Permalink
Merge pull request #41 from AOT-Technologies/feature/update-lob
Browse files Browse the repository at this point in the history
Removed all console logs and added contact and individual details in …
  • Loading branch information
nagarajaPC-AOT authored Mar 28, 2024
2 parents d875ea8 + 5768634 commit c93da41
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 54 deletions.
6 changes: 0 additions & 6 deletions app/caseflow_web/src/components/CaseDetails/CaseDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ const CaseDetails = () => {
}
async function fetchCaseHistory(id) {

console.log(id, 'fetchcasehistory')
const caseHistoryData = await getCaseHistory(id);
const caseNotes = await getCaseNotes(id);
const output = caseHistoryData?.casehistory.map((element, index) => {
Expand Down Expand Up @@ -448,8 +447,6 @@ const CaseDetails = () => {
const callBack = (err, submission) => {};

const submitForm = (data) => {
console.log(data);
console.log(selectedFormDetails);
try {
const SUBJECT = "workFlowStart";
const MESSAGE = {
Expand All @@ -467,7 +464,6 @@ const CaseDetails = () => {
}

submitNewForm(selectedForm, data).then((res) => {
console.log(res, 'inside case details');
let submissionData = {
formId: res.form,
submissionId: res._id,
Expand Down Expand Up @@ -554,7 +550,6 @@ const CaseDetails = () => {

}
const submitCommunication = async () =>{
console.log(communication);
if(communication){

let response = await createNewNote({ caseid : selectedCase.id,
Expand All @@ -577,7 +572,6 @@ const CaseDetails = () => {

}
const submitRecordedOutput = async () =>{
console.log(recordOutput);
if(recordOutput){

let response = await createNewNote({ caseid : selectedCase.id,
Expand Down
88 changes: 56 additions & 32 deletions app/caseflow_web/src/components/CaseDetails/LobCustom/LobCustom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,51 @@ import { State } from "../../../interfaces/stateInterface";
import { getLobDetails } from "../../../services/LOBService";
import { setSelectedCaseLOBDetails } from "../../../reducers/newCaseReducer";
import { useNavigate } from "react-router";
import { getContactDetails, getContactsData } from "../../../services/ContactService";
import { getIndividualsData } from "../../../services/IndividualService";
import { setSelectedContact } from "../../../reducers/newContactReducer";
import { setSelectedIndividual } from "../../../reducers/newIndividualReducer";

const LobCustom = () => {
const dispatch = useDispatch();
const navigate = useNavigate();
const selectedCase = useSelector((state: State) => state.cases.selectedCase);
const lobData = selectedCase.lobDetails;
const selectedContact = useSelector((state: State) => state.contacts.selectedContact);
const selectedIndividual = useSelector((state: State) => state.individuals.selectedIndividual);
// const lobData = selectedCase.lobDetails;
useEffect(() => {
if (selectedCase.lobcaseid > 0) {
getCaseLobDetails(selectedCase.lobcaseid);
if (selectedCase.contactid) {
getCaseContactDetails(selectedCase.contactid);
}
}, [selectedCase.lobcaseid]);
const getCaseLobDetails = async (id) => {
let lobDetails = await getLobDetails(id);
if (lobDetails && lobDetails.id) {
dispatch(setSelectedCaseLOBDetails(lobDetails));
}, [selectedCase.contactid]);
useEffect(() => {
if (selectedCase.individualid) {
getCaseIndividualDetails(selectedCase.individualid);
}
}, [selectedCase.individualid]);
const getCaseContactDetails = async (contact) => {
let searchContacts = await getContactsData(1, contact.split(" ")[0]);
let contactDetails = searchContacts?.CaseflowContacts?.map((element) => {
if(element.firstname+" "+element.lastname === contact) {
return element
} else return {}
});
dispatch(setSelectedContact(contactDetails));
};

const navigateToLob = () => {
navigate("/private/lob/" + lobData.id + "/details");
const getCaseIndividualDetails = async (individual) => {
let searchIndividuals = await getIndividualsData(1, individual.split(" ")[0]);
let individualDetails = searchIndividuals?.CaseflowIndividuals?.map((element) => {
if(element.firstname+" "+element.lastname === individual) {
return element
} else return {}
});
dispatch(setSelectedIndividual(individualDetails));
};


// const navigateToLob = () => {
// navigate("/private/lob/" + lobData.id + "/details");
// };

return (
<>
Expand All @@ -41,39 +65,39 @@ const LobCustom = () => {
Contact Details
</Typography>
<Divider sx={{ border: 1, color: "#606060" }} />
{/* {lobData && lobData.id ? ( */}
{/* {selectedContact && selectedContact.id ? ( */}
<div className="lob-custom-content-case-detail">
<div>
<Typography variant="subtitle1">Name</Typography>
<Typography variant="subtitle1">Samuel James (Parent)</Typography>
<Typography variant="subtitle1">Id</Typography>
<Typography variant="subtitle1">{selectedContact[0]?.id}</Typography>
<Typography variant="body2" color="#606060">

</Typography>
</div>
<div>
<Typography variant="subtitle1">Phone No</Typography>
<Typography variant="subtitle1">+1613555015</Typography>
<Typography variant="subtitle1">Name</Typography>
<Typography variant="subtitle1">{selectedContact[0]?.firstname} {selectedContact[0]?.lastname}</Typography>
<Typography variant="body2" color="#606060">

</Typography>
</div>
<div>
<Typography variant="subtitle1">City</Typography>
<Typography variant="subtitle1">Anytown</Typography>
<Typography variant="subtitle1">Phone No</Typography>
<Typography variant="subtitle1">{selectedContact[0]?.phonenumber}</Typography>
<Typography variant="body2" color="#606060">

</Typography>
</div>
<div>
<Typography variant="subtitle1">Region</Typography>
<Typography variant="subtitle1">BC</Typography>
<Typography variant="subtitle1">Email</Typography>
<Typography variant="subtitle1">{selectedContact[0]?.email}</Typography>
<Typography variant="body2" color="#606060">

</Typography>
</div>
<div>
<Typography variant="subtitle1">Email</Typography>
<Typography variant="subtitle1">[email protected]</Typography>
<Typography variant="subtitle1">Address</Typography>
<Typography variant="subtitle1">{selectedContact[0]?.address}</Typography>
<Typography variant="body2" color="#606060">

</Typography>
Expand Down Expand Up @@ -111,36 +135,36 @@ const LobCustom = () => {
{/* {lobData && lobData.id ? ( */}
<div className="lob-custom-content-case-detail">
<div>
<Typography variant="subtitle1">Name</Typography>
<Typography variant="subtitle1">Shruti James (child)</Typography>
<Typography variant="subtitle1">Id</Typography>
<Typography variant="subtitle1">{selectedIndividual[0]?.id}</Typography>
<Typography variant="body2" color="#606060">

</Typography>
</div>
<div>
<Typography variant="subtitle1">Phone No</Typography>
<Typography variant="subtitle1">+1613555015</Typography>
<Typography variant="subtitle1">Name</Typography>
<Typography variant="subtitle1">{selectedIndividual[0]?.firstname} {selectedIndividual[0]?.lastname}</Typography>
<Typography variant="body2" color="#606060">

</Typography>
</div>
<div>
<Typography variant="subtitle1">City</Typography>
<Typography variant="subtitle1">Anytown</Typography>
<Typography variant="subtitle1">Phone No</Typography>
<Typography variant="subtitle1">{selectedIndividual[0]?.phonenumber}</Typography>
<Typography variant="body2" color="#606060">

</Typography>
</div>
<div>
<Typography variant="subtitle1">Region</Typography>
<Typography variant="subtitle1">BC</Typography>
<Typography variant="subtitle1">Email</Typography>
<Typography variant="subtitle1">{selectedIndividual[0]?.email}</Typography>
<Typography variant="body2" color="#606060">

</Typography>
</div>
<div>
<Typography variant="subtitle1">Email</Typography>
<Typography variant="subtitle1">[email protected]</Typography>
<Typography variant="subtitle1">Address</Typography>
<Typography variant="subtitle1">{selectedIndividual[0]?.address}</Typography>
<Typography variant="body2" color="#606060">

</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useSelector } from "react-redux";
import { State } from "../../../interfaces/stateInterface";

const SingleCaseDetail = ({ caseHistoryData, userInfo, progress }) => {
console.log(caseHistoryData,"caseHistoryType")
let date = caseHistoryData.date.split(" ");
const [expand, setExpand] = useState(false);
const caseNotes = useSelector((state: State) => state.cases.selectedCase.notes);
Expand Down
5 changes: 0 additions & 5 deletions app/caseflow_web/src/components/Contacts/Contacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ const Contacts = () => {
selectedPage,
searchField,
);
console.log(searchResult, 'searchResult')
let searchResultContacts = searchResult?.CaseflowContacts?.map((element) => {
return {
title: element.id + " - " + element.firstname +" "+ element.lastname,
Expand All @@ -90,10 +89,6 @@ const Contacts = () => {
});

if (searchResultContacts) {
console.log({
searchResultContacts: searchResultContacts,
totalCount: searchResult?.totalCount,
});
dispatch(
setsearchContactResult({
searchResult: searchResultContacts,
Expand Down
4 changes: 0 additions & 4 deletions app/caseflow_web/src/components/Individuals/Individuals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ const Individuals = () => {
});

if (searchResultIndividuals) {
console.log({
searchResultIndividuals: searchResultIndividuals,
totalCount: searchResult?.totalCount,
});
dispatch(
setsearchIndividualResult({
searchResult: searchResultIndividuals,
Expand Down
1 change: 0 additions & 1 deletion app/caseflow_web/src/components/NewCase/NewCase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ const NewCase = () => {
};
const submitForm = (data) => {

console.log(data, 'inside new case details');
submitNewForm(selectedFormDetails._id, data).then((res) => {
let submissionData = {
formId: res.form,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useDispatch } from "react-redux/es/exports";
import "../../styles.scss";

const RecentCaseCard = (props) => {
console.log(props.case);
const [CaseDetails, setcaseDetails] = useState(props.case);
const dispatch = useDispatch();
const navigate = useNavigate();
Expand Down
2 changes: 0 additions & 2 deletions app/caseflow_web/src/services/ContactService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const getContactsData = async (
) => {
const url = LOBURL;
const skip = (number - 1) * Number(PAGINATION_TAKE);
console.log(searchField, 'searchField')
const output = await httpPOSTRequest(
url,
{
Expand All @@ -58,7 +57,6 @@ export const getContactsData = async (
console.log(err);
return {};
});
console.log(output, 'output')
return output?.searchCaseflowContacts;
};

Expand Down
1 change: 0 additions & 1 deletion app/caseflow_web/src/services/IndividualService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const getIndividualsData = async (
) => {
const url = LOBURL;
const skip = (number - 1) * Number(PAGINATION_TAKE);
console.log(searchField, 'searchField')
const output = await httpPOSTRequest(
url,
{
Expand Down
1 change: 0 additions & 1 deletion app/caseflow_web/src/services/formsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export const getFormDetailsById = async (formId) => {
return output;
};
export const submitNewForm = async (id, body) => {
console.log(parseInt(id));
const formIoToken = await getFormIORoleIds();
const token = { "x-jwt-token": formIoToken };
const url = `${FORMSFLOW_APPLICATION_URL}/form/${id}/submission`;
Expand Down

0 comments on commit c93da41

Please sign in to comment.