From 42ac99d42965ede4daa2f97a876df52ac833a866 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Wed, 3 Apr 2024 13:42:18 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Matthew Runyon --- plugins/ui/src/js/src/layout/ReactPanel.tsx | 2 +- plugins/ui/src/js/src/widget/WidgetUtils.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ui/src/js/src/layout/ReactPanel.tsx b/plugins/ui/src/js/src/layout/ReactPanel.tsx index 0bd3dbac9..09bc8ed64 100644 --- a/plugins/ui/src/js/src/layout/ReactPanel.tsx +++ b/plugins/ui/src/js/src/layout/ReactPanel.tsx @@ -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 diff --git a/plugins/ui/src/js/src/widget/WidgetUtils.tsx b/plugins/ui/src/js/src/widget/WidgetUtils.tsx index 1e13097fe..3848b365d 100644 --- a/plugins/ui/src/js/src/widget/WidgetUtils.tsx +++ b/plugins/ui/src/js/src/widget/WidgetUtils.tsx @@ -89,7 +89,7 @@ const PRESERVED_DATA_KEYS: (keyof ReadonlyWidgetData)[] = ['panelIds']; const PRESERVED_DATA_KEYS_SET = new Set(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.