Skip to content

Wire up GraphQL query to dynamic form

What does this MR do?

Populate SAST Configuration via GraphQL

Part of the SAST Configuration UI feature, this adds a GraphQL query to the SAST Configuration UI application, and feeds a transformed copy of the response to the DynamicFields component in order to render the form fields.

The usage of DynamicFields in this change is not ideal, but is only written this way for now to demonstrate the data flow. This will be improved in a related MR soon. Specifically, what's not ideal:

  • It currently mutates the fetched GraphQL response, rather than working with a copy of it.
  • It's not contained within a form element, and there's no way (yet) to submit the form data.

Other changes include:

  • Replace Bootstrap utility class with one from GitLab UI.
  • Extract helper for populating data for the frontend.
  • Change subheading text to match latest design.
  • Move documentation link into subheading.
  • Add error state for app component.

Addresses #231372 (closed).

Screenshots

Note that, as of writing, the backend MR which would drive this hasn't been merged yet. These screenshots have been created by merging in that branch first. This MR is not blocked by that, though, as it's behind a feature flag.

State Screenshot
Loading loading
Loaded loaded
Error error

Draft

This MR is in Draft, as it's blocked by !38162 (merged).

Feature flag

While this component isn't used anywhere yet, it will be used in the SAST Configuration UI page, which itself is behind the sast_configuration_ui feature flag.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Mark Florian

Merge request reports