Conversation
There was a problem hiding this comment.
[code-review only] Thanks @deeonwuli. See my comments and let me know if you have any questions.
| <div> | ||
| <Filters values={filters} options={filterOptions} onChange={setFilters} /> | ||
| <p> | ||
| Audit Definition: <strong>{auditDefinition}</strong> |
There was a problem hiding this comment.
Use i18n instead plain text. i18n.t("Audit Definition:")
|
|
||
| const metadata = { | ||
| programs: { | ||
| operativeCareProgramId: "Cd144iCAheH", |
There was a problem hiding this comment.
I know this could be a lot of more code and work, but normally we prefer to use codes instead hardcoding ids. That way we can prevent future changes if id's are not the same between different environments (local, dev, production, etc).
const metadata = {
programs: {
operativeCareProgramCode: "PROGRAM_CODE"
}
}
// then we can use the /metadata endpoint to get the details
api.metadata.get({})This is something to discuss with the project manager since this change will not have any impact on the functionality.
There was a problem hiding this comment.
@eperedo Miquel has suggested that we skip this at the moment. hopefully i will make the changes in a future PR
|
|
||
| const yearItems = useMemoOptionsFromStrings(filterOptions.periods); | ||
|
|
||
| const quarterPeriodItems = React.useMemo(() => { |
There was a problem hiding this comment.
Not a big deal, but since we're not really doing any modification on these objects we can move them outside the component.
const quarterPeriodItems = [
{ value: "Q1", text: i18n.t("Jan - March") },
{ value: "Q2", text: i18n.t("April - June") },
{ value: "Q3", text: i18n.t("July - September") },
{ value: "Q4", text: i18n.t("October - December") },
]
function MyComponent() {
// use quarterPeriodItems directly
return (
<SingleDropdownStyled
items={quarterPeriodItems}
value={filter.quarter}
onChange={setQuarterPeriod}
label={i18n.t("Quarter")}
hideEmpty
/>
)
}
eperedo
left a comment
There was a problem hiding this comment.
Looks good to me. thanks @deeonwuli. Code-review only from my side since I'll need more details about the functionality to do a full test. @MiquelAdell
|
@eperedo I passed it along to the client for testing, don't worry. |
📌 References
📝 Implementation
📹 Screenshots/Screen capture
Screen.Recording.2024-09-23.at.15.03.28.mov
🔥 Notes to the tester
#8695h711d