Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mifu67 committed Oct 17, 2024
1 parent 76a9add commit 2a0086f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions static/app/views/alerts/rules/issue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,10 @@ class IssueRuleEditor extends DeprecatedAsyncView<Props, State> {
delete action.name;
}
for (const condition of rule.conditions) {
// values of 0 must be manually changed to strings, otherwise they will be interpreted as missing by the serializer
if ('value' in condition && condition.value === 0) {
condition.value = '0';
}
delete condition.name;
}
for (const filter of rule.filters) {
Expand Down
5 changes: 4 additions & 1 deletion static/app/views/alerts/rules/issue/ruleNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ function NumberField({
fieldConfig,
onPropertyChange,
}: FieldProps) {
const value = data[name] && typeof data[name] !== 'boolean' ? Number(data[name]) : NaN;
const value =
(data[name] && typeof data[name] !== 'boolean') || data[name] === 0
? Number(data[name])
: NaN;

// Set default value of number fields to the placeholder value
useEffect(() => {
Expand Down

0 comments on commit 2a0086f

Please sign in to comment.