Skip to content

[2.1] Fixes #38363: open a form modal for inbox workflow transitions with required fields (backport 2.1 #38400) - #38445

Merged
harsh-vador merged 14 commits into
2.1from
fix/inbox-transition-form-modal-2.1
Nov 24, 2026
Merged

harsh-vador merged 14 commits into
2.1from
fix/inbox-transition-form-modal-2.1

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #38363

Backport of #38400 to 2.1. When an inbox workflow transition's form declares required fields (for example a custom task approve that needs targetField/proposedText), the inbox opens a form modal to collect them. Previously it fired the transition with no payload. The same check runs in My Tasks bulk resolve, which skips those tasks instead of resolving them without input. The task actions stay locked while the form schema loads, so a second click cannot send a duplicate or conflicting resolve. A transition that requires a comment as well as other form fields opens the form modal, which forwards the form's comment field; only an incident's resolve keeps the root-cause modal, which already collects its required reason.

The six commits from #38400 are cherry-picked with -x. They include the follow-ups that give the required-fields hint the danger colour and the modal dividers="scroll", and that check a transition's form before its comment-only modal. The one conflict was the TaskDetailPanel.tsx import line, where 2.1 also imports useQueryClient; it is resolved by keeping both. The generated/antlr symlink committed on #38400 by mistake is not included. This stays a draft until #38400 merges on main; if review changes #38400, this branch picks up the same changes.

Type of change:

  • Bug fix

Tests:

Unit tests

  • On this branch, yarn test on TaskDetailPanel, TaskTransitionFormModal, useBulkResolveTasks, taskResolve.utils and TaskFormSchemaUtils: 236 passed (after the follow-ups, TaskDetailPanel and TaskTransitionFormModal re-run: 134 passed).
  • ESLint and Prettier on the changed files: 0 errors and 2 warnings, both carried over from Fixes #38363: open a form modal for inbox workflow transitions with required fields #38400.
  • tsc --noEmit: no new errors. The 3 it reports, in ExploreSortDropdown.tsx and OMSelectWidget.tsx, are on origin/2.1 too.

Backend integration tests

  • Not applicable (no backend changes).

Playwright (UI) tests

Checklist:

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with both earlier findings fixed and no new issues found.

Summary

This backport collects required form answers before an Inbox workflow transition runs.

  • Inbox reviewers fill required workflow fields before resolving a task.
  • Bulk task resolution skips transitions that need extra input.

Both earlier, unnumbered findings are fixed: the form check now runs before the comment-only modal, and a requested comment must be nonblank before submit. No new findings or rule violations were identified. Tests and browser checks were not rerun.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[User selects a transition] --> B{Incident root cause?}
  B -->|Yes| C[Open root-cause modal]
  B -->|No| D[Load form schema with actions locked]
  D -->|Lookup fails| E[Show error and allow retry]
  D --> F{Required form fields?}
  F -->|Yes| G[Collect form answers and requested comment]
  F -->|No| H{Comment required?}
  H -->|Yes| I[Collect comment]
  H -->|No| J[Send transition]
  C --> J
  G --> J
  I --> J
Loading

Reviews (6) · Last reviewed commit: "chore(playwright): regenerate the impact..." · Reviewed by Greptile

detail-app Bot and others added 4 commits November 23, 2026 14:15
- Required-field guard treats false/0 as valid answers, not missing
  (only absent/null/empty-string block confirm), so a required boolean
  set to false or a required number set to 0 can be submitted.
- Distinguish a failed schema lookup from a confirmed-missing schema:
  getResolvedTaskFormSchema gains an opt-in allowFallback flag; the
  inbox passes it for workflow-driven tasks so a fetch failure blocks
  the transition (with a retry) instead of falling back to the built-in
  default and letting a required-form transition fire with no payload.
- Keep the form schema helpers and TaskPayloadSchemaFields real in the
  modal tests (mock only the modal shell and the heavy editor widgets);
  drop comments that restate the test calls.

Addresses greptile review threads on #38400.

(cherry picked from commit bb1c991)
… bulk resolve

- Key the no-fallback lookup apart so other callers never get its undefined
- Resolve the schema on click instead of hiding the inbox actions until it loads
- Leave a bulk-resolved task whose transition form requires fields for the inbox
- Type the modal test's task fixture so tsc passes

(cherry picked from commit 70b6b62)
@harsh-vador
harsh-vador marked this pull request as ready for review November 23, 2026 09:49
@harsh-vador
harsh-vador requested a review from a team as a code owner November 23, 2026 09:49
@harsh-vador
harsh-vador requested review from shrabantipaul-collate and removed request for a team November 23, 2026 09:49
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 24, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 4 closed / 4 findings

Inbox transitions now submit required workflow-form payloads, enabling configured entity updates; impact is limited to tasks whose transitions declare required fields.

Adds a form modal for inbox workflow transitions that require extra fields, so reviewers can fill them before the transition fires instead of sending it empty, and bulk resolve now skips those tasks. Four issues from earlier review were resolved: the required-field hint uses a valid error token, the modal Dialog sets dividers="scroll", the required comment is enforced again, and the lazy-loaded form shows a loader instead of a blank modal. No open issues remain.

✅ 4 closed
✅ Bug: Required-field hint uses nonexistent tw:text-error token

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskTransitionFormModal.tsx:164-167
The required-fields hint in TaskTransitionFormModal sets className="tw:text-error". Neither the core styles nor the app styles define a --color-error or --text-color-error token. Only error-primary variants exist, and no other file in the UI uses tw:text-error. Tailwind therefore emits no class, and the validation message renders in the default body colour, so users have no visual cue that it is an error.

The guidelines also say core Typography should take colour from its color prop rather than from className. color="danger" maps to tw:text-error-primary, which adapts to dark mode.

✅ Quality: New form modal's Dialog omits required dividers="scroll"

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskTransitionFormModal.tsx:150-155
The component-library guideline says modals must always use <Dialog dividers="scroll">, and that the default always is legacy only. The new TaskTransitionFormModal renders <Dialog showCloseButton ... width={768}> without dividers, so it gets the legacy divider behaviour. This matters most for this form, whose content can be long. Add dividers="scroll" to match the other migrated modals, such as UnsavedChangesModal and ODCSExportModal.

✅ Bug: Form modal no longer enforces the required comment it replaces

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskDetailPanel.tsx:759-773 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskDetailPanel.tsx:807-809 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskTransitionFormModal.tsx:62-64 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskTransitionFormModal.tsx:115-129
This commit sends a transition that has requiresComment and required form fields to the form modal, not to TaskActionCommentModal. Before, the comment modal would not submit without a comment. The form modal has no such check. ensureTransitionCommentFields (TaskFormSchemaUtils.ts) adds a comment property but never puts it in schema.required, and isMissingRequired in TaskTransitionFormModal.tsx only looks at transitionFormSchema.required. So once targetField/proposedText are filled in, the user can confirm with the comment empty. handleFormConfirm then drops the comment because it is an empty string, and the transition resolves with no comment even though it requires one. This is the "loses neither" case the new docblock says is handled. Fix: when the transition requires a comment, treat comment as required in the modal's guard, or add comment to required inside ensureTransitionCommentFields. Then extend the new test so it checks that confirm stays disabled until a comment is entered.

✅ Edge Case: Lazy form renders a blank modal with only the error hint while loading

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskTransitionFormModal.tsx:38-43 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskTransitionFormModal.tsx:167-181 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/TaskTransitionFormModal.tsx:192-197
withSuspenseFallback uses a null fallback by default (AppRouter/withSuspenseFallback.tsx:22). Until the TaskPayloadSchemaFields chunk loads on first open, Dialog.Content shows no fields, only the red "required fields" hint, because isMissingRequired is computed from the seeded payload and not from the rendered form. The confirm button is live during that window too. When every required value is already seeded (for example the boolean or 0 cases), a user can confirm a transition without ever seeing the form. The comment this commit removed warned about exactly this trade-off. Pass a visible fallback such as <Loader /> so the dialog shows progress, not a bare error message.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@harsh-vador
harsh-vador merged commit 71ed265 into 2.1 Nov 24, 2026
45 of 47 checks passed
@harsh-vador
harsh-vador deleted the fix/inbox-transition-form-modal-2.1 branch November 24, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants