Show Trust server certificate on dialog and fix bool select-box defaults (#21020)

This commit is contained in:
Cheena Malhotra
2022-10-28 19:43:43 -07:00
committed by GitHub
parent 998b528680
commit f3fcaa21da
9 changed files with 91 additions and 18 deletions

View File

@@ -63,6 +63,8 @@ export class ConnectionWidget extends lifecycle.Disposable {
private _defaultDatabaseName: string = localize('defaultDatabaseOption', "<Default>");
private _loadingDatabaseName: string = localize('loadingDatabaseOption', "Loading...");
private _serverGroupDisplayString: string = localize('serverGroup', "Server group");
private _trueInputValue: string = localize('boolean.true', 'True');
private _falseInputValue: string = localize('boolean.false', 'False');
private _token: string;
private _connectionStringOptions: ConnectionStringOptions;
protected _container: HTMLElement;
@@ -257,10 +259,12 @@ export class ConnectionWidget extends lifecycle.Disposable {
if (this._customOptions.length > 0) {
this._customOptionWidgets = [];
this._customOptions.forEach((option, i) => {
let customOptionsContainer = DialogHelper.appendRow(this._tableContainer, option.displayName, 'connection-label', 'connection-input', 'custom-connection-options');
let customOptionsContainer = DialogHelper.appendRow(this._tableContainer, option.displayName, 'connection-label', 'connection-input', 'custom-connection-options', false, option.description, 100);
switch (option.valueType) {
case ServiceOptionType.boolean:
this._customOptionWidgets[i] = new SelectBox([localize('boolean.true', 'True'), localize('boolean.false', 'False')], option.defaultValue, this._contextViewService, customOptionsContainer, { ariaLabel: option.displayName });
// Convert 'defaultValue' to string for comparison as it can be boolean here.
let optionValue = (option.defaultValue.toString() === true.toString()) ? this._trueInputValue : this._falseInputValue;
this._customOptionWidgets[i] = new SelectBox([this._trueInputValue, this._falseInputValue], optionValue, this._contextViewService, customOptionsContainer, { ariaLabel: option.displayName });
DialogHelper.appendInputSelectBox(customOptionsContainer, this._customOptionWidgets[i] as SelectBox);
this._register(styler.attachSelectBoxStyler(this._customOptionWidgets[i] as SelectBox, this._themeService));
break;
@@ -774,10 +778,13 @@ export class ConnectionWidget extends lifecycle.Disposable {
if (this._customOptionWidgets) {
this._customOptionWidgets.forEach((widget, i) => {
if (widget instanceof SelectBox) {
widget.selectWithOptionName(this.getModelValue(connectionInfo.options[this._customOptions[i].name]));
} else {
widget.value = this.getModelValue(connectionInfo.options[this._customOptions[i].name]);
let value = this.getModelValue(connectionInfo.options[this._customOptions[i].name]);
if (value !== '') {
if (widget instanceof SelectBox) {
widget.selectWithOptionName(value);
} else {
widget.value = value;
}
}
});
}

View File

@@ -111,6 +111,16 @@
font-weight: 600;
}
.custom-connection-options .connection-label .dialog-label-container,
.vs-dark .custom-connection-options .connection-label .dialog-label-container,
.hc-black .custom-connection-options .connection-label .dialog-label-container {
background-size: 9px;
background-repeat: no-repeat;
background-position: right;
padding-right: 18px;
float: left;
}
.hide-azure-accounts .azure-account-row {
display: none;
}