Skip to content

Commit

Permalink
Schedule recurrence limit fix (#3358)
Browse files Browse the repository at this point in the history
# What this PR does

## Which issue(s) this PR fixes

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

[#8080](grafana/support-escalations#8080)
  • Loading branch information
teodosii authored Nov 15, 2023
1 parent b797672 commit 904dca6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
25 changes: 11 additions & 14 deletions grafana-plugin/src/containers/RotationForm/RotationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 904dca6

Please sign in to comment.