Skip to content

Commit 46c3a88

Browse files
committed
fix(webapp): keep preview deployments enabled when the plan gates it
With the Preview environment gated by plan there is no toggle to submit, so saving Git settings sent no previewDeploymentsEnabled value and the schema transformed the absence into false, silently clearing a setting the user could not see. A hidden input now carries the persisted value through the save. Pre-existing: the toggle it replaced was rendered unchecked and disabled when gated, so it submitted nothing either.
1 parent 55daf2e commit 46c3a88

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.github.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -989,14 +989,19 @@ export function ConnectedGitHubRepoForm({
989989
}}
990990
/>
991991
) : (
992-
<LinkButton
993-
to={billingPath}
994-
variant="secondary/small"
995-
LeadingIcon={ArrowUpCircleIcon}
996-
leadingIconClassName="text-indigo-500"
997-
>
998-
Upgrade
999-
</LinkButton>
992+
<>
993+
{connectedGitHubRepo.previewDeploymentsEnabled && (
994+
<input type="hidden" name="previewDeploymentsEnabled" value="on" />
995+
)}
996+
<LinkButton
997+
to={billingPath}
998+
variant="secondary/small"
999+
LeadingIcon={ArrowUpCircleIcon}
1000+
leadingIconClassName="text-indigo-500"
1001+
>
1002+
Upgrade
1003+
</LinkButton>
1004+
</>
10001005
)
10011006
}
10021007
>

0 commit comments

Comments
 (0)