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 creation UI #160179

Merged

Conversation

Heenawter
Copy link
Contributor

@Heenawter Heenawter commented Jun 21, 2023

Closes #154360

Summary

This PR adds the first draft of the UI for creating the navigation embeddable and adding links to it. Note that this PR only addresses adding links - you cannot currently remove links from the panel or edit existing links. Also, because this PR contains critical code, some cleanup tasks were left as TODO in order to get it merged ASAP - these will be addressed in follow up PRs.

Screen.Recording.2023-07-06.at.4.31.04.PM.mov

Checklist

For maintainers

@Heenawter Heenawter force-pushed the add-creation-ui_2023-06-21 branch from b4d1adb to b1d9f30 Compare June 21, 2023 16:47
@Heenawter Heenawter force-pushed the add-creation-ui_2023-06-21 branch from 8863ace to 7a0ac38 Compare June 21, 2023 21:27
@Heenawter Heenawter force-pushed the add-creation-ui_2023-06-21 branch from 2e53f49 to 6faccad Compare June 21, 2023 22:00
@Heenawter Heenawter force-pushed the add-creation-ui_2023-06-21 branch from 87aa84a to 2198908 Compare June 22, 2023 20:38
@Heenawter Heenawter force-pushed the add-creation-ui_2023-06-21 branch from 4db8743 to bc9c863 Compare June 22, 2023 22:17
@Heenawter Heenawter force-pushed the add-creation-ui_2023-06-21 branch from 0863f99 to 5768166 Compare June 26, 2023 20:57
@Heenawter Heenawter force-pushed the add-creation-ui_2023-06-21 branch from 7165859 to e70ed3c Compare June 26, 2023 21:09
@Heenawter Heenawter force-pushed the add-creation-ui_2023-06-21 branch 3 times, most recently from 19e02b7 to 2b82446 Compare June 27, 2023 16:15
@Heenawter Heenawter force-pushed the add-creation-ui_2023-06-21 branch from 7aaa593 to 7d1864b Compare July 6, 2023 22:25
@Heenawter Heenawter marked this pull request as ready for review July 6, 2023 22:51
@Heenawter Heenawter requested review from a team as code owners July 6, 2023 22:51
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Jul 7, 2023
@Heenawter Heenawter requested a review from andreadelrio July 7, 2023 14:27
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! I added a couple of nits, but nothing that needs to block merging.

})}
<EuiButtonEmpty
size="s"
flush="left"
Copy link
Member

Choose a reason for hiding this comment

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

When the button has tab focus, the padding is 0. Since the items above have some left padding I think I'd prefer not to flush here. 🚽

Screenshot 2023-07-07 at 2 49 38 PM

Copy link
Contributor Author

@Heenawter Heenawter Jul 7, 2023

Choose a reason for hiding this comment

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

Ooooh, good catch - I definitely agree that looks pretty ugly 👀

I'm a little bit worried about how that link will look without flush="left" once we add the "Save to library" toggle from the designs:

image

But that's something we can address as part of that PR :) I think removing the left flush is the right call here.

Copy link
Contributor Author

@Heenawter Heenawter Jul 7, 2023

Choose a reason for hiding this comment

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

Fixed in c0c81e2 👍

Without focus With focus
image image

Comment on lines +100 to +121
{!links || Object.keys(links).length === 0 ? (
<EuiPanel hasBorder={true}>
<EuiFlexGroup justifyContent="spaceAround">
<EuiFlexItem grow={false}>
<EuiText size="s">
{NavEmbeddableStrings.editor.panelEditor.getEmptyLinksMessage()}
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="s" />
<EuiFlexGroup justifyContent="spaceAround">
<EuiFlexItem grow={false}>
<EuiButton
onClick={() => setShowLinkEditorFlyout(true)}
iconType="plusInCircle"
>
{NavEmbeddableStrings.editor.getAddButtonLabel()}
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
) : (
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't have to block this PR, but I wonder if we should (can?) add a nice empty prompt to the flyout? It would be nice to have a title prompt like "Create links" and a description explaining the value of the links panel, e.g. "Links can pass filters and time range to other dashboards. Or create external links to other websites." <-- probably needs some better copy 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I 100% agree - @andreadelrio @gchaps any ideas on how to add some visual interest to the flyout and/or improve the copy to give it more impact when there are no links? 👀 For reference, this is what the flyout currently looks like when first creating a links panel:

image

I definitely think there's work we could do to make it a little more ⭐ fancy ⭐ even if it's not included as part of this PR :)

Copy link
Contributor

@gchaps gchaps Jul 7, 2023

Choose a reason for hiding this comment

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

@Heenawter we can definitely improve the text. I'll post a suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gchaps Yes, it is! 👍 It is still in its early stages, but we are essentially creating a navigation system so that users don't have to use markdown links (which can very easily become out of date, especially when using hard links to specific dashboards) anymore. I can link you to the project docs on Slack if you want more information - sorry for the sudden no-context mention, haha! 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that we could make this more visually appealing. Let me think about what we can do here. I don't think we have any illustration available right now that would fit the bill so there might not be a quick solution to this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@nickpeihl @Heenawter @gchaps sending a couple of ideas for the empty state graphic.

image image

Copy link
Contributor

Choose a reason for hiding this comment

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

Wow! The first one with the big link and the fly looks incredible!

Copy link
Member

Choose a reason for hiding this comment

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

I'm partial to the first graphic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oooh, those are fantastic Andrea 🔥 I especially like the first one!! :) I've opened a related issue so that we can move discussion of the empty state there (both for copy suggestions and the graphic) - I think it's worth getting multiple opinions, and this thread is already getting pretty large hehe

@Heenawter Heenawter force-pushed the add-creation-ui_2023-06-21 branch from 2736613 to d71df9e Compare July 7, 2023 20:29
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.

@Heenawter Great job on this first PR!

Here are some things to consider design-wise:

  • I think we need to go full width with the inputs in the flyout.
  • I'm also wondering whether we should have the Current badge absolutely positioned. Right now, in the event of a super long dashboard name, the badge won't be visible.
  • The Current badge should not be getting an underline on hover.
  • For the Text input I think we should either:
    a) automatically prefill it with the text of the chosen destination.
    b) mark it as optional
  • For the Choose destination input, I suggest we show the error text below it.

@Heenawter
Copy link
Contributor Author

Heenawter commented Jul 7, 2023

@andreadelrio

I think we need to go full width with the inputs in the flyout.

Done :)

I'm also wondering whether we should have the Current badge absolutely positioned. Right now, in the event of a super long dashboard name, the badge won't be visible.

Very good point! We could prepend or append it to the EuiSelectable option, like so:

Prepend Append
image image

I think I prefer prepending, since it looks better when the current dashboard name isn't long:

Prepend Append
image image

What do you think? 👀

The Current badge should not be getting an underline on hover.

Good catch - that will be fixed by using either the append or prepend above.

For the Text input I think we should either:
a) automatically prefill it with the text of the chosen destination.
b) mark it as optional

How do we usually mark something as optional in a form? I looked through Kibana + the EUI form documentation and I couldn't find any examples - totally possible I missed something, though. Would something as simple as this work?

image

Update: Actually, at some point I had the placeholder getting replaced... That would probably help a lot, I don't know when that broke 😆 Let me try to fix that...

For the Choose destination input, I suggest we show the error text below it.

Sorry, which error text are you referring to? There's no error text at the moment - do you mean once we add better validation to the URL input as discussed here?

@andreadelrio
Copy link
Contributor

What do you think? 👀

I like the prepend better precisely for the reason you mentioned.

For the Text input I think we should either:
a) automatically prefill it with the text of the chosen destination.
b) mark it as optional

How do we usually mark something as optional in a form? I looked through Kibana + the EUI form documentation and I couldn't find any examples - totally possible I missed something, though. Would something as simple as this work?

image

Yes, that's perfect. According to EUI's guidelines, all fields are considered required unless marked as optional (using either the label of the help text)

For the Choose destination input, I suggest we show the error text below it.

Sorry, which error text are you referring to? There's no error text at the moment - do you mean once we add better validation to the URL input as discussed here?

Yes, I was referring to that 👍

@Heenawter
Copy link
Contributor Author

Heenawter commented Jul 7, 2023

I like the prepend better precisely for the reason you mentioned.

Let's go with that, then 🎉

Yes, that's perfect. According to EUI's guidelines, all fields are considered required unless marked as optional (using either the label of the help text)

Done! :) I also fixed the issue with the placeholder text not being replaced:

Screen.Recording.2023-07-07.at.4.21.19.PM.mov

(ignore the Current badge being appended - I switched it back to prepend after this video was taken)

Yes, I was referring to that

Awesome, yeah - that makes sense to me 👍

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.

Added a couple more nits. Should be easy changes.

@nickpeihl
Copy link
Member

The link validation will be resolved as part of #154381 and the empty state will be resolved as part of #161552. So I think we can merge this PR as is.

Any CI issues in the feature-branch can also be resolved separately from this PR.

@Heenawter Heenawter merged commit 3c2e8f6 into elastic:navigation-embeddable Jul 10, 2023
@Heenawter Heenawter deleted the add-creation-ui_2023-06-21 branch July 10, 2023 15:13
@kibana-ci
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

Metrics [docs]

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

History

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

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
Development

Successfully merging this pull request may close these issues.

[Dashboard Navigation] Link Creation
8 participants