From 5d5f44ba11ec553b0f01b6f4592e00067e6ed96b Mon Sep 17 00:00:00 2001 From: Yurong He <43652751+YurongHe@users.noreply.github.com> Date: Thu, 25 Apr 2019 12:59:13 -0700 Subject: [PATCH] Fixed #3961 Removed hardcoded value in notebook and use QueryEditor Result RowHight to keep it consistent (#5208) --- src/sql/workbench/parts/notebook/outputs/tableRenderers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sql/workbench/parts/notebook/outputs/tableRenderers.ts b/src/sql/workbench/parts/notebook/outputs/tableRenderers.ts index bae400523e..33af61a343 100644 --- a/src/sql/workbench/parts/notebook/outputs/tableRenderers.ts +++ b/src/sql/workbench/parts/notebook/outputs/tableRenderers.ts @@ -14,6 +14,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { MouseWheelSupport } from 'sql/base/browser/ui/table/plugins/mousewheelTableScroll.plugin'; import { AutoColumnSize } from 'sql/base/browser/ui/table/plugins/autoSizeColumns.plugin'; import { AdditionalKeyBindings } from 'sql/base/browser/ui/table/plugins/additionalKeyBindings.plugin'; +import { RESULTS_GRID_DEFAULTS } from 'sql/parts/query/editor/queryResultsEditor'; /** * Render DataResource as a grid into a host node. @@ -39,7 +40,6 @@ export function renderDataResource( let tableContainer = document.createElement('div'); tableContainer.className = 'notebook-cellTable'; - const ROW_HEIGHT = 29; const BOTTOM_PADDING_AND_SCROLLBAR = 14; let tableResultsData = new TableDataView(); let columns: string[] = sourceObject.schema.fields.map(val => val.name); @@ -57,7 +57,7 @@ export function renderDataResource( let detailTable = new Table(tableContainer, { dataProvider: tableResultsData, columns: columnsTransformed }, { - rowHeight: ROW_HEIGHT, + rowHeight: RESULTS_GRID_DEFAULTS.rowHeight, forceFitColumns: false, defaultColumnWidth: 120 }); @@ -67,7 +67,7 @@ export function renderDataResource( detailTable.registerPlugin(new AdditionalKeyBindings()); let numRows = detailTable.grid.getDataLength(); // Need to include column headers and scrollbar, so that's why 1 needs to be added - let rowsHeight = (numRows + 1) * ROW_HEIGHT + BOTTOM_PADDING_AND_SCROLLBAR; + let rowsHeight = (numRows + 1) * RESULTS_GRID_DEFAULTS.rowHeight + BOTTOM_PADDING_AND_SCROLLBAR; // if no rows are in the grid, set height to 100% of the container's height if (numRows === 0) { tableContainer.style.height = '100%';