diff --git a/src/lib/components/batch-operations/table.svelte b/src/lib/components/batch-operations/table.svelte index d891f13097..bc4fa19d78 100644 --- a/src/lib/components/batch-operations/table.svelte +++ b/src/lib/components/batch-operations/table.svelte @@ -13,8 +13,12 @@ } from '$lib/types/batch'; import { routeForBatchOperation } from '$lib/utilities/route-for'; - export let namespace: string; - export let operations: BatchOperationInfo[]; + interface Props { + namespace: string; + operations: BatchOperationInfo[]; + } + + let { namespace, operations }: Props = $props(); const jobStateToBadgeType: Record = { Completed: 'success', diff --git a/src/lib/components/lines-and-dots/svg/graph-widget.svelte b/src/lib/components/lines-and-dots/svg/graph-widget.svelte index 42e33815c5..b2f898db0e 100644 --- a/src/lib/components/lines-and-dots/svg/graph-widget.svelte +++ b/src/lib/components/lines-and-dots/svg/graph-widget.svelte @@ -7,11 +7,23 @@ import TimelineGraph from './timeline-graph.svelte'; - export let namespace: string; - export let workflowId: string; - export let runId = ''; - export let viewportHeight = 360; - export let onLoad: () => void = () => {}; + interface Props { + namespace: string; + workflowId: string; + runId?: string; + viewportHeight?: number; + onLoad?: () => void; + class?: string; + } + + let { + namespace, + workflowId, + runId = '', + viewportHeight = 360, + onLoad = () => {}, + class: className = '', + }: Props = $props(); const getWorkflowAndEventHistory = async () => { const [workflow, history] = await Promise.all([ @@ -32,7 +44,7 @@ {#await getWorkflowAndEventHistory() then { workflow, history }} -
+
; - export let attributes: CombinedAttributes; - export let onDecode: (decodedValue: string) => void | undefined = undefined; + interface Props { + key: string; + value: string | Record; + attributes: CombinedAttributes; + onDecode?: (decodedValue: string) => void | undefined; + } + + let { key, value, attributes, onDecode = undefined }: Props = $props(); const { fontSizeRatio } = DetailsConfig; - $: codeBlockValue = getCodeBlockValue(value); - $: linkType = displayLinkType(key, attributes); + const codeBlockValue = $derived(getCodeBlockValue(value)); + const linkType = $derived(displayLinkType(key, attributes)); {#if typeof value === 'object'} diff --git a/src/lib/components/lines-and-dots/svg/history-graph-row-visual.svelte b/src/lib/components/lines-and-dots/svg/history-graph-row-visual.svelte index bf8217e0ea..5d803eb203 100644 --- a/src/lib/components/lines-and-dots/svg/history-graph-row-visual.svelte +++ b/src/lib/components/lines-and-dots/svg/history-graph-row-visual.svelte @@ -23,46 +23,52 @@ import Dot from './dot.svelte'; import Line from './line.svelte'; - export let event: WorkflowEventWithPending; - export let group: EventGroup; - export let history: WorkflowEventWithPending[]; - export let groups: EventGroups; - export let index: number; - export let canvasWidth: number; + interface Props { + event: WorkflowEventWithPending; + group: EventGroup; + history: WorkflowEventWithPending[]; + groups: EventGroups; + index: number; + canvasWidth: number; + } + + let { event, group, history, groups, index, canvasWidth }: Props = $props(); const { height, radius } = HistoryConfig; const strokeWidth = radius / 2; - $: y = index * height + height / 2; - $: ({ nextDistance, offset } = getNextDistanceAndOffset( - history, - event, - groups, - height, - $eventFilterSort, - )); + const y = $derived(index * height + height / 2); + const distanceAndOffset = $derived( + getNextDistanceAndOffset(history, event, groups, height, $eventFilterSort), + ); + const nextDistance = $derived(distanceAndOffset.nextDistance); + const offset = $derived(distanceAndOffset.offset); - $: zoomNextDistance = offset > 0 && nextDistance; + const zoomNextDistance = $derived(offset > 0 && nextDistance); - $: classification = + const classification = $derived( isPendingActivity(event) || isPendingNexusOperation(event) ? 'pending' - : event?.classification; + : event?.classification, + ); - $: horizontalOffset = offset * 1.75 * radius; - $: nextIsPending = - isEvent(event) && group?.lastEvent.id === event?.id && group?.isPending; - $: connectLine = + const horizontalOffset = $derived(offset * 1.75 * radius); + const nextIsPending = $derived( + isEvent(event) && group?.lastEvent.id === event?.id && group?.isPending, + ); + const connectLine = $derived( isPendingActivity(event) || isPendingNexusOperation(event) || offset === 0 ? false - : !isMiddleEvent(event, groups); - $: category = + : !isMiddleEvent(event, groups), + ); + const category = $derived( isPendingActivity(event) || isPendingNexusOperation(event) ? 'pending' : nextIsPending ? event?.category - : (undefined as EventTypeCategory | 'pending' | undefined); - $: reverseSort = $eventFilterSort === 'descending'; + : (undefined as EventTypeCategory | 'pending' | undefined), + ); + const reverseSort = $derived($eventFilterSort === 'descending'); diff --git a/src/lib/components/lines-and-dots/svg/history-graph.svelte b/src/lib/components/lines-and-dots/svg/history-graph.svelte index f7d61ac6c9..cffc176542 100644 --- a/src/lib/components/lines-and-dots/svg/history-graph.svelte +++ b/src/lib/components/lines-and-dots/svg/history-graph.svelte @@ -11,27 +11,26 @@ import HistoryGraphRowVisual from './history-graph-row-visual.svelte'; import Line from './line.svelte'; - export let groups: EventGroups; - export let history: WorkflowEventWithPending[]; + interface Props { + groups: EventGroups; + history: WorkflowEventWithPending[]; + } - $: workflowTaskGroups = groupWorkflowTaskEvents( - $filteredEventHistory, - $eventFilterSort, + let { groups, history }: Props = $props(); + + const workflowTaskGroups = $derived( + groupWorkflowTaskEvents($filteredEventHistory, $eventFilterSort), ); - $: allGroups = [...workflowTaskGroups, ...groups]; + const allGroups = $derived([...workflowTaskGroups, ...groups]); const { height, radius } = HistoryConfig; const nodeBuffer = 4 * radius; const maxWidth = 600; - let canvasWidth = nodeBuffer; - let visualWidth = 0; - - $: canvasHeight = history.length * height; - - $: getMaxWidth = (items: WorkflowEventWithPending[]) => { - items.forEach((event) => { + const canvasWidth = $derived.by(() => { + let width = nodeBuffer; + history.forEach((event) => { const { offset } = getNextDistanceAndOffset( history, event, @@ -39,12 +38,13 @@ height, $eventFilterSort, ); - canvasWidth = Math.max(canvasWidth, offset * 1.75 * radius + nodeBuffer); - visualWidth = Math.min(canvasWidth - 2 * radius, maxWidth); + width = Math.max(width, offset * 1.75 * radius + nodeBuffer); }); - }; + return width; + }); + const visualWidth = $derived(Math.min(canvasWidth - 2 * radius, maxWidth)); - $: getMaxWidth(history); + const canvasHeight = $derived(history.length * height);
diff --git a/src/lib/components/lines-and-dots/workflow-error-stack-trace.svelte b/src/lib/components/lines-and-dots/workflow-error-stack-trace.svelte index dea28a8a6d..bcc21f1365 100644 --- a/src/lib/components/lines-and-dots/workflow-error-stack-trace.svelte +++ b/src/lib/components/lines-and-dots/workflow-error-stack-trace.svelte @@ -4,7 +4,13 @@ import { translate } from '$lib/i18n/translate'; import type { Failure } from '$lib/types'; - export let failure: Failure | undefined = undefined; + import Self from './workflow-error-stack-trace.svelte'; + + interface Props { + failure?: Failure | undefined; + } + + let { failure = undefined }: Props = $props(); {#if failure} @@ -42,5 +48,5 @@ {/if} {#if failure?.cause} - + {/if} diff --git a/src/lib/components/lines-and-dots/workflow-pending-task.svelte b/src/lib/components/lines-and-dots/workflow-pending-task.svelte index 3db5a4df14..29d45798d2 100644 --- a/src/lib/components/lines-and-dots/workflow-pending-task.svelte +++ b/src/lib/components/lines-and-dots/workflow-pending-task.svelte @@ -5,7 +5,11 @@ import { translate } from '$lib/i18n/translate'; import type { PendingWorkflowTaskInfo } from '$lib/types'; - export let pendingTask: PendingWorkflowTaskInfo | undefined = undefined; + interface Props { + pendingTask?: PendingWorkflowTaskInfo | undefined; + } + + let { pendingTask = undefined }: Props = $props(); diff --git a/src/lib/components/page-title.svelte b/src/lib/components/page-title.svelte index 5c9de8188e..eb03c13f9b 100644 --- a/src/lib/components/page-title.svelte +++ b/src/lib/components/page-title.svelte @@ -1,13 +1,20 @@ - diff --git a/src/lib/components/panel.svelte b/src/lib/components/panel.svelte index 2a72031f73..111ca4a12c 100644 --- a/src/lib/components/panel.svelte +++ b/src/lib/components/panel.svelte @@ -1,9 +1,17 @@ -
- +
+ {@render children?.()}