Conversation
Signed-off-by: Peter Fitzgibbons <pjfitz@amazon.com>
Signed-off-by: Peter Fitzgibbons <pjfitz@amazon.com>
| }); | ||
|
|
||
| describe('Testing panels table', () => { | ||
| describe.only('Testing panels table', () => { |
There was a problem hiding this comment.
I feel the .only, commented code and console.log additions were part of cypress debugging. We can remove these.
| 'Cancel', | ||
| 'Duplicate', | ||
| selectedCustomPanels[0].title + ' (copy)', | ||
| selectedCustomPanels[0].title + ' (copy)x', |
| services: { toasts }, | ||
| } = useOpenSearchDashboards<ObservabilityAppServices>(); | ||
|
|
||
| const setToast = (title: string, color: Color = 'success', text?, side?: string) => { |
There was a problem hiding this comment.
We can remove the side parameter, if not being used.
There was a problem hiding this comment.
Side is used when toast during flyout. So unless toast on right-side is OK while visualization flyout and others are active, only then could we remove it.
Side is being passed-through on OSD API
There was a problem hiding this comment.
I may be missing something here. Can you please explain how are you using/passing down the side parameter in this function?
| const [modalLayout, setModalLayout] = useState(<EuiOverlayMask />); // Modal Layout | ||
| const [isActionsPopoverOpen, setIsActionsPopoverOpen] = useState(false); | ||
| const [selectedCustomPanels, setselectedCustomPanels] = useState<CustomPanelType[]>([]); | ||
| const [selectedCustomPanels, setselectedCustomPanels$] = useState<CustomPanelType[]>([]); |
There was a problem hiding this comment.
Not sure if the $ is expected here. I see the below reference is setselectedCustomPanels
There was a problem hiding this comment.
There was debugging. Will double-check.
| const newPanel = newPanelTemplate(newCustomPanelName); | ||
| dispatch(createPanel(newPanel)); | ||
| } |
There was a problem hiding this comment.
Should we add a toast for create panel here?
From the change in panel_slice.tsx, I see that we are not redirecting to a new panel when created. So, the user stays in home table page after the panel is created.
There was a problem hiding this comment.
I think we should be redirecting - that is the current behavior?
| 'Error cloning Operational Panel, please make sure you have the correct permission.', | ||
| 'danger' | ||
| ); | ||
| console.log(err); |
There was a problem hiding this comment.
We should replace console.log with console.error to show errors.
| window.location.assign(`#/event_analytics/explorer/${savedVisId}`); | ||
| }; | ||
|
|
||
| const services = { toasts: { addDanger: (t) => {} } } |
There was a problem hiding this comment.
| @@ -0,0 +1,40 @@ | |||
| import { createSlice } from '@reduxjs/toolkit'; | |||
|
|
||
| const services: ObservabilityAppServices = { | ||
| toasts: coreStart.notifications.toasts, | ||
| }; |
There was a problem hiding this comment.
why is this another service and not using your coreRefs?
|
also backport to main? |
Description
Apply OSD GlobalToast to CustomPanels
Issues Resolved
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.