Tidy up some functions in the model evaluator (#3529)
* Rename model evaluator's updateVariantAnalysis -> setVariantAnalysis * Merge updateRepoResults and updateReposResults into single setReposResults function
This commit is contained in:
@@ -58,7 +58,7 @@ export class ModelAlertsView extends AbstractWebview<
|
||||
|
||||
await this.waitForPanelLoaded();
|
||||
await this.setViewState();
|
||||
await this.updateReposResults(reposResults);
|
||||
await this.setReposResults(reposResults);
|
||||
}
|
||||
|
||||
protected async getPanelConfig(): Promise<WebviewPanelConfig> {
|
||||
@@ -121,7 +121,7 @@ export class ModelAlertsView extends AbstractWebview<
|
||||
});
|
||||
}
|
||||
|
||||
public async updateVariantAnalysis(
|
||||
public async setVariantAnalysis(
|
||||
variantAnalysis: VariantAnalysis,
|
||||
): Promise<void> {
|
||||
if (!this.isShowingPanel) {
|
||||
@@ -134,20 +134,7 @@ export class ModelAlertsView extends AbstractWebview<
|
||||
});
|
||||
}
|
||||
|
||||
public async updateRepoResults(
|
||||
repositoryResult: VariantAnalysisScannedRepositoryResult,
|
||||
): Promise<void> {
|
||||
if (!this.isShowingPanel) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.postMessage({
|
||||
t: "setRepoResults",
|
||||
repoResults: [repositoryResult],
|
||||
});
|
||||
}
|
||||
|
||||
public async updateReposResults(
|
||||
public async setReposResults(
|
||||
repoResults: VariantAnalysisScannedRepositoryResult[],
|
||||
): Promise<void> {
|
||||
if (!this.isShowingPanel) {
|
||||
|
||||
@@ -155,7 +155,7 @@ export class ModelEvaluator extends DisposableObject {
|
||||
);
|
||||
await this.modelAlertsView.showView(reposResults);
|
||||
|
||||
await this.modelAlertsView.updateVariantAnalysis(variantAnalysis);
|
||||
await this.modelAlertsView.setVariantAnalysis(variantAnalysis);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ export class ModelEvaluator extends DisposableObject {
|
||||
});
|
||||
|
||||
// Update model alerts view
|
||||
await this.modelAlertsView?.updateVariantAnalysis(variantAnalysis);
|
||||
await this.modelAlertsView?.setVariantAnalysis(variantAnalysis);
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -295,7 +295,7 @@ export class ModelEvaluator extends DisposableObject {
|
||||
this.push(
|
||||
this.variantAnalysisManager.onRepoResultsLoaded(async (e) => {
|
||||
if (e.variantAnalysisId === variantAnalysisId) {
|
||||
await this.modelAlertsView?.updateRepoResults(e);
|
||||
await this.modelAlertsView?.setReposResults([e]);
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user