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 support for hash routing which is used by other analytics apps [DHIS2-15762] #3009

Merged
merged 49 commits into from
Jan 12, 2024

Conversation

jenniferarnesen
Copy link
Collaborator

@jenniferarnesen jenniferarnesen commented Oct 6, 2023

Implements https://dhis2.atlassian.net/browse/DHIS2-15762

Continue to support the old url patterns for backwards compatibility

Supports:

/#/ZBjCfSaLSqD
/#/ZBjCfSaLSqD/download
/#/ZBjCfSaLSqD?interpretationId=yKqhXZdeJ6a
/#/ZBjCfSaLSqD?interpretationId=yKqhXZdeJ6a&initialFocus=true
/#/currentAnalyticalObject
/#/download (new map, in download mode)



// legacy urls
/?id=ZBjCfSaLSqD
/?id=ZBjCfSaLSqD&interpretationid=yKqhXZdeJ6a
/?id=ZBjCfSaLSqD&interpretationId=yKqhXZdeJ6a
/?currentAnalyticalObject=true

The app supports legacy urls (see above) because dashboard-app still produces the legacy url for both opening the map, and opening an interpretation. In addition, urls to maps may have been shared in other ways. In maps-app, legacy urls are replaced with the new url style when the maps-app first opens (AppWrapper)

FileMenu: push paths to history for the various actions. Also, some renaming was done in the file to (hopefully) increase clarity.

useLoadMap: this is where all the map loading and history listening is set up. history.listen implementation has been copied from LL and adjusted as needed to support maps.

Refactoring. Previously there were 3 components that dealt with initiating the maps app: AppWrapper, App, AppLayout. App has become the former "AppLayout", and all of the loading and navigating logic has been moved to the new custom hook useLoadMap

@dhis2-bot
Copy link
Contributor

dhis2-bot commented Oct 6, 2023

🚀 Deployed on https://pr-3009--dhis2-maps.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify October 6, 2023 14:10 Inactive
@jenniferarnesen jenniferarnesen marked this pull request as draft October 6, 2023 14:20
@jenniferarnesen jenniferarnesen changed the base branch from dev to chore/useQueryCacheProvider October 6, 2023 14:20
@dhis2-bot dhis2-bot temporarily deployed to netlify October 6, 2023 14:27 Inactive
@cypress
Copy link

cypress bot commented Oct 6, 2023

1 flaky test on run #2859 ↗︎

0 42 16 0 Flakiness 1

Details:

Merge 8418b48 into 8110ed1...
Project: maps Commit: e3421e154e ℹ️
Status: Passed Duration: 02:54 💡
Started: Jan 12, 2024 7:21 AM Ended: Jan 12, 2024 7:24 AM
Flakiness  cypress/integration/dataDownload.cy.js • 1 flaky test • e2e-chrome-parallel-2.40

View Output

Test Artifacts
Data Download > downloads data from an event layer Screenshots

Review all test suite changes for PR #3009 ↗︎

@dhis2-bot dhis2-bot temporarily deployed to netlify October 17, 2023 16:11 Inactive
Base automatically changed from chore/useQueryCacheProvider to dev October 23, 2023 07:27
@jenniferarnesen jenniferarnesen self-assigned this Nov 13, 2023
@dhis2-bot dhis2-bot temporarily deployed to netlify December 10, 2023 21:14 Inactive
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've left some comments/questions....

Looking at the code changes it feels more likely that the re-rendering issues you encountered are related to history state changes rather than the useAlert hook. But you have obviously found that creating this custom hook fixed the issue, so I guess there is either some interaction between these two things, or there is something at play that I don't fully understand.

src/AppWrapper.js Outdated Show resolved Hide resolved
src/components/app/FileMenu.js Outdated Show resolved Hide resolved
src/components/app/useLoadMap.js Outdated Show resolved Hide resolved
src/hooks/useAlert.js Outdated Show resolved Hide resolved
@dhis2-bot dhis2-bot temporarily deployed to netlify January 8, 2024 16:14 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify January 10, 2024 10:36 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify January 10, 2024 13:46 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify January 11, 2024 09:52 Inactive
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.

Awesome 🚀

@dhis2-bot dhis2-bot temporarily deployed to netlify January 11, 2024 10:59 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify January 11, 2024 15:13 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify January 11, 2024 15:32 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify January 12, 2024 07:09 Inactive
@jenniferarnesen jenniferarnesen merged commit b25267d into dev Jan 12, 2024
15 checks passed
@jenniferarnesen jenniferarnesen deleted the feat/router-latest branch January 12, 2024 07:30
dhis2-bot added a commit that referenced this pull request Jan 12, 2024
# [100.3.0](v100.2.3...v100.3.0) (2024-01-12)

### Features

* add support for hash routing in line with other analytics apps [DHIS2-15762] ([#3009](#3009)) ([b25267d](b25267d))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 100.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

jenniferarnesen pushed a commit that referenced this pull request Jan 23, 2024
# [100.3.0](v100.2.3...v100.3.0) (2024-01-12)

### Features

* add support for hash routing in line with other analytics apps [DHIS2-15762] ([#3009](#3009)) ([b25267d](b25267d))
jenniferarnesen added a commit that referenced this pull request Jan 24, 2024
* chore(release): cut 100.3.0 [skip release]

# [100.3.0](v100.2.3...v100.3.0) (2024-01-12)

### Features

* add support for hash routing in line with other analytics apps [DHIS2-15762] ([#3009](#3009)) ([b25267d](b25267d))

* chore(deps): bump @dhis2/app-runtime from 3.9.4 to 3.10.2

Bumps
[@dhis2/app-runtime](https://github.com/dhis2/app-runtime/tree/HEAD/runtime)
from 3.9.4 to 3.10.2.
- [Release notes](https://github.com/dhis2/app-runtime/releases)
- [Changelog](https://github.com/dhis2/app-runtime/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dhis2/app-runtime/commits/v3.10.2/runtime)

---
updated-dependencies:
- dependency-name: "@dhis2/app-runtime"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: @dhis2-bot <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jen Jones Arnesen <[email protected]>
HendrikThePendric pushed a commit that referenced this pull request Jan 25, 2024
* chore(release): cut 100.3.0 [skip release]

# [100.3.0](v100.2.3...v100.3.0) (2024-01-12)

### Features

* add support for hash routing in line with other analytics apps [DHIS2-15762] ([#3009](#3009)) ([b25267d](b25267d))

* chore(deps): bump @dhis2/app-runtime from 3.9.4 to 3.10.2

Bumps
[@dhis2/app-runtime](https://github.com/dhis2/app-runtime/tree/HEAD/runtime)
from 3.9.4 to 3.10.2.
- [Release notes](https://github.com/dhis2/app-runtime/releases)
- [Changelog](https://github.com/dhis2/app-runtime/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dhis2/app-runtime/commits/v3.10.2/runtime)

---
updated-dependencies:
- dependency-name: "@dhis2/app-runtime"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: @dhis2-bot <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jen Jones Arnesen <[email protected]>
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.

3 participants