Schedule recurrence limit fix (#3358)

# What this PR does

## Which issue(s) this PR fixes

Fixes `issues with "limit each shift length" set automatically on
schedules`

[#8080](https://github.com/grafana/support-escalations/issues/8080)
This commit is contained in:
Rares Mardare 2023-11-15 14:24:07 +02:00 committed by GitHub
parent b797672626
commit 904dca6635
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 14 deletions

View file

@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
by excluding dark theme css vars in this case ([#3336](https://github.com/grafana/oncall/pull/3336))
- Fix issue when acknowledge reminder works for deleted organizations @Ferril ([#3345](https://github.com/grafana/oncall/pull/3345))
- Fix generating QR code ([#3347](https://github.com/grafana/oncall/pull/3347))
- Fixed recurrency limit issue in the Rotation Modal ([#3358](https://github.com/grafana/oncall/pull/3358))
## v1.3.57 (2023-11-10)

View file

@ -283,22 +283,19 @@ const RotationForm = observer((props: RotationFormProps) => {
[showActiveOnSelectedPartOfDay, showActiveOnSelectedDays, repeatEveryValue]
);
const handleRepeatEveryValueChange = useCallback(
(option) => {
const value = Math.floor(Number(option.value));
if (isNaN(value) || value < 1) {
return;
}
const handleRepeatEveryValueChange = (option) => {
const value = Math.floor(Number(option.value));
if (isNaN(value) || value < 1) {
return;
}
setShiftPeriodDefaultValue(undefined);
setRepeatEveryValue(value);
setShiftPeriodDefaultValue(undefined);
setRepeatEveryValue(value);
if (!showActiveOnSelectedPartOfDay) {
setShiftEnd(shiftStart.add(value, repeatEveryPeriodToUnitName[repeatEveryPeriod]));
}
},
[showActiveOnSelectedPartOfDay, repeatEveryPeriod]
);
if (!showActiveOnSelectedPartOfDay) {
setShiftEnd(rotationStart.add(value, repeatEveryPeriodToUnitName[repeatEveryPeriod]));
}
};
const handleRotationStartChange = useCallback(
(value) => {