diff --git a/grafana-plugin/src/components/CheatSheet/CheatSheet.module.css b/grafana-plugin/src/components/CheatSheet/CheatSheet.module.css index 3093ecb2..2915452c 100644 --- a/grafana-plugin/src/components/CheatSheet/CheatSheet.module.css +++ b/grafana-plugin/src/components/CheatSheet/CheatSheet.module.css @@ -3,6 +3,7 @@ height: 100%; padding: 16px; border: var(--border-weak); + min-width: min-content; } .cheatsheet-item { diff --git a/grafana-plugin/src/components/CheatSheet/CheatSheet.tsx b/grafana-plugin/src/components/CheatSheet/CheatSheet.tsx index 1649df3b..b6fa2cb1 100644 --- a/grafana-plugin/src/components/CheatSheet/CheatSheet.tsx +++ b/grafana-plugin/src/components/CheatSheet/CheatSheet.tsx @@ -13,6 +13,7 @@ import { CheatSheetInterface, CheatSheetItem } from './CheatSheet.config'; import styles from './CheatSheet.module.css'; interface CheatSheetProps { + cheatSheetName: string; cheatSheetData: CheatSheetInterface; onClose: () => void; } @@ -20,12 +21,12 @@ interface CheatSheetProps { const cx = cn.bind(styles); const CheatSheet = (props: CheatSheetProps) => { - const { cheatSheetData, onClose } = props; + const { cheatSheetName, cheatSheetData, onClose } = props; return (
- {cheatSheetData.name} + {cheatSheetName} cheatsheet {cheatSheetData.description} diff --git a/grafana-plugin/src/components/GForm/GForm.tsx b/grafana-plugin/src/components/GForm/GForm.tsx index 03bd9c76..9ca6af54 100644 --- a/grafana-plugin/src/components/GForm/GForm.tsx +++ b/grafana-plugin/src/components/GForm/GForm.tsx @@ -128,7 +128,7 @@ class GForm extends React.Component { disabled={formItem.getDisabled ? formItem.getDisabled(getValues()) : false} label={formItem.label || capitalCase(formItem.name)} invalid={!!errors[formItem.name]} - error={`${capitalCase(formItem.name)} is required`} + error={formItem.label ? `${formItem.label} is required` : `${capitalCase(formItem.name)} is required`} description={formItem.description} > {renderFormControl(formItem, register, control, (field, value) => { diff --git a/grafana-plugin/src/containers/IntegrationTemplate/IntegrationTemplate.module.css b/grafana-plugin/src/containers/IntegrationTemplate/IntegrationTemplate.module.css index d51b2bcf..17f7b2a2 100644 --- a/grafana-plugin/src/containers/IntegrationTemplate/IntegrationTemplate.module.css +++ b/grafana-plugin/src/containers/IntegrationTemplate/IntegrationTemplate.module.css @@ -25,6 +25,7 @@ border: var(--border-weak); background-color: var(--background-secondary); height: 56px; + min-width: min-content; } .template-block-list { diff --git a/grafana-plugin/src/containers/IntegrationTemplate/IntegrationTemplate.tsx b/grafana-plugin/src/containers/IntegrationTemplate/IntegrationTemplate.tsx index 539e645e..2d9afecc 100644 --- a/grafana-plugin/src/containers/IntegrationTemplate/IntegrationTemplate.tsx +++ b/grafana-plugin/src/containers/IntegrationTemplate/IntegrationTemplate.tsx @@ -100,7 +100,7 @@ const IntegrationTemplate = observer((props: IntegrationTemplateProps) => { const onSaveAndFollowLink = useCallback( (link: string) => { - onHide(); + onUpdateTemplates({ [template.name]: changedTemplateBody }); window.open(link, '_blank'); }, [onUpdateTemplates, onUpdateRoute, changedTemplateBody] @@ -174,7 +174,11 @@ const IntegrationTemplate = observer((props: IntegrationTemplateProps) => { templates={templates} /> {isCheatSheetVisible ? ( - + ) : ( <>
@@ -189,7 +193,7 @@ const IntegrationTemplate = observer((props: IntegrationTemplateProps) => {
{ {isCondition ? ( <> True + {`Selected alert will ${templateName.substring( + 0, + templateName.indexOf('_') + )} alert group`} ) : ( - - -
- + + + +
+ + {`Selected alert will not ${templateName.substring( + 0, + templateName.indexOf('_') + )} alert group`} + )} ) : ( diff --git a/grafana-plugin/src/containers/TemplatesAlertGroupsList/TemplatesAlertGroupsList.module.css b/grafana-plugin/src/containers/TemplatesAlertGroupsList/TemplatesAlertGroupsList.module.css index 59ff3509..29df3d90 100644 --- a/grafana-plugin/src/containers/TemplatesAlertGroupsList/TemplatesAlertGroupsList.module.css +++ b/grafana-plugin/src/containers/TemplatesAlertGroupsList/TemplatesAlertGroupsList.module.css @@ -1,7 +1,7 @@ .template-block-title { padding: 16px 16px 16px 0; align-items: baseline; - height: 56px; + min-height: 56px; } .template-block-list { @@ -31,6 +31,11 @@ width: 100%; } +.alert-groups-editor div[aria-label='Code editor container'] { + border-bottom: none; + border-right: none; +} + .no-alert-groups-badge { display: flex; padding: 8px; diff --git a/grafana-plugin/src/containers/TemplatesAlertGroupsList/TemplatesAlertGroupsList.tsx b/grafana-plugin/src/containers/TemplatesAlertGroupsList/TemplatesAlertGroupsList.tsx index 6e0ae4f7..26cc233b 100644 --- a/grafana-plugin/src/containers/TemplatesAlertGroupsList/TemplatesAlertGroupsList.tsx +++ b/grafana-plugin/src/containers/TemplatesAlertGroupsList/TemplatesAlertGroupsList.tsx @@ -1,15 +1,6 @@ import React, { useEffect, useState } from 'react'; -import { - Button, - HorizontalGroup, - Tooltip, - Icon, - VerticalGroup, - IconButton, - Badge, - LoadingPlaceholder, -} from '@grafana/ui'; +import { Button, HorizontalGroup, Tooltip, Icon, IconButton, Badge, LoadingPlaceholder } from '@grafana/ui'; import cn from 'classnames/bind'; import { debounce } from 'lodash-es'; @@ -88,7 +79,7 @@ const TemplatesAlertGroupsList = (props: TemplatesAlertGroupsListProps) => {
-
+
{
-
- - -
- -
-
+
+
+ +
)} @@ -150,7 +138,7 @@ const TemplatesAlertGroupsList = (props: TemplatesAlertGroupsListProps) => {
-
+
this.setState({ isEditTemplateModalOpen: undefined, }); + this.setState({ isTemplateSettingsOpen: true }); LocationHelper.update({ template: undefined, routeId: undefined }, 'partial'); }} channelFilterId={channelFilterIdForEdit}