oncall-engine/engine/apps/api/views
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
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert_group.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
alert_group_table_settings.py Alert group column/label selector (#3281) 2023-11-29 12:11:31 +00:00
alert_receive_channel.py Use autogenerated types for alert_receive_channels (#3851) 2024-02-20 12:09:22 +00:00
alert_receive_channel_template.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
alerts.py Add alert detail view (#385) 2022-08-19 14:03:07 +05:00
auth.py Enable flake8-bugbear, fix issues (#3454) 2023-11-29 15:04:48 +00:00
channel_filter.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
custom_button.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
escalation_chain.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
escalation_policy.py let mobile app use escalation options endpoints (#3847) 2024-02-07 09:55:38 +00:00
features.py Enable Grafana Alerting v2 integration (#3808) 2024-02-01 16:20:47 +08:00
integration_heartbeat.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
labels.py Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
live_setting.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
on_call_shifts.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
organization.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
paging.py Let mobile use paging endpoint (#3619) 2024-01-08 12:18:39 +00:00
preview_template_options.py Fix of templates api behaviour for public and private api (#1408) 2023-03-01 16:32:15 +08:00
public_api_tokens.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
resolution_note.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
route_regex_debugger.py remove references to AlertGroup.is_archived and AlertGroup.unarchived_objects (#2524) 2023-07-18 11:48:34 +00:00
schedule.py Refactor gaps and empty shift checks (#3785) 2024-01-31 15:25:06 +01:00
shift_swap.py Notify user when their shift swap request is taken (#2992) 2023-09-07 14:59:54 +00:00
slack_channel.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
slack_team_settings.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
team.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
telegram_channels.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
user.py Update user details internal API perms (#3900) 2024-02-16 16:48:24 +00:00
user_group.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
user_notification_policy.py WIP: Direct paging improvements (#3064) 2023-09-28 03:57:49 +00:00
webhooks.py Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00