Fix dayOption NPE, add top boundary for rotation modal (#2920)

# What this PR does

## Which issue(s) this PR fixes

Fix:

- Schedule race condition
- No obvious way to close Rotation modal

https://github.com/grafana/oncall/issues/2802
https://github.com/grafana/oncall/issues/2880

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
This commit is contained in:
Maxim Mordasov 2023-08-30 15:38:52 +03:00 committed by GitHub
parent 11d6d0a723
commit 3770cf5414
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -422,7 +422,12 @@ const RotationForm = observer((props: RotationFormProps) => {
width="430px"
onDismiss={onHide}
contentElement={(props, children) => (
<Draggable handle=".drag-handler" defaultClassName={cx('draggable')} positionOffset={{ x: 0, y: offsetTop }}>
<Draggable
handle=".drag-handler"
defaultClassName={cx('draggable')}
positionOffset={{ x: 0, y: offsetTop }}
bounds={{ top: 0 }}
>
<div {...props}>{children}</div>
</Draggable>
)}

View file

@ -82,7 +82,7 @@ export class ScheduleStore extends BaseStore {
} = {};
@observable
byDayOptions: SelectOption[];
byDayOptions: SelectOption[] = [];
@observable
scheduleId: Schedule['id'];