Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: Improve visibility of 'User error' messages #1960

Merged
merged 7 commits into from
Apr 27, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ <h5>
<lib-executions-timeline
*ngIf="!loadingExecutions"
[jobExecutions]="jobExecutions"
[showErrorMessage]="true"
[next]="
(jobState?.deployments | extractJobStatus) ===
'Enabled'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ hr {

margin-bottom: 1rem;

.form-section-readonly {
word-break: break-word;
}

.data-pipelines-job__section--border-none {
border: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
isJobMessageDifferentFromStatus()
"
>
<clr-signpost-content
[clrPosition]="'right-middle'"
*clrIfOpen="clrOpen"
>
<clr-signpost-content [clrPosition]="'right-middle'" *clrIfOpen>
{{ jobMessage }}
<vdk-copy-to-clipboard-button
[tooltip]="'Copy to clipboard'"
Expand All @@ -29,10 +26,19 @@
></vdk-copy-to-clipboard-button>
</clr-signpost-content>
</div>
<span
class="job-execution-status__text"
data-cy="data-pipelines-job-executions-status-filters"
clrSignpostTrigger
>{{ executionStatusProperties.text }}
</span>
<div class="job-execution-status__container">
<span
class="job-execution-status__text"
data-cy="data-pipelines-job-executions-status-filters"
clrSignpostTrigger
>{{ executionStatusProperties.text }}
</span>
<button
*ngIf="showErrorMessage && isJobStatusSuitableForMessageTooltip() && isJobMessageDifferentFromStatus()"
class="btn btn-link btn-icon btn-sm job-execution-status__btn"
clrSignpostTrigger
>
details
</button>
</div>
</clr-signpost>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@
* SPDX-License-Identifier: Apache-2.0
*/

.job-execution-status__text {
margin-left: 0.25rem;
.job-execution-status__container {
display: flex;
align-items: baseline;
flex-direction: column;

.job-execution-status__text {
margin-left: 0.25rem;
}

.job-execution-status__btn {
padding: 0;
margin-left: 5px;
text-transform: lowercase;
font-size: 12px;
outline-color: transparent;
}
}

:host {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ type StatusPropertiesMapping = {
styleUrls: ['./data-job-execution-status.component.scss']
})
export class DataJobExecutionStatusComponent {
@HostListener('mouseenter') onMouseEnter(): void {
this.clrOpen = true;
}

@HostListener('mouseleave') onMouseLeave(): void {
this.clrOpen = false;
}

@Input() jobStatus: DataJobExecutionStatus;
@Input() jobMessage = '';
@Input() showErrorMessage = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@
<lib-data-job-execution-status
*ngIf="getJobStatus(job)"
[jobStatus]="getJobStatus(job)"
[showErrorMessage]="true"
></lib-data-job-execution-status>
</clr-dg-cell>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class DataJobsApiService extends TaurusBaseApiService<DataJobsApiService>
id
status
logsUrl
message
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@

<div class="clr-timeline-step-description">
<div class="clr-timeline__element--display-block">
<span
*ngIf="showErrorMessage && isJobStatusSuitableForMessageTooltip(execution) && isJobMessageDifferentFromStatus(execution)"
>
{{ execution.message}}
<br />
</span>
<span>Duration: </span>
<span
class="clr-timeline__duration-tag"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@

.clr-timeline__element--display-block {
display: block;
width: 200px;

span {
word-break: break-word;
}
}

.clr-timeline__duration-tag {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class ExecutionsTimelineComponent {

@Input() jobExecutions: DataJobExecutions = [];
@Input() next: Date = null;
@Input() showErrorMessage = false;

dataJobExecutionStatus = DataJobExecutionStatus;

Expand Down Expand Up @@ -55,4 +56,17 @@ export class ExecutionsTimelineComponent {

return `${ExecutionsTimelineComponent.manualRunKnownUser} ${user}`;
}

isJobStatusSuitableForMessageTooltip(execution: DataJobExecution): boolean {
return (
execution.status === DataJobExecutionStatus.PLATFORM_ERROR ||
execution.status === DataJobExecutionStatus.USER_ERROR ||
execution.status === DataJobExecutionStatus.SKIPPED
);
}

isJobMessageDifferentFromStatus(execution: DataJobExecution): boolean {
const message = execution.message?.toLowerCase();
return message !== 'user error' && message !== 'platform error' && message !== 'skipped' && message !== '';
}
}