-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
UI improvements to watch list page #36816
Conversation
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
|
||
if (getPageErrorCode(error)) { |
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 this is only checking for 403
and 404
errors. Do we need to guard against other status codes?
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.
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?
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.
Pinging @elastic/es-ui |
💔 Build Failed |
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.
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}}', |
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 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`; |
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 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?
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.
done
render: (id: string) => { | ||
return ( | ||
<EuiLink | ||
className="indTable__link euiTableCellContent" |
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.
Is this class name left over from a copy/paste? indTable__link
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.
yep, looks that way. deleted the class.
aria-label={i18n.translate( | ||
'xpack.watcher.sections.watchList.watchTable.actionEditAriaLabel', | ||
{ | ||
defaultMessage: 'Edit watch `{name}`', |
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 change this to:
`Edit watch '{name}'`
I'm not sure backticks work as quotation marks in the original code. Perhaps worth checking with Gail.
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.
good catch, fixed!
aria-label={i18n.translate( | ||
'xpack.watcher.sections.watchList.watchTable.actionDeleteAriaLabel', | ||
{ | ||
defaultMessage: 'Delete watch `{name}`', |
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.
Same 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.
fixed
@@ -52,6 +55,56 @@ const WatchListUi = ({ intl }: { intl: InjectedIntl }) => { | |||
[watches, deletedWatches] | |||
); | |||
|
|||
const createWatchButtons = ( | |||
<EuiFlexGroup gutterSize="m"> |
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.
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:
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.
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.
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)) { |
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.
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?
cc808d5
to
fc27f21
Compare
@cjcenizal thanks for your review! I have made the changes you suggested. |
💚 Build Succeeded |
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.
LGTM!
This PR makes some UI improvements to the watch list page
ID
columnScreenshots
Before:
![Screen Shot 2019-05-21 at 1 38 58 PM](https://user-images.githubusercontent.com/5226211/58119543-393a1580-7bd1-11e9-9d23-d3b16928999a.png)
Latest changes:
![Screen Shot 2019-05-21 at 1 45 38 PM](https://user-images.githubusercontent.com/5226211/58119587-52db5d00-7bd1-11e9-8b2c-f130590830b9.png)