Skip to content

Commit 137807c

Browse files
gurinder39Gurinder Singh
and
Gurinder Singh
authored
Grafana firefox (#77)
* vscode fix * fixed firefox bugs --------- Co-authored-by: Gurinder Singh <[email protected]>
1 parent 9d90474 commit 137807c

File tree

7 files changed

+26
-27
lines changed

7 files changed

+26
-27
lines changed

.yarn/sdks/prettier/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prettier",
3-
"version": "2.8.1-sdk",
3+
"version": "2.8.4-sdk",
44
"main": "./index.js",
55
"type": "commonjs"
66
}

.yarn/sdks/typescript/lib/tsserver.js

+2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ const moduleWrapper = tsserver => {
109109
str = `zip:${str}`;
110110
} break;
111111
}
112+
} else {
113+
str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`);
112114
}
113115
}
114116

.yarn/sdks/typescript/lib/tsserverlibrary.js

+2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ const moduleWrapper = tsserver => {
109109
str = `zip:${str}`;
110110
} break;
111111
}
112+
} else {
113+
str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`);
112114
}
113115
}
114116

public/app/features/dashboard/dashgrid/LazyLoader.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isFunction } from 'lodash';
12
import React, { useRef, useState } from 'react';
23
import { useEffectOnce } from 'react-use';
34

@@ -55,7 +56,7 @@ LazyLoader.addCallback = (id: string, c: (e: IntersectionObserverEntry) => void)
5556
LazyLoader.observer = new IntersectionObserver(
5657
(entries) => {
5758
for (const entry of entries) {
58-
LazyLoader.callbacks[entry.target.id](entry);
59+
isFunction(LazyLoader.callbacks[entry.target.id]) && LazyLoader.callbacks[entry.target.id](entry);
5960
}
6061
},
6162
{ rootMargin: '100px' }

public/app/fn-app/fn-app-provider.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ export const FnAppProvider: FC<FnAppProviderProps> = (props) => {
4949
<BrowserRouter>
5050
<ErrorBoundaryAlert style="page">
5151
<GrafanaContext.Provider value={app.context}>
52-
<ThemeProvider value={config.theme2} children={
52+
<ThemeProvider value={config.theme2}>
5353
<>
5454
<GlobalStyles />
55-
{children || null}
56-
</>}
57-
/>
55+
{children}
56+
</>
57+
</ThemeProvider>
5858
</GrafanaContext.Provider>
5959
</ErrorBoundaryAlert>
6060
</BrowserRouter>

public/app/fn-app/fn-dashboard-page/fn-dashboard.tsx

+10-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { pick } from 'lodash';
2-
import React, { FC, Suspense, useMemo } from 'react';
3-
import { lazily } from 'react-lazily';
2+
import React, { FC, useMemo } from 'react';
43
import { connect, MapStateToProps } from 'react-redux';
54

65
import {
@@ -11,25 +10,23 @@ import {
1110
FnPropsMappedFromState,
1211
} from 'app/core/reducers/fn-slice';
1312

13+
import { AngularRoot } from '../../angular/AngularRoot';
14+
import { FnAppProvider } from '../fn-app-provider';
1415
import { FNDashboardProps } from '../types';
1516
import { RenderPortal } from '../utils';
1617

17-
const { RenderFNDashboard } = lazily(() => import('./render-fn-dashboard'));
18-
const { FnAppProvider } = lazily(() => import('../fn-app-provider'));
19-
const { AngularRoot } = lazily(() => import('../../angular/AngularRoot'));
18+
import { RenderFNDashboard } from './render-fn-dashboard';
2019

2120
type FNDashboardComponentProps = Omit<FNDashboardProps, FnPropMappedFromState>;
2221

2322
export const FNDashboard: FC<FNDashboardComponentProps> = (props) => {
2423
return (
25-
<Suspense fallback={<>{props.fnLoader}</>}>
26-
<FnAppProvider fnError={props.fnError}>
27-
<div className="page-dashboard">
28-
<AngularRoot />
29-
<DashboardPortal {...props} />
30-
</div>
31-
</FnAppProvider>
32-
</Suspense>
24+
<FnAppProvider fnError={props.fnError}>
25+
<div className="page-dashboard">
26+
<AngularRoot />
27+
<DashboardPortal {...props} />
28+
</div>
29+
</FnAppProvider>
3330
);
3431
};
3532

@@ -42,7 +39,6 @@ function mapStateToProps(): MapStateToProps<
4239
}
4340

4441
export const DashboardPortalComponent: FC<FNDashboardComponentProps & FnPropsMappedFromState> = (props) => {
45-
4642
const content = useMemo(() => {
4743
if (!props.FNDashboard) {
4844
// TODO Use no data

public/app/fn-app/utils.tsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FC } from 'react';
1+
import { FC, PropsWithChildren } from 'react';
22
import ReactDOM from 'react-dom';
33

44
export interface RenderPortalProps {
@@ -7,14 +7,12 @@ export interface RenderPortalProps {
77

88
export const getPortalContainer = (ID: string): HTMLElement | null => document.getElementById(ID);
99

10-
export const RenderPortal: FC<RenderPortalProps> = ({ ID, children }) => {
11-
const portalDiv = getPortalContainer(ID)
12-
13-
if(!portalDiv){
10+
export const RenderPortal: FC<PropsWithChildren<RenderPortalProps>> = ({ ID, children }) => {
11+
const portalDiv = getPortalContainer(ID);
12+
13+
if (!portalDiv) {
1414
return null;
1515
}
1616

1717
return ReactDOM.createPortal(children, portalDiv);
1818
};
19-
20-

0 commit comments

Comments
 (0)