Skip to content

Commit

Permalink
Automatically switch to the trace explorer view after opening a trace.
Browse files Browse the repository at this point in the history
Signed-off-by: Ankush Tyagi <ankush.tyagi@ericsson.com>
  • Loading branch information
ankusht-work authored and PatrickTasse committed Mar 19, 2021
1 parent 5108f13 commit 5e72e4e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ThemeService } from '@theia/core/lib/browser/theming';
import { signalManager, Signals } from '@trace-viewer/base/lib/signal-manager';
import { OutputAddedSignalPayload } from '../trace-explorer/output-added-signal-payload';
import { TraceExplorerWidget } from '../trace-explorer/trace-explorer-widget';
import { TraceExplorerContribution } from '../trace-explorer/trace-explorer-contribution';

export const TraceViewerWidgetOptions = Symbol('TraceViewerWidgetOptions');
export interface TraceViewerWidgetOptions {
Expand Down Expand Up @@ -53,6 +54,7 @@ export class TraceViewerWidget extends ReactWidget {
@inject(ApplicationShell) protected readonly shell: ApplicationShell;
@inject(TheiaMessageManager) protected readonly _signalHandler: TheiaMessageManager;
@inject(MessageService) protected readonly messageService: MessageService;
@inject(TraceExplorerContribution) protected readonly traceExplorerContribution: TraceExplorerContribution;

@postConstruct()
async init(): Promise<void> {
Expand Down Expand Up @@ -88,7 +90,7 @@ export class TraceViewerWidget extends ReactWidget {
this.title.label = 'Trace: ' + experiment.name;
this.id = experiment.UUID;
this.experimentManager.addExperiment(experiment);
signalManager().emit(Signals.EXPERIMENT_OPENED, {experiment: experiment});
signalManager().emit(Signals.EXPERIMENT_OPENED, { experiment: experiment });
if (this.isVisible) {
this.explorerWidget.onOpenedTracesWidgetActivated(experiment);
}
Expand Down Expand Up @@ -205,6 +207,10 @@ export class TraceViewerWidget extends ReactWidget {
if (this.isVisible) {
this.explorerWidget.onOpenedTracesWidgetActivated(experiment);
}
this.traceExplorerContribution.openView({
toggle: true,
activate: true
});
}
// Check if there are any invalid traces and display the warning message with the names of the invalid traces if any.
if (Array.isArray(invalidTraces) && invalidTraces.length) {
Expand Down

0 comments on commit 5e72e4e

Please sign in to comment.