Skip to content

Commit

Permalink
Merge pull request #5360 from gooddata/SHA_master
Browse files Browse the repository at this point in the history
fix: use relative only on change type
  • Loading branch information
hackerstanislav authored Sep 17, 2024
2 parents 3c26eb6 + d67d22a commit 1a75b64
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
JsonApiUserLinkage,
JsonApiUserOutWithLinks,
JsonApiAutomationPatchAttributesAlert,
ArithmeticMeasureOperatorEnum,
} from "@gooddata/api-client-tiger";
import {
IAlertComparisonOperator,
Expand Down Expand Up @@ -172,7 +173,13 @@ const convertAlert = (
left: relative.measure.left.localIdentifier,
right: relative.measure.right.localIdentifier,
},
threshold: relative.threshold.value * 100,
...(relative.measure.operator === ArithmeticMeasureOperatorEnum.CHANGE
? {
threshold: relative.threshold.value * 100,
}
: {
threshold: relative.threshold.value,
}),
},
...base,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,13 @@ const convertAlert = (alert: IAutomationAlert): JsonApiAutomationPatchAttributes
right: { localIdentifier: condition.measure.right },
},
threshold: {
value: condition.threshold / 100,
...(condition.measure.operator === ArithmeticMeasureOperatorEnum.CHANGE
? {
value: condition.threshold / 100,
}
: {
value: condition.threshold,
}),
},
},
},
Expand Down

0 comments on commit 1a75b64

Please sign in to comment.