Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Runyon <[email protected]>
  • Loading branch information
mofojed and mattrunyon authored Apr 3, 2024
1 parent 7483c55 commit 42ac99d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/ui/src/js/src/layout/ReactPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function ReactPanel({ children, title }: ReactPanelProps) {
/**
* Opens a panel in the layout if necessary. There are a few cases this is triggered:
* 1. Panel has not been opened yet: we need to open the panel in this case.
* 2. Panel metadata changes: we need to update the panel with the new metadata, show the panel in it's current stack,
* 2. Panel metadata changes: we need to update the panel with the new metadata, show the panel in its current stack,
* and refresh the content with new state.
* 3. Widget is being re-hydrated: we need to check if the panel ID is already open, and then use that existing portal.
* We don't need to focus in this case, as this is when a whole dashboard is being re-hydrated - not when the user is
Expand Down
2 changes: 1 addition & 1 deletion plugins/ui/src/js/src/widget/WidgetUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const PRESERVED_DATA_KEYS: (keyof ReadonlyWidgetData)[] = ['panelIds'];
const PRESERVED_DATA_KEYS_SET = new Set<string>(PRESERVED_DATA_KEYS);

/**
* Returns an object with only the data preserved that should be preserved when re-opening (i.e. opening it again from console) a widget.
* Returns an object with only the data preserved that should be preserved when re-opening a widget (e.g. opening it again from console).
* For example, if you re-open a widget, you want to keep the `panelIds` data because that will re-open the widget to where it was before.
* However, we do _not_ want to preserve the `state` in this case - we want to widget to start from a fresh state.
* Similar to how when you re-open a table, it'll open in the same spot, but all UI applied filters/operations will be reset.
Expand Down

0 comments on commit 42ac99d

Please sign in to comment.