sartography / spiff-arena

SpiffWorkflow is a software development platform for building, running, and monitoring executable diagrams
https://www.spiffworkflow.org/
GNU Lesser General Public License v2.1
44 stars 34 forks source link

Embedded dashboard (Expense process) #1491

Open sashayar13 opened 2 weeks ago

sashayar13 commented 2 weeks ago

There is a need to show the embedded Superset dashboard in the Spiff manual task, the dashboard should be pre-filtered by:

The user who starts the process in Spiff should see only the entries associated with their expenses for a selected period. (There is an existing Expense dashboard in Superset).

The prototype of the embedded report we created previously with the iframe https://dev.app.spiff.status.im/editor/process-models/misc:prototypes:embedded-superset-dashboard/files/embedded_superset_dashboard.bpmn - it doesn't send any info to the Superset.

@burnettk @jasquat can you pls advise on what needs to be configured in the process so that it can send the variables to Superset? Lalo @JoseAnaya28 will need to check from the Superset side

Sample of auth data (for Lalo @JoseAnaya28)

"auth_user_info": {
    "id": 2,
    "email": "sasha@status.im",
    "username": "sasha@status.im",
    "display_name": "sasha",
    "created_at_in_seconds": 1710324262,
    "updated_at_in_seconds": 1710324262,
    "tenant_specific_field_1": "112",
    "tenant_specific_field_2": null,
    "tenant_specific_field_3": null
  },
calexh-sar commented 1 week ago

Estimate based on using iFrame. May be more if another approach is needed.

burnettk commented 1 week ago

@JoseAnaya28 can we pass query parameters to this sucker in the iframe?

JoseAnaya28 commented 1 week ago

@burnettk yeah, we can pass the parameters in the url something like this:

Pass specified parameter in query into URL such as url/?reg=North+America.

burnettk commented 5 days ago

@JoseAnaya28 great, thanks, can we filter by user and period with query params (please see the first comment from sasha)?

JoseAnaya28 commented 4 days ago

@burnettk Yes, if we're able to pass the user or/and cc id and the period we should be good to filter the dashboards.

I think these are the next steps:

  1. Create a test dataset that incorporates the conditions to filter data using the URL parameter.
  2. Create a test dashboard featuring a chart that uses the test dataset.
  3. Set up the Spiff process to summon the iframe with the necessary parameters and check that works

Is the prototype that Sasha mentioned usable for 3? It seems like it already passes a parameter in the iframe.

sashayar13 commented 4 days ago

@JoseAnaya28 regarding the 3# - I need to update it slightly so that it has the data we need