-
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
[Observability RAC] Alerts table post-EuiDataGrid
style updates
#106349
[Observability RAC] Alerts table post-EuiDataGrid
style updates
#106349
Conversation
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
@@ -104,7 +94,6 @@ export const columns: Array< | |||
}), | |||
linkField: '*', | |||
id: RULE_NAME, | |||
initialWidth: 400, |
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.
columns that don't have an initialWidth
automatically use up the remaining width
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.
This looks good in large screen resolutions. In smaller resolutions (even at 1200px) the reason text gets cut off.
Since the table is not responsive, could we possibly add an overflow: scroll
to the EventsTBody as shown here 8bb0f07#diff-d98503225da4a83c1a846a2185b182229b868fd580d0ef19182ff235e5f98a41R206? At least there will be a horizontal scrollbar and user will be able to read the text.
Unless there is a responsive attribute that we could add to the EuiDataGrid Table that automatically makes the table responsive? Are you aware of something like this?
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 table itself is responsive, and after removing initialWidth
, the Reason
column expands to fill with width of the browser, per the animated gif below:
The ...
truncation was not being applied to the link text at smaller resolutions due to a subtle change in rendering behavior when EuiLink
is used with an onClick
prop:
EuiDataGrid
automatically applies text truncation to the cell, but EuiLink
automatically renders links via a button
instead of an a
when an onClick
prop is passed to EuiLink
.
I'm pushing a commit with the following change in render_cell_value.tsx
, but I won't merge it until I hear back from @chandlerprall to see if there's another way to achieve this without passing an empty href
to EuiLInk
:
// NOTE: EuiLink automatically renders links using a <button>
// instead of an <a> when an `onClick` prop is provided, but this
// breaks text-truncation in `EuiDataGrid`, because (per the HTML
// spec), buttons are *always* rendered as `inline-block`, even if
// `display` is overridden. Passing an empty `href` prop forces
// `EuiLink` to render the link as an (inline) <a>, which enables
// text truncation, but requires overriding the linter warning below:
// eslint-disable-next-line @elastic/eui/href-or-on-click
<EuiLink href="" onClick={() => setFlyoutAlert && setFlyoutAlert(alert)}>
{alert.reason}
</EuiLink>
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'm pushing a commit with the following change in
render_cell_value.tsx
, but I won't merge it until I hear back from @chandlerprall to see if there's another way to achieve this without passing an emptyhref
toEuiLInk
:
Per an out-of-band conversation with @chandlerprall, we decided to merge this PR as-is, and follow-up re: the empty href
on EuiLink
in a separate PR, if necessary.
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.
Post-merge update: this workaround is valid for now, and tracked by the following EUI
issue: elastic/eui#4990
Details from the issue above:
Apparently by HTML's design / spec, text inside a button element will not receive a parent's text-overflow: ellipsis - https://stackoverflow.com/questions/9905409/is-it-possible-to-use-text-overflow-ellipsis-on-a-button-element
It looks nice and fixes the issues according to the specs! There are a few small things I noticed:
Further improvements
|
Thanks for your feedback @mgiota! 😄 Regarding the alignment of duration:
I agree, and also like the left-aligned duration shown in the mock below: Above: the mock from https://github.com/elastic/security-team/issues/1299 , with left-aligned duration We need to troubleshoot the behavior you're seeing where the style is applied on-hover, but as a temporary workaround, I think it makes sense to (for now) left-align it like the mock. @mdefazio are you OK with left-aligned duration for now?
I see what you mean; the column now expands to take up the remaining width, but now it needs truncation. I'll push an update to this PR to add truncation.
The legacy TGrid is styled like suggestions above, but the new styles are To keep things moving forward, I'm wondering if it would make sense to make changes to the header-cell selection in a follow-up PR. @mdefazio do you have any thoughts on overriding the |
@andrew-goldstein I totally agree, let's keep things moving forward and we address the changes to the header-cell selection in another PR. Regarding left alignment issue, you can remove the changes I've done in a previous PR https://github.com/elastic/kibana/pull/105446/files#diff-8c01a3c597461ead53f52ba5028576fc4465fcea366eb4526a60c676bc899912R62. |
👍 I'll remove it since we're all in agreement the left alignment looks good. Thanks to @XavierM for helping to debug the alignment / hover issue, which is reproducible using (just) the The good news is this issue appears to be fixed in EUI
to |
37f8bb7
to
4875ac2
Compare
This PR updates styles in the Observability `Alerts` table, as a follow-up to the [TGrid migrating to use `EuiDataGrid` for rendering](elastic#106199), and [this PR](elastic#105446), which improved the alerts table columns. - The `Reason` column uses up the remaining width, a follow-up task from <elastic#105446> - This task was originally tracked by <elastic#105227> - Increased the font weight and vertically aligned the `Actions` header with the other columns - Removed the `Status` column - Increased the width of the `Triggered` column - Renamed the `Duration` column to `Alert duration` - Eliminated the gap between actions ### Before  ### After  ### Desk testing - To desk test the `Observability > Alerts` page, add the following settings to `config/kibana.dev.yml`: ``` xpack.observability.unsafe.cases.enabled: true xpack.observability.unsafe.alertingExperience.enabled: true xpack.ruleRegistry.write.enabled: true ```
4875ac2
to
8bb4f9b
Compare
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
…astic#106349) ## [Observability RAC] Alerts table post-`EuiDataGrid` style updates This PR updates styles in the Observability `Alerts` table, as a follow-up to the [TGrid migrating to use `EuiDataGrid` for rendering](elastic#106199), and [this PR](elastic#105446), which improved the alerts table columns. - The `Reason` column uses up the remaining width, a follow-up task from elastic#105446 - This task was originally tracked by elastic#105227 - Increased the font weight and vertically aligned the `Actions` header with the other columns - ~Removed the `Status` column~ (EDIT: we won't remove this, per a discussion w/ UX) - Increased the width of the `Triggered` column - ~Renamed the `Duration` column to `Alert duration`~ (EDIT: we won't rename this, per a discussion w/ UX) - Eliminated the gap between actions - Added truncation to the `Reason` column ### Before  ### After <img width="1280" alt="after" src="https://user-images.githubusercontent.com/4459398/126716690-be310fdf-3760-4014-998b-3c89099c2564.png"> ### Desk testing - To desk test the `Observability > Alerts` page, add the following settings to `config/kibana.dev.yml`: ``` xpack.observability.unsafe.cases.enabled: true xpack.observability.unsafe.alertingExperience.enabled: true xpack.ruleRegistry.write.enabled: true ``` cc @mdefazio
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…06349) (#106923) ## [Observability RAC] Alerts table post-`EuiDataGrid` style updates This PR updates styles in the Observability `Alerts` table, as a follow-up to the [TGrid migrating to use `EuiDataGrid` for rendering](#106199), and [this PR](#105446), which improved the alerts table columns. - The `Reason` column uses up the remaining width, a follow-up task from #105446 - This task was originally tracked by #105227 - Increased the font weight and vertically aligned the `Actions` header with the other columns - ~Removed the `Status` column~ (EDIT: we won't remove this, per a discussion w/ UX) - Increased the width of the `Triggered` column - ~Renamed the `Duration` column to `Alert duration`~ (EDIT: we won't rename this, per a discussion w/ UX) - Eliminated the gap between actions - Added truncation to the `Reason` column ### Before  ### After <img width="1280" alt="after" src="https://user-images.githubusercontent.com/4459398/126716690-be310fdf-3760-4014-998b-3c89099c2564.png"> ### Desk testing - To desk test the `Observability > Alerts` page, add the following settings to `config/kibana.dev.yml`: ``` xpack.observability.unsafe.cases.enabled: true xpack.observability.unsafe.alertingExperience.enabled: true xpack.ruleRegistry.write.enabled: true ``` cc @mdefazio Co-authored-by: Andrew Goldstein <andrew-goldstein@users.noreply.github.com>
…astic#106349) ## [Observability RAC] Alerts table post-`EuiDataGrid` style updates This PR updates styles in the Observability `Alerts` table, as a follow-up to the [TGrid migrating to use `EuiDataGrid` for rendering](elastic#106199), and [this PR](elastic#105446), which improved the alerts table columns. - The `Reason` column uses up the remaining width, a follow-up task from elastic#105446 - This task was originally tracked by elastic#105227 - Increased the font weight and vertically aligned the `Actions` header with the other columns - ~Removed the `Status` column~ (EDIT: we won't remove this, per a discussion w/ UX) - Increased the width of the `Triggered` column - ~Renamed the `Duration` column to `Alert duration`~ (EDIT: we won't rename this, per a discussion w/ UX) - Eliminated the gap between actions - Added truncation to the `Reason` column ### Before  ### After <img width="1280" alt="after" src="https://user-images.githubusercontent.com/4459398/126716690-be310fdf-3760-4014-998b-3c89099c2564.png"> ### Desk testing - To desk test the `Observability > Alerts` page, add the following settings to `config/kibana.dev.yml`: ``` xpack.observability.unsafe.cases.enabled: true xpack.observability.unsafe.alertingExperience.enabled: true xpack.ruleRegistry.write.enabled: true ``` cc @mdefazio
[Observability RAC] Alerts table post-
EuiDataGrid
style updatesThis PR updates styles in the Observability
Alerts
table, as a follow-up to the TGrid migrating to useEuiDataGrid
for rendering, and this PR, which improved the alerts table columns.Reason
column uses up the remaining width, a follow-up task from [Observability RAC] Improve alerts table columns #105446Actions
header with the other columnsRemoved the(EDIT: we won't remove this, per a discussion w/ UX)Status
columnTriggered
columnRenamed the(EDIT: we won't rename this, per a discussion w/ UX)Duration
column toAlert duration
Reason
columnBefore
After
Desk testing
Observability > Alerts
page, add the following settings toconfig/kibana.dev.yml
:cc @mdefazio