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

Workflow Electron #2335

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
68a514d
Accordion component updates (#2316)
laurakwhit Sep 12, 2024
bd34e6e
Highlight active link in nav bar (#2324)
laurakwhit Sep 12, 2024
0ea3d60
Add workflow electron
Alex-Tideman Sep 17, 2024
8e76540
Add http api port and async update flag (#2314)
Alex-Tideman Sep 17, 2024
d496841
Show all possible failures for WorkflowTaskError (#2328)
Alex-Tideman Sep 17, 2024
d57594a
Add border
Alex-Tideman Sep 18, 2024
b03b7eb
Merge branch 'main' into codefreeze-09.12.24
Alex-Tideman Sep 18, 2024
4f68115
Merge branch 'codefreeze-09.12.24' into workflow-electron
Alex-Tideman Sep 18, 2024
6bed6a0
WIP: filter
Alex-Tideman Sep 18, 2024
cff5fdc
Bump express from 4.19.2 to 4.20.0 (#2323)
dependabot[bot] Sep 18, 2024
cd3b18a
Bump vite from 5.0.13 to 5.2.14 (#2329)
dependabot[bot] Sep 18, 2024
37f142c
Fix the go things
Alex-Tideman Sep 18, 2024
0335adf
MVP of electron. Needs some performance tweaks and to add links to ea…
Alex-Tideman Sep 18, 2024
2b649ed
Add icons, clean up
Alex-Tideman Sep 19, 2024
5ccc8f9
Remove commented out code
Alex-Tideman Sep 19, 2024
3a42b2c
Update snapshots
Alex-Tideman Sep 19, 2024
f70fe35
Update go to 1.22.6 (#2334)
Alex-Tideman Sep 19, 2024
ade48fe
Fix merge conflict
Alex-Tideman Sep 19, 2024
b001988
Merge branch 'main' into workflow-electron
Alex-Tideman Sep 24, 2024
5ac9b2e
Small UI fixes (#2345)
laurakwhit Sep 24, 2024
62944b9
2.31.1 (#2346)
temporal-cicd[bot] Sep 24, 2024
e4e2453
Update version.go to v2.31.0 (#2347)
Alex-Tideman Sep 25, 2024
1e0cdf5
Use go 1.23.0 (#2348)
Alex-Tideman Sep 25, 2024
2943464
Use 1.23 (#2349)
Alex-Tideman Sep 25, 2024
412abee
Update go version to 1.23 in update ui-server (#2351)
Alex-Tideman Sep 26, 2024
df9be0c
Add breadcrumbs for nodes
Alex-Tideman Sep 30, 2024
c89e663
Add hover/click state with opacity
Alex-Tideman Sep 30, 2024
5617b14
Add back child table
Alex-Tideman Sep 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/update-ui-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ jobs:
app_id: ${{ secrets.TEMPORAL_CICD_APP_ID }}
private_key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }}

- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version-file: server/go.mod
cache: true
cache-dependency-path: server/go.sum
go-version: '1.23'
- name: Setup Protoc
uses: arduino/setup-protoc@v1
with:
Expand Down
7 changes: 6 additions & 1 deletion .storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import type { TestRunnerConfig } from '@storybook/test-runner';
import { getStoryContext } from '@storybook/test-runner';
import { injectAxe, checkA11y } from 'axe-playwright';

const config: TestRunnerConfig = {
async preVisit(page) {
await injectAxe(page);
},
async postVisit(page) {
async postVisit(page, context) {
const storyContext = await getStoryContext(page, context);
if (storyContext.parameters?.a11y?.disable) {
return;
}
await checkA11y(page, '#storybook-root', {
detailedReport: true,
detailedReportOptions: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@temporalio/ui",
"version": "2.31.0",
"version": "2.31.1",
"engines": {
"pnpm": ">=8.6.0",
"node": ">=18.15.0"
Expand Down
2 changes: 1 addition & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_SERVER_IMAGE=temporalio/base-server:1.15.7
ARG BASE_BUILDER_IMAGE=temporalio/base-builder:1.14.8
ARG BASE_BUILDER_IMAGE=temporalio/base-builder:1.15.0

FROM ${BASE_BUILDER_IMAGE} AS server-builder

Expand Down
2 changes: 1 addition & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/temporalio/ui-server/v2

go 1.22.6
go 1.23

require (
github.com/coreos/go-oidc/v3 v3.1.0
Expand Down
2 changes: 1 addition & 1 deletion server/server/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ const (
clientNameHeaderName = "client-name"
clientNameHeaderValue = "temporal-ui"
clientVersionHeaderName = "client-version"
UIVersion = "2.30.3"
UIVersion = "2.31.0"
)
201 changes: 201 additions & 0 deletions src/lib/components/workflow/workflow-atom.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
<script lang="ts">
import { page } from '$app/stores';

import Breadcrumbs from '$lib/holocene/breadcrumbs.svelte';
import ZoomSvg from '$lib/holocene/zoom-svg.svelte';
import type { RootNode } from '$lib/services/workflow-service';
import { workflowRun } from '$lib/stores/workflow-run';
import { routeForEventHistory } from '$lib/utilities/route-for';

import WorkflowElectron from './workflow-electron.svelte';

$: ({ namespace } = $page.params);
$: ({ workflow } = $workflowRun);

export let root: RootNode;

let activeNode: RootNode | undefined;
let hoverNode: RootNode | undefined;

let links: { copy: string; href: string }[] = [];

$: currentNode =
root?.workflow?.runId === workflow.runId &&
root?.workflow?.id === workflow.id;

const getPositions = (width: number, height: number, zoomLevel: number) => {
const centerX = width / 2;
const centerY = height / 2;
const orbits = {
root: width / 50 / zoomLevel,
level1: width / 16 / zoomLevel,
level2: width / 9 / zoomLevel,
level3: width / 6 / zoomLevel,
level4: width / 4 / zoomLevel,
};
const radius = 10 / (2 * zoomLevel);
return {
centerX,
centerY,
orbits,
radius,
};
};

const onNodeMouseEnter = (node: RootNode) => {
if (activeNode) return;
hoverNode = node;
};

const onNodeMouseLeave = (_node: RootNode) => {
if (activeNode) return;
hoverNode = undefined;
};

const onNodeClick = (node: RootNode) => {
if (activeNode === node) {
activeNode = undefined;
links = [];
} else {
activeNode = node;
links = node.rootPaths.map((path) => {
return {
copy: node.workflow.id,
href: routeForEventHistory({
namespace,
workflow: path.workflowId,
run: path.runId,
}),
};
});
}
};
</script>

{#if links.length}
<Breadcrumbs {links} />
{/if}
<div class="w-full rounded-xl border-2 border-subtle bg-primary">
<ZoomSvg
initialZoom={0.65}
maxZoomOut={1}
maxZoomIn={0.25}
let:width
let:height
let:zoomLevel
class="spin"
>
{@const { centerX, centerY, orbits, radius } = getPositions(
width,
height,
zoomLevel,
)}
<circle
class="stroke-black dark:stroke-white"
cx={centerX}
cy={centerY}
r={orbits.level1}
stroke-width="1"
fill-opacity="0"
/>
<circle
class="stroke-black opacity-50 dark:stroke-white"
cx={centerX}
cy={centerY}
r={orbits.level2}
stroke-width="1"
fill-opacity="0"
/>
<circle
class="stroke-black opacity-50 dark:stroke-white"
cx={centerX}
cy={centerY}
r={orbits.level3}
stroke-width="1"
fill-opacity="0"
/>
<circle
class="stroke-black opacity-50 dark:stroke-white"
cx={centerX}
cy={centerY}
r={orbits.level4}
stroke-width="1"
fill-opacity="0"
/>
{#each root.children as child, i}
<WorkflowElectron
index={i}
node={child}
parent={root}
center={{ x: centerX, y: centerY }}
parentCenter={{ x: centerX, y: centerY }}
{radius}
{orbits}
generation={1}
{zoomLevel}
{activeNode}
{hoverNode}
{onNodeClick}
{onNodeMouseEnter}
{onNodeMouseLeave}
/>
{/each}
<g
class="outline-none"
role="button"
tabindex="0"
on:keypress={() => onNodeClick(root)}
on:click={() => onNodeClick(root)}
>
{#if currentNode}
<circle
class="dark:fill-white"
cx={centerX}
cy={centerY}
r={orbits.root * 1.1}
/>
{/if}
<circle
class={root.workflow.status}
cx={centerX}
cy={centerY}
r={orbits.root}
/>
</g>
</ZoomSvg>
</div>

<style lang="postcss">
.Running {
fill: #93bbfd;
}

.Started {
fill: #92a4c3;
}

.Completed {
fill: #00f37e;
}

.Fired {
fill: #f8a208;
}

.Signaled {
fill: #d300d8;
}

.Failed,
.Terminated {
fill: #ff4518;
}

.TimedOut {
fill: #c2570c;
}

.Canceled {
fill: #fed64b;
}
</style>
Loading
Loading