-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: [DHIS2-18250] Breadcrumb for event & enrollment pages #3849
feat: [DHIS2-18250] Breadcrumb for event & enrollment pages #3849
Conversation
@@ -73,6 +76,11 @@ export const EnrollmentEditEventPageComponent = ({ | |||
pageLayout={pageLayout} | |||
currentPage={mode === EnrollmentPageKeys.EDIT_EVENT ? EnrollmentPageKeys.EDIT_EVENT : EnrollmentPageKeys.VIEW_EVENT} | |||
availableWidgets={WidgetsForEnrollmentEventEdit} | |||
userInteractionInProgress={mode === EnrollmentPageKeys.EDIT_EVENT} |
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 refactor this at some point, but just following the logic in src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/TopBar.container.js
* fix: use title instead of alt on missing icons * chore: fix failing tests
## [101.12.1](v101.12.0...v101.12.1) (2024-10-16) ### Bug Fixes * [DHIS2-17978] use title instead of alt on missing icons ([#3847](#3847)) ([b5940f2](b5940f2))
b90f061
to
fe1a7b1
Compare
…-breadcrumb-navigation-bar # Conflicts: # i18n/en.pot
…t/DHIS2-18250-breadcrumb-navigation-bar # Conflicts: # i18n/en.pot # src/core_modules/capture-core/components/Pages/MainPage/MainPage.component.js
...ore_modules/capture-core/components/Breadcrumbs/EnrollmentBreadcrumb/EnrollmentBreadcrumb.js
Outdated
Show resolved
Hide resolved
src/core_modules/capture-core/components/Breadcrumbs/EventBreadcrumb/EventBreadcrumb.js
Show resolved
Hide resolved
...ore_modules/capture-core/components/Breadcrumbs/EnrollmentBreadcrumb/EnrollmentBreadcrumb.js
Outdated
Show resolved
Hide resolved
...ore_modules/capture-core/components/Breadcrumbs/EnrollmentBreadcrumb/EnrollmentBreadcrumb.js
Show resolved
Hide resolved
src/core_modules/capture-core/components/Breadcrumbs/EventBreadcrumb/EventBreadcrumb.js
Outdated
Show resolved
Hide resolved
...odules/capture-core/components/Breadcrumbs/EnrollmentBreadcrumb/hooks/useWorkingListLabel.js
Outdated
Show resolved
Hide resolved
...ore_modules/capture-core/components/Breadcrumbs/EventBreadcrumb/hooks/useWorkingListLabel.js
Outdated
Show resolved
Hide resolved
...ore_modules/capture-core/components/Breadcrumbs/EnrollmentBreadcrumb/EnrollmentBreadcrumb.js
Show resolved
Hide resolved
...ore_modules/capture-core/components/Breadcrumbs/EnrollmentBreadcrumb/EnrollmentBreadcrumb.js
Show resolved
Hide resolved
...ore_modules/capture-core/components/Breadcrumbs/EnrollmentBreadcrumb/EnrollmentBreadcrumb.js
Show resolved
Hide resolved
selected: page === EnrollmentPageKeys.NEW_EVENT, | ||
condition: page === EnrollmentPageKeys.NEW_EVENT, | ||
}, | ||
].filter(item => item.condition !== false)), [ |
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 condition is a boolean, and then we can simplify this
].filter(item => item.condition !== false)), [ | |
].filter(item => item.condition) |
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.
Makes sense! Good catch!
src/core_modules/capture-core/components/Breadcrumbs/common/BreadcrumbItem.js
Show resolved
Hide resolved
Thanks for the review @simonadomnisoru & @henrikmv! Should be sorted 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.
Thanks for the review @simonadomnisoru & @henrikmv! Should be sorted now 🚀
Looks great now 👏 !
@@ -9,29 +9,25 @@ import { useDispatch, useSelector } from 'react-redux'; | |||
import { useHistory } from 'react-router-dom'; | |||
import { useTimeZoneConversion } from '@dhis2/app-runtime'; | |||
import { | |||
useCommonEnrollmentDomainData, | |||
useRuleEffects, | |||
commitEnrollmentAndEvents, |
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.
NIT: not your change, but can we remove the // $FlowFixMe on line 7 in this file?
const workingListTemplates = useSelector(({ workingListsTemplates }) => workingListsTemplates?.teiList); | ||
const workingListProgramId = useSelector(({ workingListsContext }) => workingListsContext?.teiList?.programIdView); |
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.
For me it looks like the two useSelector calls are rendered 10 times each whenever navigating to the dashboard for a TEI. Should this behavior be optimized?"
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 looks like workingListProgramId
triggers one render and workingListTemplates
triggers two. (One of each is batched, so they should only really trigger one rerender. Did you have any other experience, @henrikmv? Remember, if you want to see it the value triggers a rerender, you will have to wrap the console.log
inside a useEffect.
…-breadcrumb-navigation-bar
Thanks @henrikmv! Moving the issue to testing for now, but we can still continue discussing the rest of the comments 😊 |
🚀 Deployed on https://deploy-preview-3849.capture.netlify.dhis2.org |
…t/DHIS2-18250-breadcrumb-navigation-bar # Conflicts: # i18n/en.pot
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.
Tested successfully on 2.42,2.41.3,2.40.6,2.39.8 versions
# [101.16.0](v101.15.0...v101.16.0) (2024-11-13) ### Features * [DHIS2-18250] Breadcrumb for event & enrollment pages ([#3849](#3849)) ([d65882e](d65882e))
🎉 This PR is included in version 101.16.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Tech-summary:
Added two new components that helps the user navigate our app