mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
cleanup uneccessary awaits in query store extension (#23701)
This commit is contained in:
@@ -36,7 +36,7 @@ export async function createOneComponentFlexContainer(view: azdata.ModelView, co
|
|||||||
* @param flexFlow row or column
|
* @param flexFlow row or column
|
||||||
* @returns Flex container containing the two components
|
* @returns Flex container containing the two components
|
||||||
*/
|
*/
|
||||||
export async function createTwoComponentFlexContainer(view: azdata.ModelView, firstComponent: azdata.Component, secondComponent: azdata.Component, flexFlow: string): Promise<azdata.FlexContainer> {
|
export function createTwoComponentFlexContainer(view: azdata.ModelView, firstComponent: azdata.Component, secondComponent: azdata.Component, flexFlow: string): azdata.FlexContainer {
|
||||||
const flexContainer = view.modelBuilder.flexContainer().component();
|
const flexContainer = view.modelBuilder.flexContainer().component();
|
||||||
|
|
||||||
if (flexFlow === 'row') {
|
if (flexFlow === 'row') {
|
||||||
|
|||||||
@@ -61,18 +61,18 @@ export abstract class BaseQueryStoreReport {
|
|||||||
case 2: {
|
case 2: {
|
||||||
// TODO: replace 800 to have the number be based on how big the window is
|
// TODO: replace 800 to have the number be based on how big the window is
|
||||||
// one container on top, one on the bottom
|
// one container on top, one on the bottom
|
||||||
mainContainer = this.resizeable ? utils.createVerticalSplitView(view, containers[0], containers[1], 800) : await utils.createTwoComponentFlexContainer(view, containers[0], containers[1], 'column');
|
mainContainer = this.resizeable ? utils.createVerticalSplitView(view, containers[0], containers[1], 800) : utils.createTwoComponentFlexContainer(view, containers[0], containers[1], 'column');
|
||||||
break;
|
break;
|
||||||
} case 3: {
|
} case 3: {
|
||||||
// 2 containers on top, one on the bottom
|
// 2 containers on top, one on the bottom
|
||||||
// TODO: support portrait and landscape view. Right now it's landscape view only
|
// TODO: support portrait and landscape view. Right now it's landscape view only
|
||||||
mainContainer = this.resizeable ? utils.createVerticalSplitView(view, await utils.createTwoComponentFlexContainer(view, containers[0], containers[1], 'row'), containers[2], 800)
|
mainContainer = this.resizeable ? utils.createVerticalSplitView(view, utils.createTwoComponentFlexContainer(view, containers[0], containers[1], 'row'), containers[2], 800)
|
||||||
: await utils.createTwoComponentFlexContainer(view, await utils.createTwoComponentFlexContainer(view, containers[0], containers[1], 'row'), containers[2], 'column');
|
: utils.createTwoComponentFlexContainer(view, utils.createTwoComponentFlexContainer(view, containers[0], containers[1], 'row'), containers[2], 'column');
|
||||||
break;
|
break;
|
||||||
} case 4: {
|
} case 4: {
|
||||||
// 2 containers on top, 2 on the bottom
|
// 2 containers on top, 2 on the bottom
|
||||||
mainContainer = this.resizeable ? utils.createVerticalSplitView(view, await utils.createTwoComponentFlexContainer(view, containers[0], containers[1], 'row'), await utils.createTwoComponentFlexContainer(view, containers[2], containers[3], 'row'), 800)
|
mainContainer = this.resizeable ? utils.createVerticalSplitView(view, utils.createTwoComponentFlexContainer(view, containers[0], containers[1], 'row'), utils.createTwoComponentFlexContainer(view, containers[2], containers[3], 'row'), 800)
|
||||||
: await utils.createTwoComponentFlexContainer(view, await utils.createTwoComponentFlexContainer(view, containers[0], containers[1], 'row'), await utils.createTwoComponentFlexContainer(view, containers[2], containers[3], 'row'), 'column');
|
: utils.createTwoComponentFlexContainer(view, utils.createTwoComponentFlexContainer(view, containers[0], containers[1], 'row'), utils.createTwoComponentFlexContainer(view, containers[2], containers[3], 'row'), 'column');
|
||||||
break;
|
break;
|
||||||
} default: {
|
} default: {
|
||||||
throw new Error(`{views.length} number of views in a QDS report is not supported`);
|
throw new Error(`{views.length} number of views in a QDS report is not supported`);
|
||||||
|
|||||||
Reference in New Issue
Block a user