Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

fix(headerbar): links and app icons #20

Merged
merged 3 commits into from
Jul 5, 2019
Merged

fix(headerbar): links and app icons #20

merged 3 commits into from
Jul 5, 2019

Conversation

teug91
Copy link
Contributor

@teug91 teug91 commented Jun 6, 2019

There is a lot of contextPath prop-drilling. Do you prefer another implementation? Using useContext perhaps?

Also, maybe the locale stuff can be moved into the useEffect?

@amcgee
Copy link
Member

amcgee commented Jun 7, 2019

Hi @teug91 thank you for this PR! Are you using this version of the HeaderBar with <DataProvider> in a custom DHIS2 apps?

I've been wanting to update the links and icon paths here to support 3rd party domain deployments and non-core apps for a while. I think we will want to use Context rather than prop-drilling, as you say. I'll be extending the API of dhis2/app-runtime shortly with a new hook to access application configuration (especially the baseUrl). We currently have that information available in the DataProvider context but we don't expose the raw context to consumers.

I'll let @varl make the call on whether to accept this as-is and then update it to use context, or to wait for the new context accessor (probably next week).

@amcgee amcgee requested a review from varl June 7, 2019 15:19
@teug91
Copy link
Contributor Author

teug91 commented Jun 7, 2019

Yes, I'm using this version along with <DataProvider> in custom apps. Everything seems to be working as expected apart from link and icon paths.

It makes no difference to me if we have to wait for context or if the PR is accepted. Thanks.

@varl
Copy link
Contributor

varl commented Jun 11, 2019

I'll let @varl make the call on whether to accept this as-is and then update it to use context, or to wait for the new context accessor (probably next week).

@amcgee If it will be available this week, I think we should use the context. If it's going to take longer, merge this.

@varl
Copy link
Contributor

varl commented Jul 5, 2019

It's been almost a month, so I'm going to go ahead and merge this for now, and we can refactor down the line. This doesn't touch the external component API, so refactoring to Context down the line is a non-breaking change.

Thanks for this, @teug91.

@varl varl merged commit 2758ce6 into dhis2:master Jul 5, 2019
dhis2-bot pushed a commit that referenced this pull request Jul 5, 2019
## [1.0.7](v1.0.6...v1.0.7) (2019-07-05)

### Bug Fixes

* **headerbar:** links and app icons ([#20](#20)) ([2758ce6](2758ce6))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 1.0.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@amcgee
Copy link
Member

amcgee commented Jul 5, 2019

@varl OK sounds good. For reference: This is the app-runtime change to enable context-provided application config dhis2/app-runtime#13

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HeaderBar: App icons are not loaded correctly
4 participants