mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-06 01:25:38 -05:00
OptionsMapTable changes for SC deployment options (#19808)
* OptionsMapTable changes for SC deployment options * OptionsMapTable updates from STS * SC comments addressing * converted OptionsMapTable into custom type and updates references * BooleanOptionsMap changes all updates * Deployment options tab refactoing * Prop name updated to booleanOptionsDictionary and references * Updated lookup map by merging nameprop map * updated comments * SC options table updates based on SQLDB comments * Addressing the comments except the reset logic
This commit is contained in:
committed by
GitHub
parent
89816c9ff3
commit
eec944ff7d
@@ -8,7 +8,6 @@ import * as vscode from 'vscode';
|
||||
import * as mssql from 'mssql';
|
||||
import * as loc from '../localizedConstants';
|
||||
import { SchemaCompareMainWindow } from '../schemaCompareMainWindow';
|
||||
import { isNullOrUndefined } from 'util';
|
||||
import { SchemaCompareOptionsModel } from '../models/schemaCompareOptionsModel';
|
||||
import { TelemetryReporter, TelemetryViews } from '../telemetry';
|
||||
|
||||
@@ -25,7 +24,6 @@ export class SchemaCompareOptionsDialog {
|
||||
private optionsTable: azdata.TableComponent;
|
||||
private objectsTable: azdata.TableComponent;
|
||||
private disposableListeners: vscode.Disposable[] = [];
|
||||
|
||||
private optionsChanged: boolean = false;
|
||||
|
||||
private optionsModel: SchemaCompareOptionsModel;
|
||||
@@ -63,8 +61,10 @@ export class SchemaCompareOptionsDialog {
|
||||
}
|
||||
|
||||
protected execute(): void {
|
||||
// Update the model deploymentoptions with the updated table component values
|
||||
this.optionsModel.setDeploymentOptions();
|
||||
this.optionsModel.setObjectTypeOptions();
|
||||
// Set the publish deploymentoptions with the updated table component values
|
||||
this.schemaComparison.setDeploymentOptions(this.optionsModel.deploymentOptions);
|
||||
|
||||
const yesItem: vscode.MessageItem = {
|
||||
@@ -100,8 +100,8 @@ export class SchemaCompareOptionsDialog {
|
||||
this.optionsModel.deploymentOptions = result.defaultDeploymentOptions;
|
||||
this.optionsChanged = true;
|
||||
|
||||
// This will update the Map table with default values
|
||||
this.optionsModel.InitializeUpdateOptionsMapTable();
|
||||
// reset optionsvalueNameLookup with fresh deployment options
|
||||
this.optionsModel.setOptionsToValueNameLookup();
|
||||
|
||||
await this.updateOptionsTable();
|
||||
this.optionsFlexBuilder.removeItem(this.optionsTable);
|
||||
@@ -136,19 +136,24 @@ export class SchemaCompareOptionsDialog {
|
||||
this.optionsTable = view.modelBuilder.table().component();
|
||||
await this.updateOptionsTable();
|
||||
|
||||
// Get the description of the selected option
|
||||
this.disposableListeners.push(this.optionsTable.onRowSelected(async () => {
|
||||
let row = this.optionsTable.selectedRows[0];
|
||||
let label = this.optionsModel.optionsLabels[row];
|
||||
// selectedRows[0] contains selected row number
|
||||
const row = this.optionsTable.selectedRows[0];
|
||||
// data[row][1] contains the option display name
|
||||
const displayName = this.optionsTable?.data[row!][1];
|
||||
await this.descriptionText.updateProperties({
|
||||
value: this.optionsModel.getDescription(label)
|
||||
value: this.optionsModel.getOptionDescription(displayName)
|
||||
});
|
||||
}));
|
||||
|
||||
// Update deploy options value on checkbox onchange
|
||||
this.disposableListeners.push(this.optionsTable.onCellAction((rowState) => {
|
||||
let checkboxState = <azdata.ICheckboxCellActionEventArgs>rowState;
|
||||
const checkboxState = <azdata.ICheckboxCellActionEventArgs>rowState;
|
||||
if (checkboxState && checkboxState.row !== undefined) {
|
||||
let label = this.optionsModel.optionsLabels[checkboxState.row];
|
||||
this.optionsModel.optionsLookup[label] = checkboxState.checked;
|
||||
// data[row][1] contains the option display name
|
||||
const displayName = this.optionsTable?.data[checkboxState.row][1];
|
||||
this.optionsModel.setOptionValue(displayName, checkboxState.checked);
|
||||
this.optionsChanged = true;
|
||||
}
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user