Skip to content

feat: show modal when switching to incompatible providers#4288

Open
colocated wants to merge 4 commits intoDokploy:canaryfrom
colocated:colocated/feat/disable-preview-tab
Open

feat: show modal when switching to incompatible providers#4288
colocated wants to merge 4 commits intoDokploy:canaryfrom
colocated:colocated/feat/disable-preview-tab

Conversation

@colocated
Copy link
Copy Markdown
Contributor

@colocated colocated commented Apr 22, 2026

What is this PR about?

This commit shows a modal after validating the form data with Zod to confirm that the user intends to switch providers after being told that the preview deployments feature will disabled, as it's only compatible with one of the available application source types.

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Issues related (if applicable)

None, new feature

Screenshots (if applicable)

Runs Zod validation checks BEFORE showing the modal to prevent confusion
image

Shows a modal if the change is valid to make sure the user wants to disable the preview deployments feature (only triggers if sourceType = 'github' and previewDeployments are enabled as a feature on the application)
image

Greptile Summary

This PR adds a confirmation modal when a user saves a non-GitHub provider (Bitbucket, GitLab, Gitea, Docker, plain Git, drag-and-drop) while the application currently has GitHub + preview deployments active. It also hides the "Preview Deployments" tab for non-GitHub source types, and consistently sets isPreviewDeploymentsActive: false on the server for every non-GitHub save mutation. The refetchutils.application.one.invalidate change is a minor cache-management improvement bundled in.

Confidence Score: 5/5

Safe to merge — logic is correct, server-side enforcement is consistent, and no critical issues remain.

The confirmation guard fires when and only when it should (sourceType === 'github' + isPreviewDeploymentsActive). Server mutations independently set isPreviewDeploymentsActive: false for every non-GitHub provider, so correctness doesn't depend solely on the UI path. The double-validation in the confirmation path is harmless. Previous P1 concerns have been addressed or acknowledged. All remaining observations are P2 or lower.

No files require special attention.

Reviews (4): Last reviewed commit: "fix: use application document invalidate..." | Re-trigger Greptile

This commit shows a modal after validating the form data with Zod to confirm that the user intends to switch providers after being told that the preview deployments feature will disabled, as it's only compatible with one of the available application source types.
Hides the "Preview Deployments" tab when the feature is not available to prevent confusion.
@colocated colocated requested a review from Siumauricio as a code owner April 22, 2026 19:55
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 22, 2026
Comment thread packages/server/src/lib/auth.ts Outdated
was NOT meant to commit that, my fault
@colocated
Copy link
Copy Markdown
Contributor Author

@greptileai reset confidence score

@colocated
Copy link
Copy Markdown
Contributor Author

Converting to draft as I've found a UI bug, will fix and republish

@colocated colocated marked this pull request as draft April 23, 2026 09:21
@colocated
Copy link
Copy Markdown
Contributor Author

There was a bug when saving the docker provider (which is what i tested with) that it wouldn't properly hide the tab on a fresh project until next refresh of the page, so we use a different method to invalidate and reload the component now.

@greptileai re-review

@colocated colocated marked this pull request as ready for review April 23, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant