Repository navigation
[Fix-18448][UI] Guard workflowDefinition before reading releaseState in the DAG node menu - #18670
Conversation
startDisplay and menuDisplay checked props.definition but then read props.definition!.workflowDefinition.releaseState. The ! assertion is compile-time only, so an undefined workflowDefinition threw a TypeError while the DAG node menu rendered. Read the release state through an optional chain, matching dag-toolbar.tsx, so the start button and the "other" menu items are hidden instead of breaking the page.
|
Thanks for opening this pull request! Please check out our contributing guidelines. (https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md) |
|
CI has not actually run on this PR: 9 of its 10 workflow runs are parked at |
|
CI update after today's re-run, nothing here needs the committer's action. Docs and E2E also fail on dev itself (Docs red on 15/15 nightly runs; E2E red at c63ecc9). Backend's license step diffs one line: the baseline expects minimatch-5.1.6.jar while the resolved build now ships 5.1.9 - a transitive webjar drift. This PR changes only dag/index.tsx. |
I've rerun the CI. |
|
Awesome work, congrats on your first merged pull request! |
Was this PR generated or assisted by AI?
YES. An AI assistant drafted this two-line change and this description under my direction; I reviewed the diff and ran the repo's own frontend checks locally before pushing.
Purpose of the pull request
Fixes #18448
startDisplayandmenuDisplayindolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsxguardedprops.definitionbut then readprops.definition!.workflowDefinition.releaseState.!is a TypeScript-only assertion with no runtime effect, so whenworkflowDefinitionisundefinedthe right-click node menu throwsTypeError: Cannot read properties of undefined (reading 'releaseState')and the DAG stops rendering.Brief change log
dag/index.tsx: both computeds now read the release state throughprops.definition.workflowDefinition?.releaseState, so the start button and the "other" menu items are hidden in that transient state instead of throwing.This is the pattern the same module already uses —
dag-toolbar.tsxguards withprops.definition?.workflowDefinition?.releaseState(lines 276 and 512). Behaviour is unchanged wheneverworkflowDefinitionis present.Verify this pull request
Ran the two steps of the
Frontendworkflow fromdolphinscheduler-ui:pnpm install(pnpm 7, as CI does) andpnpm run lint— exit 0, no problems reported, and the formatter left my two lines as written.pnpm run build:prod(vue-tsc --noEmit && vite build --mode production) — exit 0: the type check reported no errors and the production bundle completed.Two honesty notes: this host runs Node 24 while that workflow pins Node 16, and
dolphinscheduler-uihas no test runner (package.jsondefines no test script and no test dependency:dev, build:prod, preview, lint, prettier), so I could not add the unit test for these computeds that I mentioned when claiming the issue. Introducing vitest plus its config and CI wiring does not belong in a bugfix; I am happy to do it in a follow-up PR if you want it.Related: #18449 and #18542 are both still open with no review; SbloodyS assigned this issue to me on 2026-10-02, so here is the implementation.