oncall-engine/engine/apps
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
..
alerts Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
api Use autogenerated types for alert_receive_channels (#3851) 2024-02-20 12:09:22 +00:00
api_for_grafana_incident Add render_for_web information to alert group incident API (#3005) 2023-09-12 12:02:42 +00:00
auth_token Add more logging to plugin sync and install (#3730) 2024-01-23 22:59:33 +00:00
base Allow setting email app to use SSL instead of TLS (#3911) 2024-02-20 03:38:09 -05:00
email Allow setting email app to use SSL instead of TLS (#3911) 2024-02-20 03:38:09 -05:00
grafana_plugin Enable labels feature only if labels plugin is enabled (#3769) 2024-01-30 07:29:16 +00:00
heartbeat Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
integrations add pytest-xdist to speed up backend tests (#3839) 2024-02-05 16:04:15 -05:00
labels Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
metrics_exporter Add transaction on_commit before signals for alert group actions (#3731) 2024-01-31 15:54:50 -07:00
mobile_app Fix rounding issue with displayed time when sending "You're going oncall" push notification (#3872) 2024-02-09 15:31:34 -05:00
oss_installation Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
phone_notifications Revert "upgrade to Python 3.12 (#3456)" and "bump uwsgi version to latest #3466" (#3483) 2023-12-01 09:56:26 -05:00
public_api Restrict integration name uniqueness per team (#3863) 2024-02-12 11:40:08 +00:00
schedules Refactor gaps and empty shift checks (#3785) 2024-01-31 15:25:06 +01:00
slack Check for permissions on Slack escalate command (#3891) 2024-02-14 19:02:09 +00:00
social_auth Don't check chatops gateway link in OSS deployment (#3893) 2024-02-14 13:15:04 +00:00
telegram Handle ag telegram message does not exist (#3830) 2024-02-05 12:19:41 +00:00
twilioapp add missing db migrations + add additional backend db migration check to CI (#3234) 2023-10-31 16:00:55 -04:00
user_management Fix grafana_labels sync 2024-02-01 13:43:32 +08:00
webhooks Add status change trigger type to webhooks (#3920) 2024-02-19 14:12:56 -03:00
zvonok Improve zvonok verification call (#3768) 2024-02-08 14:05:11 -05:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00