From 4efe1a42c9bf867d7cfddf2e413bb7d885d4af1e Mon Sep 17 00:00:00 2001 From: Joey Orlando Date: Tue, 31 Oct 2023 11:19:46 -0400 Subject: [PATCH] remove is_restricted from frontend codebase (#3219) # What this PR does The concept of `AlertGroup.is_restricted` is deprecated and no longer used. In a future release I will remove all references to `is_restricted` from the backend (doing it in separate releases to avoid any potential issues where the frontend still references it shortly after release of it being removed from the API response) ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated (N/A) - [ ] 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) --- .../src/models/alertgroup/alertgroup.types.ts | 1 - .../src/pages/incident/Incident.helpers.tsx | 12 ++-- .../src/pages/incident/Incident.tsx | 62 ++++--------------- 3 files changed, 18 insertions(+), 57 deletions(-) diff --git a/grafana-plugin/src/models/alertgroup/alertgroup.types.ts b/grafana-plugin/src/models/alertgroup/alertgroup.types.ts index 48369f4e..5514042e 100644 --- a/grafana-plugin/src/models/alertgroup/alertgroup.types.ts +++ b/grafana-plugin/src/models/alertgroup/alertgroup.types.ts @@ -55,7 +55,6 @@ export interface Alert { acknowledged_at: string; acknowledged_by_user: User; acknowledged_on_source: boolean; - is_restricted: boolean; channel: Channel; slack_permalink?: string; permalinks: { diff --git a/grafana-plugin/src/pages/incident/Incident.helpers.tsx b/grafana-plugin/src/pages/incident/Incident.helpers.tsx index 39b5c162..938b4841 100644 --- a/grafana-plugin/src/pages/incident/Incident.helpers.tsx +++ b/grafana-plugin/src/pages/incident/Incident.helpers.tsx @@ -153,7 +153,7 @@ export function getActionButtons(incident: AlertType, cx: any, callbacks: { [key const resolveButton = ( - @@ -161,7 +161,7 @@ export function getActionButtons(incident: AlertType, cx: any, callbacks: { [key const unacknowledgeButton = ( - @@ -169,7 +169,7 @@ export function getActionButtons(incident: AlertType, cx: any, callbacks: { [key const unresolveButton = ( - @@ -177,7 +177,7 @@ export function getActionButtons(incident: AlertType, cx: any, callbacks: { [key const acknowledgeButton = ( - @@ -188,7 +188,7 @@ export function getActionButtons(incident: AlertType, cx: any, callbacks: { [key if (incident.status === IncidentStatus.Silenced) { buttons.push( - @@ -198,7 +198,7 @@ export function getActionButtons(incident: AlertType, cx: any, callbacks: { [key ); diff --git a/grafana-plugin/src/pages/incident/Incident.tsx b/grafana-plugin/src/pages/incident/Incident.tsx index 98aca39f..42d2fc6d 100644 --- a/grafana-plugin/src/pages/incident/Incident.tsx +++ b/grafana-plugin/src/pages/incident/Incident.tsx @@ -171,7 +171,6 @@ class IncidentPage extends React.Component @@ -289,12 +288,7 @@ class IncidentPage extends React.Component {incident.root_alert_group.render_for_web.title} {' '} - @@ -310,16 +304,10 @@ class IncidentPage extends React.Component onClick={this.showAttachIncidentForm} tooltip="Attach to another Alert Group" className={cx('title-icon')} - disabled={incident.is_restricted} /> )} - + openNotification('Link copied'); }} > - + @@ -358,7 +341,7 @@ class IncidentPage extends React.Component query={{ page: 'integrations', id: incident.alert_receive_channel.id }} > @@ -427,7 +410,7 @@ class IncidentPage extends React.Component