oncall-engine/engine/apps/api
Dominik Broj 6da36b3c0b
Use autogenerated types for alert_receive_channels (#3851)
# What this PR does

- autogenerate new types exposed by backend, remove custom types that
duplicate autogenerated ones
- use autogenerated types for alert receive channels
- in alert_receive_channel model:
  - use autogenerate http client (`onCallApi`) for http requests
- extract methods that don't update state into
alert_receive_channel.helpers.ts and make them pure (they accept
AlertReceiveChannelStore as param) to avoid inconsistency and issues
with `this` binding
  - use `makeAutoObservable`
  - remove unneeded decorators
- rename update* methods to fetch* whenever such methods retrieve data
from backend with GET requests
- in other models use `@action.bound` for actions and arrow functions
for store methods that are not actions (in subsequent PRs we will apply
the same changes as in alert_receive_channel, this is just for now until
we do it)
- refactor http-client so that it shows global notification on http
errors automatically and provide the possibility to opt-out from it when
making a call
- improve type-safety of `GSelect`
- fix bug related to attaching alert group
(https://raintank-corp.slack.com/archives/C04JCU51NF8/p1707476487580579)

## Which issue(s) this PR fixes

https://github.com/grafana/oncall/issues/3331

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)

---------

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2024-02-20 12:09:22 +00:00
..
serializers Use autogenerated types for alert_receive_channels (#3851) 2024-02-20 12:09:22 +00:00
tests Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
throttlers Fix warnings when running backend tests (#2079) 2023-06-06 18:38:00 +00:00
views Use autogenerated types for alert_receive_channels (#3851) 2024-02-20 12:09:22 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert_group_table_columns.py Alert group column/label selector (#3281) 2023-11-29 12:11:31 +00:00
errors.py Fix backend for resolution notes via mobile app (#2117) 2023-06-07 12:19:16 +00:00
label_filtering.py Webhook labels (#3383) 2023-11-22 11:17:41 +00:00
permissions.py Permissions for labels (#3173) 2023-10-23 11:03:51 +00:00
urls.py Alert group column/label selector (#3281) 2023-11-29 12:11:31 +00:00