Skip to content
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: add class when map is rendered #552

Merged
merged 10 commits into from
Mar 4, 2024
Merged

Conversation

turban
Copy link
Collaborator

@turban turban commented Dec 4, 2023

This PR will add a "dhis2-map-rendered" to the map container when the map is fully rendered, and remove it if the map is rendering.

We will use it in DHIS2 Maps to control when the map is ready for download (used in push analytics).

Related PR: dhis2/maps-app#3072

@turban turban marked this pull request as draft December 4, 2023 15:26
Copy link
Contributor

@HendrikThePendric HendrikThePendric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll refrain from approving or rejecting because I simply don't know enough about this app. But I did add one comment to a piece of code I'd like to learn more about.

src/Map.js Outdated Show resolved Hide resolved
src/layers/EarthEngine.js Outdated Show resolved Hide resolved
@HendrikThePendric
Copy link
Contributor

@turban @jenniferarnesen I pushed commit 06fd528, which seems to have improved things a bit. My thinking behind this was that the timeout can be cleared when data is being fetched. It seems to have reduced the flickering of the download button in the maps-app a lot. But on slow 3G I do see it on initial app-load, but not when I have the app open and then navigate to a download view.

Let me know if you'd like to keep it or revert it.

@HendrikThePendric HendrikThePendric self-requested a review March 4, 2024 11:54
@HendrikThePendric HendrikThePendric merged commit c3830ac into master Mar 4, 2024
1 check passed
@HendrikThePendric HendrikThePendric deleted the feat/map-rendered branch March 4, 2024 11:55
@HendrikThePendric HendrikThePendric restored the feat/map-rendered branch March 4, 2024 12:17
HendrikThePendric added a commit that referenced this pull request Mar 4, 2024
HendrikThePendric added a commit that referenced this pull request Mar 5, 2024
)

* feat: add class when map is rendered

* chore: code cleaning

* chore: code cleaning

* feat: check if bing layer is loaded

* chore: code cleaning

* fix: rendering timeout

* chore: refactor

* chore: change isLoading to within the trycatch

* fix: clear render timeout when data is fetched or received

* fix: restore check that returns if loading layers are encountered

* Revert "feat: add class when map is rendered and push-analytics helper files and classes (#552)"

This reverts commit c3830ac.

* fix: adjust test to changes

* chore: deduplicate node modules

* chore: add verify-app workflow

* fix: ensure mock Map class is an actual class

* fix: include error message when rejecting a promise

* fix: mock earth engine worker with class implementation

* fix: mock `getWorkerInstance` method instead of `getEarthEngineWorker` function

---------

Co-authored-by: Bjørn Sandvik <[email protected]>
Co-authored-by: Jen Jones Arnesen <[email protected]>
dhis2-bot added a commit that referenced this pull request Mar 5, 2024
# [3.9.0](v3.8.6...v3.9.0) (2024-03-05)

### Features

* add class when map is rendered and push-analytics helper files and classes ([#552](#552)) ([c3830ac](c3830ac))
* add map rendered class and push-analytics config and classes ([#565](#565)) ([354ba97](354ba97)), closes [#552](#552)
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 3.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants