fix: save unit on dashboard without hitting apply (#912)

This commit is contained in:
Pranshu Chittora 2022-03-25 12:29:40 +05:30 committed by GitHub
parent 78b1a750fa
commit ca78947a55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,7 @@ export const SaveDashboard = ({
title,
widgetId,
dashboardId,
yAxisUnit,
}: SaveDashboardProps): ((dispatch: Dispatch<AppActions>) => void) => {
return async (dispatch: Dispatch<AppActions>): Promise<void> => {
try {
@ -39,6 +40,7 @@ export const SaveDashboard = ({
const updatednullZeroValues = nullZeroValues;
const updatedopacity = opacity;
const updatedtimePreferance = timePreferance;
const updatedYAxisUnit = yAxisUnit;
const selectedWidgetIndex = data.widgets?.findIndex(
(e) => e.id === widgetId,
@ -74,6 +76,7 @@ export const SaveDashboard = ({
opacity: updatedopacity,
title: updatedTitle,
timePreferance: updatedtimePreferance,
yAxisUnit: updatedYAxisUnit,
queryData: {
...selectedWidget.queryData,
data: [

View File

@ -357,6 +357,7 @@ const dashboard = (
case SAVE_SETTING_TO_PANEL_SUCCESS: {
const selectedDashboard = action.payload;
return {
...state,
dashboards: [