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

Feature/open chart as map [DHIS2-5987] #213

Merged
merged 37 commits into from
Feb 27, 2019
Merged

Conversation

neeilya
Copy link
Contributor

@neeilya neeilya commented Feb 6, 2019

This PR enables "Open as: Map" chart type in DV app.

User Data Store (UDS) has been chosen for data sharing across DV and Maps apps.
More details about user data store in docs.

Chart config format

After some discussion decision was made to remove some attributes from analytical object (AO) before putting it into user data store:

  • id
  • name
  • displayName

Reason: if user decides to open existing chart/AO in another app (e.g. maps), then we need to allow sharing only chart configuration (excluding name and interpretations).

How it works

Open as map use case

  • Prepares AO format
    • Removes id, name, displayName attributes from object
    • Appends path attributes to org unit dimension items
    • Appends dimension item names
  • Saves transformed AO in user data store with namespace=analytics and key=currentAnalyticalObject
  • Redirects to maps app with URL flag currentAnalyticalObject=true

Open visualization from map use case

  • On app start checks if routing id equals to currentAnalyticalObject (assume yes for this use case)
  • Fetches visualization config from user data store using same namespace and key (analytics and currentAnalyticalObject correspondingly)
  • Generates parentGraphMap and puts it in ui redux object (required for org units tree functioning)
  • Calls redux acSetVisualization action with fetched AO as argument
  • Calls redux acSetUiFromVisualization action with fetched AO as argument
  • Calls redux acSetCurrentFromUi action with updated current redux store object

@neeilya neeilya added the WIP label Feb 6, 2019
Copy link
Member

@edoardo edoardo left a comment

Choose a reason for hiding this comment

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

One doubt, but I might have missed the spec for this, is the Open as map still supposed to be part of the chart type selector as per: https://projects.invisionapp.com/d/main#/console/12702965/266385321/preview @joeDHIS ?

packages/app/src/api/analytics.js Outdated Show resolved Hide resolved
@neeilya neeilya changed the title Feature/open chart as map [DHIS2-5690] [WIP]: Feature/open chart as map [DHIS2-5690] Feb 11, 2019
@neeilya neeilya changed the title [WIP]: Feature/open chart as map [DHIS2-5690] [WIP] Feature/open chart as map [DHIS2-5690] Feb 11, 2019
@neeilya neeilya changed the title [WIP] Feature/open chart as map [DHIS2-5690] Feature/open chart as map [DHIS2-5690] Feb 13, 2019
@neeilya neeilya removed the WIP label Feb 13, 2019
@neeilya neeilya changed the title Feature/open chart as map [DHIS2-5690] Feature/open chart as map [DHIS2-5987] Feb 13, 2019
@joakimia joakimia self-requested a review February 25, 2019 10:47
@joakimia
Copy link
Contributor

Tested the branch successfully

@neeilya neeilya requested a review from edoardo February 25, 2019 10:52
Copy link
Member

@edoardo edoardo left a comment

Choose a reason for hiding this comment

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

It looks fine.
I just have one comment about prepareCurrentAnalyticalObject.
I didn't try the branch yet, but I see @joakimia did test it.

Copy link
Member

@edoardo edoardo left a comment

Choose a reason for hiding this comment

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

i18n on the text and button labels?

@neeilya neeilya merged commit 2c1eae1 into master Feb 27, 2019
@neeilya neeilya deleted the feature/open-chart-as-map branch February 27, 2019 12:23
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 33.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 32.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 33.1.13 🎉

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
Development

Successfully merging this pull request may close these issues.

None yet

5 participants