diff --git a/Dashboard/src/Components/Dashboard/Canvas/ArgumentsForm.tsx b/Dashboard/src/Components/Dashboard/Canvas/ArgumentsForm.tsx index 0b5a5ed690..6046a0adba 100644 --- a/Dashboard/src/Components/Dashboard/Canvas/ArgumentsForm.tsx +++ b/Dashboard/src/Components/Dashboard/Canvas/ArgumentsForm.tsx @@ -18,7 +18,9 @@ import DashboardComponentType from "Common/Types/Dashboard/DashboardComponentTyp export interface ComponentProps { component: DashboardBaseComponent; - onHasFormValidationErrors?: ((values: Dictionary) => void) | undefined; + onHasFormValidationErrors?: + | ((values: Dictionary) => void) + | undefined; onFormChange: (component: DashboardBaseComponent) => void; } @@ -34,8 +36,8 @@ const ArgumentsForm: FunctionComponent = ( >({}); useEffect(() => { - if(props.onHasFormValidationErrors) { - props.onHasFormValidationErrors(hasFormValidationErrors); + if (props.onHasFormValidationErrors) { + props.onHasFormValidationErrors(hasFormValidationErrors); } }, [hasFormValidationErrors]); diff --git a/Dashboard/src/Components/Dashboard/DashboardView.tsx b/Dashboard/src/Components/Dashboard/DashboardView.tsx index 2c0bd07ffc..76772de786 100644 --- a/Dashboard/src/Components/Dashboard/DashboardView.tsx +++ b/Dashboard/src/Components/Dashboard/DashboardView.tsx @@ -54,22 +54,23 @@ const DashboardViewer: FunctionComponent = ( setDashboardTotalWidth(dashboardViewRef.current?.offsetWidth || 0); }; - const saveDashboardViewConfig: PromiseVoidFunction = async (): Promise => { - try { - setIsSaving(true); - await ModelAPI.updateById({ - modelType: Dashboard, - id: props.dashboardId, - data: { - dashboardViewConfig: dashboardViewConfig, - }, - }); - } catch (err) { - setError(API.getFriendlyErrorMessage(err as Error)); - } + const saveDashboardViewConfig: PromiseVoidFunction = + async (): Promise => { + try { + setIsSaving(true); + await ModelAPI.updateById({ + modelType: Dashboard, + id: props.dashboardId, + data: { + dashboardViewConfig: dashboardViewConfig, + }, + }); + } catch (err) { + setError(API.getFriendlyErrorMessage(err as Error)); + } - setIsSaving(false); - } + setIsSaving(false); + }; useEffect(() => { setDashboardTotalWidth(dashboardViewRef.current?.offsetWidth || 0); @@ -118,7 +119,7 @@ const DashboardViewer: FunctionComponent = ( dashboard.dashboardViewConfig || DashboardViewConfigUtil.createDefaultDashboardViewConfig(), ); - setDashboardName(dashboard.name || 'Untitled Dashboard'); + setDashboardName(dashboard.name || "Untitled Dashboard"); } catch (err) { setError(API.getFriendlyErrorMessage(err as Error)); } diff --git a/Dashboard/src/Components/Dashboard/Toolbar/DashboardToolbar.tsx b/Dashboard/src/Components/Dashboard/Toolbar/DashboardToolbar.tsx index fc57509e13..a1b5abb3e6 100644 --- a/Dashboard/src/Components/Dashboard/Toolbar/DashboardToolbar.tsx +++ b/Dashboard/src/Components/Dashboard/Toolbar/DashboardToolbar.tsx @@ -33,88 +33,88 @@ const DashboardToolbar: FunctionComponent = ( {/* Name Component */} {props.dashboardName} - {!props.isSaving &&
- {isEditMode ? ( - - { - props.onAddComponentClick(DashboardComponentType.Chart); - }} - /> - { - props.onAddComponentClick(DashboardComponentType.Value); - }} - /> - { - props.onAddComponentClick(DashboardComponentType.Text); - }} - /> - - ) : ( - <> - )} + {!props.isSaving && ( +
+ {isEditMode ? ( + + { + props.onAddComponentClick(DashboardComponentType.Chart); + }} + /> + { + props.onAddComponentClick(DashboardComponentType.Value); + }} + /> + { + props.onAddComponentClick(DashboardComponentType.Text); + }} + /> + + ) : ( + <> + )} - {!isEditMode && !props.isFullScreen && ( -
} - { - props.isSaving && ( -
-
-
Saving...
-
- ) - } + {isEditMode && ( +
+ )} + {props.isSaving && ( +
+
+
Saving...
+
+ )} );