Skip to content

Commit 70a766e

Browse files
author
Noam Kfir
committed
Move start time logic to insight tab and handle error messages better
1 parent 597b70b commit 70a766e

File tree

3 files changed

+19
-36
lines changed

3 files changed

+19
-36
lines changed

src/views/codeAnalytics/InsightListView/Actions/SetCustomStartTimeAction.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/views/codeAnalytics/codeAnalyticsView.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { DigmaCommands } from "../../commands";
3333
import { EnvSelectStatusBar } from "./StatusBar/envSelectStatusBar";
3434
import { AnalyticsCodeLens } from "../../analyticsCodeLens";
3535
import { CodeObjectInfo, MinimalCodeObjectInfo, EmptyCodeObjectInfo } from "../../services/codeObject";
36-
import { SetCustomStartTimeAction } from "./InsightListView/Actions/SetCustomStartTimeAction";
3736
import { Action } from "./InsightListView/Actions/Action";
3837
//import { DigmaFileDecorator } from "../../decorators/fileDecorator";
3938

src/views/codeAnalytics/insightsViewTab.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export class InsightsViewTab implements ICodeAnalyticsViewTab
3636
private _viewUris: WebViewUris,
3737
private _noCodeObjectsMessage: NoCodeObjectMessage,
3838
private _workspaceState: WorkspaceState,
39-
private _noEnvironmentSelectedMessage: NoEnvironmentSelectedMessage) { }
39+
private _noEnvironmentSelectedMessage: NoEnvironmentSelectedMessage,
40+
) {
41+
this._channel.consume(UiMessage.Notify.SetInsightCustomStartTime, this.onSetInsightCustomStartTime.bind(this));
42+
}
4043

4144

4245
onRefreshRequested(codeObject: CodeObjectInfo): void {
@@ -214,4 +217,19 @@ export class InsightsViewTab implements ICodeAnalyticsViewTab
214217
215218
`;
216219
}
220+
221+
private async onSetInsightCustomStartTime(event: UiMessage.Notify.SetInsightCustomStartTime) {
222+
if (event.codeObjectId && event.insightType && event.time) {
223+
try {
224+
await this._analyticsProvider.setInsightCustomStartTime(
225+
event.codeObjectId,
226+
event.insightType,
227+
event.time,
228+
);
229+
}
230+
catch(error) {
231+
this.showError(error);
232+
}
233+
}
234+
}
217235
}

0 commit comments

Comments
 (0)