Annotations: Add selector to new query button (#83240)

add selector
This commit is contained in:
Erik Sundell
2024-03-07 07:25:11 +01:00
committed by GitHub
parent d549a3aabb
commit bc34874bbb
2 changed files with 17 additions and 2 deletions
@@ -119,7 +119,14 @@ export const AnnotationSettingsList = ({ annotations, onNew, onEdit, onMove, onD
}}
/>
)}
{!showEmptyListCTA && <ListNewButton onClick={onNew}>New query</ListNewButton>}
{!showEmptyListCTA && (
<ListNewButton
data-testid={selectors.pages.Dashboard.Settings.Annotations.List.addAnnotationCTAV2}
onClick={onNew}
>
New query
</ListNewButton>
)}
</VerticalGroup>
);
};
@@ -2,6 +2,7 @@ import { css } from '@emotion/css';
import React, { useState } from 'react';
import { arrayUtils, AnnotationQuery } from '@grafana/data';
import { selectors } from '@grafana/e2e-selectors';
import { getDataSourceSrv } from '@grafana/runtime';
import { Button, DeleteButton, IconButton, useStyles2, VerticalGroup } from '@grafana/ui';
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
@@ -127,7 +128,14 @@ export const AnnotationSettingsList = ({ dashboard, onNew, onEdit }: Props) => {
}}
/>
)}
{!showEmptyListCTA && <ListNewButton onClick={onNew}>New query</ListNewButton>}
{!showEmptyListCTA && (
<ListNewButton
data-testid={selectors.pages.Dashboard.Settings.Annotations.List.addAnnotationCTAV2}
onClick={onNew}
>
New query
</ListNewButton>
)}
</VerticalGroup>
);
};