diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dfde0fc..882c2df1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v1.2.5 (2023-03-30) + +### Fixed + +- Fixed a bug with Slack links not working in the plugin UI ([#1671](https://github.com/grafana/oncall/pull/1671)) + ## v1.2.4 (2023-03-30) ### Added diff --git a/grafana-plugin/src/components/Tutorial/Tutorial.tsx b/grafana-plugin/src/components/Tutorial/Tutorial.tsx index 213e33bd..51a05bee 100644 --- a/grafana-plugin/src/components/Tutorial/Tutorial.tsx +++ b/grafana-plugin/src/components/Tutorial/Tutorial.tsx @@ -66,7 +66,7 @@ const Tutorial: FC = (props) => {
- +
diff --git a/grafana-plugin/src/containers/AlertReceiveChannelCard/AlertReceiveChannelCard.tsx b/grafana-plugin/src/containers/AlertReceiveChannelCard/AlertReceiveChannelCard.tsx index cc4699d5..71c1b2f1 100644 --- a/grafana-plugin/src/containers/AlertReceiveChannelCard/AlertReceiveChannelCard.tsx +++ b/grafana-plugin/src/containers/AlertReceiveChannelCard/AlertReceiveChannelCard.tsx @@ -65,7 +65,7 @@ const AlertReceiveChannelCard = observer((props: AlertReceiveChannelCardProps) = {alertReceiveChannelCounter && ( (
Demo alert was generated. Find it on the - "Alert Groups" + "Alert Groups" page and make sure it didn't freak out your colleagues 😉
); diff --git a/grafana-plugin/src/containers/AttachIncidentForm/AttachIncidentForm.tsx b/grafana-plugin/src/containers/AttachIncidentForm/AttachIncidentForm.tsx index 74b110ce..a7445181 100644 --- a/grafana-plugin/src/containers/AttachIncidentForm/AttachIncidentForm.tsx +++ b/grafana-plugin/src/containers/AttachIncidentForm/AttachIncidentForm.tsx @@ -63,15 +63,15 @@ const AttachIncidentForm = observer(({ id, onUpdate, onHide }: AttachIncidentFor title={ - Attach to another alert group + Attach to another incident } className={cx('root')} onDismiss={onHide} > { {selectedAlertItem ? ( {JSON.stringify(selectedAlertItem, null, 2)} ) : ( - ← Select alert group first + ← Select incident first )}
diff --git a/grafana-plugin/src/containers/IntegrationSettings/IntegrationSettings.tsx b/grafana-plugin/src/containers/IntegrationSettings/IntegrationSettings.tsx index 0154fe2c..ace4c65d 100644 --- a/grafana-plugin/src/containers/IntegrationSettings/IntegrationSettings.tsx +++ b/grafana-plugin/src/containers/IntegrationSettings/IntegrationSettings.tsx @@ -59,7 +59,6 @@ const IntegrationSettings = observer((props: IntegrationSettingsProps) => { const [expanded, _setExpanded] = useState(false); const handleSwitchToTemplate = (templateName: string) => { - setActiveTab(IntegrationSettingsTab.Templates); setSelectedTemplate(templateName); }; diff --git a/grafana-plugin/src/containers/IntegrationSettings/parts/Autoresolve.module.css b/grafana-plugin/src/containers/IntegrationSettings/parts/Autoresolve.module.css index 0614492e..c3710fe4 100644 --- a/grafana-plugin/src/containers/IntegrationSettings/parts/Autoresolve.module.css +++ b/grafana-plugin/src/containers/IntegrationSettings/parts/Autoresolve.module.css @@ -34,12 +34,7 @@ padding: 4px 8px; margin-top: 8px; min-width: 500px; - width: 620px; -} - -.autoresolve-div { - display: flex; - align-items: baseline; + width: 520px; } .warning-icon-color { diff --git a/grafana-plugin/src/containers/IntegrationSettings/parts/Autoresolve.tsx b/grafana-plugin/src/containers/IntegrationSettings/parts/Autoresolve.tsx index 6b4e8c83..8d61fcb4 100644 --- a/grafana-plugin/src/containers/IntegrationSettings/parts/Autoresolve.tsx +++ b/grafana-plugin/src/containers/IntegrationSettings/parts/Autoresolve.tsx @@ -150,7 +150,7 @@ const Autoresolve = ({ alertReceiveChannelId, onSwitchToTemplate, alertGroupId }
@@ -172,9 +172,9 @@ const Autoresolve = ({ alertReceiveChannelId, onSwitchToTemplate, alertGroupId } {autoresolveSelected && ( <> -
+
- Alert group will be automatically resolved when it matches{' '} + Incident will be automatically resolved when it matches{' '} @@ -244,7 +244,7 @@ class IncidentPage extends React.Component - + {/* @ts-ignore*/} @@ -256,12 +256,12 @@ class IncidentPage extends React.Component {incident.root_alert_group && ( Attached to{' '} - + #{incident.root_alert_group.inside_organization_number}{' '} {incident.root_alert_group.render_for_web.title} {' '} - @@ -421,7 +421,9 @@ class IncidentPage extends React.Component getUnattachClickHandler = (pk: Alert['pk']) => { const { store } = this.props; - return store.alertGroupStore.unattachAlert(pk).then(this.update); + return () => { + store.alertGroupStore.unattachAlert(pk).then(this.update); + }; }; renderTimeline = () => { @@ -760,7 +762,7 @@ function AttachedIncidentsList({ {alerts.map((incident) => { return ( - + #{incident.inside_organization_number} {incident.render_for_web.title} diff --git a/grafana-plugin/src/pages/incidents/Incidents.tsx b/grafana-plugin/src/pages/incidents/Incidents.tsx index 5c2fe3de..cc4769cc 100644 --- a/grafana-plugin/src/pages/incidents/Incidents.tsx +++ b/grafana-plugin/src/pages/incidents/Incidents.tsx @@ -127,7 +127,7 @@ class Incidents extends React.Component this.setState({ showAddAlertGroupForm: false }); }} onCreate={(id: Alert['pk']) => { - history.push(`${PLUGIN_ROOT}/alert-groups/${id}`); + history.push(`${PLUGIN_ROOT}/incidents/${id}`); }} /> )} @@ -557,13 +557,7 @@ class Incidents extends React.Component
{record.render_for_web.title} diff --git a/grafana-plugin/src/pages/index.tsx b/grafana-plugin/src/pages/index.tsx index ab094bf5..acdeceb4 100644 --- a/grafana-plugin/src/pages/index.tsx +++ b/grafana-plugin/src/pages/index.tsx @@ -27,24 +27,24 @@ function getPath(name = '') { export const pages: { [id: string]: PageDefinition } = [ { icon: 'bell', - id: 'alert-groups', + id: 'incidents', hideFromBreadcrumbs: true, text: 'Alert Groups', hideTitle: true, - path: getPath('alert-groups'), + path: getPath('incidents'), action: UserActions.AlertGroupsRead, }, { icon: 'bell', - id: 'alert-group', + id: 'incident', text: '', hideFromTabs: true, hideFromBreadcrumbs: true, parentItem: { - text: 'Alert Group', - url: `${PLUGIN_ROOT}/alert-groups`, + text: 'Incident', + url: `${PLUGIN_ROOT}/incidents`, }, - path: getPath('alert-groups'), + path: getPath('incident'), action: UserActions.AlertGroupsRead, }, { @@ -189,8 +189,8 @@ export const pages: { [id: string]: PageDefinition } = [ }, {}); export const ROUTES = { - 'alert-groups': ['alert-groups'], - 'alert-group': ['alert-groups/:id'], + incidents: ['incidents'], + incident: ['incidents/:id'], users: ['users', 'users/:id'], integrations: ['integrations', 'integrations/:id'], escalations: ['escalations', 'escalations/:id'], @@ -205,10 +205,6 @@ export const ROUTES = { 'live-settings': ['live-settings'], cloud: ['cloud'], test: ['test'], - - // backwards compatible to redirect to new alert-groups - incident: ['incidents/:id'], - incidents: ['incidents'], }; export const getRoutesForPage = (name: string) => { diff --git a/grafana-plugin/src/plugin.json b/grafana-plugin/src/plugin.json index 2ab9172e..7f10dc71 100644 --- a/grafana-plugin/src/plugin.json +++ b/grafana-plugin/src/plugin.json @@ -41,7 +41,7 @@ { "type": "page", "name": "Alert Groups", - "path": "/a/grafana-oncall-app/alert-groups", + "path": "/a/grafana-oncall-app/incidents", "role": "Viewer", "action": "grafana-oncall-app.alert-groups:read", "addToNav": true diff --git a/grafana-plugin/src/plugin/GrafanaPluginRootPage.tsx b/grafana-plugin/src/plugin/GrafanaPluginRootPage.tsx index 18585ea9..04fafaf8 100644 --- a/grafana-plugin/src/plugin/GrafanaPluginRootPage.tsx +++ b/grafana-plugin/src/plugin/GrafanaPluginRootPage.tsx @@ -14,7 +14,7 @@ import weekday from 'dayjs/plugin/weekday'; import { observer, Provider } from 'mobx-react'; import Header from 'navbar/Header/Header'; import LegacyNavTabsBar from 'navbar/LegacyNavTabsBar'; -import { Redirect, Route, Switch, useLocation } from 'react-router-dom'; +import { Route, Switch, useLocation } from 'react-router-dom'; import { AppRootProps } from 'types'; import Unauthorized from 'components/Unauthorized'; @@ -138,10 +138,10 @@ export const Root = observer((props: AppRootProps) => { > {userHasAccess ? ( - + - + @@ -183,32 +183,6 @@ export const Root = observer((props: AppRootProps) => { - - ( - - )} - > - ( - - )} - > - diff --git a/grafana-plugin/src/utils/consts.ts b/grafana-plugin/src/utils/consts.ts index 11c01ed8..57e004ba 100644 --- a/grafana-plugin/src/utils/consts.ts +++ b/grafana-plugin/src/utils/consts.ts @@ -11,7 +11,7 @@ export const GRAFANA_LICENSE_OSS = 'OpenSource'; export const BREAKPOINT_TABS = 1024; // Default redirect page -export const DEFAULT_PAGE = 'alert-groups'; +export const DEFAULT_PAGE = 'incidents'; export const PLUGIN_ROOT = '/a/grafana-oncall-app'; diff --git a/grafana-plugin/src/utils/url.ts b/grafana-plugin/src/utils/url.ts index b87fd490..f286f996 100644 --- a/grafana-plugin/src/utils/url.ts +++ b/grafana-plugin/src/utils/url.ts @@ -22,7 +22,7 @@ export function getPathFromQueryParams(query: ParsedQuery) { path += `/${normalizedQuery.page}`; if (normalizedQuery.id) { - if (normalizedQuery.page === 'alert-group' || normalizedQuery.page === 'schedule') { + if (normalizedQuery.page === 'incident' || normalizedQuery.page === 'schedule') { path += 's'; }