Skip to content

Commit

Permalink
fix: Change evaluate type in evaluation form
Browse files Browse the repository at this point in the history
  • Loading branch information
adityachoudhari26 committed Oct 10, 2024
1 parent f8372a7 commit 56e9f31
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -184,7 +190,13 @@ export const DeploymentControl: React.FC<{
Filter which releases can be deployed to this environment.
</FormDescription>
</div>
<RadioGroup onValueChange={onChange} value={value}>
<RadioGroup
onValueChange={(v) => {
onEvaluateChange(v);
onChange(v);
}}
value={value}
>
<FormItem className="flex items-center space-x-3 space-y-0">
<FormControl>
<RadioGroupItem value="none" />
Expand Down

0 comments on commit 56e9f31

Please sign in to comment.