-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[CCR]: Add UI page + form to create Auto-follow pattern #26407
[CCR]: Add UI page + form to create Auto-follow pattern #26407
Conversation
💚 Build Succeeded |
Hey @sebelga, nice work. I couldn't get this running locally (assume there is some setup), so I'm just adding some comments to the screens posted. We're trying to get more consistant with breadcrumb usage #25689. Although sub-nav breadcrumbs are fine, they seem pretty duplicative in a lot of these situations. I'd just keep the thread in a single place. As we move towards K7 you'll not only have a more consistent breadcrumb path, but also have a left side nav for management in general, which should better highlight where you are within management. cc @cjcenizal since I see similar stuff in rollups and I'm sure he has opinions. Also for context, though this is missing the breadcrumbs in the top. But shows off why the sub breadcrumbs aren't really very useful in management once the sidenav comes in along with #25905 |
@snide Good points. The reason I created these in-page breadcrumbs was in anticipation of that new side, since it also seemed like the header breadcrumbs duplicate part of the side nav. I probably jumped the gun by incorporating them into 6.5, but I was thinking that switching to breadcrumbs in the page itself for management would make more sense once the side nav is present. That said, we'll go whichever direction Design team thinks makes sense. Header breadcrumbs: In-page breadcrumbs: |
I know it's gonna sound like a lame answer, but having everyone use the
header breadcrumbs is just the only way I know to keep design consistent
across apps. Believe it or not every team has opinions on this stuff, and
people are implementing things differently from app to app (it's come up
twice today!). I admit they sometimes make more sense with inner
breadcrumbs in some of these cases, but taken as a whole it just comes off
scattered across the app.
The general rule I've given is that if your inner breadcrumbs can fit under
a constant, header H1 (navigation under a persistent whole), rather than as
a temporary sub nav than it's normally OK. I wouldn't recommend it in this
case, since really we're just following the normal list / item / create
patterns. APM though... it kind of makes sense because of the deep trees..
So of your options, the in header one makes the most sense. I'd likely add
"Add" or "Create" as the last active breadcrumb though, since "Rollup Jobs"
should be clickable and lead to the list view. Check the guidelines in that
ticket I referenced #25689, we'll
make something more formal in EUI to cover this stuff.
Apologies, as this stuff is just coming up recently, so we're just this
past month formalizing some real rules.
…On Thu, Nov 29, 2018 at 6:35 PM CJ Cenizal ***@***.***> wrote:
@snide <https://github.com/snide> Good points. The reason I created these
in-page breadcrumbs was in anticipation of that new side, since it also
seemed like the header breadcrumbs duplicate part of the side nav. I
probably jumped the gun by incorporating them into 6.5, but I was thinking
that switching to breadcrumbs in the page itself for management would make
more sense once the side nav is present. That said, we'll go whichever
direction Design team thinks makes sense.
Header breadcrumbs:
[image: image]
<https://user-images.githubusercontent.com/1238659/49264918-045cbb00-f405-11e8-93d0-52b1622f9bcd.png>
In-page breadcrumbs:
[image: image]
<https://user-images.githubusercontent.com/1238659/49264922-0888d880-f405-11e8-950f-2a3a549f105b.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#26407 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AATzp0fOpPq2Y762_Qe1RuAcwPuqX-Guks5u0JlmgaJpZM4Y5d-5>
.
|
@snide thanks for the feedback! We'll align with what you say it makes sense. |
💔 Build Failed |
@snide @sebelga I just tried using the Spencer is planning on removing the auto-breadcrumb system for 7.0. I think our best option for the time being is to just remove the in-page breadcrumbs for now. When Spencer works on removing the auto-breadcrumb system he'll let us know, at which point we can update the breadcrumbs to show the correct trail. |
@cjcenizal that sounds good to me. This is all minor stuff and I don't think you all need to get hung up on it for me. Hopefully the new service will help clean this stuff up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Tested locally and everything works as expected. I have some UI/UX suggestions.
- Can we set a max-width on the page form? We do this with a class in remote clusters: https://github.com/elastic/kibana/blob/feature/ccr/x-pack/plugins/remote_clusters/public/sections/remote_cluster_edit/remote_cluster_edit.js#L184
- I see an error immediately when I load the "Add auto-follow pattern" page.
- I think we can shorten the "Auto-follow pattern name" label to simply "Name".
import { BASE_PATH_REMOTE_CLUSTERS } from '../../../../common/constants'; | ||
import { AutoFollowPatternForm, RemoteClustersProvider, SectionLoading, SectionError } from '../../components'; | ||
|
||
class AutoFollowPatternAddUI extends PureComponent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit, but I think UI
should be Ui
to follow the camel case pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
defaultMessage: 'Remote cluster connection error' | ||
}); | ||
|
||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving the button inside of the callout? This way the problem and solution are associated more closely with one another. Right now the EUI callout styles mess up the color of the button but I can help fix this in EUI if you think this is an improvement. I also made some changes to the copy to make it a bit clearer.
return (
<EuiCallOut
title={title}
color="warning"
iconType="cross"
>
<p>
<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternCreateForm.emptyRemoteClustersCallOutDescription"
defaultMessage="Auto-follow patterns capture indices on remote clusters. Add a remote cluster before you create an auto-follow pattern." //eslint-disable-line max-len
/>
</p>
<EuiButton
{...routing.getRouterLinkProps('/add', BASE_PATH_REMOTE_CLUSTERS)}
iconType="plusInCircle"
color="warning"
>
<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternCreateForm.addRemoteClusterButtonLabel"
defaultMessage="Add remote cluster"
/>
</EuiButton>
</EuiCallOut>
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea! It might be worth seeing this with @elastic/eui-design and know what is the recommendation here (fill button? align left/center/right? should any button inside a callout inherit the color of the callout automatically? should the callout have a actionLabel
, actionIcon
, and actionHandler
props?)
}); | ||
|
||
return ( | ||
<Fragment> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar suggestion here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
<SectionLoading> | ||
<FormattedMessage | ||
id="xpack.crossClusterReplication.autoFollowPatternForm.loadingRemoteClusters" | ||
defaultMessage="Loading remote clusters..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the copywriters discourage the use of the ellipsis in these kinds of situations: ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The eui writing style guide mentions: Do. Use an ellipsis for truncated text or situations that require waiting.
, talking as an example the loading texts.
* Example of the array returned: | ||
* ["prefix_leader-index-0_suffix", "prefix_leader-index-1_suffix", "prefix_leader-index-2_suffix"] | ||
*/ | ||
export const getPreviewIndicesFromAutoFollowPattern = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a couple simple tests to this function and getPrefixSuffixFromFollowPattern
?
template: template, | ||
controllerAs: 'ccr', | ||
controller: class CrossClusterReplicationController { | ||
constructor($scope, $route, $http) { | ||
unmountReactApp(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a comment explaining why we need to do this?
// React-router's <Redirect> will cause this controller to re-execute without the $destroy
// handler being called. This means the app will re-mount, so we need to unmount it first
// here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally right, and I'll also send an email to all kibana devs as a warning.
💔 Build Failed |
💚 Build Succeeded |
This PR contains the UI view to create an auto-follow pattern. For some reason (a change in history on the target branch
feature/ccr
?) the (de)serialization on the server appears here in the change although it has already been reviewed 😊This PR does not include yet the client validation on the form which is the next thing that will be added along with the UI tests.
Until the client validation is put in place, the required fields are:
I really would like to be able to add the leader index pattern when leaving the input field (
onBlur()
) as I think it would make the UX better on the Combobox (so many times I have written the pattern then pressedTAB
go to the next field, and then realized I have to go back and pressENTER
). I will talk with the @elastic/kibana-design team for that.EDIT: I added the UI Edit capability for an auto-follow pattern as I made a refactor that changed the current PR. The functionality does not allow to refresh the page on the auto-follow pattern being edited.
Use cases to tests
No clusters added
When there are no clusters added in the "Remote Cluster" app, the following screen appears
Clusters added but none is connected
ES throws an error when trying to add an auto-follow pattern to a cluster that is not connected. In order to prevent a bad UX, if none of the clusters defined in the Remote Cluster app is connected, then the following screen appears
Disconnected clusters
The user should not be allowed to create an auto-follow pattern from a disconnected cluster. Thus, it should be disabled in the select dropdown.