From d32ce4818d28df388f7b2bc1c788e01232dc02df Mon Sep 17 00:00:00 2001 From: ssreerama Date: Sun, 10 Sep 2023 08:13:18 -0700 Subject: [PATCH 1/7] fix for File size input in DB properties can be decremented into the negative #24307 --- extensions/mssql/src/objectManagement/ui/databaseFileDialog.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/mssql/src/objectManagement/ui/databaseFileDialog.ts b/extensions/mssql/src/objectManagement/ui/databaseFileDialog.ts index e27ae84905e2..1b64f8823194 100644 --- a/extensions/mssql/src/objectManagement/ui/databaseFileDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/databaseFileDialog.ts @@ -157,7 +157,8 @@ export class DatabaseFileDialog extends DialogBase { ariaLabel: localizedConstants.SizeInMbText, inputType: 'number', enabled: this.options.databaseFile.type !== localizedConstants.FilestreamFileType, - value: String(this.options.databaseFile.sizeInMb) + value: String(this.options.databaseFile.sizeInMb), + min: 1 }); const fileSizeContainer = this.createLabelInputContainer(localizedConstants.SizeInMbText, this.fileSizeInput); containers.push(fileSizeContainer); From b2cf09114295d9e45779d8549abee491b51e66ef Mon Sep 17 00:00:00 2001 From: ssreerama Date: Sun, 10 Sep 2023 08:32:37 -0700 Subject: [PATCH 2/7] Some DB Scoped Config options are sentence cased #24196 --- extensions/mssql/src/objectManagement/ui/databaseDialog.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/mssql/src/objectManagement/ui/databaseDialog.ts b/extensions/mssql/src/objectManagement/ui/databaseDialog.ts index 85decf74a3b9..6f6e17ed0c0b 100644 --- a/extensions/mssql/src/objectManagement/ui/databaseDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/databaseDialog.ts @@ -1317,7 +1317,7 @@ export class DatabaseDialog extends ObjectManagementDialogBase { - return [metaData.name, + return [metaData.name.toLocaleUpperCase(), metaData.valueForPrimary, metaData.valueForSecondary] }), From d19da1e00c207bc50d1cb8b5f07f70fec5585346 Mon Sep 17 00:00:00 2001 From: ssreerama Date: Sun, 10 Sep 2023 15:27:40 -0700 Subject: [PATCH 3/7] cannot add a file with filestream data filegroup type #24359 --- .../mssql/src/objectManagement/ui/databaseFileDialog.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/mssql/src/objectManagement/ui/databaseFileDialog.ts b/extensions/mssql/src/objectManagement/ui/databaseFileDialog.ts index 1b64f8823194..a13fccd7962b 100644 --- a/extensions/mssql/src/objectManagement/ui/databaseFileDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/databaseFileDialog.ts @@ -92,7 +92,10 @@ export class DatabaseFileDialog extends DialogBase { errors.push(localizedConstants.FileNameExistsError(this.result.name.trim())); } // If new file, verify if the file name with extension already exists - if (this.options.isNewFile && !!this.options.files.find(file => { return (path.join(file.path, file.fileNameWithExtension) === path.join(this.result.path, this.result.fileNameWithExtension)) })) { + if (this.options.isNewFile && !!this.options.files.find(file => { + return (this.result.name === file.name && + path.join(file.path, file.fileNameWithExtension) === path.join(this.result.path, this.result.fileNameWithExtension)) + })) { errors.push(localizedConstants.FileAlreadyExistsError(path.join(this.result.path, this.result.fileNameWithExtension))); } } @@ -333,7 +336,7 @@ export class DatabaseFileDialog extends DialogBase { } // File Stream else if (selectedOption === localizedConstants.FilestreamFileType) { - fileGroupDdOptions = this.options.filestreamFilegroups; + fileGroupDdOptions = this.options.filestreamFilegroups.length > 0 ? this.options.filestreamFilegroups : [localizedConstants.FileGroupForFilestreamTypeText]; fileGroupDdValue = this.result.fileGroup; visibility = 'hidden'; maxSizeGroupMarginTop = '-130px'; From 510ec1179548258942de5b246af82ff31653c373 Mon Sep 17 00:00:00 2001 From: ssreerama Date: Sun, 10 Sep 2023 16:03:10 -0700 Subject: [PATCH 4/7] DB Scoped Secondary values aren't updated when hidden #24197 --- extensions/mssql/src/objectManagement/ui/databaseDialog.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/extensions/mssql/src/objectManagement/ui/databaseDialog.ts b/extensions/mssql/src/objectManagement/ui/databaseDialog.ts index 6f6e17ed0c0b..7f2af10f915e 100644 --- a/extensions/mssql/src/objectManagement/ui/databaseDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/databaseDialog.ts @@ -12,7 +12,6 @@ import { CreateDatabaseDocUrl, DatabaseGeneralPropertiesDocUrl, DatabaseFilesPro import { Database, DatabaseFile, DatabaseScopedConfigurationsInfo, DatabaseViewInfo, FileGrowthType, FileGroup, FileGroupType } from '../interfaces'; import { convertNumToTwoDecimalStringInMB } from '../utils'; import { isUndefinedOrNull } from '../../types'; -import { deepClone } from '../../util/objects'; import { DatabaseFileDialog } from './databaseFileDialog'; import * as vscode from 'vscode'; @@ -82,7 +81,6 @@ export class DatabaseDialog extends ObjectManagementDialogBase { - this.dscOriginalData = deepClone(this.objectInfo.databaseScopedConfigurations); const dscNameColumn: azdata.TableColumn = { type: azdata.ColumnType.text, value: localizedConstants.DatabaseScopedOptionsColumnHeader, @@ -1488,7 +1485,7 @@ export class DatabaseDialog extends ObjectManagementDialogBase { await this.dscSecondaryValueInputGroup.updateCssStyles({ 'visibility': checked ? 'hidden' : 'visible' }); - this.currentRowObjectInfo.valueForSecondary = checked ? this.currentRowObjectInfo.valueForPrimary : this.dscOriginalData[this.currentRowId].valueForSecondary; + this.currentRowObjectInfo.valueForSecondary = this.currentRowObjectInfo.valueForPrimary; await this.valueForSecondaryInput.updateProperties({ value: this.currentRowObjectInfo.valueForSecondary }); if (this.dscTable.data[this.currentRowId][2] !== this.currentRowObjectInfo.valueForSecondary) { this.dscTable.data[this.currentRowId][2] = this.currentRowObjectInfo.valueForSecondary; @@ -1550,7 +1547,7 @@ export class DatabaseDialog extends ObjectManagementDialogBase { await this.dscSecondaryValueDropdownGroup.updateCssStyles({ 'visibility': checked ? 'hidden' : 'visible' }); - this.currentRowObjectInfo.valueForSecondary = checked ? this.currentRowObjectInfo.valueForPrimary : this.dscOriginalData[this.currentRowId].valueForSecondary; + this.currentRowObjectInfo.valueForSecondary = this.currentRowObjectInfo.valueForPrimary; await this.valueForSecondaryDropdown.updateProperties({ value: this.currentRowObjectInfo.valueForSecondary }); }, true); this.dscSecondaryCheckboxForDropdownGroup = this.createGroup('', [this.setSecondaryCheckboxForDropdowns], false, true); From 2a21e63277ffa87a266229a50c382f90156ccaa4 Mon Sep 17 00:00:00 2001 From: ssreerama Date: Sun, 10 Sep 2023 17:13:52 -0700 Subject: [PATCH 5/7] DB Scoped Config shows secondary values for non-secondary options #24192 --- extensions/mssql/src/objectManagement/localizedConstants.ts | 1 + extensions/mssql/src/objectManagement/ui/databaseDialog.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/mssql/src/objectManagement/localizedConstants.ts b/extensions/mssql/src/objectManagement/localizedConstants.ts index c28eb6c08cf7..38bd20541e20 100644 --- a/extensions/mssql/src/objectManagement/localizedConstants.ts +++ b/extensions/mssql/src/objectManagement/localizedConstants.ts @@ -464,6 +464,7 @@ export const QueryStoreUsedText = localize('objectManagement.databaseProperties. export const QueryStoreAvailableText = localize('objectManagement.databaseProperties.queryStoreAvailableText', "Query Store Available"); export const PurgeQueryDataButtonText = localize('objectManagement.databaseProperties.purgeQueryDataButtonText', "Purge Query Store Data"); export const YesText = localize('objectManagement.databaseProperties.yesText', "Yes"); +export const NotAvailableText = localize('objectManagement.databaseProperties.notAvailableText', "N/A"); export const PurgeQueryStoreDataMessage = (databaseName: string) => localize('objectManagement.databaseProperties.purgeQueryStoreDataMessage', "Are you sure you want to purge the Query Store data from '{0}'?", databaseName); // Util functions diff --git a/extensions/mssql/src/objectManagement/ui/databaseDialog.ts b/extensions/mssql/src/objectManagement/ui/databaseDialog.ts index 7f2af10f915e..bf2f7bac5581 100644 --- a/extensions/mssql/src/objectManagement/ui/databaseDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/databaseDialog.ts @@ -1295,6 +1295,8 @@ export class DatabaseDialog extends ObjectManagementDialogBase { + // Configurations that doesn't support secondary replica + let secondaryUnsupportedConfigsSet = new Set([11, 12, 25, 6, 21]); const dscNameColumn: azdata.TableColumn = { type: azdata.ColumnType.text, value: localizedConstants.DatabaseScopedOptionsColumnHeader, @@ -1316,7 +1318,7 @@ export class DatabaseDialog extends ObjectManagementDialogBase { return [metaData.name.toLocaleUpperCase(), metaData.valueForPrimary, - metaData.valueForSecondary] + secondaryUnsupportedConfigsSet.has(metaData.id) ? localizedConstants.NotAvailableText : metaData.valueForSecondary] }), height: getTableHeight(this.objectInfo.databaseScopedConfigurations.length, 1, DscTableRowLength), width: DefaultTableWidth From 5c42313fad24c0601d06225e7bd2d123b92e87b2 Mon Sep 17 00:00:00 2001 From: ssreerama Date: Mon, 11 Sep 2023 09:07:29 -0700 Subject: [PATCH 6/7] Query store capture policy section is enabling on non-custom capture mode #24371 --- extensions/mssql/src/objectManagement/ui/databaseDialog.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/mssql/src/objectManagement/ui/databaseDialog.ts b/extensions/mssql/src/objectManagement/ui/databaseDialog.ts index bf2f7bac5581..fcf83c0bf035 100644 --- a/extensions/mssql/src/objectManagement/ui/databaseDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/databaseDialog.ts @@ -1847,7 +1847,8 @@ export class DatabaseDialog extends ObjectManagementDialogBase { From 544c33e6e6b34d37cdabd9c5f0dcecef2fed121e Mon Sep 17 00:00:00 2001 From: ssreerama Date: Mon, 11 Sep 2023 10:00:52 -0700 Subject: [PATCH 7/7] queryStore WaitStatistics options should be a dropdown #24372 --- .../mssql/src/objectManagement/interfaces.ts | 4 +-- .../objectManagementService.ts | 2 +- .../src/objectManagement/ui/databaseDialog.ts | 30 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/extensions/mssql/src/objectManagement/interfaces.ts b/extensions/mssql/src/objectManagement/interfaces.ts index 445699ca6cfa..d80d57f3748a 100644 --- a/extensions/mssql/src/objectManagement/interfaces.ts +++ b/extensions/mssql/src/objectManagement/interfaces.ts @@ -476,7 +476,7 @@ export interface DatabaseViewInfo extends ObjectManagement.ObjectViewInfo { - this.objectInfo.queryStoreOptions.waitStatisticsCaptureMode = checked; - }, this.objectInfo.queryStoreOptions.waitStatisticsCaptureMode, this.areQueryStoreOptionsEnabled); - containers.push(this.waitStatisticsCaptureMode); + this.waitStatisticsCaptureMode = this.createDropdown(localizedConstants.WaitStatisticsCaptureModeText, async (newValue) => { + this.objectInfo.queryStoreOptions.waitStatisticsCaptureMode = newValue as string; + }, this.viewInfo.propertiesOnOffOptions, this.objectInfo.queryStoreOptions.waitStatisticsCaptureMode.toUpperCase(), this.areQueryStoreOptionsEnabled, DefaultInputWidth); + containers.push(this.createLabelInputContainer(localizedConstants.WaitStatisticsCaptureModeText, this.waitStatisticsCaptureMode)); } const retentionSection = this.createGroup(localizedConstants.WaitStatisticsCaptureModeText, containers, true); this.queryStoreTabSectionsContainer.push(retentionSection);