Skip to content

fix(ui): keep update credentials wizard open#10675

Merged
jfagoagas merged 5 commits into
masterfrom
fix/ui-provider-update-wizard-test-step
Apr 15, 2026
Merged

fix(ui): keep update credentials wizard open#10675
jfagoagas merged 5 commits into
masterfrom
fix/ui-provider-update-wizard-test-step

Conversation

@Alan-TheGentleman
Copy link
Copy Markdown
Contributor

@Alan-TheGentleman Alan-TheGentleman commented Apr 13, 2026

Context

Updating provider credentials in the providers table wizard was closing the modal after a successful connection test, which prevented users from reaching the final launch step and starting a scan from the same flow.

Description

  • keep update flows inside the wizard after a successful connection test so they advance to the launch step
  • stop revalidating /providers during wizard connection checks to avoid remounting the row-level modal in Next 16
  • add regression coverage for update credentials and check connection wizard actions

Steps to review

  1. Open /providers
  2. Pick a provider with existing credentials and click Update Credentials
  3. Submit valid updated credentials
  4. In Check connection, click Check connection
  5. Verify the wizard stays open and advances to the final Launch scan step
  6. Launch a scan from the modal
  7. Run pnpm run healthcheck
  8. Run pnpm test:run actions/providers/providers.test.ts
  9. Run pnpm test:run components/providers/wizard/hooks/use-provider-wizard-controller.test.tsx

Checklist

Screen.Recording.2026-04-14.at.12.43.15.mov
Community Checklist
  • This feature/issue is listed in here or roadmap.prowler.com
  • Is it assigned to me, if not, request it via the issue/feature in here or Prowler Community Slack

SDK/CLI

  • Are there new checks included in this PR? No
    • If so, do we need to update permissions for the provider? Please review this carefully.

UI (if applicable)

  • All issue/task requirements work as expected on the UI
  • Screenshots/Video - Mobile (X < 640px)
  • Screenshots/Video - Tablet (640px > X < 1024px)
  • Screenshots/Video - Desktop (X > 1024px)
  • Ensure new entries are added to ui/CHANGELOG.md

API (if applicable)

  • All issue/task requirements work as expected on the API
  • Endpoint response output (if applicable)
  • EXPLAIN ANALYZE output for new/modified queries or indexes (if applicable)
  • Performance test results (if applicable)
  • Any other relevant evidence of the implementation (if applicable)
  • Verify if API specs need to be regenerated.
  • Check if version updates are required.
  • Ensure new entries are added to api/CHANGELOG.md

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Alan-TheGentleman Alan-TheGentleman requested a review from a team as a code owner April 13, 2026 19:07
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

✅ All necessary CHANGELOG.md files have been updated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

🔒 Container Security Scan

Image: prowler-ui:4be1b8e
Last scan: 2026-04-15 11:45:23 UTC

✅ No Vulnerabilities Detected

The container image passed all security checks. No known CVEs were found.

📋 Resources:

Copy link
Copy Markdown
Contributor

@alejandrobailo alejandrobailo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey!

I spotted one thing that I think introduces a subtle regression though:

/providers is never revalidated in the update flow

After this PR, the full update-credentials chain looks like:

  1. updateCredentialsProviderhandleApiResponse(response) — no revalidation
  2. checkConnectionProviderhandleApiResponse(response) — no revalidation
  3. LaunchStep → calls scanOnDemand / scheduleDaily → revalidates /scans, not /providers
  4. handleClose() → resets wizard state, closes modal — no revalidation

So the /providers page data is never refreshed after the user updates credentials through the wizard. Any changes that should be reflected in the providers table (connection status, credential type, etc.) will stay stale until a manual page refresh.

The PR description says "revalidation deferred to the connection test step", but checkConnectionProvider also had its "/providers" removed — so the revalidation isn't deferred, it's gone entirely.

Suggested fix

The controller fix (removing the early-return in handleTestSuccess) is what actually solves the modal-closing bug. I think we can safely restore revalidatePath in checkConnectionProvider:

// checkConnectionProvider
return handleApiResponse(response, "/providers");

Since the modal no longer remounts on revalidation (the early-close is gone), this should keep the wizard open and ensure the providers table shows fresh data when the user eventually closes it.

The removal in updateCredentialsProvider is fine to keep — revalidating at connection-test time is enough.

Let me know what you think!

Comment thread ui/actions/providers/providers.ts Outdated
Comment thread ui/actions/providers/providers.ts Outdated
@Alan-TheGentleman
Copy link
Copy Markdown
Contributor Author

Alan-TheGentleman commented Apr 14, 2026

Fixed the wizard flow end to end.

The root cause was that the provider wizard modal was mounted inside table rows, so every refresh of the providers page could remount the row and close the modal.

I moved the wizard to a stable page-level host and wired row actions and Add Provider to open that shared modal instead.

With that change in place, the providers table now refreshes after:

  1. linking the provider
  2. authenticating credentials
  3. checking the connection

and the modal stays open through each intermediate step until the flow actually finishes.

I also fixed the action label so rows without a secret show Add Credentials instead of Update Credentials.

Tests updated and passing locally.

@alejandrobailo @pfe-nazaries could you please take another look?

pfe-nazaries
pfe-nazaries previously approved these changes Apr 14, 2026
Copy link
Copy Markdown
Contributor

@pfe-nazaries pfe-nazaries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alejandrobailo alejandrobailo requested review from alejandrobailo and removed request for alejandrobailo April 14, 2026 14:23
Copy link
Copy Markdown
Contributor

@alejandrobailo alejandrobailo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog must be for the .24

@Alan-TheGentleman
Copy link
Copy Markdown
Contributor Author

Fixed. Moved the changelog entry out of the released 1.23.0 block into a new [1.24.0] (Prowler UNRELEASED) section. Also updated the entry text to reflect the full scope of the change (page-level wizard host).

- avoid providers revalidation during credential updates
- add regression coverage for add and update credential actions
- add changelog entry for update credentials wizard fix
- add inline comment explaining why revalidation is omitted
- add test verifying checkConnectionProvider still revalidates
- send update flows to the launch step after a successful test
- avoid providers revalidation during connection checks inside the wizard
- cover the launch transition with regression tests
- move the providers wizard to a stable page-level host
- refresh providers data after link, authenticate, and connection checks
- update provider actions and tests for the shared wizard flow
@Alan-TheGentleman Alan-TheGentleman force-pushed the fix/ui-provider-update-wizard-test-step branch from 0669e60 to 0c9df42 Compare April 15, 2026 11:41
@jfagoagas jfagoagas merged commit 606efec into master Apr 15, 2026
37 checks passed
@jfagoagas jfagoagas deleted the fix/ui-provider-update-wizard-test-step branch April 15, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants