Report specific filter issue through a template

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1541#issuecomment-966697347
This commit is contained in:
Raymond Hill 2021-11-12 09:11:28 -05:00
parent dea7184f30
commit e1c386515a
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 7 additions and 31 deletions

View File

@ -183,36 +183,12 @@ function reportSpecificFilterType() {
}
function reportSpecificFilterIssue(ev) {
const bodyTemplate = [
'## Address of the web page',
'',
'`{{url}}`',
'',
'## Type of issue',
'',
'{{type}}',
'',
'## Description (when issue is not obvious)',
'',
'[none]',
'',
'## Screenshot (when description is difficult)',
'',
'[none]',
'',
'## Configuration',
'',
'{{configuration}}',
].join('\n');
const githubURL = new URL('https://github.com/uBlockOrigin/uAssets/issues/new');
const issueType = document.querySelector('[data-i18n="supportS6Select1"] ~ select').value;
const title = `${reportSpecificFilterHostname()}: ${reportSpecificFilterType()}`;
const body = bodyTemplate
.replace('{{url}}', reportURL.href)
.replace('{{type}}', issueType)
.replace('{{configuration}}', configToMarkdown(false));
githubURL.searchParams.set('title', title);
githubURL.searchParams.set('body', body);
const githubURL = new URL('https://github.com/uBlockOrigin/uAssets/issues/new?template=specific_report_from_ubo.yml');
const issueType = reportSpecificFilterType();
githubURL.searchParams.set('title', `${reportSpecificFilterHostname()}: ${issueType}`);
githubURL.searchParams.set('url_address_of_the_web_page', '`' + reportURL.href + '`');
githubURL.searchParams.set('category', issueType);
githubURL.searchParams.set('configuration', configToMarkdown(false));
vAPI.messaging.send('default', {
what: 'gotoURL',
details: { url: githubURL.href, select: true, index: -1 },

View File

@ -50,7 +50,7 @@
<p data-i18n="supportS3P3">
</div>
<div>
<button id="filterReport" type="button" data-url="https://github.com/uBlockOrigin/uAssets/issues/new?template=bug_report_from_ubo.yml" data-i18n="supportOpenButton"></button>
<button id="filterReport" type="button" data-url="https://github.com/uBlockOrigin/uAssets/issues/new?template=report_from_ubo.yml" data-i18n="supportOpenButton"></button>
</div>
</div>
<hr>