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

UI improvements to watch list page #36816

Merged

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented May 21, 2019

This PR makes some UI improvements to the watch list page

Screenshots

Before:
Screen Shot 2019-05-21 at 1 38 58 PM

Latest changes:
Screen Shot 2019-05-21 at 1 45 38 PM

Screen Shot 2019-05-21 at 1 42 15 PM

Screen Shot 2019-05-21 at 1 41 51 PM

@alisonelizabeth alisonelizabeth added Feature:Watcher non-issue Indicates to automation that a pull request should not appear in the release notes labels May 21, 2019
</EuiFlexItem>
</EuiFlexGroup>
);

if (getPageErrorCode(error)) {
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 think this is only checking for 403 and 404 errors. Do we need to guard against other status codes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I think it's probably best to render a danger callout with the error status and message in the event of non-403 and non-404 errors, since if there's an error then the table can't render content and might throw a fatal error (e.g. by trying to access a property on an undefined variable). I think a callout is better than a toast notification in this case because a toast notification is transient and the user might want to report the error in an issue or something. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, makes sense - updated.

Screen Shot 2019-05-23 at 10 02 26 AM

@alisonelizabeth alisonelizabeth added the Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more label May 21, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Great work tracking down all of these details! They really add up. Just had a few comments and suggestions.

@@ -58,8 +58,8 @@ export const DeleteWatchesModal = ({
'xpack.watcher.sections.watchList.deleteSelectedWatchesSuccessNotification.descriptionText',
{
defaultMessage:
'Deleted {numWatchesToDelete, plural, one {watch} other {{numSuccesses} out of # selected watches}} ',
values: { numSuccesses, numWatchesToDelete },
'Successfuly deleted {numSuccesses, number} {numSuccesses, plural, one {watch} other {watches}}',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can drop "Successfully". I know we use this in Index Management but I don't see it anywhere else. Feel free to confirm this with Gail.

@@ -12,6 +12,7 @@ const esStackBase = `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack-overview/${DOC

export const putWatchApiUrl = `${esBase}/watcher-api-put-watch.html`;
export const executeWatchApiUrl = `${esBase}/watcher-api-execute-watch.html#watcher-api-execute-watch-action-mode`;
export const watcherGettingStartedUrl = `${esStackBase}/watcher-getting-started.html`;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be more helpful to link to the Watcher UI docs: https://www.elastic.co/guide/en/kibana/current/watcher-ui.html

In fact, we should update the screenshots in the docs as part of this work. Would you mind adding it as an item to the roadmap?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

render: (id: string) => {
return (
<EuiLink
className="indTable__link euiTableCellContent"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this class name left over from a copy/paste? indTable__link

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, looks that way. deleted the class.

aria-label={i18n.translate(
'xpack.watcher.sections.watchList.watchTable.actionEditAriaLabel',
{
defaultMessage: 'Edit watch `{name}`',
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this to:

`Edit watch '{name}'`

I'm not sure backticks work as quotation marks in the original code. Perhaps worth checking with Gail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, fixed!

aria-label={i18n.translate(
'xpack.watcher.sections.watchList.watchTable.actionDeleteAriaLabel',
{
defaultMessage: 'Delete watch `{name}`',
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -52,6 +55,56 @@ const WatchListUi = ({ intl }: { intl: InjectedIntl }) => {
[watches, deletedWatches]
);

const createWatchButtons = (
<EuiFlexGroup gutterSize="m">
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to apply justifyContent="center" to this flex group when the buttons are presented in the empty state in order to align them along the vertical axis with the other content:

image

I'm not sure if this prop will make sense when the buttons are used elsewhere, so maybe we'll have to wrap them in a function that lets you conditionally apply this prop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch! i didn't see any adverse affects with having justifyContent="center" applied when the buttons are aligned with the search so i did not add any conditionally logic.

</EuiFlexItem>
</EuiFlexGroup>
);

if (getPageErrorCode(error)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I think it's probably best to render a danger callout with the error status and message in the event of non-403 and non-404 errors, since if there's an error then the table can't render content and might throw a fatal error (e.g. by trying to access a property on an undefined variable). I think a callout is better than a toast notification in this case because a toast notification is transient and the user might want to report the error in an issue or something. WDYT?

@alisonelizabeth
Copy link
Contributor Author

@cjcenizal thanks for your review! I have made the changes you suggested.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

LGTM!

@alisonelizabeth alisonelizabeth merged commit 24802ae into elastic:watcher-port May 23, 2019
@alisonelizabeth alisonelizabeth deleted the watch-list-improvements branch May 23, 2019 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Watcher non-issue Indicates to automation that a pull request should not appear in the release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants