This commit is contained in:
Nora 2023-01-25 09:46:33 +00:00
Родитель ec9b5fe1d3
Коммит 0936185d2f
3 изменённых файлов: 6 добавлений и 38 удалений

Просмотреть файл

@ -1,16 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="7" stroke="#959DA5"/>
<mask id="mask0_394_2982" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="15" height="15">
<circle cx="7.5" cy="7.5" r="7.5" fill="#C4C4C4"/>
</mask>
<g mask="url(#mask0_394_2982)">
<path d="M14.5 7.5C14.5 9.42971 13.6822 11.1907 12.5493 12.4721C11.4035 13.7683 10.0054 14.5 8.90625 14.5C7.84644 14.5 6.81131 13.8113 6.01569 12.5383C5.22447 11.2724 4.71875 9.49235 4.71875 7.5C4.71875 5.50765 5.22447 3.72765 6.01569 2.4617C6.81131 1.1887 7.84644 0.5 8.90625 0.5C10.0054 0.5 11.4035 1.23172 12.5493 2.52786C13.6822 3.80934 14.5 5.57029 14.5 7.5Z" stroke="#959DA5"/>
</g>
<mask id="mask1_394_2982" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="1" y="0" width="16" height="15">
<circle cx="9.375" cy="7.5" r="7.5" fill="#C4C4C4"/>
</mask>
<g mask="url(#mask1_394_2982)">
<path d="M10.2812 7.5C10.2812 9.49235 9.77553 11.2724 8.98431 12.5383C8.18869 13.8113 7.15356 14.5 6.09375 14.5C4.99456 14.5 3.5965 13.7683 2.45067 12.4721C1.31781 11.1907 0.5 9.42971 0.5 7.5C0.5 5.57029 1.31781 3.80934 2.45067 2.52786C3.5965 1.23172 4.99456 0.5 6.09375 0.5C7.15356 0.5 8.18869 1.1887 8.98431 2.4617C9.77553 3.72765 10.2812 5.50765 10.2812 7.5Z" stroke="#959DA5"/>
</g>
<line y1="7.5" x2="15" y2="7.5" stroke="#959DA5"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Просмотреть файл

@ -8,6 +8,7 @@ import {
ExtensionContext,
ProviderResult,
Range,
ThemeColor,
ThemeIcon,
TreeDataProvider,
TreeItem,
@ -101,11 +102,6 @@ const SHOW_QUERY_TEXT_QUICK_EVAL_MSG = `\
`;
/**
* Path to icon to display next to a successful remote run.
*/
const REMOTE_SUCCESS_QUERY_HISTORY_ITEM_ICON = "media/globe.svg";
export enum SortOrder {
NameAsc = "NameAsc",
NameDesc = "NameDesc",
@ -148,19 +144,10 @@ export class HistoryTreeDataProvider
private history: QueryHistoryInfo[] = [];
private remoteSuccessIconPath: string;
private current: QueryHistoryInfo | undefined;
constructor(
extensionPath: string,
private readonly labelProvider: HistoryItemLabelProvider,
) {
constructor(private readonly labelProvider: HistoryItemLabelProvider) {
super();
this.remoteSuccessIconPath = join(
extensionPath,
REMOTE_SUCCESS_QUERY_HISTORY_ITEM_ICON,
);
}
async getTreeItem(element: QueryHistoryInfo): Promise<TreeItem> {
@ -189,10 +176,10 @@ export class HistoryTreeDataProvider
if (element.t === "local") {
return new ThemeIcon("database");
} else {
return this.remoteSuccessIconPath;
return new ThemeIcon("cloud");
}
case QueryStatus.Failed:
return new ThemeIcon("error");
return new ThemeIcon("error", new ThemeColor("errorForeground"));
default:
assertNever(element.status);
}
@ -402,7 +389,7 @@ export class QueryHistoryManager extends DisposableObject {
);
this.treeDataProvider = this.push(
new HistoryTreeDataProvider(ctx.extensionPath, this.labelProvider),
new HistoryTreeDataProvider(this.labelProvider),
);
this.treeView = this.push(
window.createTreeView("codeQLQueryHistory", {

Просмотреть файл

@ -1652,10 +1652,7 @@ describe("query-history", () => {
labelProvider = new HistoryItemLabelProvider({
/**/
} as QueryHistoryConfig);
historyTreeDataProvider = new HistoryTreeDataProvider(
vscode.Uri.file(mockExtensionLocation).fsPath,
labelProvider,
);
historyTreeDataProvider = new HistoryTreeDataProvider(labelProvider);
});
afterEach(() => {