From 9c886dd80a47c1a929f297613eb09aa7635bf9e6 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Thu, 4 Mar 2021 09:50:57 -0800 Subject: [PATCH] Remove unneeded validation error messages (#14531) --- extensions/arc/src/localizedConstants.ts | 6 ------ .../src/ui/dashboards/miaa/miaaComputeAndStoragePage.ts | 4 ---- .../dashboards/postgres/postgresComputeAndStoragePage.ts | 9 --------- .../arc/src/ui/dashboards/postgres/postgresParameters.ts | 3 +-- extensions/sql-database-projects/src/common/constants.ts | 2 -- .../src/dialogs/createProjectFromDatabaseDialog.ts | 6 ++---- 6 files changed, 3 insertions(+), 27 deletions(-) diff --git a/extensions/arc/src/localizedConstants.ts b/extensions/arc/src/localizedConstants.ts index 5001517a2d..cc18b19974 100644 --- a/extensions/arc/src/localizedConstants.ts +++ b/extensions/arc/src/localizedConstants.ts @@ -165,9 +165,6 @@ export const coresLimit = localize('arc.coresLimit', "CPU limit:"); export const coresRequest = localize('arc.coresRequest', "CPU request:"); export const memoryLimit = localize('arc.memoryLimit', "Memory limit (in GB):"); export const memoryRequest = localize('arc.memoryRequest', "Memory request (in GB):"); -export const workerValidationErrorMessage = localize('arc.workerValidationErrorMessage', "The number of workers cannot be decreased."); -export const memoryRequestValidationErrorMessage = localize('arc.memoryRequestValidationErrorMessage', "Memory request must be at least 0.25Gib"); -export const memoryLimitValidationErrorMessage = localize('arc.memoryLimitValidationErrorMessage', "Memory limit must be at least 0.25Gib"); export const arcResources = localize('arc.arcResources', "Azure Arc Resources"); export const enterANonEmptyPassword = localize('arc.enterANonEmptyPassword', "Enter a non empty password or press escape to exit."); export const thePasswordsDoNotMatch = localize('arc.thePasswordsDoNotMatch', "The passwords do not match. Confirm the password or press escape to exit."); @@ -182,7 +179,6 @@ export const connectToPostgresDescription = localize('arc.connectToPostgresDescr export const postgresExtension = localize('arc.postgresExtension', "microsoft.azuredatastudio-postgresql"); export function rangeSetting(min: string, max: string): string { return localize('arc.rangeSetting', "Value is expected to be in the range {0} - {1}", min, max); } -export function allowedValue(value: string): string { return localize('arc.allowedValue', "Value is expected to be {0}", value); } export function databaseCreated(name: string): string { return localize('arc.databaseCreated', "Database {0} created", name); } export function deletingInstance(name: string): string { return localize('arc.deletingInstance', "Deleting instance '{0}'...", name); } export function installingExtension(name: string): string { return localize('arc.installingExtension', "Installing extension '{0}'...", name); } @@ -207,13 +203,11 @@ export function numVCores(vCores: string | undefined): string { } } export function updated(when: string): string { return localize('arc.updated', "Updated {0}", when); } -export function validationMin(min: number): string { return localize('arc.validationMin', "Value must be greater than or equal to {0}.", min); } // Errors export const pgConnectionRequired = localize('arc.pgConnectionRequired', "A connection is required to show and set database engine settings."); export const miaaConnectionRequired = localize('arc.miaaConnectionRequired', "A connection is required to list the databases on this instance."); export const couldNotFindControllerRegistration = localize('arc.couldNotFindControllerRegistration', "Could not find controller registration."); -export function outOfRange(min: string, max: string): string { return localize('arc.outOfRange', "The number must be in range {0} - {1}", min, max); } export function refreshFailed(error: any): string { return localize('arc.refreshFailed', "Refresh failed. {0}", getErrorMessage(error)); } export function resetFailed(error: any): string { return localize('arc.resetFailed', "Reset failed. {0}", getErrorMessage(error)); } export function openDashboardFailed(error: any): string { return localize('arc.openDashboardFailed', "Error opening dashboard. {0}", getErrorMessage(error)); } diff --git a/extensions/arc/src/ui/dashboards/miaa/miaaComputeAndStoragePage.ts b/extensions/arc/src/ui/dashboards/miaa/miaaComputeAndStoragePage.ts index bd0631dffb..0b3e29e07d 100644 --- a/extensions/arc/src/ui/dashboards/miaa/miaaComputeAndStoragePage.ts +++ b/extensions/arc/src/ui/dashboards/miaa/miaaComputeAndStoragePage.ts @@ -217,7 +217,6 @@ export class MiaaComputeAndStoragePage extends DashboardPage { this.memoryLimitBox = this.modelView.modelBuilder.inputBox().withProperties({ readOnly: false, min: 2, - validationErrorMessage: loc.memoryLimitValidationErrorMessage, inputType: 'number', placeHolder: loc.loading }).component(); @@ -235,7 +234,6 @@ export class MiaaComputeAndStoragePage extends DashboardPage { this.memoryRequestBox = this.modelView.modelBuilder.inputBox().withProperties({ readOnly: false, min: 2, - validationErrorMessage: loc.memoryRequestValidationErrorMessage, inputType: 'number', placeHolder: loc.loading }).component(); @@ -320,7 +318,6 @@ export class MiaaComputeAndStoragePage extends DashboardPage { currentCPUSize = ''; } - this.coresRequestBox!.validationErrorMessage = loc.validationMin(this.coresRequestBox!.min!); this.coresRequestBox!.placeHolder = currentCPUSize; this.coresRequestBox!.value = ''; this.saveArgs.coresRequest = undefined; @@ -331,7 +328,6 @@ export class MiaaComputeAndStoragePage extends DashboardPage { currentCPUSize = ''; } - this.coresLimitBox!.validationErrorMessage = loc.validationMin(this.coresLimitBox!.min!); this.coresLimitBox!.placeHolder = currentCPUSize; this.coresLimitBox!.value = ''; this.saveArgs.coresLimit = undefined; diff --git a/extensions/arc/src/ui/dashboards/postgres/postgresComputeAndStoragePage.ts b/extensions/arc/src/ui/dashboards/postgres/postgresComputeAndStoragePage.ts index 4acb7b4188..f19da09ee7 100644 --- a/extensions/arc/src/ui/dashboards/postgres/postgresComputeAndStoragePage.ts +++ b/extensions/arc/src/ui/dashboards/postgres/postgresComputeAndStoragePage.ts @@ -263,7 +263,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage { // Worker node count this.workerBox = this.modelView.modelBuilder.inputBox().withProperties({ readOnly: false, - validationErrorMessage: loc.workerValidationErrorMessage, inputType: 'number', placeHolder: loc.loading, required: true @@ -319,7 +318,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage { this.workerMemoryRequestBox = this.modelView.modelBuilder.inputBox().withProperties({ readOnly: false, min: 0.25, - validationErrorMessage: loc.memoryRequestValidationErrorMessage, inputType: 'number', placeHolder: loc.loading }).component(); @@ -340,7 +338,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage { this.workerMemoryLimitBox = this.modelView.modelBuilder.inputBox().withProperties({ readOnly: false, min: 0.25, - validationErrorMessage: loc.memoryLimitValidationErrorMessage, inputType: 'number', placeHolder: loc.loading }).component(); @@ -397,7 +394,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage { this.coordinatorMemoryRequestBox = this.modelView.modelBuilder.inputBox().withProperties({ readOnly: false, min: 0.25, - validationErrorMessage: loc.memoryRequestValidationErrorMessage, inputType: 'number', placeHolder: loc.loading }).component(); @@ -418,7 +414,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage { this.coordinatorMemoryLimitBox = this.modelView.modelBuilder.inputBox().withProperties({ readOnly: false, min: 0.25, - validationErrorMessage: loc.memoryLimitValidationErrorMessage, inputType: 'number', placeHolder: loc.loading }).component(); @@ -608,7 +603,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage { this.currentConfiguration.workerCoresRequest = ''; } - this.workerCoresRequestBox!.validationErrorMessage = loc.validationMin(this.workerCoresRequestBox!.min!); this.workerCoresRequestBox!.placeHolder = ''; this.workerCoresRequestBox!.value = this.currentConfiguration.workerCoresRequest; this.saveArgs.workerCoresRequest = undefined; @@ -619,7 +613,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage { this.currentConfiguration.workerCoresLimit = ''; } - this.workerCoresLimitBox!.validationErrorMessage = loc.validationMin(this.workerCoresLimitBox!.min!); this.workerCoresLimitBox!.placeHolder = ''; this.workerCoresLimitBox!.value = this.currentConfiguration.workerCoresLimit; this.saveArgs.workerCoresLimit = undefined; @@ -658,7 +651,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage { this.currentConfiguration.coordinatorCoresRequest = ''; } - this.coordinatorCoresRequestBox!.validationErrorMessage = loc.validationMin(this.coordinatorCoresRequestBox!.min!); this.coordinatorCoresRequestBox!.placeHolder = ''; this.coordinatorCoresRequestBox!.value = this.currentConfiguration.coordinatorCoresRequest; this.saveArgs.coordinatorCoresRequest = undefined; @@ -669,7 +661,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage { this.currentConfiguration.coordinatorCoresLimit = ''; } - this.coordinatorCoresLimitBox!.validationErrorMessage = loc.validationMin(this.coordinatorCoresLimitBox!.min!); this.coordinatorCoresLimitBox!.placeHolder = ''; this.coordinatorCoresLimitBox!.value = this.currentConfiguration.coordinatorCoresLimit; this.saveArgs.coordinatorCoresLimit = undefined; diff --git a/extensions/arc/src/ui/dashboards/postgres/postgresParameters.ts b/extensions/arc/src/ui/dashboards/postgres/postgresParameters.ts index 765ae4a5fa..0d81063e57 100644 --- a/extensions/arc/src/ui/dashboards/postgres/postgresParameters.ts +++ b/extensions/arc/src/ui/dashboards/postgres/postgresParameters.ts @@ -468,7 +468,6 @@ export abstract class PostgresParametersPage extends DashboardPage { readOnly: false, min: parseInt(engineSetting.min!), max: parseInt(engineSetting.max!), - validationErrorMessage: loc.outOfRange(engineSetting.min!, engineSetting.max!), inputType: 'number', value: engineSetting.value, width: '150px' @@ -492,7 +491,7 @@ export abstract class PostgresParametersPage extends DashboardPage { width: '15px', height: '15px', enabled: false, - title: loc.allowedValue(loc.rangeSetting(engineSetting.min!, engineSetting.max!)) + title: loc.rangeSetting(engineSetting.min!, engineSetting.max!) }).component(); valueContainer.addItem(information, { CSSStyles: { 'margin-left': '5px' } }); } diff --git a/extensions/sql-database-projects/src/common/constants.ts b/extensions/sql-database-projects/src/common/constants.ts index e1f9d35b99..2434ca5c3e 100644 --- a/extensions/sql-database-projects/src/common/constants.ts +++ b/extensions/sql-database-projects/src/common/constants.ts @@ -146,8 +146,6 @@ export const missingVersion = localize('missingVersion', "Missing 'version' entr export const unrecognizedDataSourcesVersion = localize('unrecognizedDataSourcesVersion', "Unrecognized version: "); export const unknownDataSourceType = localize('unknownDataSourceType', "Unknown data source type: "); export const invalidSqlConnectionString = localize('invalidSqlConnectionString', "Invalid SQL connection string"); -export const projectNameRequired = localize('projectNameRequired', "Name is required to create a new database project."); -export const projectLocationRequired = localize('projectLocationRequired', "Location is required to create a new database project."); export const extractTargetRequired = localize('extractTargetRequired', "Target information for extract is required to create database project."); export const schemaCompareNotInstalled = localize('schemaCompareNotInstalled', "Schema compare extension installation is required to run schema compare"); export const buildFailedCannotStartSchemaCompare = localize('buildFailedCannotStartSchemaCompare', "Schema compare could not start because build failed"); diff --git a/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts b/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts index a1b4023c30..1053f6714e 100644 --- a/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts +++ b/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts @@ -249,8 +249,7 @@ export class CreateProjectFromDatabaseDialog { ariaLabel: constants.projectNamePlaceholderText, placeHolder: constants.projectNamePlaceholderText, required: true, - width: cssStyles.createProjectFromDatabaseTextboxWidth, - validationErrorMessage: constants.projectNameRequired + width: cssStyles.createProjectFromDatabaseTextboxWidth }).component(); this.projectNameTextBox.onTextChanged(() => { @@ -278,8 +277,7 @@ export class CreateProjectFromDatabaseDialog { value: '', ariaLabel: constants.projectLocationLabel, placeHolder: constants.projectLocationPlaceholderText, - width: cssStyles.createProjectFromDatabaseTextboxWidth, - validationErrorMessage: constants.projectLocationRequired + width: cssStyles.createProjectFromDatabaseTextboxWidth }).component(); this.projectLocationTextBox.onTextChanged(() => {