Adding tooltips and fixing spacing (#18400)

This commit is contained in:
Aasim Khan
2022-02-15 16:24:40 -08:00
committed by GitHub
parent 33ea2d8ee6
commit 25f563229f

View File

@@ -18,6 +18,7 @@ import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
import { removeLineBreaks } from 'sql/base/common/strings'; import { removeLineBreaks } from 'sql/base/common/strings';
import { isString } from 'vs/base/common/types'; import { isString } from 'vs/base/common/types';
import { sortAlphabeticallyIconClassNames, sortByDisplayOrderIconClassNames } from 'sql/workbench/contrib/queryplan2/browser/constants'; import { sortAlphabeticallyIconClassNames, sortByDisplayOrderIconClassNames } from 'sql/workbench/contrib/queryplan2/browser/constants';
import { textFormatter } from 'sql/base/browser/ui/table/formatters';
export class QueryPlanPropertiesView { export class QueryPlanPropertiesView {
@@ -96,7 +97,8 @@ export class QueryPlanPropertiesView {
field: 'name', field: 'name',
width: 250, width: 250,
editor: Slick.Editors.Text, editor: Slick.Editors.Text,
headerCssClass: 'prop-table-header' headerCssClass: 'prop-table-header',
formatter: textFormatter
}, },
{ {
id: 'value', id: 'value',
@@ -104,7 +106,8 @@ export class QueryPlanPropertiesView {
field: 'value', field: 'value',
width: 250, width: 250,
editor: Slick.Editors.Text, editor: Slick.Editors.Text,
headerCssClass: 'prop-table-header' headerCssClass: 'prop-table-header',
formatter: textFormatter
} }
]; ];
@@ -199,15 +202,16 @@ export class QueryPlanPropertiesView {
} }
props.forEach((p, i) => { props.forEach((p, i) => {
let row = {}; let row = {};
row['name'] = '\t'.repeat(indent) + p.name; rows.push(row);
row['name'] = ' '.repeat(indent) + p.name;
row['parent'] = parentIndex; row['parent'] = parentIndex;
if (!isString(p.value)) { if (!isString(p.value)) {
row['value'] = ''; row['value'] = removeLineBreaks(p.displayValue, ' ');
this.convertPropertiesToTableRows(p.value, rows.length - 1, indent + 2, rows); this.convertPropertiesToTableRows(p.value, rows.length - 1, indent + 2, rows);
} else { } else {
row['value'] = p.value; row['value'] = removeLineBreaks(p.value, ' ');
row['tooltip'] = p.value;
} }
rows.push(row);
}); });
return rows; return rows;
} }