Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <dxho@amazon.com>
  • Loading branch information
derek-ho committed Apr 27, 2023
1 parent f62f1b8 commit dbc7976
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions public/components/custom_panels/custom_panel_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const CustomPanelTable = ({
setToast('Invalid Dashboard name', 'danger');
} else {
const newPanel = newPanelTemplate(newCustomPanelName);
dispatch(createPanel(newPanel, setToast));
dispatch(createPanel(newPanel));
}
closeModal();
};
Expand Down Expand Up @@ -158,7 +158,7 @@ export const CustomPanelTable = ({
title: newName,
};

dispatch(createPanel(newPanel, setToast));
dispatch(createPanel(newPanel));
} catch (err) {
setToast(
'Error cloning Observability Dashboard, please make sure you have the correct permission.',
Expand Down
20 changes: 18 additions & 2 deletions public/components/custom_panels/custom_panel_view_so.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import {
import { useToast } from '../common/toast';
import PPLService from '../../services/requests/ppl';
import DSLService from '../../services/requests/dsl';

/*
* "CustomPanelsView" module used to render an Observability Dashboard
*
Expand Down Expand Up @@ -258,10 +258,27 @@ export const CustomPanelViewSO = (props: CustomPanelViewProps) => {
};

// toggle between panel edit mode
<<<<<<< HEAD
const editPanel = (editType: string) => {
setIsEditing(!isEditing);
if (editType === 'cancel') dispatch(fetchPanel(panelId));
setEditActionType(editType);
=======

const startEdit = () => {
setIsEditing(true);
};

const applyEdits = useCallback(() => {
dispatch(updatePanel(panel, '', ''));
setIsEditing(false);
setEditActionType('save');
}, [panel]);

const cancelEdit = () => {
dispatch(fetchPanel(panelId));
setIsEditing(false);
>>>>>>> 22977feb (code cleanup)
};

const closeFlyout = () => {
Expand Down Expand Up @@ -446,7 +463,6 @@ export const CustomPanelViewSO = (props: CustomPanelViewProps) => {
pplFilterValue={pplFilterValue}
start={panel.timeRange.from}
end={panel.timeRange.to}
setToast={setToast}
http={coreRefs.http!}
pplService={pplService}
setPanelVisualizations={setPanelVisualizations}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,12 @@ interface VisualizationFlyoutSOProps {
}

export const VisaulizationFlyoutSO = ({
panelId,
appId = '',
pplFilterValue,
closeFlyout,
start,
end,
http,
savedObjects,
pplService,
setPanelVisualizations,
isFlyoutReplacement,
replaceVisualizationId,
addVisualizationPanel,
Expand Down

0 comments on commit dbc7976

Please sign in to comment.