mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 17:22:48 -05:00
Show Trust server certificate on dialog and fix bool select-box defaults (#21020)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user