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

fix(dashboard): Workflow executions #9757

Merged
merged 4 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
import { HttpTypes } from "@medusajs/types"
import { TransactionState, TransactionStepState } from "./types"

export const STEP_IN_PROGRESS_STATES = [
export const STEP_IN_PROGRESS_STATES: HttpTypes.TransactionStepState[] = [
TransactionStepState.COMPENSATING,
TransactionStepState.INVOKING,
]

export const STEP_SKIPPED_STATES = [
export const STEP_SKIPPED_STATES: HttpTypes.TransactionStepState[] = [
TransactionStepState.SKIPPED,
TransactionStepState.SKIPPED_FAILURE,
]
export const STEP_OK_STATES = [TransactionStepState.DONE]
export const STEP_OK_STATES: HttpTypes.TransactionStepState[] = [
TransactionStepState.DONE,
]

export const STEP_ERROR_STATES = [
export const STEP_ERROR_STATES: HttpTypes.TransactionStepState[] = [
TransactionStepState.FAILED,
TransactionStepState.REVERTED,
TransactionStepState.TIMEOUT,
TransactionStepState.DORMANT,
]
export const STEP_INACTIVE_STATES = [TransactionStepState.NOT_STARTED]
export const STEP_INACTIVE_STATES: HttpTypes.TransactionStepState[] = [
TransactionStepState.NOT_STARTED,
]

export const TRANSACTION_OK_STATES = [TransactionState.DONE]
export const TRANSACTION_ERROR_STATES = [
export const TRANSACTION_OK_STATES: HttpTypes.TransactionState[] = [
TransactionState.DONE,
]
export const TRANSACTION_ERROR_STATES: HttpTypes.TransactionState[] = [
TransactionState.FAILED,
TransactionState.REVERTED,
]
export const TRANSACTION_IN_PROGRESS_STATES = [
export const TRANSACTION_IN_PROGRESS_STATES: HttpTypes.TransactionState[] = [
TransactionState.INVOKING,
TransactionState.WAITING_TO_COMPENSATE,
TransactionState.COMPENSATING,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Spinner, TriangleDownMini } from "@medusajs/icons"
import {
clx,
CodeBlock,
Container,
Heading,
IconButton,
Text,
clx,
} from "@medusajs/ui"
import * as Collapsible from "@radix-ui/react-collapsible"
import { format } from "date-fns"
Expand All @@ -14,8 +14,8 @@ import { useTranslation } from "react-i18next"
import { useLocation } from "react-router-dom"
import {
STEP_ERROR_STATES,
STEP_INACTIVE_STATES,
STEP_IN_PROGRESS_STATES,
STEP_INACTIVE_STATES,
STEP_OK_STATES,
STEP_SKIPPED_STATES,
} from "../../../constants"
Expand Down Expand Up @@ -93,7 +93,7 @@ const Event = ({
isUnreachable,
}: {
step: HttpTypes.AdminWorkflowExecutionStep
stepInvokeContext: HttpTypes.StepInvoke | undefined
stepInvokeContext: HttpTypes.StepInvokeResult | undefined
stepError?: HttpTypes.StepError | undefined
isLast: boolean
isUnreachable?: boolean
Expand All @@ -115,8 +115,6 @@ const Event = ({

const identifier = step.id.split(".").pop()

stepInvokeContext

return (
<div
className="grid grid-cols-[20px_1fr] items-start gap-x-2 px-2"
Expand Down Expand Up @@ -217,7 +215,7 @@ const Event = ({
</CodeBlock>
</div>
)}
{!!stepInvokeContext?.output.compensateInput &&
{!!stepInvokeContext?.output?.compensateInput &&
step.compensate.state === TransactionStepState.REVERTED && (
<div className="text-ui-fg-subtle flex flex-col gap-y-2">
<Text size="small" leading="compact">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const WorkflowExecutionListTable = () => {
useWorkflowExecutions(
{
...searchParams,
fields: "execution,state",
},
{
placeholderData: keepPreviousData,
Expand Down
Loading