-
Notifications
You must be signed in to change notification settings - Fork 38
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
[MDS-5583] View Report #2885
[MDS-5583] View Report #2885
Conversation
…t record on that page. Already had the endpoint there, but no 'get' of a single record. Made a couple files typescript. Make the link to the new page from the 'view' on the table
…itialValues for the form, pass them in. Update Callout to tsx
… edit with initialValues
… picking the previous year, pass the right form values to ReportFilesTable, do submission handling on the ReportPage
…y of mine reports, too) and give some initial values to view report form to test that all out
@@ -38,6 +46,12 @@ const reportReducerObject = { | |||
export const getReports = (state) => state[REPORTS].reports; | |||
export const getReportsPageData = (state) => state[REPORTS].reportsPageData; | |||
export const getMineReports = (state) => state[REPORTS].mineReports; | |||
export const getMineReportById = (state, reportGuid) => { |
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 this function used to get the latest report or the first report ?
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.
it is meant to get the whole report, including all submissions.
useEffect(() => { | ||
if (!mine || mine.mine_guid !== mineGuid) { | ||
dispatch(fetchMineRecordById(mineGuid)); | ||
} |
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.
Can the logic here can be moved to the other useEffect on line 38 since the useEffect gets triggered when either reportGuid or mineGuid changes ?
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.
hmm, yeah, I think I can. 👍
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!
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.
Yayy for more things in the common folder! 🙌
Objective
NOTE: report type & report name are a bit broken right now. This is expected and there's another ticket where this should be handled (5662 I think?)
MDS-5583