Skip to content

Extract project settings clearing modal into component

Elwyn Benson requested to merge extract-clear-settings-modal into master

What does this MR do and why?

Extracts the modal + logic for clearing project-level product analytics settings into a standalone component.

Uses this new component back in the GitLab-managed provider card where it came from.

This work is in preparation for an upcoming change to allow the self-managed provider card to seamlessly clear settings form within the onboarding flow, similar to how the GitLab-managed provider card currently does.

Editing settings work stream:

  • Fetch project-level provider settings via GraphQL !160657 (merged)
  • Extract clear settings modal to standalone component <-- you are here
  • Remove redirect when clearing self-managed project-level provider settings !160669 (merged)
  • Allow configuring project-level provider settings within onboarding flow !160669 (merged)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
image image

(no visual differences)

How to set up and validate locally

  1. Follow these instructions to setup Product Analytics in GDK.
  2. Create a new project / visit a not-onboarded project.
  3. Enable the product_analytics_billing_override flag for the projects root ancestor if required, to ensure it can use a GitLab-managed provider:
  • echo "Feature.enable(:product_analytics_billing_override, Group.find_by_full_path(\"gitlab-org\"))" | gdk rails c
  1. Ensure you are signed in as a maintainer or higher role.
  2. Manually configure some project-level provider settings at Project > Settings > Analytics > Data Sources > Product Analytics (any dummy values can be used, e.g. https://example.com)
  3. Visit Project > Analytics > Analytics dashboards.
  4. Click "Set up" to start the onboarding flow.
  5. In the GitLab-managed provider, agree to the data region, and select Use GitLab-managed provider
  6. Verify that the modal to clear project-level settings is displayed, and correctly clears these values, and onboarding succeeds with instance-level provider settings. (if you used example.com dummy values, onboarding won't succeed, but the important bit for this MR is that the settings are cleared, which you can verify by visiting Project > Settings > Analytics > Data Sources > Product Analytics again)
Edited by Elwyn Benson

Merge request reports

Loading