Convert handleViewCsvAlerts to use createSingleSelectionCommand
This commit is contained in:
@@ -284,7 +284,10 @@ export class QueryHistoryManager extends DisposableObject {
|
|||||||
this.handleViewCsvResults.bind(this),
|
this.handleViewCsvResults.bind(this),
|
||||||
"query",
|
"query",
|
||||||
),
|
),
|
||||||
"codeQLQueryHistory.viewCsvAlerts": this.handleViewCsvAlerts.bind(this),
|
"codeQLQueryHistory.viewCsvAlerts": createSingleSelectionCommand(
|
||||||
|
this.handleViewCsvAlerts.bind(this),
|
||||||
|
"query",
|
||||||
|
),
|
||||||
"codeQLQueryHistory.viewSarifAlerts": createSingleSelectionCommand(
|
"codeQLQueryHistory.viewSarifAlerts": createSingleSelectionCommand(
|
||||||
this.handleViewSarifAlerts.bind(this),
|
this.handleViewSarifAlerts.bind(this),
|
||||||
"query",
|
"query",
|
||||||
@@ -873,22 +876,14 @@ export class QueryHistoryManager extends DisposableObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleViewCsvAlerts(
|
async handleViewCsvAlerts(item: QueryHistoryInfo) {
|
||||||
singleItem: QueryHistoryInfo,
|
if (item.t !== "local" || !item.completedQuery) {
|
||||||
multiSelect: QueryHistoryInfo[] | undefined,
|
|
||||||
) {
|
|
||||||
// Local queries only
|
|
||||||
if (
|
|
||||||
!this.assertSingleQuery(multiSelect) ||
|
|
||||||
singleItem.t !== "local" ||
|
|
||||||
!singleItem.completedQuery
|
|
||||||
) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await tryOpenExternalFile(
|
await tryOpenExternalFile(
|
||||||
this.app.commands,
|
this.app.commands,
|
||||||
await singleItem.completedQuery.query.ensureCsvAlerts(
|
await item.completedQuery.query.ensureCsvAlerts(
|
||||||
this.qs.cliServer,
|
this.qs.cliServer,
|
||||||
this.dbm,
|
this.dbm,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user