Annotations: Prevent creating on unsaved dashboard (#81200)

This commit is contained in:
Adela Almasan
2024-01-24 19:24:52 -06:00
committed by GitHub
parent 1d25039674
commit 9da3db1ddf
5 changed files with 7 additions and 7 deletions
@@ -299,8 +299,8 @@ export const CandlestickPanel = ({
/>
);
}}
maxWidth={options.tooltip.maxWidth}
maxHeight={options.tooltip.maxHeight}
maxWidth={options.tooltip?.maxWidth}
maxHeight={options.tooltip?.maxHeight}
/>
) : (
<>
@@ -320,7 +320,7 @@ export const CandlestickPanel = ({
annotations={data.annotations ?? []}
config={uplotConfig}
timeZone={timeZone}
newRange={newAnnotationRange}
newRange={enableAnnotationCreation ? newAnnotationRange : null}
setNewRange={setNewAnnotationRange}
/>
) : (
@@ -286,7 +286,7 @@ export const HeatmapPanel = ({
annotations={data.annotations ?? []}
config={builder}
timeZone={timeZone}
newRange={newAnnotationRange}
newRange={enableAnnotationCreation ? newAnnotationRange : null}
setNewRange={setNewAnnotationRange}
canvasRegionRendering={false}
/>
@@ -249,7 +249,7 @@ export const StateTimelinePanel = ({
annotations={data.annotations ?? []}
config={builder}
timeZone={timeZone}
newRange={newAnnotationRange}
newRange={enableAnnotationCreation ? newAnnotationRange : null}
setNewRange={setNewAnnotationRange}
canvasRegionRendering={false}
/>
@@ -275,7 +275,7 @@ export const StatusHistoryPanel = ({
annotations={data.annotations ?? []}
config={builder}
timeZone={timeZone}
newRange={newAnnotationRange}
newRange={enableAnnotationCreation ? newAnnotationRange : null}
setNewRange={setNewAnnotationRange}
canvasRegionRendering={false}
/>
@@ -170,7 +170,7 @@ export const TimeSeriesPanel = ({
annotations={data.annotations ?? []}
config={uplotConfig}
timeZone={timeZone}
newRange={newAnnotationRange}
newRange={enableAnnotationCreation ? newAnnotationRange : null}
setNewRange={setNewAnnotationRange}
/>
) : (