Skip to content

Conversation

@lokanandaprabhu
Copy link
Member

@lokanandaprabhu lokanandaprabhu commented Dec 24, 2025

Hey, I just made a Pull Request!

Fixes:
https://issues.redhat.com/browse/RHDHBUGS-2454
https://issues.redhat.com/browse/RHDHBUGS-2453

This PR introduces two new ui:props options for the orchestrator form widgets to improve user experience when working with dynamic forms that depend on fetch operations.


Feature 1: fetch:error:skip

Problem: When using widgets with fetch:retrigger dependencies, the initial fetch often fails because dependent fields don't have values yet. This results in HTTP errors (e.g., 404, 400) being displayed to users during initial load, even though this is expected behavior.

Solution: Added fetch:error:skip option that suppresses fetch error display until all fetch:retrigger dependencies have non-empty values.

Behavior:

  • When true, errors are hidden while dependencies are empty
  • Once all dependencies have values, errors are shown normally
  • Supported by: ActiveTextInput, ActiveDropdown, ActiveMultiSelect, SchemaUpdater

Feature 2: fetch:response:default

Problem: Widgets previously required fetch:response:value for default values, meaning a fetch must succeed for any default to be applied.

This was problematic when:

  • You want a static fallback default when fetch fails or hasn't completed
  • You want to pre-populate a field without requiring a fetch
  • The fetch depends on fields that aren't filled yet

Solution: Added fetch:response:default option for static default values applied immediately on form initialization.

Key Implementation Details:

  • Defaults are extracted from schema and applied at form initialization level (in OrchestratorForm), not inside widgets
  • This ensures controlled components work correctly and values persist across wizard step navigation
  • Static defaults act as fallback when fetch fails, hasn't completed, or returns empty
  • Fetched values only override defaults when non-empty
  • Loading spinners are skipped when static defaults exist for instant display

Supported Types:
ActiveTextInput: string (e.g., "create")
ActiveDropdown: string (e.g., "default-profile")
ActiveMultiSelect: string[] (e.g., ["tag1", "tag2"])


Orchestrator - fetch error skip and resp default


✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Dec 24, 2025

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-orchestrator-form-react workspaces/orchestrator/plugins/orchestrator-form-react minor v2.4.0
@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets workspaces/orchestrator/plugins/orchestrator-form-widgets minor v1.5.0

@sonarqubecloud
Copy link

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.

1 participant