Skip to content

Commit 7ce1e2a

Browse files
author
ci bot
committed
Merge branch 'aarthy/gantt-time' into 'enterprise'
fix(ui): update time formats and add pipeline key to Gantt tooltip See merge request dkinternal/observability/dataops-observability!32
2 parents 157acd3 + aafa464 commit 7ce1e2a

File tree

12 files changed

+34
-51
lines changed

12 files changed

+34
-51
lines changed

observability_ui/apps/shell/src/app/projects/instances/instance-tests/instance-tests.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
<span headerLabel="start_time">Start Time</span>
184184
</ng-container>
185185
<ng-container *matCellDef="let test">
186-
<div dkTooltip="{{test.start_time | date: 'medium'}}">{{test.start_time | date: 'hh:mm:ss a'}}</div>
186+
<div dkTooltip="{{test.start_time | date: 'medium'}}">{{test.start_time | date: 'h:mm:ss a'}}</div>
187187
</ng-container>
188188
</ng-container>
189189
<ng-container matColumnDef="end_time"
@@ -193,7 +193,7 @@
193193
<span headerLabel="end_time">End Time</span>
194194
</ng-container>
195195
<ng-container *matCellDef="let test">
196-
<div dkTooltip="{{test.end_time | date: 'medium'}}">{{test.end_time | date: 'hh:mm:ss a'}}</div>
196+
<div dkTooltip="{{test.end_time | date: 'medium'}}">{{test.end_time | date: 'h:mm:ss a'}}</div>
197197
</ng-container>
198198
</ng-container>
199199
<ng-container matColumnDef="actions"

observability_ui/apps/shell/src/app/projects/instances/instance-timeline/instance-timeline.component.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
[start]="ganttStartDate$ | async"
1313
[end]="ganttEndDate$ | async"
1414
[nowBar]="instanceIsActive$ | async"
15-
[timeformat]="timeformat$ | async"
16-
[showDays]="spansMultipleDays$ | async">
15+
[timeformat]="timeformat$ | async">
1716

1817
<ng-template ganttLabel
1918
let-taskGroup="group">
@@ -49,8 +48,10 @@
4948
<ng-template #barTooltip>
5049
<div class="gantt-bar-tooltip">
5150
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--name">{{ run.pipeline.display_name }}</span>
51+
<span *ngIf="run.pipeline.key !== run.pipeline.display_name"
52+
class="gantt-bar-tooltip--line gantt-bar-tooltip--key">Key: {{ run.pipeline.key ?? '-' }}</span>
5253
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--status">{{ 'runStatus.' + run.status | translate }}</span>
53-
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--key">Key: {{ run.key ?? '-' }}</span>
54+
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--key">Run Key: {{ run.key ?? '-' }}</span>
5455
<span *ngIf="run.hasTime"
5556
class="gantt-bar-tooltip--line gantt-bar-tooltip--start">Start Time: {{ run.start_time | date: (timeformat$ | async) }}</span>
5657
<span *ngIf="run.hasTime && run.status !== 'RUNNING'"

observability_ui/apps/shell/src/app/projects/instances/instance-timeline/instance-timeline.component.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,11 @@ export class InstanceTimelineComponent implements OnInit, OnDestroy {
5656
map(([ start, end ]) => {
5757
const timespan = end.getTime() - start.getTime();
5858
if (timespan <= this.minTimespanInMilliseconds) {
59-
return 'hh:mm:ss a';
59+
return 'MMM d, h:mm:ss a';
6060
}
61-
return 'hh:mm a';
62-
}),
63-
startWith('hh:mm a'),
64-
);
65-
spansMultipleDays$ = combineLatest([ this.ganttStartDate$, this.ganttEndDate$ ]).pipe(
66-
map(([ start, end ]) => {
67-
return (end.getTime() - start.getTime()) > 24 * 60 * 60 * 1000;
61+
return 'MMM d, h:mm a';
6862
}),
63+
startWith('MMM d, h:mm a'),
6964
);
7065

7166
private minTimespanInMilliseconds: number = 1 * 60 * 1000;

observability_ui/apps/shell/src/app/projects/overview/overview.component.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,22 @@ <h1 class="page-title">{{ 'overview' | translate }}</h1>
145145
<span class="gantt-bar-tooltip--line">{{ instance.errorAlertsCount }}
146146
errors, {{ instance.warningAlertsCount }} warnings</span>
147147
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--runs">Total Runs: {{ instance.runsCount }}</span>
148-
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--start">Start Time: {{ instance.start_time | date:'MMM d, hh:mm a' }}</span>
148+
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--start">Start Time: {{ instance.start_time | date:'MMM d, h:mm a' }}</span>
149149
<span *ngIf="!instance.active"
150-
class="gantt-bar-tooltip--line gantt-bar-tooltip--end">End Time: {{ instance.end_time | date:'MMM d, hh:mm a' }}</span>
150+
class="gantt-bar-tooltip--line gantt-bar-tooltip--end">End Time: {{ instance.end_time | date:'MMM d, h:mm a' }}</span>
151151
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--duration">Duration: {{ instance.start_time | duration:instance.end_time }}</span>
152152
</ng-container>
153153

154154
<ng-container *ngIf="instance.status === 'UPCOMING'">
155155

156156
<span *ngIf="instance.expected_start_time"
157157
class="gantt-bar-tooltip--line gantt-bar-tooltip--start">
158-
Expected Start Time: {{ instance.start_time | date:'MMM d, hh:mm a' }}
158+
Expected Start Time: {{ instance.start_time | date:'MMM d, h:mm a' }}
159159
</span>
160160

161161
<span *ngIf="instance.expected_end_time"
162162
class="gantt-bar-tooltip--line gantt-bar-tooltip--end">
163-
Expected End Time: {{ instance.end_time | date:'MMM d, hh:mm a' }}
163+
Expected End Time: {{ instance.end_time | date:'MMM d, h:mm a' }}
164164
</span>
165165

166166
</ng-container>
@@ -246,22 +246,22 @@ <h1 class="page-title">{{ 'overview' | translate }}</h1>
246246
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--runs">{{ directive.value.active ? 'Active' : 'Ended' }}</span>
247247
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--status">{{ directive.value.errorAlertsCount }}
248248
errors, {{ directive.value.warningAlertsCount }} warnings</span>
249-
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--start">Start Time: {{ directive.value.start_time | date:'MMM d, hh:mm a' }}</span>
249+
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--start">Start Time: {{ directive.value.start_time | date:'MMM d, h:mm a' }}</span>
250250
<span *ngIf="!directive.value.active"
251-
class="gantt-bar-tooltip--line gantt-bar-tooltip--end">End Time: {{ directive.value.end_time | date:'MMM d, hh:mm a' }}</span>
251+
class="gantt-bar-tooltip--line gantt-bar-tooltip--end">End Time: {{ directive.value.end_time | date:'MMM d, h:mm a' }}</span>
252252
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--duration">Duration: {{ directive.value.start_time | duration:directive.value.end_time }}</span>
253253
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--runs">Total Runs: {{ directive.value.runsCount }}</span>
254254
</ng-container>
255255

256256
<ng-container *ngIf="directive.value.status === 'UPCOMING'">
257257
<span *ngIf="directive.value.expected_start_time"
258258
class="gantt-bar-tooltip--line gantt-bar-tooltip--start mt-2">
259-
Expected Start Time: {{ directive.value.start_time | date:'MMM d, hh:mm a' }}
259+
Expected Start Time: {{ directive.value.start_time | date:'MMM d, h:mm a' }}
260260
</span>
261261

262262
<span *ngIf="directive.value.expected_end_time"
263263
class="gantt-bar-tooltip--line gantt-bar-tooltip--end">
264-
Expected End Time: {{ directive.value.end_time | date:'MMM d, hh:mm a' }}
264+
Expected End Time: {{ directive.value.end_time | date:'MMM d, h:mm a' }}
265265
</span>
266266

267267
</ng-container>
@@ -290,9 +290,9 @@ <h1 class="page-title">{{ 'overview' | translate }}</h1>
290290
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--status">{{ 'runStatus.' + run.status | translate }}</span>
291291
<span class="gantt-bar-tooltip--line gantt-bar-tooltip--key">Key: {{ run.key ?? '-' }}</span>
292292
<span *ngIf="run.hasTime"
293-
class="gantt-bar-tooltip--line gantt-bar-tooltip--start">Start Time: {{ run.start_time | date: 'MMM d, hh:mm a' }}</span>
293+
class="gantt-bar-tooltip--line gantt-bar-tooltip--start">Start Time: {{ run.start_time | date: 'MMM d, h:mm a' }}</span>
294294
<span *ngIf="run.hasTime && run.status !== 'RUNNING'"
295-
class="gantt-bar-tooltip--line gantt-bar-tooltip--end">End Time: {{ run.end_time | date: 'MMM d, hh:mm a' }}</span>
295+
class="gantt-bar-tooltip--line gantt-bar-tooltip--end">End Time: {{ run.end_time | date: 'MMM d, h:mm a' }}</span>
296296
<span *ngIf="run.hasTime"
297297
class="gantt-bar-tooltip--line gantt-bar-tooltip--duration">Duration: {{ run.start_time | duration: (run.end_time ?? (now$ | async)) }}</span>
298298
</div>

observability_ui/apps/shell/src/app/projects/runs/run-tests/run-tests.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
<span headerLabel="start_time">Start Time</span>
166166
</ng-container>
167167
<ng-container *matCellDef="let test">
168-
<div dkTooltip="{{test.start_time | date: 'medium'}}">{{test.start_time | date: 'hh:mm:ss a'}}</div>
168+
<div dkTooltip="{{test.start_time | date: 'medium'}}">{{test.start_time | date: 'h:mm:ss a'}}</div>
169169
</ng-container>
170170
</ng-container>
171171
<ng-container matColumnDef="end_time"
@@ -175,7 +175,7 @@
175175
<span headerLabel="end_time">End Time</span>
176176
</ng-container>
177177
<ng-container *matCellDef="let test">
178-
<div dkTooltip="{{test.end_time | date: 'medium'}}">{{test.end_time | date: 'hh:mm:ss a'}}</div>
178+
<div dkTooltip="{{test.end_time | date: 'medium'}}">{{test.end_time | date: 'h:mm:ss a'}}</div>
179179
</ng-container>
180180
</ng-container>
181181
<ng-container matColumnDef="actions"

observability_ui/apps/shell/src/app/projects/runs/run-timeline/run-timeline.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
[start]="ganttStartDate$ | async"
1313
[end]="ganttEndDate$ | async"
1414
[nowBar]="(run$ | async)?.active"
15-
[timeformat]="timeformat$ | async"
16-
[showDays]="spansMultipleDays$ | async">
15+
[timeformat]="timeformat$ | async">
1716

1817
<ng-template ganttLabel
1918
let-taskGroup="group">

observability_ui/apps/shell/src/app/projects/runs/run-timeline/run-timeline.component.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,11 @@ export class RunTimelineComponent implements OnInit, OnDestroy {
6060
map(([ start, end ]) => {
6161
const timespan = end.getTime() - start.getTime();
6262
if (timespan <= this.minTimespanInMilliseconds) {
63-
return 'hh:mm:ss a';
63+
return 'MMM d, h:mm:ss a';
6464
}
65-
return 'hh:mm a';
66-
}),
67-
startWith('hh:mm a'),
68-
);
69-
spansMultipleDays$ = combineLatest([ this.ganttStartDate$, this.ganttEndDate$ ]).pipe(
70-
map(([ start, end ]) => {
71-
return (end.getTime() - start.getTime()) > 24 * 60 * 60 * 1000;
65+
return 'MMM d, h:mm a';
7266
}),
67+
startWith('MMM d, h:mm a'),
7368
);
7469

7570
private subscriptions: Subscription[] = [];

observability_ui/libs/ui/src/lib/fields/schedule-field/schedule-field.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
<div class="schedule-field-overlay--form--main--summary">
6666
<span>Cron Expression: {{ cronExpression$ | async }}</span>
67-
<span>Next Time: {{ nextTime$ | async | date: 'MMM d, YYYY hh:mm a' }}</span>
67+
<span>Next Time: {{ nextTime$ | async | date: 'MMM d, YYYY h:mm a' }}</span>
6868
</div>
6969

7070
<help-link href="https://docs.datakitchen.io/article/dataops-observability-help/cron-expressions-in-observability">cron expressions</help-link>

observability_ui/libs/ui/src/lib/gantt-chart/gantt-chart.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class="now-layer"
88
[style.left]="now()?.offset + 'px'">
99
<span class="now-layer--bar">
10-
{{ now()?.time | date:'hh:mm a' }}
10+
{{ now()?.time | date:'h:mm a' }}
1111
</span>
1212
</div>
1313

observability_ui/libs/ui/src/lib/gantt-chart/gantt-chart.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('GanttChartComponent', () => {
116116
});
117117

118118
it('should render the ticks', () => {
119-
const format = 'hh:mm a';
119+
const format = 'h:mm a';
120120
const start = testComponent.start;
121121
const end = testComponent.end;
122122

0 commit comments

Comments
 (0)