Skip to content

Commit

Permalink
Enabling options tab for database properties (#23448)
Browse files Browse the repository at this point in the history
* Initial commit for adding a basic general tab for the database properties

* Refactoring for dialog inputs

* removed properties nodeType and using database node and additional cleanup, diabling the functionality.

* Changes according to STS data fetch

* Reuse database Dialog

* Undo contract file change

* more refactoring

* fetched scrollbar fix into this PR

* Tabbed panel is being used for horizontal tabs

* stying fix for general tab button

* final commit for today :)

* Updates according to STS changes

* missed updates

* Refactored updates

* moved options as discussed and added collapsible sections... need to fix scroll bar

* Fixing the horizontal scroll bar of tabbedpanel

* initial updates

* need to fix the error!

* rror fixed and options are loading with sample values

* need to load real values for all felds and map values to dropdown options

* Dd loading correctly, need to add validation to recovery field and save options back

* refactor

* removing nullable property

* All changes done except recoveryTime validation

* Refactoring

* all values are saving as expected, isDirty flag is fixed. Todo: recovery validation and tests

* added general section for the options tab

* modifying pageVerify and userAccess to string array

* updates to general section of options tb

* disabling couple of general properties for MI

* Adding server edition conditions and toggling the UI options

* adding numeric validation to the recovey time

* Removing serveInfo logic and using the unsupported options approach from STS

* addressing comments and little code refactor

* changes with nullOrUndefined helper method

* replacing dropdowns with checkboxes

* adding unit test for helper method

* removed commented sample code and added comments
  • Loading branch information
ssreerama authored Jul 6, 2023
1 parent 1bc22d8 commit acfa93f
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 15 deletions.
14 changes: 13 additions & 1 deletion extensions/mssql/src/objectManagement/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,17 @@ export interface Database extends ObjectManagement.SqlObject {
azureServiceLevelObjective?: string;
azureEdition?: string;
azureMaxSize?: string;
autoCreateIncrementalStatistics: boolean;
autoCreateStatistics: boolean;
autoShrink: boolean;
autoUpdateStatistics: boolean;
autoUpdateStatisticsAsynchronously: boolean;
isLedgerDatabase?: boolean;
pageVerify?: string;
targetRecoveryTimeInSec?: number;
databaseReadOnly?: boolean;
encryptionEnabled: boolean;
restrictAccess?: string;
}

export interface DatabaseViewInfo extends ObjectManagement.ObjectViewInfo<Database> {
Expand All @@ -452,12 +463,13 @@ export interface DatabaseViewInfo extends ObjectManagement.ObjectViewInfo<Databa
containmentTypes: string[];
recoveryModels: string[];
files: DatabaseFile[];

isAzureDB: boolean;
azureBackupRedundancyLevels: string[];
azureServiceLevelObjectives: AzureEditionDetails[];
azureEditions: string[];
azureMaxSizes: AzureEditionDetails[];
pageVerifyOptions: string[];
restrictAccessOptions: string[];
}

export interface AzureEditionDetails {
Expand Down
20 changes: 18 additions & 2 deletions extensions/mssql/src/objectManagement/localizedConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,17 @@ export const ServerCollationText = localize('objectManagement.serverCollation',
export const ServiceTierText = localize('objectManagement.serviceTier', "Service Tier");
export const StorageSpaceUsageInMBText = localize('objectManagement.storageSpaceUsageInMB', "Storage Space Usage (MB)");
export const VersionText = localize('objectManagement.versionText', "Version");


export const minServerMemoryText = localize('objectManagement.minServerMemoryText', "Minimum Server Memory (MB)");
export const maxServerMemoryText = localize('objectManagement.maxServerMemoryText', "Maximum Server Memory (MB)");

//Database properties Dialog
export const LastDatabaseBackupText = localize('objectManagement.lastDatabaseBackup', "Last Database Backup");
export const LastDatabaseLogBackupText = localize('objectManagement.lastDatabaseLogBackup', "Last Database Log Backup");
export const BackupSectionHeader = localize('objectManagement.databaseProperties.backupSectionHeader', "Backup");
export const AutomaticSectionHeader = localize('objectManagement.databaseProperties.automaticSectionHeader', "Automatic");
export const LedgerSectionHeader = localize('objectManagement.databaseProperties.ledgerSectionHeader', "Ledger");
export const RecoverySectionHeader = localize('objectManagement.databaseProperties.recoverySectionHeader', "Recovery");
export const StateSectionHeader = localize('objectManagement.databaseProperties.stateSectionHeader', "State");
export const DatabaseSectionHeader = localize('objectManagement.databaseProperties.databaseSectionHeader', "Database");
export const NamePropertyText = localize('objectManagement.databaseProperties.name', "Name");
export const StatusText = localize('objectManagement.databaseProperties.status', "Status");
Expand All @@ -277,6 +280,19 @@ export const NumberOfUsersText = localize('objectManagement.databaseProperties.n
export const MemoryAllocatedText = localize('objectManagement.databaseProperties.memoryAllocated', "Memory Allocated To Memory Optimized Objects");
export const MemoryUsedText = localize('objectManagement.databaseProperties.memoryUsed', "Memory Used By Memory Optimized Objects");
export const StringValueInMB = (value: string) => localize('objectManagement.databaseProperties.mbUnitText', "{0} MB", value);
export const AutoCreateIncrementalStatisticsText = localize('objectManagement.databaseProperties.autoCreateIncrementalStatisticsText', "Auto Create Incremental Statistics");
export const AutoCreateStatisticsText = localize('objectManagement.databaseProperties.AutoCreateStatisticsText', "Auto Create Statistics");
export const AutoShrinkText = localize('objectManagement.databaseProperties.autoShrinkText', "Auto Shrink");
export const AutoUpdateStatisticsText = localize('objectManagement.databaseProperties.autoUpdateStatisticsText', "Auto Update Statistics");
export const AutoUpdateStatisticsAsynchronouslyText = localize('objectManagement.databaseProperties.autoUpdateStatisticsAsynchronouslyText', "Auto Update Statistics Asynchronously");
export const IsLedgerDatabaseText = localize('objectManagement.databaseProperties.isLedgerDatabaseText', "Is Ledger Database");
export const PageVerifyText = localize('objectManagement.databaseProperties.pageVerifyText', "Page Verify");
export const TargetRecoveryTimeInSecondsText = localize('objectManagement.databaseProperties.targetRecoveryTimeInSecondsText', "Target Recovery Time (Seconds)");
export const DatabaseReadOnlyText = localize('objectManagement.databaseProperties.databaseReadOnlyText', "Database Read-Only");
export const DatabaseStateText = localize('objectManagement.databaseProperties.databaseStateText', "Database State");
export const EncryptionEnabledText = localize('objectManagement.databaseProperties.encryptionEnabledText', "Encryption Enabled");
export const RestrictAccessText = localize('objectManagement.databaseProperties.restrictAccessText', "Restrict Access");


// Util functions
export function getNodeTypeDisplayName(type: string, inTitle: boolean = false): string {
Expand Down
13 changes: 12 additions & 1 deletion extensions/mssql/src/objectManagement/objectManagementService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,18 @@ export class TestObjectManagementService implements IObjectManagementService {
owner: 'databaseProperties 1',
sizeInMb: 16.00,
spaceAvailableInMb: 1.15,
status: 'Normal'
status: 'Normal',
autoCreateIncrementalStatistics: false,
autoCreateStatistics: true,
autoShrink: false,
autoUpdateStatistics: true,
autoUpdateStatisticsAsynchronously: false,
isLedgerDatabase: false,
pageVerify: 'CHECKSUM',
targetRecoveryTimeInSec: 60,
databaseReadOnly: true,
encryptionEnabled: false,
restrictAccess: 'SINGLE_USER',
}
};
}
Expand Down
Loading

0 comments on commit acfa93f

Please sign in to comment.