diff --git a/apps/webservice/src/app/[workspaceSlug]/_components/environment-policy-drawer/DeploymentControl.tsx b/apps/webservice/src/app/[workspaceSlug]/_components/environment-policy-drawer/DeploymentControl.tsx index 69f5a205..53791811 100644 --- a/apps/webservice/src/app/[workspaceSlug]/_components/environment-policy-drawer/DeploymentControl.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/_components/environment-policy-drawer/DeploymentControl.tsx @@ -106,6 +106,12 @@ export const DeploymentControl: React.FC<{ .then(() => utils.environment.policy.bySystemId.invalidate(systemId)), ); + const onEvaluateChange = (v: string) => { + if (v === "none") form.setValue("evaluate", null); + if (v === "filter") form.setValue("evaluate", defaultCondition); + if (v === "regex" || v === "semver") form.setValue("evaluate", ""); + }; + const { concurrencyLimit } = form.watch(); return ( @@ -184,7 +190,13 @@ export const DeploymentControl: React.FC<{ Filter which releases can be deployed to this environment. - + { + onEvaluateChange(v); + onChange(v); + }} + value={value} + >