mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Support placeholder text for connection dialog options (#22693)
This commit is contained in:
@@ -66,6 +66,7 @@
|
|||||||
"groupName": "%cms.connectionOptions.groupName.source%",
|
"groupName": "%cms.connectionOptions.groupName.source%",
|
||||||
"valueType": "string",
|
"valueType": "string",
|
||||||
"defaultValue": null,
|
"defaultValue": null,
|
||||||
|
"placeholder": "%cms.connectionOptions.serverName.placeholder%",
|
||||||
"objectType": null,
|
"objectType": null,
|
||||||
"categoryValues": null,
|
"categoryValues": null,
|
||||||
"isRequired": true,
|
"isRequired": true,
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
"cms.logRetentionMinutes": "Number of minutes to retain log files for backend services. Default is 1 week.",
|
"cms.logRetentionMinutes": "Number of minutes to retain log files for backend services. Default is 1 week.",
|
||||||
"cms.logFilesRemovalLimit": "Maximum number of old files to remove upon startup that have expired mssql.logRetentionMinutes. Files that do not get cleaned up due to this limitation get cleaned up next time Azure Data Studio starts up.",
|
"cms.logFilesRemovalLimit": "Maximum number of old files to remove upon startup that have expired mssql.logRetentionMinutes. Files that do not get cleaned up due to this limitation get cleaned up next time Azure Data Studio starts up.",
|
||||||
"ignorePlatformWarning": "[Optional] Do not show unsupported platform warnings",
|
"ignorePlatformWarning": "[Optional] Do not show unsupported platform warnings",
|
||||||
|
|
||||||
"onprem.databaseProperties.recoveryModel": "Recovery Model",
|
"onprem.databaseProperties.recoveryModel": "Recovery Model",
|
||||||
"onprem.databaseProperties.lastBackupDate": "Last Database Backup",
|
"onprem.databaseProperties.lastBackupDate": "Last Database Backup",
|
||||||
"onprem.databaseProperties.lastLogBackupDate": "Last Log Backup",
|
"onprem.databaseProperties.lastLogBackupDate": "Last Log Backup",
|
||||||
@@ -34,19 +33,18 @@
|
|||||||
"onprem.serverProperties.serverEdition": "Edition",
|
"onprem.serverProperties.serverEdition": "Edition",
|
||||||
"onprem.serverProperties.machineName": "Computer Name",
|
"onprem.serverProperties.machineName": "Computer Name",
|
||||||
"onprem.serverProperties.osVersion": "OS Version",
|
"onprem.serverProperties.osVersion": "OS Version",
|
||||||
|
|
||||||
"cloud.databaseProperties.azureEdition": "Edition",
|
"cloud.databaseProperties.azureEdition": "Edition",
|
||||||
"cloud.databaseProperties.serviceLevelObjective": "Pricing Tier",
|
"cloud.databaseProperties.serviceLevelObjective": "Pricing Tier",
|
||||||
"cloud.databaseProperties.compatibilityLevel": "Compatibility Level",
|
"cloud.databaseProperties.compatibilityLevel": "Compatibility Level",
|
||||||
"cloud.databaseProperties.owner": "Owner",
|
"cloud.databaseProperties.owner": "Owner",
|
||||||
"cloud.serverProperties.serverVersion": "Version",
|
"cloud.serverProperties.serverVersion": "Version",
|
||||||
"cloud.serverProperties.serverEdition": "Type",
|
"cloud.serverProperties.serverEdition": "Type",
|
||||||
|
|
||||||
"cms.provider.displayName": "Microsoft SQL Server",
|
"cms.provider.displayName": "Microsoft SQL Server",
|
||||||
"cms.connectionOptions.connectionName.displayName": "Name (optional)",
|
"cms.connectionOptions.connectionName.displayName": "Name (optional)",
|
||||||
"cms.connectionOptions.connectionName.description": "Custom name of the connection",
|
"cms.connectionOptions.connectionName.description": "Custom name of the connection",
|
||||||
"cms.connectionOptions.serverName.displayName": "Server",
|
"cms.connectionOptions.serverName.displayName": "Server",
|
||||||
"cms.connectionOptions.serverName.description": "Name of the SQL Server instance",
|
"cms.connectionOptions.serverName.description": "Name of the SQL Server instance",
|
||||||
|
"cms.connectionOptions.serverName.placeholder": "e.g. tcp:servername,1433",
|
||||||
"cms.connectionOptions.serverDescription.displayName": "Server Description",
|
"cms.connectionOptions.serverDescription.displayName": "Server Description",
|
||||||
"cms.connectionOptions.serverDescription.description": "Description of the SQL Server instance",
|
"cms.connectionOptions.serverDescription.description": "Description of the SQL Server instance",
|
||||||
"cms.connectionOptions.authType.displayName": "Authentication type",
|
"cms.connectionOptions.authType.displayName": "Authentication type",
|
||||||
|
|||||||
@@ -837,6 +837,7 @@
|
|||||||
"groupName": "%mssql.connectionOptions.groupName.source%",
|
"groupName": "%mssql.connectionOptions.groupName.source%",
|
||||||
"valueType": "string",
|
"valueType": "string",
|
||||||
"defaultValue": null,
|
"defaultValue": null,
|
||||||
|
"placeholder": "%mssql.connectionOptions.serverName.placeholder%",
|
||||||
"objectType": null,
|
"objectType": null,
|
||||||
"categoryValues": null,
|
"categoryValues": null,
|
||||||
"isRequired": true,
|
"isRequired": true,
|
||||||
|
|||||||
@@ -5,15 +5,11 @@
|
|||||||
"json.schemas.fileMatch.item.desc": "A file pattern that can contain '*' to match against when resolving JSON files to schemas.",
|
"json.schemas.fileMatch.item.desc": "A file pattern that can contain '*' to match against when resolving JSON files to schemas.",
|
||||||
"json.schemas.schema.desc": "The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL.",
|
"json.schemas.schema.desc": "The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL.",
|
||||||
"json.format.enable.desc": "Enable/disable default JSON formatter (requires restart)",
|
"json.format.enable.desc": "Enable/disable default JSON formatter (requires restart)",
|
||||||
|
|
||||||
"title.searchServers": "Search: Servers",
|
"title.searchServers": "Search: Servers",
|
||||||
"title.clearSearchServerResult": "Search: Clear Search Server Results",
|
"title.clearSearchServerResult": "Search: Clear Search Server Results",
|
||||||
|
|
||||||
"title.showLogFile": "Show Log File",
|
"title.showLogFile": "Show Log File",
|
||||||
|
|
||||||
"mssql.disabled": "Disabled",
|
"mssql.disabled": "Disabled",
|
||||||
"mssql.enabled": "Enabled",
|
"mssql.enabled": "Enabled",
|
||||||
|
|
||||||
"mssql.executionPlan.expensiveOperationMetric": "The default metric to use to highlight an expensive operation in query execution plans",
|
"mssql.executionPlan.expensiveOperationMetric": "The default metric to use to highlight an expensive operation in query execution plans",
|
||||||
"mssql.executionPlan.expensiveOperationMetric.off": "Expensive operation highlighting will be turned off for execution plans.",
|
"mssql.executionPlan.expensiveOperationMetric.off": "Expensive operation highlighting will be turned off for execution plans.",
|
||||||
"mssql.executionPlan.expensiveOperationMetric.actualElapsedTime": "Highlights the execution plan operation that took the most time.",
|
"mssql.executionPlan.expensiveOperationMetric.actualElapsedTime": "Highlights the execution plan operation that took the most time.",
|
||||||
@@ -68,7 +64,6 @@
|
|||||||
"mssql.query.alwaysEncryptedParameterization": "Enable Parameterization for Always Encrypted",
|
"mssql.query.alwaysEncryptedParameterization": "Enable Parameterization for Always Encrypted",
|
||||||
"mssql.tracing.desc": "Traces the communication between Azure Data Studio and SQL Tools Service to the SQL Tools Service output channel. WARNING: This may include sensitive information when verbose logging is enabled.",
|
"mssql.tracing.desc": "Traces the communication between Azure Data Studio and SQL Tools Service to the SQL Tools Service output channel. WARNING: This may include sensitive information when verbose logging is enabled.",
|
||||||
"mssql.ignorePlatformWarning": "[Optional] Do not show unsupported platform warnings",
|
"mssql.ignorePlatformWarning": "[Optional] Do not show unsupported platform warnings",
|
||||||
|
|
||||||
"onprem.databaseProperties.recoveryModel": "Recovery Model",
|
"onprem.databaseProperties.recoveryModel": "Recovery Model",
|
||||||
"onprem.databaseProperties.lastBackupDate": "Last Database Backup",
|
"onprem.databaseProperties.lastBackupDate": "Last Database Backup",
|
||||||
"onprem.databaseProperties.lastLogBackupDate": "Last Log Backup",
|
"onprem.databaseProperties.lastLogBackupDate": "Last Log Backup",
|
||||||
@@ -78,19 +73,18 @@
|
|||||||
"onprem.serverProperties.serverEdition": "Edition",
|
"onprem.serverProperties.serverEdition": "Edition",
|
||||||
"onprem.serverProperties.machineName": "Computer Name",
|
"onprem.serverProperties.machineName": "Computer Name",
|
||||||
"onprem.serverProperties.osVersion": "OS Version",
|
"onprem.serverProperties.osVersion": "OS Version",
|
||||||
|
|
||||||
"cloud.databaseProperties.azureEdition": "Edition",
|
"cloud.databaseProperties.azureEdition": "Edition",
|
||||||
"cloud.databaseProperties.serviceLevelObjective": "Pricing Tier",
|
"cloud.databaseProperties.serviceLevelObjective": "Pricing Tier",
|
||||||
"cloud.databaseProperties.compatibilityLevel": "Compatibility Level",
|
"cloud.databaseProperties.compatibilityLevel": "Compatibility Level",
|
||||||
"cloud.databaseProperties.owner": "Owner",
|
"cloud.databaseProperties.owner": "Owner",
|
||||||
"cloud.serverProperties.serverVersion": "Version",
|
"cloud.serverProperties.serverVersion": "Version",
|
||||||
"cloud.serverProperties.serverEdition": "Type",
|
"cloud.serverProperties.serverEdition": "Type",
|
||||||
|
|
||||||
"mssql.provider.displayName": "Microsoft SQL Server",
|
"mssql.provider.displayName": "Microsoft SQL Server",
|
||||||
"mssql.connectionOptions.connectionName.displayName": "Name (optional)",
|
"mssql.connectionOptions.connectionName.displayName": "Name (optional)",
|
||||||
"mssql.connectionOptions.connectionName.description": "Custom name of the connection",
|
"mssql.connectionOptions.connectionName.description": "Custom name of the connection",
|
||||||
"mssql.connectionOptions.serverName.displayName": "Server",
|
"mssql.connectionOptions.serverName.displayName": "Server",
|
||||||
"mssql.connectionOptions.serverName.description": "Name of the SQL Server instance",
|
"mssql.connectionOptions.serverName.description": "Name of the SQL Server instance",
|
||||||
|
"mssql.connectionOptions.serverName.placeholder": "e.g. tcp:servername,1433",
|
||||||
"mssql.connectionOptions.databaseName.displayName": "Database",
|
"mssql.connectionOptions.databaseName.displayName": "Database",
|
||||||
"mssql.connectionOptions.databaseName.description": "The name of the initial catalog or database int the data source",
|
"mssql.connectionOptions.databaseName.description": "The name of the initial catalog or database int the data source",
|
||||||
"mssql.connectionOptions.authType.displayName": "Authentication type",
|
"mssql.connectionOptions.authType.displayName": "Authentication type",
|
||||||
|
|||||||
10
src/sql/azdata.proposed.d.ts
vendored
10
src/sql/azdata.proposed.d.ts
vendored
@@ -522,6 +522,11 @@ declare module 'azdata' {
|
|||||||
export interface ConnectionOption {
|
export interface ConnectionOption {
|
||||||
defaultValueOsOverrides?: DefaultValueOsOverride[];
|
defaultValueOsOverrides?: DefaultValueOsOverride[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to define placeholder text
|
||||||
|
*/
|
||||||
|
placeholder?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When set to true, the respective connection option will be rendered on the main connection dialog
|
* When set to true, the respective connection option will be rendered on the main connection dialog
|
||||||
* and not the Advanced Options window.
|
* and not the Advanced Options window.
|
||||||
@@ -535,6 +540,11 @@ declare module 'azdata' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ServiceOption {
|
export interface ServiceOption {
|
||||||
|
/**
|
||||||
|
* Used to define placeholder text
|
||||||
|
*/
|
||||||
|
placeholder?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to define list of values based on which another option is rendered visible/hidden.
|
* Used to define list of values based on which another option is rendered visible/hidden.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ export function createOptionElement(option: azdata.ServiceOption, rowContainer:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ariaLabel: option.displayName
|
ariaLabel: option.displayName,
|
||||||
|
placeholder: option.placeholder
|
||||||
}, option.name);
|
}, option.name);
|
||||||
optionWidget.value = optionValue;
|
optionWidget.value = optionValue;
|
||||||
inputElement = findElement(rowContainer, 'input');
|
inputElement = findElement(rowContainer, 'input');
|
||||||
@@ -54,7 +55,8 @@ export function createOptionElement(option: azdata.ServiceOption, rowContainer:
|
|||||||
validationOptions: {
|
validationOptions: {
|
||||||
validation: (value: string) => (!value && option.isRequired) ? ({ type: MessageType.ERROR, content: option.displayName + missingErrorMessage }) : null
|
validation: (value: string) => (!value && option.isRequired) ? ({ type: MessageType.ERROR, content: option.displayName + missingErrorMessage }) : null
|
||||||
},
|
},
|
||||||
ariaLabel: option.displayName
|
ariaLabel: option.displayName,
|
||||||
|
placeholder: option.placeholder
|
||||||
}, option.name);
|
}, option.name);
|
||||||
optionWidget.value = optionValue;
|
optionWidget.value = optionValue;
|
||||||
if (option.valueType === ServiceOptionType.password) {
|
if (option.valueType === ServiceOptionType.password) {
|
||||||
|
|||||||
@@ -294,7 +294,10 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
|||||||
this._register(styler.attachSelectBoxStyler(this._customOptionWidgets[i] as SelectBox, this._themeService));
|
this._register(styler.attachSelectBoxStyler(this._customOptionWidgets[i] as SelectBox, this._themeService));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this._customOptionWidgets[i] = new InputBox(customOptionsContainer, this._contextViewService, { ariaLabel: option.displayName });
|
this._customOptionWidgets[i] = new InputBox(customOptionsContainer, this._contextViewService, {
|
||||||
|
ariaLabel: option.displayName,
|
||||||
|
placeholder: option.placeholder
|
||||||
|
});
|
||||||
this._register(styler.attachInputBoxStyler(this._customOptionWidgets[i] as InputBox, this._themeService));
|
this._register(styler.attachInputBoxStyler(this._customOptionWidgets[i] as InputBox, this._themeService));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -381,7 +384,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
|||||||
|
|
||||||
protected addServerNameOption(): void {
|
protected addServerNameOption(): void {
|
||||||
// Server name
|
// Server name
|
||||||
let serverNameOption = this._optionsMaps[ConnectionOptionSpecialType.serverName];
|
let serverNameOption: azdata.ConnectionOption = this._optionsMaps[ConnectionOptionSpecialType.serverName];
|
||||||
let serverName = DialogHelper.appendRow(this._tableContainer, serverNameOption.displayName, 'connection-label', 'connection-input', 'server-name-row', true);
|
let serverName = DialogHelper.appendRow(this._tableContainer, serverNameOption.displayName, 'connection-label', 'connection-input', 'server-name-row', true);
|
||||||
this._serverNameInputBox = new InputBox(serverName, this._contextViewService, {
|
this._serverNameInputBox = new InputBox(serverName, this._contextViewService, {
|
||||||
validationOptions: {
|
validationOptions: {
|
||||||
@@ -389,7 +392,8 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
|||||||
return this.validateRequiredOptionValue(value, serverNameOption.displayName);
|
return this.validateRequiredOptionValue(value, serverNameOption.displayName);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ariaLabel: serverNameOption.displayName
|
ariaLabel: serverNameOption.displayName,
|
||||||
|
placeholder: serverNameOption.placeholder
|
||||||
});
|
});
|
||||||
this._register(this._serverNameInputBox);
|
this._register(this._serverNameInputBox);
|
||||||
}
|
}
|
||||||
@@ -397,19 +401,23 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
|||||||
protected addLoginOptions(): void {
|
protected addLoginOptions(): void {
|
||||||
// Username
|
// Username
|
||||||
let self = this;
|
let self = this;
|
||||||
let userNameOption = this._optionsMaps[ConnectionOptionSpecialType.userName];
|
let userNameOption: azdata.ConnectionOption = this._optionsMaps[ConnectionOptionSpecialType.userName];
|
||||||
let userName = DialogHelper.appendRow(this._tableContainer, userNameOption.displayName, 'connection-label', 'connection-input', 'username-row', userNameOption.isRequired);
|
let userName = DialogHelper.appendRow(this._tableContainer, userNameOption.displayName, 'connection-label', 'connection-input', 'username-row', userNameOption.isRequired);
|
||||||
this._userNameInputBox = new InputBox(userName, this._contextViewService, {
|
this._userNameInputBox = new InputBox(userName, this._contextViewService, {
|
||||||
validationOptions: {
|
validationOptions: {
|
||||||
validation: (value: string) => self.validateUsername(value, userNameOption.isRequired) ? ({ type: MessageType.ERROR, content: localize('connectionWidget.missingRequireField', "{0} is required.", userNameOption.displayName) }) : null
|
validation: (value: string) => self.validateUsername(value, userNameOption.isRequired) ? ({ type: MessageType.ERROR, content: localize('connectionWidget.missingRequireField', "{0} is required.", userNameOption.displayName) }) : null
|
||||||
},
|
},
|
||||||
ariaLabel: userNameOption.displayName
|
ariaLabel: userNameOption.displayName,
|
||||||
|
placeholder: userNameOption.placeholder
|
||||||
});
|
});
|
||||||
this._register(this._userNameInputBox);
|
this._register(this._userNameInputBox);
|
||||||
// Password
|
// Password
|
||||||
let passwordOption = this._optionsMaps[ConnectionOptionSpecialType.password];
|
let passwordOption: azdata.ConnectionOption = this._optionsMaps[ConnectionOptionSpecialType.password];
|
||||||
let password = DialogHelper.appendRow(this._tableContainer, passwordOption.displayName, 'connection-label', 'connection-input', 'password-row');
|
let password = DialogHelper.appendRow(this._tableContainer, passwordOption.displayName, 'connection-label', 'connection-input', 'password-row');
|
||||||
this._passwordInputBox = new InputBox(password, this._contextViewService, { ariaLabel: passwordOption.displayName });
|
this._passwordInputBox = new InputBox(password, this._contextViewService, {
|
||||||
|
ariaLabel: passwordOption.displayName,
|
||||||
|
placeholder: passwordOption.placeholder
|
||||||
|
});
|
||||||
this._passwordInputBox.inputElement.type = 'password';
|
this._passwordInputBox.inputElement.type = 'password';
|
||||||
this._register(this._passwordInputBox);
|
this._register(this._passwordInputBox);
|
||||||
|
|
||||||
@@ -438,13 +446,13 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
|||||||
|
|
||||||
private addDatabaseOption(): void {
|
private addDatabaseOption(): void {
|
||||||
// Database
|
// Database
|
||||||
let databaseOption = this._optionsMaps[ConnectionOptionSpecialType.databaseName];
|
let databaseOption: azdata.ConnectionOption = this._optionsMaps[ConnectionOptionSpecialType.databaseName];
|
||||||
if (databaseOption) {
|
if (databaseOption) {
|
||||||
let databaseName = DialogHelper.appendRow(this._tableContainer, databaseOption.displayName, 'connection-label', 'connection-input', 'database-row');
|
let databaseName = DialogHelper.appendRow(this._tableContainer, databaseOption.displayName, 'connection-label', 'connection-input', 'database-row');
|
||||||
this._databaseNameInputBox = new Dropdown(databaseName, this._contextViewService, {
|
this._databaseNameInputBox = new Dropdown(databaseName, this._contextViewService, {
|
||||||
values: [this._defaultDatabaseName, this._loadingDatabaseName],
|
values: [this._defaultDatabaseName, this._loadingDatabaseName],
|
||||||
strictSelection: false,
|
strictSelection: false,
|
||||||
placeholder: this._defaultDatabaseName,
|
placeholder: databaseOption.placeholder ?? this._defaultDatabaseName,
|
||||||
maxHeight: 125,
|
maxHeight: 125,
|
||||||
ariaLabel: databaseOption.displayName
|
ariaLabel: databaseOption.displayName
|
||||||
});
|
});
|
||||||
@@ -462,10 +470,13 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
|||||||
|
|
||||||
protected addConnectionNameOptions(): void {
|
protected addConnectionNameOptions(): void {
|
||||||
// Connection name
|
// Connection name
|
||||||
let connectionNameOption = this._optionsMaps[ConnectionOptionSpecialType.connectionName];
|
let connectionNameOption: azdata.ConnectionOption = this._optionsMaps[ConnectionOptionSpecialType.connectionName];
|
||||||
connectionNameOption.displayName = localize('connectionName', "Name (optional)");
|
connectionNameOption.displayName = localize('connectionName', "Name (optional)");
|
||||||
let connectionNameBuilder = DialogHelper.appendRow(this._tableContainer, connectionNameOption.displayName, 'connection-label', 'connection-input');
|
let connectionNameBuilder = DialogHelper.appendRow(this._tableContainer, connectionNameOption.displayName, 'connection-label', 'connection-input');
|
||||||
this._connectionNameInputBox = new InputBox(connectionNameBuilder, this._contextViewService, { ariaLabel: connectionNameOption.displayName });
|
this._connectionNameInputBox = new InputBox(connectionNameBuilder, this._contextViewService, {
|
||||||
|
ariaLabel: connectionNameOption.displayName,
|
||||||
|
placeholder: connectionNameOption.placeholder
|
||||||
|
});
|
||||||
this._register(this._connectionNameInputBox);
|
this._register(this._connectionNameInputBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user