-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7 create dashboard #59
Conversation
webapp/src/app/mottak/mine-saker/dashbord/[caseNumber]/page.tsx
Outdated
Show resolved
Hide resolved
{status === 'success' ? ( | ||
<div className="flex items-center text-green-600" data-test="status-indicator"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use one of the svgs in the public folder or react icon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
// Simulate clicking the component and ensure it navigates to the detailed page | ||
cy.get("[data-test=archiveGPT-component]") | ||
.click() | ||
.location("pathname") // TODO: Add route to report page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
…etectionToSubItem function
it("The page must ", () => { | ||
it("should load the title", () => { | ||
cy.visit(BASE_URL); | ||
cy.get('[data-cy="title"]') | ||
.should("exist") | ||
.and("contain.text", "Plansituasjon:") | ||
.and("be.visible"); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the "The page must" wrapper needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix double wrap here
{/* | ||
<div> | ||
<ResultAI title={"ArkivGPT"} status={'success'} feedback={"Arkivdata funnet"} reportUrl={'https://www.youtube.com/watch?v=dQw4w9WgXcQ'} /> | ||
</div> | ||
*/} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗑️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is included in the newest pull request
webapp/src/components/ResultAI.tsx
Outdated
} | ||
|
||
const ResultAI: React.FC<StatusCardProps> = ({ title, status, feedback, reportUrl }) => { | ||
const navigate = useNavigate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use react router. Use useRouter() from next/navigation instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already corrected in the newest pull request
}`} | ||
onClick={() => onToggleSubItem(fileName, subItem.id)} | ||
> | ||
{subItem.isComplete ? '✔️' : '⭕'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think react icons would look better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo: Fix this
alert( | ||
`Status: ${status}\nFeedback: ${feedbackText}\nChecklist: ${JSON.stringify( | ||
checklistSummary, | ||
null, | ||
2 | ||
)}` | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a custom modal component instead of an alert in the final product
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Make custom modal component
@@ -38,6 +38,7 @@ | |||
"ntnu-kpro-ai-assistant": "file:", | |||
"react": "^18.3.1", | |||
"react-dom": "^18.3.1", | |||
"react-router-dom": "^6.27.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this dependency and use next/navigations built-in routing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Remove react-router
@@ -1,14 +1,170 @@ | |||
"use client"; | |||
|
|||
import { useParams } from "next/navigation"; | |||
import { getCase, CaseData } from "~/types/cases"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { getCase, CaseData } from "~/types/cases"; | |
import { getCase, type CaseData } from "~/types/cases"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Fix this
import Summary from "~/components/Summary"; | ||
import EmbeddedFrame from "~/components/EmbeddedFrame"; | ||
import CaseDocumentsComponent from "~/components/CaseDocuments"; | ||
import ResultAI from "~/components/ResultAI"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently unused. Either use it or remove the import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All imports are in use
import React from "react"; | ||
import { Detection } from "~/types/detection"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Detection } from "~/types/detection"; | |
import type { Detection } from "~/types/detection"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Fix this
const checklist = transformDetectionToChecklist(detections); | ||
|
||
/** Convert from string to number for getCase function */ | ||
const caseNumberAsNumber = Number(caseNumber); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Fetch case number from URL
@@ -0,0 +1,81 @@ | |||
import React, { useState } from 'react'; | |||
import { ChecklistItemData } from './Checklist'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { ChecklistItemData } from './Checklist'; | |
import type { ChecklistItemData } from './Checklist'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting should be 2 spaces for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Review this
@@ -34,3 +36,43 @@ export const hasErrors = (result: Detection): boolean => { | |||
export const capitalize = (str: string): string => { | |||
return str.charAt(0).toUpperCase() + str.slice(1); | |||
}; | |||
|
|||
export const transformDetectionToChecklist = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice solution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably find a better solution than copy-pasting the same file three different places. But ok for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Discuss in the group, don't wanna mess up routing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix after user tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple small changes needed, but it was hard to find things to comment on.
Overall very good work!
No description provided.