mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
annotations editor menu should not appear if annotations are disabled (#42068)
This commit is contained in:
parent
035e676cad
commit
410044fa05
@ -71,6 +71,7 @@ export const TimeSeriesPanel: React.FC<TimeSeriesPanelProps> = ({
|
|||||||
<AnnotationsPlugin annotations={data.annotations} config={config} timeZone={timeZone} />
|
<AnnotationsPlugin annotations={data.annotations} config={config} timeZone={timeZone} />
|
||||||
)}
|
)}
|
||||||
{/* Enables annotations creation*/}
|
{/* Enables annotations creation*/}
|
||||||
|
{enableAnnotationCreation ? (
|
||||||
<AnnotationEditorPlugin data={alignedDataFrame} timeZone={timeZone} config={config}>
|
<AnnotationEditorPlugin data={alignedDataFrame} timeZone={timeZone} config={config}>
|
||||||
{({ startAnnotating }) => {
|
{({ startAnnotating }) => {
|
||||||
return (
|
return (
|
||||||
@ -79,9 +80,7 @@ export const TimeSeriesPanel: React.FC<TimeSeriesPanelProps> = ({
|
|||||||
config={config}
|
config={config}
|
||||||
timeZone={timeZone}
|
timeZone={timeZone}
|
||||||
replaceVariables={replaceVariables}
|
replaceVariables={replaceVariables}
|
||||||
defaultItems={
|
defaultItems={[
|
||||||
enableAnnotationCreation
|
|
||||||
? [
|
|
||||||
{
|
{
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
@ -97,13 +96,20 @@ export const TimeSeriesPanel: React.FC<TimeSeriesPanelProps> = ({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]}
|
||||||
: []
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</AnnotationEditorPlugin>
|
</AnnotationEditorPlugin>
|
||||||
|
) : (
|
||||||
|
<ContextMenuPlugin
|
||||||
|
data={alignedDataFrame}
|
||||||
|
config={config}
|
||||||
|
timeZone={timeZone}
|
||||||
|
replaceVariables={replaceVariables}
|
||||||
|
defaultItems={[]}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{data.annotations && (
|
{data.annotations && (
|
||||||
<ExemplarsPlugin
|
<ExemplarsPlugin
|
||||||
config={config}
|
config={config}
|
||||||
|
Loading…
Reference in New Issue
Block a user