-
Notifications
You must be signed in to change notification settings - Fork 906
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[New Migration Experience] added toolbar for performance data collect…
…ion (#24256) * added new icon files * updated the folder structure for skuRecommendationPage * added new toolbar for SKU Recommendation * added new toolbar for performance data collection * minors changes in data collection toolbar * removed duplicate icons/strings * updated stopDataCollection icon
- Loading branch information
Showing
14 changed files
with
209 additions
and
25 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
extensions/sql-migration/src/wizard/skuRecommendation/skuDataCollectionToolbar.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the Source EULA. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
/*--------------------------------------------------------------------------------------------- | ||
* For Assessement Summary and SKU Recommendation Page. | ||
* This file contains the code for toolbar at the top of page with buttons for different data | ||
* collection functionalities. | ||
-----------------------------------------------------------------------------------------------*/ | ||
|
||
import * as azdata from 'azdata'; | ||
import * as vscode from 'vscode'; | ||
import { IconPathHelper } from '../../constants/iconPathHelper'; | ||
import * as styles from '../../constants/styles'; | ||
import * as constants from '../../constants/strings'; | ||
|
||
export class SkuDataCollectionToolbar implements vscode.Disposable { | ||
private _disposables: vscode.Disposable[] = []; | ||
|
||
public createToolbar(view: azdata.ModelView): azdata.ToolbarContainer { | ||
const toolbar = view.modelBuilder.toolbarContainer() | ||
|
||
toolbar.addToolbarItems([ | ||
<azdata.ToolbarComponent>{ component: this.createRefreshSKURecommendationButton(view), toolbarSeparatorAfter: true }, | ||
<azdata.ToolbarComponent>{ component: this.createStartPerformanceCollectionButton(view), toolbarSeparatorAfter: false }, | ||
<azdata.ToolbarComponent>{ component: this.createStopPerformanceCollectionButton(view), toolbarSeparatorAfter: false }, | ||
<azdata.ToolbarComponent>{ component: this.createImportPerformanceDataButton(view), toolbarSeparatorAfter: true }, | ||
<azdata.ToolbarComponent>{ component: this.createRecommendationParametersButton(view), toolbarSeparatorAfter: false }, | ||
]); | ||
|
||
return toolbar.component(); | ||
} | ||
|
||
private createRefreshSKURecommendationButton(view: azdata.ModelView): azdata.ButtonComponent { | ||
const refreshSKURecommendationButton = view.modelBuilder.button() | ||
.withProps({ | ||
buttonType: azdata.ButtonType.Normal, | ||
label: constants.REFRESH, | ||
height: 36, | ||
iconHeight: 16, | ||
iconWidth: 16, | ||
iconPath: IconPathHelper.refresh, | ||
CSSStyles: { | ||
...styles.TOOLBAR_CSS | ||
} | ||
}).component(); | ||
// TODO - implement onDidClick and add to disposables | ||
return refreshSKURecommendationButton; | ||
} | ||
|
||
private createStartPerformanceCollectionButton(view: azdata.ModelView): azdata.ButtonComponent { | ||
const startPerformanceCollectionButton = view.modelBuilder.button() | ||
.withProps({ | ||
buttonType: azdata.ButtonType.Normal, | ||
label: constants.START_PERFORMANCE_COLLECTION, | ||
width: 146, | ||
height: 36, | ||
iconHeight: 16, | ||
iconWidth: 16, | ||
iconPath: IconPathHelper.startDataCollection, | ||
CSSStyles: { | ||
...styles.TOOLBAR_CSS | ||
} | ||
}).component(); | ||
// TODO - implement onDidClick and add to disposables | ||
return startPerformanceCollectionButton; | ||
} | ||
|
||
private createStopPerformanceCollectionButton(view: azdata.ModelView): azdata.ButtonComponent { | ||
const stopPerformanceCollectionButton = view.modelBuilder.button() | ||
.withProps({ | ||
buttonType: azdata.ButtonType.Normal, | ||
label: constants.STOP_PERFORMANCE_COLLECTION, | ||
height: 36, | ||
iconHeight: 16, | ||
iconWidth: 16, | ||
iconPath: IconPathHelper.stopDataCollection, | ||
CSSStyles: { | ||
...styles.TOOLBAR_CSS | ||
} | ||
}).component(); | ||
stopPerformanceCollectionButton.enabled = false; | ||
// TODO - implement onDidClick and add to disposables | ||
return stopPerformanceCollectionButton; | ||
} | ||
|
||
private createImportPerformanceDataButton(view: azdata.ModelView): azdata.ButtonComponent { | ||
const importPerformanceDataButton = view.modelBuilder.button() | ||
.withProps({ | ||
buttonType: azdata.ButtonType.Normal, | ||
label: constants.IMPORT_PERFORMANCE_DATA, | ||
height: 36, | ||
iconHeight: 16, | ||
iconWidth: 16, | ||
iconPath: IconPathHelper.import, | ||
CSSStyles: { | ||
...styles.TOOLBAR_CSS | ||
} | ||
}).component(); | ||
// TODO - implement onDidClick and add to disposables | ||
return importPerformanceDataButton; | ||
} | ||
|
||
private createRecommendationParametersButton(view: azdata.ModelView): azdata.ButtonComponent { | ||
const recommendationParametersButton = view.modelBuilder.button() | ||
.withProps({ | ||
buttonType: azdata.ButtonType.Normal, | ||
label: constants.RECOMMENDATION_PARAMETERS, | ||
height: 36, | ||
iconHeight: 16, | ||
iconWidth: 16, | ||
iconPath: IconPathHelper.settings, | ||
CSSStyles: { | ||
...styles.TOOLBAR_CSS | ||
} | ||
}).component(); | ||
// TODO - implement onDidClick and add to disposables | ||
return recommendationParametersButton; | ||
} | ||
|
||
public dispose(): void { | ||
// TODO - need to call this at the place where toolbar is initialized | ||
this._disposables.forEach( | ||
d => { try { d.dispose(); } catch { } }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.