Skip to content

Commit b6d4abc

Browse files
committed
fn_init fix and other fixes
1 parent 97bee45 commit b6d4abc

File tree

13 files changed

+374
-97
lines changed

13 files changed

+374
-97
lines changed

Diff for: .eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ vendor
2323

2424
# Auto-generated icon file
2525
/packages/grafana-ui/src/components/Icon/iconBundle.ts
26+
27+
# Sankey panel
28+
/public/app/plugins/panel/sankey-panel-0.5.0/module.js

Diff for: .husky/prepare-commit-msg

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/sh
2+
3+
if [ "$LEFTHOOK" = "0" ]; then
4+
exit 0
5+
fi
6+
7+
call_lefthook()
8+
{
9+
dir="$(git rev-parse --show-toplevel)"
10+
osArch=$(uname | tr '[:upper:]' '[:lower:]')
11+
cpuArch=$(uname -m | sed 's/aarch64/arm64/')
12+
13+
if lefthook -h >/dev/null 2>&1
14+
then
15+
lefthook "$@"
16+
elif test -f "$dir/node_modules/lefthook/bin/index.js"
17+
then
18+
"$dir/node_modules/lefthook/bin/index.js" "$@"
19+
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook"
20+
then
21+
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@"
22+
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook"
23+
then
24+
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook" "$@"
25+
elif bundle exec lefthook -h >/dev/null 2>&1
26+
then
27+
bundle exec lefthook "$@"
28+
elif yarn lefthook -h >/dev/null 2>&1
29+
then
30+
yarn lefthook "$@"
31+
elif pnpm lefthook -h >/dev/null 2>&1
32+
then
33+
pnpm lefthook "$@"
34+
elif command -v npx >/dev/null 2>&1
35+
then
36+
npx @evilmartians/lefthook "$@"
37+
elif swift package plugin lefthook >/dev/null 2>&1
38+
then
39+
swift package --disable-sandbox plugin lefthook "$@"
40+
else
41+
echo "Can't find lefthook in PATH"
42+
fi
43+
}
44+
45+
call_lefthook run "prepare-commit-msg" "$@"

Diff for: lefthook.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# EXAMPLE USAGE:
2+
#
3+
# Refer for explanation to following link:
4+
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
5+
#
6+
pre-push:
7+
commands:
8+
packages-audit:
9+
tags: frontend security
10+
run: yarn audit
11+
gems-audit:
12+
tags: backend security
13+
run: bundle audit
14+
15+
pre-commit:
16+
parallel: true
17+
commands:
18+
eslint:
19+
glob: "*.{js,ts,jsx,tsx}"
20+
run: yarn eslint {staged_files}
21+
rubocop:
22+
tags: backend style
23+
glob: "*.rb"
24+
exclude: "application.rb|routes.rb"
25+
run: bundle exec rubocop --force-exclusion {all_files}
26+
govet:
27+
tags: backend style
28+
files: git ls-files -m
29+
glob: "*.go"
30+
run: go vet {files}
31+
scripts:
32+
"hello.js":
33+
runner: node
34+
"any.go":
35+
runner: go run

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212
"jest-fail-on-console": "3.1.1",
213213
"jest-junit": "16.0.0",
214214
"jest-matcher-utils": "29.3.1",
215+
"lefthook": "^1.5.2",
215216
"lerna": "5.5.4",
216217
"lint-staged": "13.2.3",
217218
"mini-css-extract-plugin": "2.7.2",

Diff for: public/app/fn-app/fn-app-provider.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect, FC } from 'react';
1+
import React, { useState, useEffect, FC, PropsWithChildren } from 'react';
22
import { Provider } from 'react-redux';
33
import { BrowserRouter } from 'react-router-dom';
44

@@ -15,7 +15,7 @@ import { FNDashboardProps } from './types';
1515

1616
type FnAppProviderProps = Pick<FNDashboardProps, 'fnError'>;
1717

18-
export const FnAppProvider: FC<FnAppProviderProps> = (props) => {
18+
export const FnAppProvider: FC<PropsWithChildren<FnAppProviderProps>> = (props) => {
1919
const { children, fnError = null } = props;
2020

2121
const [ready, setReady] = useState(false);

Diff for: public/app/fn_app.ts

+20-20
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ import { Echo } from './core/services/echo/Echo';
5959
import { reportPerformance } from './core/services/echo/EchoSrv';
6060
import { PerformanceBackend } from './core/services/echo/backends/PerformanceBackend';
6161
import { ApplicationInsightsBackend } from './core/services/echo/backends/analytics/ApplicationInsightsBackend';
62-
import { GA4EchoBackend } from './core/services/echo/backends/analytics/GA4Backend';
63-
import { GAEchoBackend } from './core/services/echo/backends/analytics/GABackend';
62+
// import { GA4EchoBackend } from './core/services/echo/backends/analytics/GA4Backend';
63+
// import { GAEchoBackend } from './core/services/echo/backends/analytics/GABackend';
6464
import { RudderstackBackend } from './core/services/echo/backends/analytics/RudderstackBackend';
6565
import { GrafanaJavascriptAgentBackend } from './core/services/echo/backends/grafana-javascript-agent/GrafanaJavascriptAgentBackend';
6666
import { KeybindingSrv } from './core/services/keybindingSrv';
6767
import { startMeasure, stopMeasure } from './core/utils/metrics';
6868
import { initDevFeatures } from './dev';
6969
import { getTimeSrv } from './features/dashboard/services/TimeSrv';
70-
import { initGrafanaLive } from './features/live';
70+
// import { initGrafanaLive } from './features/live';
7171
import { PanelDataErrorView } from './features/panel/components/PanelDataErrorView';
7272
import { PanelRenderer } from './features/panel/components/PanelRenderer';
7373
import { DatasourceSrv } from './features/plugins/datasource_srv';
@@ -135,7 +135,7 @@ export class GrafanaApp {
135135
setPanelDataErrorView(PanelDataErrorView);
136136
setLocationSrv(locationService);
137137
setTimeZoneResolver(() => config.bootData.user.timezone);
138-
initGrafanaLive();
138+
// initGrafanaLive();
139139

140140
// Expose the app-wide eventbus
141141
setAppEvents(appEvents);
@@ -285,22 +285,22 @@ function initEchoSrv() {
285285
);
286286
}
287287

288-
if (config.googleAnalyticsId) {
289-
registerEchoBackend(
290-
new GAEchoBackend({
291-
googleAnalyticsId: config.googleAnalyticsId,
292-
})
293-
);
294-
}
295-
296-
if (config.googleAnalytics4Id) {
297-
registerEchoBackend(
298-
new GA4EchoBackend({
299-
googleAnalyticsId: config.googleAnalytics4Id,
300-
googleAnalytics4SendManualPageViews: config.googleAnalytics4SendManualPageViews,
301-
})
302-
);
303-
}
288+
// if (config.googleAnalyticsId) {
289+
// registerEchoBackend(
290+
// new GAEchoBackend({
291+
// googleAnalyticsId: config.googleAnalyticsId,
292+
// })
293+
// );
294+
// }
295+
296+
// if (config.googleAnalytics4Id) {
297+
// registerEchoBackend(
298+
// new GA4EchoBackend({
299+
// googleAnalyticsId: config.googleAnalytics4Id,
300+
// googleAnalytics4SendManualPageViews: config.googleAnalytics4SendManualPageViews,
301+
// })
302+
// );
303+
// }
304304

305305
if (config.rudderstackWriteKey && config.rudderstackDataPlaneUrl) {
306306
registerEchoBackend(

Diff for: public/app/plugins/datasource/grafadruid-druid-datasource/builder/aggregation/Filtered.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { QueryBuilderProps } from '../types';
66

77
import { Aggregation } from './';
88

9-
109
export const Filtered = (props: QueryBuilderProps) => {
1110
const scopedProps = useScopedQueryBuilderFieldProps(props, Filtered);
1211
return (

Diff for: public/app/plugins/datasource/grafadruid-druid-datasource/builder/filter/Spatial.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { QueryBuilderProps } from '../types';
77

88
import { FilterTuning } from '.';
99

10-
1110
export const Spatial = (props: QueryBuilderProps) => {
1211
const scopedProps = useScopedQueryBuilderFieldProps(props, Spatial);
1312
return (

Diff for: public/app/plugins/datasource/grafadruid-druid-datasource/configuration/QuerySettings/DruidQueryDefaultSettings.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { QuerySettingsProps } from './types';
77

88
import { DruidQueryRequestSettings, DruidQueryResponseSettings } from './';
99

10-
1110
export const DruidQueryDefaultSettings = (props: QuerySettingsProps) => {
1211
return (
1312
<>

Diff for: public/app/plugins/datasource/grafadruid-druid-datasource/configuration/QuerySettings/DruidQuerySettings.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { QuerySettingsProps } from './types';
77

88
import { DruidQueryRequestSettings, DruidQueryResponseSettings } from './';
99

10-
1110
export const DruidQuerySettings = (props: QuerySettingsProps) => {
1211
return (
1312
<>

0 commit comments

Comments
 (0)