Remove unneeded validation error messages (#14531)

This commit is contained in:
Charles Gagnon
2021-03-04 09:50:57 -08:00
committed by GitHub
parent 8c04266ff4
commit 9c886dd80a
6 changed files with 3 additions and 27 deletions

View File

@@ -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)); }

View File

@@ -217,7 +217,6 @@ export class MiaaComputeAndStoragePage extends DashboardPage {
this.memoryLimitBox = this.modelView.modelBuilder.inputBox().withProperties<azdata.InputBoxProperties>({
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<azdata.InputBoxProperties>({
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;

View File

@@ -263,7 +263,6 @@ export class PostgresComputeAndStoragePage extends DashboardPage {
// Worker node count
this.workerBox = this.modelView.modelBuilder.inputBox().withProperties<azdata.InputBoxProperties>({
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<azdata.InputBoxProperties>({
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<azdata.InputBoxProperties>({
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<azdata.InputBoxProperties>({
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<azdata.InputBoxProperties>({
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;

View File

@@ -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' } });
}

View File

@@ -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");

View File

@@ -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(() => {