Remove unused 'SettingSearch' issue type

This commit is contained in:
Rachel Macfarlane
2020-09-11 10:21:13 -07:00
parent 5c76fc51e0
commit 07ad5d6f18
4 changed files with 8 additions and 136 deletions

View File

@@ -23,7 +23,7 @@ import { localize } from 'vs/nls';
import { isRemoteDiagnosticError, SystemInfo } from 'vs/platform/diagnostics/common/diagnostics';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IMainProcessService, MainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
import { ISettingsSearchIssueReporterData, IssueReporterData, IssueReporterExtensionData, IssueReporterFeatures, IssueReporterStyles, IssueType } from 'vs/platform/issue/common/issue';
import { IssueReporterData, IssueReporterExtensionData, IssueReporterFeatures, IssueReporterStyles, IssueType } from 'vs/platform/issue/common/issue';
import { IWindowConfiguration } from 'vs/platform/windows/common/windows';
const MAX_URL_LENGTH = 2045;
@@ -148,10 +148,6 @@ export class IssueReporter extends Disposable {
applyZoom(configuration.data.zoomLevel);
this.applyStyles(configuration.data.styles);
this.handleExtensionData(configuration.data.enabledExtensions);
if (configuration.data.issueType === IssueType.SettingsSearchIssue) {
this.handleSettingsSearchData(<ISettingsSearchIssueReporterData>configuration.data);
}
}
render(): void {
@@ -244,7 +240,7 @@ export class IssueReporter extends Disposable {
content.push(`.monaco-text-button:not(.disabled):hover, .monaco-text-button:focus { background-color: ${styles.buttonHoverBackground} !important; }`);
}
styleTag.innerHTML = content.join('\n');
styleTag.textContent = content.join('\n');
document.head.appendChild(styleTag);
document.body.style.color = styles.color || '';
}
@@ -266,39 +262,6 @@ export class IssueReporter extends Disposable {
this.updateExtensionSelector(installedExtensions);
}
private handleSettingsSearchData(data: ISettingsSearchIssueReporterData): void {
this.issueReporterModel.update({
actualSearchResults: data.actualSearchResults,
query: data.query,
filterResultCount: data.filterResultCount
});
this.updateSearchedExtensionTable(data.enabledExtensions);
this.updateSettingsSearchDetails(data);
}
private updateSettingsSearchDetails(data: ISettingsSearchIssueReporterData): void {
const target = document.querySelector<HTMLElement>('.block-settingsSearchResults .block-info');
if (target) {
const queryDiv = $<HTMLDivElement>('div', undefined, `Query: "${data.query}"` as string);
const countDiv = $<HTMLElement>('div', undefined, `Literal match count: ${data.filterResultCount}` as string);
const detailsDiv = $<HTMLDivElement>('.block-settingsSearchResults-details', undefined, queryDiv, countDiv);
const table = $('table', undefined,
$('tr', undefined,
$('th', undefined, 'Setting'),
$('th', undefined, 'Extension'),
$('th', undefined, 'Score'),
),
...data.actualSearchResults.map(setting => $('tr', undefined,
$('td', undefined, setting.key),
$('td', undefined, setting.extensionId),
$('td', undefined, String(setting.score).slice(0, 5)),
))
);
reset(target, detailsDiv, table);
}
}
private initServices(configuration: IssueReporterConfiguration): void {
const serviceCollection = new ServiceCollection();
const mainProcessService = new MainProcessService(configuration.windowId);
@@ -498,10 +461,6 @@ export class IssueReporter extends Disposable {
return true;
}
if (issueType === IssueType.SettingsSearchIssue) {
return true;
}
return false;
}
@@ -668,16 +627,11 @@ export class IssueReporter extends Disposable {
const typeSelect = this.getElementById('issue-type')! as HTMLSelectElement;
const { issueType } = this.issueReporterModel.getData();
if (issueType === IssueType.SettingsSearchIssue) {
reset(typeSelect, makeOption(IssueType.SettingsSearchIssue, localize('settingsSearchIssue', "Settings Search Issue")));
typeSelect.disabled = true;
} else {
reset(typeSelect,
makeOption(IssueType.Bug, localize('bugReporter', "Bug Report")),
makeOption(IssueType.FeatureRequest, localize('featureRequest', "Feature Request")),
makeOption(IssueType.PerformanceIssue, localize('performanceIssue', "Performance Issue"))
);
}
reset(typeSelect,
makeOption(IssueType.Bug, localize('bugReporter', "Bug Report")),
makeOption(IssueType.FeatureRequest, localize('featureRequest', "Feature Request")),
makeOption(IssueType.PerformanceIssue, localize('performanceIssue', "Performance Issue"))
);
typeSelect.value = issueType.toString();
@@ -791,13 +745,6 @@ export class IssueReporter extends Disposable {
if (fileOnExtension) {
show(extensionSelector);
}
} else if (issueType === IssueType.SettingsSearchIssue) {
show(blockContainer);
show(searchedExtensionsBlock);
show(settingsSearchResultsBlock);
reset(descriptionTitle, localize('expectedResults', "Expected Results"), $('span.required-input', undefined, '*'));
reset(descriptionSubtitle, localize('settingsSearchResultsDescription', "Please list the results that you were expecting to see when you searched with this query. We support GitHub-flavored Markdown. You will be able to edit your issue and add screenshots when we preview it on GitHub."));
}
}
@@ -1135,20 +1082,6 @@ export class IssueReporter extends Disposable {
}
}
private updateSearchedExtensionTable(extensions: IssueReporterExtensionData[]): void {
const target = document.querySelector<HTMLElement>('.block-searchedExtensions .block-info');
if (target) {
if (!extensions.length) {
target.innerText = 'Extensions: none';
return;
}
const table = this.getExtensionTableHtml(extensions);
target.innerText = '';
target.appendChild(table);
}
}
private getExtensionTableHtml(extensions: IssueReporterExtensionData[]): HTMLTableElement {
return $('table', undefined,
$('tr', undefined,

View File

@@ -102,8 +102,6 @@ ${this.getInfos()}
return 'Bug';
} else if (this._data.issueType === IssueType.PerformanceIssue) {
return 'Performance Issue';
} else if (this._data.issueType === IssueType.SettingsSearchIssue) {
return 'Settings Search Issue';
} else {
return 'Feature Request';
}
@@ -135,17 +133,6 @@ ${this.getInfos()}
}
}
if (this._data.issueType === IssueType.SettingsSearchIssue) {
if (this._data.includeSearchedExtensions) {
info += this.generateExtensionsMd();
}
if (this._data.includeSettingsSearchDetails) {
info += this.generateSettingSearchResultsMd();
info += '\n' + this.generateSettingsSearchResultDetailsMd();
}
}
return info;
}
@@ -243,35 +230,6 @@ ${tableHeader}
${table}
${themeExclusionStr}
</details>`;
}
private generateSettingsSearchResultDetailsMd(): string {
return `
Query: ${this._data.query}
Literal matches: ${this._data.filterResultCount}`;
}
private generateSettingSearchResultsMd(): string {
if (!this._data.actualSearchResults) {
return '';
}
if (!this._data.actualSearchResults.length) {
return `No fuzzy results`;
}
const tableHeader = `Setting|Extension|Score
---|---|---`;
const table = this._data.actualSearchResults.map(setting => {
return `${setting.key}|${setting.extensionId}|${String(setting.score).slice(0, 5)}`;
}).join('\n');
return `<details><summary>Results</summary>
${tableHeader}
${table}
</details>`;
}
}

View File

@@ -218,16 +218,5 @@ Remote OS version: Linux x64 4.18.0
assert.equal(issueReporterModel.fileOnExtension(), true);
});
[
IssueType.SettingsSearchIssue
].forEach(type => {
const issueReporterModel = new IssueReporterModel({
issueType: type,
fileOnExtension: true
});
assert.equal(issueReporterModel.fileOnExtension(), false);
});
});
});