Skip to content

Commit

Permalink
[8.11] [Cloud Security] set rowHeight to 0 to fix the bug of large ro…
Browse files Browse the repository at this point in the history
…w height in Findings (#170503) (#170587)

# Backport

This will backport the following commits from `main` to `8.11`:
- [[Cloud Security] set rowHeight to 0 to fix the bug of large row
height in Findings
(#170503)](#170503)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Maxim
Kholod","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-11-04T14:26:33Z","message":"[Cloud
Security] set rowHeight to 0 to fix the bug of large row height in
Findings (#170503)\n\n## Summary\r\n\r\nfixes\r\n-
https://github.com/elastic/kibana/issues/170502\r\n\r\ndefaulting to row
height 0 for the findings table. As the default was -1\r\nbefore, we
were defaulting to 0, but due to this
change\r\nhttps://github.com//pull/169724/files the
default became\r\n3, which broke our table. I guess the logic of taking
the UI setting if\r\nit's differnt from default -1 was to cater for
users changing the row\r\nheight somewhere in the settings, but we need
to bring to product/design\r\nto see if we want to support
it\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"5b72f77e078ecde5754161c8ba23f1ce63cfeb9f","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Cloud
Security","backport:prev-minor","v8.12.0"],"number":170503,"url":"https://github.com/elastic/kibana/pull/170503","mergeCommit":{"message":"[Cloud
Security] set rowHeight to 0 to fix the bug of large row height in
Findings (#170503)\n\n## Summary\r\n\r\nfixes\r\n-
https://github.com/elastic/kibana/issues/170502\r\n\r\ndefaulting to row
height 0 for the findings table. As the default was -1\r\nbefore, we
were defaulting to 0, but due to this
change\r\nhttps://github.com//pull/169724/files the
default became\r\n3, which broke our table. I guess the logic of taking
the UI setting if\r\nit's differnt from default -1 was to cater for
users changing the row\r\nheight somewhere in the settings, but we need
to bring to product/design\r\nto see if we want to support
it\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"5b72f77e078ecde5754161c8ba23f1ce63cfeb9f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/170503","number":170503,"mergeCommit":{"message":"[Cloud
Security] set rowHeight to 0 to fix the bug of large row height in
Findings (#170503)\n\n## Summary\r\n\r\nfixes\r\n-
https://github.com/elastic/kibana/issues/170502\r\n\r\ndefaulting to row
height 0 for the findings table. As the default was -1\r\nbefore, we
were defaulting to 0, but due to this
change\r\nhttps://github.com//pull/169724/files the
default became\r\n3, which broke our table. I guess the logic of taking
the UI setting if\r\nit's differnt from default -1 was to cater for
users changing the row\r\nheight somewhere in the settings, but we need
to bring to product/design\r\nto see if we want to support
it\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"5b72f77e078ecde5754161c8ba23f1ce63cfeb9f"}}]}]
BACKPORT-->

Co-authored-by: Maxim Kholod <[email protected]>
  • Loading branch information
kibanamachine and maxcold authored Nov 4, 2023
1 parent f2ea0c4 commit 42cd5ad
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import { UnifiedDataTableSettings, useColumns } from '@kbn/unified-data-table';
import { type DataView } from '@kbn/data-views-plugin/common';
import { UnifiedDataTable, DataLoadingState } from '@kbn/unified-data-table';
import { CellActionsProvider } from '@kbn/cell-actions';
import {
ROW_HEIGHT_OPTION,
SHOW_MULTIFIELDS,
SORT_DEFAULT_ORDER_SETTING,
} from '@kbn/discover-utils';
import { SHOW_MULTIFIELDS, SORT_DEFAULT_ORDER_SETTING } from '@kbn/discover-utils';
import { DataTableRecord } from '@kbn/discover-utils/types';
import { EuiDataGridCellValueElementProps, EuiDataGridStyle, EuiProgress } from '@elastic/eui';
import { AddFieldFilterHandler } from '@kbn/unified-field-list';
Expand Down Expand Up @@ -223,8 +219,7 @@ export const CloudSecurityDataTable = ({
height: `calc(100vh - ${filters.length > 0 ? 443 : 403}px)`,
};

const rowHeightState =
uiSettings.get(ROW_HEIGHT_OPTION) === -1 ? 0 : uiSettings.get(ROW_HEIGHT_OPTION);
const rowHeightState = 0;

const loadingStyle = {
opacity: isLoading ? 1 : 0,
Expand Down

0 comments on commit 42cd5ad

Please sign in to comment.