mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
Issue Reporter: display message if url length exceeds limits, #42603
This commit is contained in:
@@ -435,7 +435,18 @@ export class IssueReporter extends Disposable {
|
||||
const queryStringPrefix = product.reportIssueUrl.indexOf('?') === -1 ? '?' : '&';
|
||||
const baseUrl = `${product.reportIssueUrl}${queryStringPrefix}title=${issueTitle}&body=`;
|
||||
const issueBody = this.issueReporterModel.serialize();
|
||||
shell.openExternal(baseUrl + encodeURIComponent(issueBody));
|
||||
const url = baseUrl + encodeURIComponent(issueBody);
|
||||
|
||||
const lengthValidationElement = document.getElementById('url-length-validation-error');
|
||||
if (url.length > 2081) {
|
||||
lengthValidationElement.textContent = localize('urlLengthError', "The data exceeds the length limit of 2081. The data is length {0}.", url.length);
|
||||
show(lengthValidationElement);
|
||||
return false;
|
||||
} else {
|
||||
hide(lengthValidationElement);
|
||||
}
|
||||
|
||||
shell.openExternal(url);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user