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

[Dashboard Navigation] Add link editing + reordering #161568

Merged

Conversation

Heenawter
Copy link
Contributor

@Heenawter Heenawter commented Jul 10, 2023

Closes #154361
Closes #161274
Closes #161693

Summary

This PR adds editing capabilities to the navigation embeddable, including deleting/editing existing links and reordering the list of links. It also fixes the delay in opening the editing flyout from the async import in getExplicitInput (from the navigation embeddable factory) by moving it to the constructor of the factory.

Screen.Recording.2023-07-12.at.11.25.46.AM.mov

Checklist

For maintainers

@Heenawter Heenawter added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:large Large Level of Effort impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Project:Dashboard Navigation Related to the Dashboard Navigation Project labels Jul 10, 2023
@Heenawter Heenawter self-assigned this Jul 10, 2023
@Heenawter Heenawter changed the title [Dashboard Navigation] Add link editing [Dashboard Navigation] Add link editing + reordering Jul 10, 2023
@andreadelrio
Copy link
Contributor

When the user chooses a destination dashboard we should be showing it in the input, with the clearable option enabled like so:

Sorry, I'm a bit confused on what you mean by that 🤔 The top input is a search, so we can't really auto-populate it like your mocks show - should this be different? Also, the EuiTextField component doesn't support the isClearable prop, so I'd have to create my own version of that if you wanted it to show up for the Text input.

@Heenawter I think I was thinking of the isClearable prop in EuiFieldSearch which I guess is not exactly what we need. That would make the search query clearable, it wouldn't show the "selected dashboard" which is what I was thinking of. Do you think it is valuable to show the selected dashboard's name in another place other than in EuiSelectable itself? I worry that when we have many available dashboards and scrolling kicks in, if the user selects a dashboard at the bottom and changes the label, the only way for them to see their selection is by scrolling to the bottom of the list (or by searching).

@Heenawter
Copy link
Contributor Author

Heenawter commented Jul 14, 2023

Do you think it is valuable to show the selected dashboard's name in another place other than in EuiSelectable itself? I worry that when we have many available dashboards and scrolling kicks in, if the user selects a dashboard at the bottom and changes the label, the only way for them to see their selection is by scrolling to the bottom of the list (or by searching).

@andreadelrio Ahhh, that's an excellent point... I definitely think it could be valuable to show the selected dashboard title somewhere, although I'm not exactly sure where.

We could do something with an EuiSuperSelect:

image

... or something like the data view picker in the controls creation flyout with a popover + EuiSelectable combo:

image

... but I'm not convinced that those make the best use of the real estate we have in the flyout - it would probably look pretty empty 😅 For the field picker in the controls flyout, it looks like we only show the name of the selected field in the Label text input, similar to how we're doing it now for selecting dashboards:

image

We could have a similar idea to the Control type row, which auto-populates with the selected dashboard/URL....

Jul-14-2023 09-36-37

Not sure if that's overkill though?

Copy link
Member

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

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

We could have a similar idea to the Control type row, which auto-populates with the selected dashboard/URL....

Jul-14-2023 09-36-37

Not sure if that's overkill though?

Of the proposed options, I like this idea the best.

I do sometimes forget that the EuiSelectable here is only for single selections. My muscle memory expects to use CMD-click to select multiple dashboards. That would be a slight concern for me if I was a user wanting to quickly create a very long sidebar list of links. But then users would also not be able to change the label on a link during creation.

But we can always add multi-select in a later release. Not necessary for MVP, IMO.

@Heenawter
Copy link
Contributor Author

Major design change

After discussion with @andreadelrio, we have decided to go with an EuiComboBox for the dashboard selector rather than the EuiSelectable:

Screen.Recording.2023-07-14.at.4.20.37.PM.mov

This was implement in bdf7756.

Copy link
Member

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

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

lgtm! EuiComboBox is a great improvement!

code review and tested add/edit link functionality

@andreadelrio andreadelrio self-requested a review July 17, 2023 21:02
Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

LGTM! EuiComboBox feels a lot cleaner, thanks for implementing it. We might want to think about doing the same for Controls in the future.

@kibana-ci
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [70813b7]

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @Heenawter

@Heenawter Heenawter merged commit c7485e6 into elastic:navigation-embeddable Jul 17, 2023
1 check passed
@Heenawter Heenawter deleted the nav-emb-editing_2023-07-10 branch July 17, 2023 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Embedding Embedding content via iFrame impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:large Large Level of Effort Project:Dashboard Navigation Related to the Dashboard Navigation Project Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
8 participants