-
Notifications
You must be signed in to change notification settings - Fork 16
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: provide the app's name & version to the <HeaderBar> #674
base: master
Are you sure you want to change the base?
Conversation
Implementation looks good to me, and the |
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.
Hmmm... implementation looks good here. I'm not sure about making it a prop instead of using the @dhis2/app-service-config context to pass it in... As mentioned, when moving to a global shell we'll have to "subscribe" to the values which context lets us do. At that time we'll need to remove or deprecate the appName prop from the HeaderBar anyway (and also appVersion)
I think the main reason I'd like to make this available through useConfig
, though, is that the application version (and maybe even name as well) could likely be useful in other application components... would it be a huge amount of additional effort to add it there? I'm not opposed to adding this for now, if it's a lot easier... being able to access the resolved application config could be quite useful I think.
I think putting the information into
I don't understand the reasoning here. From what I can tell, the global shell will always know which app and its version is being displayed (as it's the service responsible for replacing the app when navigating to a different one). Changing the prop would also cause the headerbar to rerender. Of course I'm making some assumptions here:
I think this boils down to a more fundamental aspect: I think in the end this is quite a subjective topic.. My experience makes me believe that controlled components are more robust/future-proof without having to anticipate the future (I can expand on why I think this way if you want; I guess this is the part where different developers have made different experiences in their career and therefore favor different approaches). With that in mind I guess using the |
Closes LIBS-176 (link)
Blocked by dhis2/ui#795
<HeaderBar>
With the global shell, the headerbar would have "subscribe" to the values in order to notice the change. With a prop, this happens automatically(might be wrong.. here 🤦)