Skip to content

Commit fbd2517

Browse files
authored
Add bi-directional links to Timeline info (#2561)
* Add bi-di link to timeline info * Switch to text-secondary instead of text-subtle * Consistent styles for link * Fix pending activities empty state check
1 parent 290fcf4 commit fbd2517

File tree

6 files changed

+33
-7
lines changed

6 files changed

+33
-7
lines changed

Diff for: server/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/labstack/echo/v4 v4.9.1
1111
github.com/stretchr/testify v1.9.0
1212
github.com/urfave/cli/v2 v2.3.0
13-
go.temporal.io/api v1.43.0
13+
go.temporal.io/api v1.44.1
1414
golang.org/x/net v0.33.0
1515
golang.org/x/oauth2 v0.22.0
1616
google.golang.org/grpc v1.66.0

Diff for: server/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw
5151
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
5252
github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4=
5353
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
54-
go.temporal.io/api v1.43.0 h1:lBhq+u5qFJqGMXwWsmg/i8qn1UA/3LCwVc88l2xUMHg=
55-
go.temporal.io/api v1.43.0/go.mod h1:1WwYUMo6lao8yl0371xWUm13paHExN5ATYT/B7QtFis=
54+
go.temporal.io/api v1.44.1 h1:sb5Hq08AB0WtYvfLJMiWmHzxjqs2b+6Jmzg4c8IOeng=
55+
go.temporal.io/api v1.44.1/go.mod h1:1WwYUMo6lao8yl0371xWUm13paHExN5ATYT/B7QtFis=
5656
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
5757
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
5858
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=

Diff for: src/lib/components/lines-and-dots/svg/group-details-row.svelte

+22-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
import WorkflowStatus from '$lib/components/workflow-status.svelte';
88
import Button from '$lib/holocene/button.svelte';
99
import Icon from '$lib/holocene/icon/icon.svelte';
10+
import Link from '$lib/holocene/link.svelte';
1011
import { translate } from '$lib/i18n/translate';
1112
import type { EventGroup } from '$lib/models/event-groups/event-groups';
1213
import { activeGroupHeight, setActiveGroup } from '$lib/stores/active-events';
1314
import { format } from '$lib/utilities/format-camel-case';
1415
import { formatDistanceAbbreviated } from '$lib/utilities/format-time';
1516
import { isChildWorkflowExecutionStartedEvent } from '$lib/utilities/is-event-type';
17+
import { routeForEventHistory } from '$lib/utilities/route-for';
1618
1719
import { mergeEventGroupDetails } from '../constants';
1820
@@ -44,6 +46,7 @@
4446
$: textAttributes = Object.entries(attributes).filter(
4547
([, value]) => typeof value !== 'object',
4648
);
49+
$: link = group.links?.[0];
4750
4851
$: childWorkflowStartedEvent =
4952
group && group.eventList.find(isChildWorkflowExecutionStartedEvent);
@@ -117,9 +120,25 @@
117120
</div>
118121
</MetadataDecoder>
119122
{/if}
123+
{#if link}
124+
<div>
125+
<div class="font-medium leading-3 text-secondary">
126+
{translate('nexus.link')}
127+
</div>
128+
<div class="text-wrap break-all leading-4">
129+
<Link
130+
href={routeForEventHistory({
131+
namespace: link.workflowEvent.namespace,
132+
workflow: link.workflowEvent.workflowId,
133+
run: link.workflowEvent.runId,
134+
})}>{link.workflowEvent.workflowId}</Link
135+
>
136+
</div>
137+
</div>
138+
{/if}
120139
{#each textAttributes as [key, value] (key)}
121140
<div>
122-
<div class="font-medium leading-3 text-subtle">
141+
<div class="font-medium leading-3 text-secondary">
123142
{format(key)}
124143
</div>
125144
<div class="text-wrap break-all leading-4">
@@ -132,7 +151,7 @@
132151
<div class="flex w-full flex-col gap-2 xl:w-1/2">
133152
{#each codeBlockAttributes as [key, value] (key)}
134153
<div>
135-
<div class="font-medium leading-4 text-subtle">
154+
<div class="font-medium leading-4 text-secondary">
136155
{format(key)}
137156
</div>
138157
<GroupDetailsText {key} {value} {attributes} {onDecode} />
@@ -142,7 +161,7 @@
142161
</div>
143162
{#if childWorkflowStartedEvent}
144163
<div class="surface-primary px-4">
145-
<div class="font-medium leading-4 text-subtle">Child Workflow</div>
164+
<div class="font-medium leading-4 text-secondary">Child Workflow</div>
146165
{#key group.eventList.length}
147166
<GraphWidget
148167
{namespace}

Diff for: src/lib/models/event-groups/create-event-group.ts

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ const createGroupFor = <K extends keyof StartingEvents>(
9191
get eventList() {
9292
return Array.from(this.events, ([_key, value]) => value);
9393
},
94+
get links() {
95+
return Array.from(this.events, ([_key, value]) => value.links).flat();
96+
},
9497
get lastEvent() {
9598
return getLastEvent(this);
9699
},

Diff for: src/lib/models/event-groups/event-groups.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Payload } from '$lib/types';
22
import type {
3+
EventLink,
34
PendingActivity,
45
PendingNexusOperation,
56
WorkflowEvent,
@@ -31,6 +32,7 @@ interface EventGroup
3132
pendingActivity: PendingActivity | undefined;
3233
pendingNexusOperation: PendingNexusOperation | undefined;
3334
userMetadata?: { summary?: Payload };
35+
links: EventLink[];
3436
}
3537

3638
type EventGroups = EventGroup[];

Diff for: src/lib/pages/workflow-pending-activities.svelte

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
import { omit } from '$lib/utilities/omit';
2323
import { stringifyWithBigInt } from '$lib/utilities/parse-with-big-int';
2424
import { toTimeDifference } from '$lib/utilities/to-time-difference';
25+
26+
$: pendingActivities = $workflowRun.workflow?.pendingActivities;
2527
</script>
2628

27-
{#if $workflowRun.workflow?.pendingActivities}
29+
{#if pendingActivities?.length}
2830
{#await toDecodedPendingActivities($workflowRun.workflow) then activities}
2931
<Table class="mb-6 w-full min-w-[600px] table-fixed">
3032
<caption class="sr-only" slot="caption"

0 commit comments

Comments
 (0)