From 1006649ead43c88f4bca0970c55e6906a5c89ab1 Mon Sep 17 00:00:00 2001 From: Gurinder Singh Date: Fri, 16 Jun 2023 16:25:50 -0400 Subject: [PATCH 1/2] vscode fix --- .yarn/sdks/prettier/package.json | 2 +- .yarn/sdks/typescript/lib/tsserver.js | 2 ++ .yarn/sdks/typescript/lib/tsserverlibrary.js | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.yarn/sdks/prettier/package.json b/.yarn/sdks/prettier/package.json index 3f8599ab15492..f2362f14d65ad 100644 --- a/.yarn/sdks/prettier/package.json +++ b/.yarn/sdks/prettier/package.json @@ -1,6 +1,6 @@ { "name": "prettier", - "version": "2.8.1-sdk", + "version": "2.8.4-sdk", "main": "./index.js", "type": "commonjs" } diff --git a/.yarn/sdks/typescript/lib/tsserver.js b/.yarn/sdks/typescript/lib/tsserver.js index 0fb2ac1079786..bbb1e46501b52 100644 --- a/.yarn/sdks/typescript/lib/tsserver.js +++ b/.yarn/sdks/typescript/lib/tsserver.js @@ -109,6 +109,8 @@ const moduleWrapper = tsserver => { str = `zip:${str}`; } break; } + } else { + str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`); } } diff --git a/.yarn/sdks/typescript/lib/tsserverlibrary.js b/.yarn/sdks/typescript/lib/tsserverlibrary.js index e7033a81782d0..a68f028fe1971 100644 --- a/.yarn/sdks/typescript/lib/tsserverlibrary.js +++ b/.yarn/sdks/typescript/lib/tsserverlibrary.js @@ -109,6 +109,8 @@ const moduleWrapper = tsserver => { str = `zip:${str}`; } break; } + } else { + str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`); } } From a489d8dd7582d3686b21dbb75a5bee9f6863db41 Mon Sep 17 00:00:00 2001 From: Gurinder Singh Date: Fri, 16 Jun 2023 16:27:30 -0400 Subject: [PATCH 2/2] fixed firefox bugs --- .../dashboard/dashgrid/LazyLoader.tsx | 3 ++- public/app/fn-app/fn-app-provider.tsx | 8 +++---- .../fn-app/fn-dashboard-page/fn-dashboard.tsx | 24 ++++++++----------- public/app/fn-app/utils.tsx | 12 ++++------ 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/public/app/features/dashboard/dashgrid/LazyLoader.tsx b/public/app/features/dashboard/dashgrid/LazyLoader.tsx index da9339e54592e..ea992bdfea53b 100644 --- a/public/app/features/dashboard/dashgrid/LazyLoader.tsx +++ b/public/app/features/dashboard/dashgrid/LazyLoader.tsx @@ -1,3 +1,4 @@ +import { isFunction } from 'lodash'; import React, { useRef, useState } from 'react'; import { useEffectOnce } from 'react-use'; @@ -55,7 +56,7 @@ LazyLoader.addCallback = (id: string, c: (e: IntersectionObserverEntry) => void) LazyLoader.observer = new IntersectionObserver( (entries) => { for (const entry of entries) { - LazyLoader.callbacks[entry.target.id](entry); + isFunction(LazyLoader.callbacks[entry.target.id]) && LazyLoader.callbacks[entry.target.id](entry); } }, { rootMargin: '100px' } diff --git a/public/app/fn-app/fn-app-provider.tsx b/public/app/fn-app/fn-app-provider.tsx index 444a33577abd5..07cee337f5571 100644 --- a/public/app/fn-app/fn-app-provider.tsx +++ b/public/app/fn-app/fn-app-provider.tsx @@ -49,12 +49,12 @@ export const FnAppProvider: FC = (props) => { - <> - {children || null} - } - /> + {children} + + diff --git a/public/app/fn-app/fn-dashboard-page/fn-dashboard.tsx b/public/app/fn-app/fn-dashboard-page/fn-dashboard.tsx index 24f9051077ad5..639a8fbca5ea9 100644 --- a/public/app/fn-app/fn-dashboard-page/fn-dashboard.tsx +++ b/public/app/fn-app/fn-dashboard-page/fn-dashboard.tsx @@ -1,6 +1,5 @@ import { pick } from 'lodash'; -import React, { FC, Suspense, useMemo } from 'react'; -import { lazily } from 'react-lazily'; +import React, { FC, useMemo } from 'react'; import { connect, MapStateToProps } from 'react-redux'; import { @@ -11,25 +10,23 @@ import { FnPropsMappedFromState, } from 'app/core/reducers/fn-slice'; +import { AngularRoot } from '../../angular/AngularRoot'; +import { FnAppProvider } from '../fn-app-provider'; import { FNDashboardProps } from '../types'; import { RenderPortal } from '../utils'; -const { RenderFNDashboard } = lazily(() => import('./render-fn-dashboard')); -const { FnAppProvider } = lazily(() => import('../fn-app-provider')); -const { AngularRoot } = lazily(() => import('../../angular/AngularRoot')); +import { RenderFNDashboard } from './render-fn-dashboard'; type FNDashboardComponentProps = Omit; export const FNDashboard: FC = (props) => { return ( - {props.fnLoader}}> - -
- - -
-
-
+ +
+ + +
+
); }; @@ -42,7 +39,6 @@ function mapStateToProps(): MapStateToProps< } export const DashboardPortalComponent: FC = (props) => { - const content = useMemo(() => { if (!props.FNDashboard) { // TODO Use no data diff --git a/public/app/fn-app/utils.tsx b/public/app/fn-app/utils.tsx index c7599d2d49166..5acdf0deee7ec 100644 --- a/public/app/fn-app/utils.tsx +++ b/public/app/fn-app/utils.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import { FC, PropsWithChildren } from 'react'; import ReactDOM from 'react-dom'; export interface RenderPortalProps { @@ -7,14 +7,12 @@ export interface RenderPortalProps { export const getPortalContainer = (ID: string): HTMLElement | null => document.getElementById(ID); -export const RenderPortal: FC = ({ ID, children }) => { - const portalDiv = getPortalContainer(ID) - - if(!portalDiv){ +export const RenderPortal: FC> = ({ ID, children }) => { + const portalDiv = getPortalContainer(ID); + + if (!portalDiv) { return null; } return ReactDOM.createPortal(children, portalDiv); }; - -