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

[VisBuilder] When creating wizard from visualization page, provide additional options to add to new/existing dashboard, or add to library #2534

Open
abbyhu2000 opened this issue Oct 7, 2022 · 10 comments
Labels
enhancement New feature or request vis builder

Comments

@abbyhu2000
Copy link
Member

abbyhu2000 commented Oct 7, 2022

Is your feature request related to a problem? Please describe.
When user creates a wizard:

  1. User can go to the dashboard page, choose a dashboard and create wizard there by clicking Edit and Create new [VizBuilder] Create a new wizard directly on a dashboard #2384
  2. User can go to the visualization page, and create wizard; however, if user wants to add the wizard to a specific dashboard, they would need to go to the dashboard page and choose the dashboard and click Add

Describe the solution you'd like
When user takes the second route to create wizard from the visualization page, we can provide an option for user to add the wizard directly to the dashboard. Here is the UI mockup: @btzeng

  1. User can add the wizard to an existing dashboard
  2. User can add the wizard to a new dashboard
  3. User can add the wizard to the library(save as a saved object, not related to any dashboard)

image

Requirements

  • Implementation
  • Tests
    • unit
    • functional tests
@btzeng
Copy link

btzeng commented Oct 7, 2022

@abbyhu2000 thanks for posting this. Let's prioritize number 1 and 3 for now. Add to a new dashboard requires another flow to create a new dash. Will put more thought on this one.

@kavilla kavilla added the v2.4.0 'Issues and PRs related to version v2.4.0' label Oct 10, 2022
@kavilla
Copy link
Member

kavilla commented Oct 10, 2022

[Planning]

@btzeng do you have insight for a new dashboard?

@abbyhu2000
Copy link
Member Author

abbyhu2000 commented Oct 13, 2022

As I work on this issue, some questions arise and i want more opinions:

  1. Visualizations in OpenSearch Dashboards has a 1 to many relationship with dashboards so that means we allow the same visualization to be added to multiple dashboards. However, by adding this dropdown to add to a single dashboard when creating the visualization, it seems to imply to the end user that visualizations have a 1 to 1 relationship with dashboards. (it is a little confusing so i don’t know if we should allow adding to multiple dashboards option here)
  2. Currently we have two options: ‘Add to saved objects’ and ‘Add to dashboard’, and by having these two options here seem to imply that it’s either adding to dashboard or adding to saved objects. But it’s not true because we always store visualization in the saved object no matter which option the end user chooses. So i think maybe it makes more sense to make ‘Add to dashboard’ a toggle other than a radio group?
  3. Since we need to display a list of dashboards in the dropdown for this feature, and i am wondering if it is a good idea to make the dashboard plugin and wizard plugin too tightly coupled. Will there ever be a scenario that user disable the dashboard plugin and only use the visualization or the wizard plugin? I remember there are previous chats about a long term design idea that we should be able to rip out any plugin within the repo and just have users install them -> [DISCUSS] What constitutes a new plugin being a core plugin #2065 (comment)
  4. Is there permission control on creating visualization and editing dashboard? Will we have scenario that end user is only allowed to create visualization but is not allowed to edit a dashboard?

@ashwin-pc @joshuarrrr @kavilla @btzeng @KrooshalUX @kgcreative

@kgcreative
Copy link
Member

kgcreative commented Oct 13, 2022

  1. Visualizations in OpenSearch Dashboards has a 1 to many relationship with dashboards so that means we allow the same visualization to be added to multiple dashboards. However, by adding this dropdown to add to a single dashboard when creating the visualization, it seems to imply to the end user that visualizations have a 1 to 1 relationship with dashboards. (it is a little confusing so i don’t know if we should allow adding to multiple dashboards option here)

We can use OuiComboBox here to multi-select dashboards and keep the same 1:many relationship.

2. Currently we have two options: ‘Add to saved objects’ and ‘Add to dashboard’, and by having these two options here seem to imply that it’s either adding to dashboard or adding to saved objects. But it’s not true because we always store visualization in the saved object no matter which option the end user chooses. So i think maybe it makes more sense to make ‘Add to dashboard’ a toggle other than a radio group?

We can remove `Add to saved objects. By Saving, it automatically adds to saved objects, and there is no case where a saved object is added to a dashboard, but NOT added to saved objects, so this will simplify the flow.

3. Since we need to display a list of dashboards in the dropdown for this feature, and i am wondering if it is a good idea to make the dashboard plugin and wizard plugin too tightly coupled. Will there ever be a scenario that user disable the dashboard plugin and only use the visualization or the wizard plugin? I remember there are previous chats about a long term design idea that we should be able to rip out any plugin within the repo and just have users install them -> [DISCUSS] What constitutes a new plugin being a core plugin #2065 (comment)

I think it makes sense to add this conditionally (if dashboards exist, then display the add to dashboard link, otherwise don't) -- this will help this be more extensible in the future

cc: @btzeng

@kavilla
Copy link
Member

kavilla commented Oct 14, 2022

Blocking for now: until @abbyhu2000 @btzeng @opensearch-project/opensearch-ux work out the finer details.

@ashwin-pc
Copy link
Member

@abbyhu2000 great callouts. @kgcreative @btzeng This makes me think if we can actually make the save and navigation logic a lot simpler and sensible for the user?

My proposal:

  • Consolidate all save buttons into one. (Saves as, Save and Return, etc) to a simple "Save" button. This is only responsible for saving a visualization (Either as a new saved object, or save as, or overwrite depending on the usecase). No redirection.
  • Add a new "Dashboards" button that opens up a modal in which you can manage how the visualization is linked to a dashboard

The Dashboard manager (i.e. the popup that opens when you click the button) should do the following:

  1. Show all Dashbaords that the visualization is already linked to
  2. Have the ability to link the visualization to existing dashboards from a picker of sorts
  3. The ability to navigate to any dashboard by clicking on it
  4. The ability to create a dashboard and link the visualization to it
  5. The "Dashboard" button should only be available once the visualization has been saved atleast one

Here is a similar UX that does just this:

Screen Shot 2022-10-14 at 2 21 20 PM

@abbyhu2000
Copy link
Member Author

abbyhu2000 commented Oct 14, 2022

@ashwin-pc @kgcreative @btzeng Although I think it is a useful flow to allow user add visualization directly to dashboard, there are currently some implementation blockers. First of all, we do not have existing flow that let user to add any visualization directly to a dashboard outside of the dashboard app. The current flow is that user go to the dashboard and add the visualization from the add panel or they can create new. The visualization will show up on the dashboard, but the relationship is not actually saved. It only gets saved when user clicks the save button on the dashboard. This save action requires a lot of information from the dashboard app like the dashboard container information, dashboardStateManager, and the grid data and layout of the current list of visualization panels on the dashboard (shown below). All the relationship between dashboard and visualization is managed and stored by dashboard saved object, so only dashboard knows how to add and manage this visualization/dashboard relationship. And dashboard plugin does not currently expose any apis to let another plugin to obtain those information or to give them ability to manage that relationship. There are some potential solutions to solve this:

  1. Change the user flow: after user chooses a dashboard and click save on the save modal, it takes them to the dashboard page where they can then click save button on that dashboard to actual link the visualization to the dashboard. If we do it this way, feels like we are defeating the purpose of this new user flow and it wont be working if we are adding viz to multiple dashboards at the same time.
  2. Add an api in the dashboard plugin to let others have the ability to add visualization/dashboard relationship. I am not sure if this is a good idea as this will need in depth research of current dashboard plugin architecture and the complexity of the design might be intentional.
  3. It makes me wonder if we need this new user flow and if it’s an actual pain point for our users.
{
    "embeddableConfig": {
      "mapZoom": 2,
      "mapCenter": [
        28.304380682962783,
        -22.148437500000004
      ]
    },
    "gridData": {
      "x": 0,
      "y": 39,
      "w": 24,
      "h": 15,
      "i": "11"
    },
    "panelIndex": "11",
    "version": "7.0.0-alpha1",
    "panelRefName": "panel_10"
  }

@kgcreative
Copy link
Member

I would be aligned with de-scoping "Add to dashboard" from 2.4 and consider it an incremental feature for all visualizations

@ashwin-pc
Copy link
Member

ashwin-pc commented Oct 14, 2022

It makes me wonder if we need this new user flow and if it’s an actual pain point for our users.

This is definitely a pain for users, especially newer users. But i'm aligned with @kgcreative here. The complexity here is not trivial and needs more research.

@ashwin-pc ashwin-pc removed the v2.4.0 'Issues and PRs related to version v2.4.0' label Oct 20, 2022
@kgcreative
Copy link
Member

If I recall correctly, notebooks can also embed visualizations, so another requirement may be to add to other type of saved objects. If in the future we have multiple dashboard types, we should be able to add a visualization to any type of container object.

@ashwin-pc ashwin-pc added the enhancement New feature or request label Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vis builder
Projects
None yet
Development

No branches or pull requests

5 participants