Skip to content

Commit 9599374

Browse files
authored
fix(ui): fix link with log line (#5206)
* fix: loading logs * fix(ui): link with job line
1 parent d4d7ca7 commit 9599374

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

ui/src/app/views/workflow/run/node/pipeline/node.pipeline.component.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ export class WorkflowRunNodePipelineComponent implements OnInit, OnDestroy {
6161
}
6262

6363
ngOnInit() {
64-
this.queryParamsSub = this._route.queryParams.subscribe((queryParams) => {
65-
this.updateSelectedItems(queryParams);
66-
});
6764
this.nodeJobRunSubs = this.nodeJobRun$.subscribe(rj => {
6865
if (!rj && !this.currentJob) {
6966
return;
@@ -102,12 +99,6 @@ export class WorkflowRunNodePipelineComponent implements OnInit, OnDestroy {
10299
});
103100
}
104101

105-
updateSelectedItems(queryParams) {
106-
if (queryParams['actionId']) {
107-
this.selectJob(queryParams['actionId']);
108-
}
109-
}
110-
111102
selectedJobManual(jobID: number) {
112103
if (!this.mapJobStatus.has(jobID)) {
113104
return;
@@ -157,11 +148,14 @@ export class WorkflowRunNodePipelineComponent implements OnInit, OnDestroy {
157148
{ status: rj.status, warnings, start: rj.start, done: rj.done });
158149
}
159150

160-
if (!currentNodeJobRun && sIndex === 0 && rjIndex === 0) {
151+
if (!currentNodeJobRun && sIndex === 0 && rjIndex === 0 && !this._route.snapshot.queryParams['actionId']) {
161152
refresh = true;
162153
this.selectJob(s.jobs[0].pipeline_action_id);
163154
} else if (currentNodeJobRun && currentNodeJobRun.job.pipeline_action_id === this.currentJob.pipeline_action_id) {
164155
this.selectJob(this.currentJob.pipeline_action_id);
156+
} else if (this._route.snapshot.queryParams['actionId'] &&
157+
this._route.snapshot.queryParams['actionId'] === rj.job.pipeline_action_id.toString()) {
158+
this.selectJob(rj.job.pipeline_action_id);
165159
}
166160
});
167161
}

ui/src/app/views/workflow/run/node/pipeline/step/step.log.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ export class WorkflowStepLogComponent implements OnInit, OnDestroy {
141141
let activeStep = parseInt(qps['stageId'], 10) === this.job.pipeline_stage_id &&
142142
parseInt(qps['actionId'], 10) === this.job.pipeline_action_id && parseInt(qps['stepOrder'], 10) === this.stepOrder;
143143
if (activeStep) {
144-
this.showLogs = true;
145144
this.selectedLine = parseInt(qps['line'], 10);
145+
if (!this.showLogs) {
146+
this.toggleLogs();
147+
}
146148
} else {
147149
this.selectedLine = null;
148150
}
@@ -343,7 +345,6 @@ export class WorkflowStepLogComponent implements OnInit, OnDestroy {
343345
stepOrder: this.stepOrder,
344346
line: lineNumber
345347
});
346-
let fragment = 'L' + this.job.pipeline_stage_id + '-' + this.job.pipeline_action_id + '-' + this.stepOrder + '-' + lineNumber;
347348
this._router.navigate([
348349
'project',
349350
this._store.selectSnapshot(ProjectState.projectSnapshot).key,
@@ -353,6 +354,6 @@ export class WorkflowStepLogComponent implements OnInit, OnDestroy {
353354
(<WorkflowStateModel>this._store.selectSnapshot(WorkflowState)).workflowNodeRun.num,
354355
'node',
355356
(<WorkflowStateModel>this._store.selectSnapshot(WorkflowState)).workflowNodeRun.id
356-
], { queryParams: qps, fragment });
357+
], { queryParams: qps });
357358
}
358359
}

0 commit comments

Comments
 (0)