Skip to content

Commit

Permalink
Display proper tiltle in case history for actions taken (Communicatio…
Browse files Browse the repository at this point in the history
…ns Added, Closing case)
  • Loading branch information
nagarajaPC-AOT committed Jul 23, 2024
1 parent a396611 commit f94766e
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ export class CreateCaseNoteInput {
@IsString()
@IsNotEmpty()
notetext: string;

@Field({ nullable: true })
@IsNumber()
actiontype: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ export class CaseNotes {
@Field(() => Cases, { nullable: true })
@JoinColumn({ name: 'id' })
case: Cases;

@Column({ nullable: true })
@Field()
actiontype: number;
}
19 changes: 11 additions & 8 deletions app/caseflow_core/microservices/server/src/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ type CaseNotes {
userid: Float!
notetext: String
case: Cases
actiontype: Float!
}

type WorkflowActivity {
Expand Down Expand Up @@ -188,7 +189,7 @@ input CreateCaseInput {
statusid: Int!
typeid: Float
linkedcases: [Int!]
creationdate: DateTime = "2024-04-21T04:08:52.906Z"
creationdate: DateTime = "2024-07-22T23:56:32.290Z"
completiondate: DateTime
lastmodificationdate: DateTime
penduntildate: DateTime
Expand Down Expand Up @@ -217,9 +218,9 @@ input UpdateCaseInput {
statusid: Int!
typeid: Float
linkedcases: [Int!]
creationdate: DateTime = "2024-04-21T04:08:52.902Z"
creationdate: DateTime = "2024-07-22T23:56:32.287Z"
completiondate: DateTime
lastmodificationdate: DateTime = "2024-04-21T04:08:52.902Z"
lastmodificationdate: DateTime = "2024-07-22T23:56:32.287Z"
penduntildate: DateTime
archivedate: DateTime
startuserid: Int
Expand All @@ -245,7 +246,7 @@ input RemoveCaseArgs {
}

input CreateCaseHistoryInput {
datetime: DateTime = "2024-04-21T04:08:52.912Z"
datetime: DateTime = "2024-07-22T23:56:32.297Z"
outcome: String = "sucess"
userid: Float
caseId: [Int!]!
Expand All @@ -255,7 +256,7 @@ input CreateCaseHistoryInput {
}

input UpdateCaseHistoryInput {
datetime: DateTime = "2024-04-21T04:08:52.912Z"
datetime: DateTime = "2024-07-22T23:56:32.297Z"
outcome: String = "sucess"
userid: Float
caseId: [Int!]
Expand Down Expand Up @@ -310,22 +311,24 @@ input UpdateCaseTypeInput {

input CreateCaseNoteInput {
caseid: Float!
creationdate: DateTime = "2024-04-21T04:08:52.987Z"
creationdate: DateTime = "2024-07-22T23:56:32.366Z"
userid: Float
notetext: String
actiontype: Float
}

input UpdateCaseNoteInput {
caseid: Float
creationdate: DateTime = "2024-04-21T04:08:52.987Z"
creationdate: DateTime = "2024-07-22T23:56:32.366Z"
userid: Float
notetext: String
actiontype: Float
id: Int!
}

input CreateWorkflowActivityInput {
caseid: Float
creationdate: DateTime = "2024-04-21T04:08:52.992Z"
creationdate: DateTime = "2024-07-22T23:56:32.372Z"
userid: String
taskid: String!
taskname: String
Expand Down
14 changes: 10 additions & 4 deletions app/caseflow_web/src/components/CaseDetails/CaseDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const CaseDetails = () => {
};
const optionsForAction = [
{ id: 9, code: 9, text: "Edit" },
{ id: 1, code: "1", text: "Start Workflow" },
{ id: 1, code: 1, text: "Start Workflow" },
{ id: 2, code: 2, text: "Wake" },
{ id: 3, code: 3, text: "Pending" },
// { id: 4, code: 4, text: "Complete" },
Expand Down Expand Up @@ -205,6 +205,7 @@ const CaseDetails = () => {
const [confirmationText, setConfirmationText] = useState("");
const [newStatus, setNewStatus] = useState(0);
const [selected, setSelected] = useState(0);
const [selectedAction, setSelectedAction] = useState(0);
const docDetail = useSelector(
(state: store) => state.cases.selectedCase.documents
);
Expand Down Expand Up @@ -297,12 +298,15 @@ const CaseDetails = () => {
return setDeleteConfirmation(true)
}
case optionsForAction[5].text: {
setSelectedAction(5)
return setIsNoteOpen(true)
}
case optionsForAction[7].text: {
setSelectedAction(7)
return setIsCommunicationOpen(true)
}
case optionsForAction[8].text: {
setSelectedAction(8)
return setIsRecordOutputOpen(true)
}
}
Expand Down Expand Up @@ -551,12 +555,12 @@ const CaseDetails = () => {
});
};
const submitNote = async () =>{
console.log(note);
if(note){

let response = await createNewNote({ caseid : selectedCase.id,
userid : userName,
notetext : note,
actiontype: selectedAction,
});
if(response.id){
setSelected(0);
Expand All @@ -578,7 +582,8 @@ const CaseDetails = () => {

let response = await createNewNote({ caseid : selectedCase.id,
userid : userName,
notetext : "Communication - "+communication,
notetext : communication,
actiontype: selectedAction,
});
if(response.id){
setSelected(0);
Expand All @@ -600,7 +605,8 @@ const CaseDetails = () => {

let response = await createNewNote({ caseid : selectedCase.id,
userid : userName,
notetext : "Output of the Issue - "+recordOutput,
notetext : recordOutput,
actiontype: selectedAction,
});
if(response.id){
setSelected(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const SingleCaseDetail = ({ caseHistoryData, userInfo, progress }) => {

const getNote = () => {
let note = caseNotes.find(note=>note.id == caseHistoryData.artifactId);

return (note && note["notetext"]) ? note["notetext"] : "";
}
return (
Expand Down Expand Up @@ -55,7 +54,7 @@ const SingleCaseDetail = ({ caseHistoryData, userInfo, progress }) => {
</h3>
{expand && (
<div>
<p>{( caseNotes && caseNotes.length && caseHistoryData.eventtypeId == 4) ? getNote() : (caseHistoryData.caseHistoryWorkflowType ? caseHistoryData.caseHistoryWorkflowType : caseHistoryData.caseHistoryType)}</p>
<p>{( caseNotes && caseNotes.length && (caseHistoryData.eventtypeId == 4 || caseHistoryData.eventtypeId == 14 || caseHistoryData.eventtypeId == 15)) ? getNote() : (caseHistoryData.caseHistoryWorkflowType ? caseHistoryData.caseHistoryWorkflowType : caseHistoryData.caseHistoryType)}</p>
<p>User - {userInfo.userName}</p>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ export default function MiniDrawer() {
// if (route.key === 2) {
// openLinkInNewTab(FORMSFLOW_WEB_URL + "/task");
// } else
if (route.key === 5) {
openLinkInNewTab(FORMSFLOW_WEB_URL + "/insights");
} else {
// if (route.key === 5) {
// openLinkInNewTab(FORMSFLOW_WEB_URL + "/insights");
// } else {
navigate(route.path);
}
// }
};

const routes = [
Expand All @@ -137,7 +137,7 @@ export default function MiniDrawer() {
{ key: 2, text: "Tasks", path: "/private/tasks" },
{ key: 3, text: GENERIC_NAME, path: "/private/cases" },
{ key: 4, text: "Documents", path: "/private/documents" },
{ key: 5, text: "Reports", path: FORMSFLOW_WEB_URL + "/insights" },
{ key: 5, text: "Reports", path: "/private/reports" },
{ key: 6, text: "Individual", path: "/private/individuals" },
{ key: 7, text: "Contacts", path: "/private/contacts" },
];
Expand Down
4 changes: 4 additions & 0 deletions app/caseflow_web/src/graphql/caseNotesRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const FETCH_DATA = gql`
creationdate
userid
notetext
actiontype
}
}
`;
Expand All @@ -22,6 +23,7 @@ export const CREATE_NEW_CASE_NOTE = gql`
creationdate
userid
notetext
actiontype
}
}
`;
Expand All @@ -34,6 +36,7 @@ export const UPDATE_NEW_CASE_NOTE = gql`
creationdate
userid
notetext
actiontype
}
}
`;
Expand All @@ -47,6 +50,7 @@ export const FETCH_CASENOTES = gql`
creationdate
userid
notetext
actiontype
}
}
`;
5 changes: 3 additions & 2 deletions app/caseflow_web/src/services/caseNotesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export const createNewNote = async (data) => {
createCaseNoteInput: {
caseid : parseInt(data.caseid) ,
creationdate : new Date(),
userid : 1,
notetext : data.notetext
userid : 1,
notetext : data.notetext,
actiontype: data.actiontype
},
},
},
Expand Down

0 comments on commit f94766e

Please sign in to comment.