EQWorks / widget-studio

Widget-creating tool for charts, maps, tables, stats
https://eqworks.github.io/widget-studio/
2 stars 3 forks source link

[WIP] Insights product/insights data provider #121

Closed vxsl closed 2 years ago

vxsl commented 2 years ago

Introduced InsightsDataProvider and new special logic for insights data inside Widget.


⚠️

until there are Cox users with policies and the ACL is implemented, the InsightsDataProvider won't work unless you use EQWorks/firstorder#687


explanation

Note that firstorder automatically scopes the data to the dealer ID embedded in the user's access object.


explanation of the InsightsDataProvider story

I've created+used widgets with the following IDs to demonstrate the new functionality: 100056, 100057, 100058, and 100084. These are copies of 56, 57, 58 and 84 respectively with the only difference being that the data source has changed from something like this:

  "dataSource": {
    "id": "1842",
    "type": "Execution"
  }

to something like this:

  "dataSource": {
    "id": "visitor_visitation",
    "type": "Insights data"
  }

so, the idea is that the widget config itself is generic therefore widget 100084 can be used in the same dashboard for all dealers -- InsightsDataProvider and firstorder take care of adding the dynamic aspects (attaching the month/year and dealer ID).

github-actions[bot] commented 2 years ago

📚 Storybook preview (updated to 38599a75c23195bf4502998ba510364e8748781a)

geoerika commented 2 years ago

Nice work! As usual!