From 17059489d8f127ab8988bcfd7f76afc15b3b7813 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Wed, 15 Apr 2020 07:51:51 -0700 Subject: [PATCH] Inspector: move `Panel JSON` and query inspector to the inspector (#23354) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * move Panel JSON to inspector * move Panel JSON to inspector * update test * use stats display options * move query inspector to inspector * open inspector from the queries section * subscribe to results * subscribe to results * open the right tab * apply review feedback * update menus (inspect tabs) * Dashboard: extend dashnav to add custom content (#23433) * Dashlist: Fixed dashlist broken in edit mode (#23426) * Chore: Fix bunch of strict null error to fix master CI (#23443) * Fix bunch of null error * Fix failing test * Another test fix * Docs: Add SQL region annotation examples (#23268) Add region annotation examples for SQL data sources in docs. Co-authored-by: Marcus Efraimsson * Docs: Update contributing doc to install node@12. (#23450) * NewPanelEdit: Minor style and description tweaks, AND PanelQueryRunner & autoMinMax (#23445) * NewPanelEdit: Minor style and description tweaks * Removed the worst snapshot of all time * ReactTable: adds color text to field options (#23427) * Feature: adds text color field config * Refactor: created an extension point * Refactor: uses HOC for extension instead * Fix: fixes background styling from affecting cells without display.color * Chore: export OptionsUIRegistryBuilder on grafana/data (#23444) * export the ui registry * add to utils index also * DataLinks: Do not full page reload data links links (#23429) * Templating: Fix global variable "__org.id" (#23362) * Fixed global variable __org.id value * correct orgId value * reverted the change as variables moved to new file * Chore: reduce null check errors to 788 (currently over 798) (#23449) * Fixed ts errors so build will succeed * Update packages/grafana-data/src/types/graph.ts Co-Authored-By: Ryan McKinley * Feedback from code review * Leaving out trivial typing's * Fix error with color being undefined now. * fix test with timezone issue * Fixed test Co-authored-by: Ryan McKinley Co-authored-by: Torkel Ödegaard * Cloudwatch: prefer webIdentity over EC2 role (#23452) * Plugins: add a signature status flag (#23420) * Progress * fixed button * Final touches * now works from edit mode * fix layout * show raw objects * move query inspector buttons to the bottom * update snapshot * Updated design * Made full page reload work * Fixed minor style issue * Updated * More fixes * Removed unused imports * Updated * Moved to data tab out to seperate component * fixed ts issue Co-authored-by: Torkel Ödegaard Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> Co-authored-by: Andrej Ocenas Co-authored-by: Alexandre de Verteuil Co-authored-by: Marcus Efraimsson Co-authored-by: Cyril Tovena Co-authored-by: Hugo Häggmark Co-authored-by: Vikky Omkar Co-authored-by: Stephanie Closson Co-authored-by: Dário Nascimento --- .../src/components/Drawer/Drawer.tsx | 4 +- .../src/components/Forms/Form.story.tsx | 2 +- .../components/TextArea/TextArea.story.tsx | 6 +- .../src/components/TextArea/TextArea.tsx | 21 +- public/app/core/controllers/all.ts | 1 - .../app/core/controllers/json_editor_ctrl.ts | 20 - public/app/core/services/keybindingSrv.ts | 22 +- .../components/Inspector/InspectDataTab.tsx | 95 +++++ .../components/Inspector/InspectHeader.tsx | 5 +- .../components/Inspector/InspectJSONTab.tsx | 178 +++++++++ .../components/Inspector/PanelInspector.tsx | 352 ++++++++---------- .../Inspector}/QueryInspector.tsx | 92 +++-- .../dashboard/components/Inspector/styles.ts | 58 +++ .../dashboard/containers/DashboardPage.tsx | 25 +- .../dashboard/panel_editor/QueriesTab.tsx | 17 +- .../dashboard/state/DashboardModel.ts | 4 + .../dashboard/utils/getPanelMenu.test.ts | 13 +- .../features/dashboard/utils/getPanelMenu.ts | 44 ++- public/app/features/dashboard/utils/panel.ts | 34 +- public/sass/base/_type.scss | 5 +- 20 files changed, 651 insertions(+), 347 deletions(-) delete mode 100644 public/app/core/controllers/json_editor_ctrl.ts create mode 100644 public/app/features/dashboard/components/Inspector/InspectDataTab.tsx create mode 100644 public/app/features/dashboard/components/Inspector/InspectJSONTab.tsx rename public/app/features/dashboard/{panel_editor => components/Inspector}/QueryInspector.tsx (66%) create mode 100644 public/app/features/dashboard/components/Inspector/styles.ts diff --git a/packages/grafana-ui/src/components/Drawer/Drawer.tsx b/packages/grafana-ui/src/components/Drawer/Drawer.tsx index 9fb7d53ea29..9ef23bc23d3 100644 --- a/packages/grafana-ui/src/components/Drawer/Drawer.tsx +++ b/packages/grafana-ui/src/components/Drawer/Drawer.tsx @@ -9,7 +9,7 @@ import { stylesFactory, useTheme } from '../../themes'; export interface Props { children: ReactNode; /** Title shown at the top of the drawer */ - title?: (() => JSX.Element) | string; + title?: JSX.Element | string; /** Should the Drawer be closable by clicking on the mask */ closeOnMaskClick?: boolean; /** Render the drawer inside a container on the page */ @@ -98,7 +98,7 @@ export const Drawer: FC = ({ )} - {typeof title === 'function' && title()} + {typeof title !== 'string' && title}
{!scrollableContent ? children : {children}}
diff --git a/packages/grafana-ui/src/components/Forms/Form.story.tsx b/packages/grafana-ui/src/components/Forms/Form.story.tsx index ded4478e682..60fdd214e7e 100644 --- a/packages/grafana-ui/src/components/Forms/Form.story.tsx +++ b/packages/grafana-ui/src/components/Forms/Form.story.tsx @@ -91,7 +91,7 @@ const renderForm = (defaultValues?: Partial) => ( -