diff --git a/src/sql/parts/dashboard/containers/dashboardGridContainer.component.ts b/src/sql/parts/dashboard/containers/dashboardGridContainer.component.ts index d9414dfc07..dcab728a56 100644 --- a/src/sql/parts/dashboard/containers/dashboardGridContainer.component.ts +++ b/src/sql/parts/dashboard/containers/dashboardGridContainer.component.ts @@ -25,8 +25,8 @@ export interface GridCellConfig { id?: string; row?: number; col?: number; - colspan?: string; - rowspan?: string; + colspan?: string | number; + rowspan?: string | number; } export interface GridWidgetConfig extends GridCellConfig, WidgetConfig { @@ -136,7 +136,10 @@ export class DashboardGridContainer extends DashboardTab implements OnDestroy { return rowCount * this.cellHeight + 'px'; } - private convertToNumber(value: string, maxNumber: number): number { + private convertToNumber(value: string | number, maxNumber: number): number { + if (!value) { + return 1; + } if (value === '*') { return maxNumber; } diff --git a/src/sql/parts/dashboard/pages/dashboardPageContribution.ts b/src/sql/parts/dashboard/pages/dashboardPageContribution.ts index cef86fd740..7c6969a6bf 100644 --- a/src/sql/parts/dashboard/pages/dashboardPageContribution.ts +++ b/src/sql/parts/dashboard/pages/dashboardPageContribution.ts @@ -83,7 +83,7 @@ export function generateDashboardGridLayoutSchema(type?: 'database' | 'server', description: localize('dashboardpage.rowNumber', "The row of the component in the grid") }, rowspan: { - type: 'string', + type: ['string', 'number'], description: localize('dashboardpage.rowSpan', "The rowspan of the component in the grid. Default value is 1. Use '*' to set to number of rows in the grid.") }, col: { @@ -91,7 +91,7 @@ export function generateDashboardGridLayoutSchema(type?: 'database' | 'server', description: localize('dashboardpage.colNumber', "The column of the component in the grid") }, colspan: { - type: 'string', + type: ['string', 'number'], description: localize('dashboardpage.colspan', "The colspan of the component in the grid. Default value is 1. Use '*' to set to number of columns in the grid.") }, widget: {