From 3ba321cdd80888cd563b627f8abf98252c05fdde Mon Sep 17 00:00:00 2001 From: Ildar Iskhakov Date: Fri, 21 Jul 2023 14:59:05 +0800 Subject: [PATCH] Add filter integrations by type (#2609) # What this PR does ## Which issue(s) this PR fixes ## 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) --- CHANGELOG.md | 1 + engine/apps/api/views/alert_receive_channel.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01d3be74..1a3e2d7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Allow persisting mobile app's timezone, to allow for more accurate datetime related notifications by @joeyorlando ([#2601](https://github.com/grafana/oncall/pull/2601)) +- Add filter integrations by type ([2609](https://github.com/grafana/oncall/pull/2609)) ### Changed diff --git a/engine/apps/api/views/alert_receive_channel.py b/engine/apps/api/views/alert_receive_channel.py index 2e213ae7..a44f5a9a 100644 --- a/engine/apps/api/views/alert_receive_channel.py +++ b/engine/apps/api/views/alert_receive_channel.py @@ -80,7 +80,7 @@ class AlertReceiveChannelView( update_serializer_class = AlertReceiveChannelUpdateSerializer filter_backends = [SearchFilter, DjangoFilterBackend] - search_fields = ("verbal_name",) + search_fields = ("verbal_name", "integration") filterset_class = AlertReceiveChannelFilter pagination_class = FifteenPageSizePaginator @@ -284,6 +284,12 @@ class AlertReceiveChannelView( "href": api_root + "teams/", "global": True, }, + { + "name": "integration", + "display_name": "Type", + "type": "options", + "href": api_root + "alert_receive_channels/integration_options/", + }, ] if filter_name is not None: