mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
adds limit on issue reporter description (#208346)
This commit is contained in:
parent
774f610801
commit
adfa191fec
|
@ -83,6 +83,7 @@ export default (): string => `
|
|||
<textarea name="description" id="description" placeholder="${escape(localize('details', "Please enter details."))}" required></textarea>
|
||||
</div>
|
||||
<div id="description-empty-error" class="validation-error hidden" role="alert">${escape(localize('descriptionEmptyValidation', "A description is required."))}</div>
|
||||
<div id="description-short-error" class="validation-error hidden" role="alert">${escape(localize('descriptionTooShortValidation', "Please provide a longer description."))}</div>
|
||||
</div>
|
||||
|
||||
<div class="system-info" id="block-container">
|
||||
|
|
|
@ -924,13 +924,24 @@ export class IssueReporter extends Disposable {
|
|||
private validateInput(inputId: string): boolean {
|
||||
const inputElement = (<HTMLInputElement>this.getElementById(inputId));
|
||||
const inputValidationMessage = this.getElementById(`${inputId}-empty-error`);
|
||||
const descriptionShortMessage = this.getElementById(`description-short-error`);
|
||||
if (!inputElement.value) {
|
||||
inputElement.classList.add('invalid-input');
|
||||
inputValidationMessage?.classList.remove('hidden');
|
||||
descriptionShortMessage?.classList.add('hidden');
|
||||
return false;
|
||||
} else {
|
||||
} else if (inputId === 'description' && inputElement.value.length < 10) {
|
||||
inputElement.classList.add('invalid-input');
|
||||
descriptionShortMessage?.classList.remove('hidden');
|
||||
inputValidationMessage?.classList.add('hidden');
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
inputElement.classList.remove('invalid-input');
|
||||
inputValidationMessage?.classList.add('hidden');
|
||||
if (inputId === 'description') {
|
||||
descriptionShortMessage?.classList.add('hidden');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue