mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Eslint: Update grafana/eslint-config that allows public accessability modifier (#73906)
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
"@betterer/regexp": "5.4.0",
|
||||
"@emotion/eslint-plugin": "11.11.0",
|
||||
"@grafana/e2e": "workspace:*",
|
||||
"@grafana/eslint-config": "6.0.0",
|
||||
"@grafana/eslint-config": "6.0.1",
|
||||
"@grafana/eslint-plugin": "link:./packages/grafana-eslint-rules",
|
||||
"@grafana/toolkit": "workspace:*",
|
||||
"@grafana/tsconfig": "^1.3.0-rc1",
|
||||
|
||||
@@ -35,14 +35,14 @@ export class AppChromeService {
|
||||
layout: PageLayoutType.Canvas,
|
||||
});
|
||||
|
||||
setMatchedRoute(route: RouteDescriptor) {
|
||||
public setMatchedRoute(route: RouteDescriptor) {
|
||||
if (this.currentRoute !== route) {
|
||||
this.currentRoute = route;
|
||||
this.routeChangeHandled = false;
|
||||
}
|
||||
}
|
||||
|
||||
update(update: Partial<AppChromeState>) {
|
||||
public update(update: Partial<AppChromeState>) {
|
||||
const current = this.state.getValue();
|
||||
const newState: AppChromeState = {
|
||||
...current,
|
||||
@@ -68,7 +68,7 @@ export class AppChromeService {
|
||||
}
|
||||
}
|
||||
|
||||
ignoreStateUpdate(newState: AppChromeState, current: AppChromeState) {
|
||||
private ignoreStateUpdate(newState: AppChromeState, current: AppChromeState) {
|
||||
if (isShallowEqual(newState, current)) {
|
||||
return true;
|
||||
}
|
||||
@@ -88,22 +88,22 @@ export class AppChromeService {
|
||||
return false;
|
||||
}
|
||||
|
||||
useState() {
|
||||
public useState() {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
return useObservable(this.state, this.state.getValue());
|
||||
}
|
||||
|
||||
onToggleMegaMenu = () => {
|
||||
public onToggleMegaMenu = () => {
|
||||
const isOpen = !this.state.getValue().megaMenuOpen;
|
||||
reportInteraction('grafana_toggle_menu_clicked', { action: isOpen ? 'open' : 'close' });
|
||||
this.update({ megaMenuOpen: isOpen });
|
||||
};
|
||||
|
||||
setMegaMenu = (megaMenuOpen: boolean) => {
|
||||
public setMegaMenu = (megaMenuOpen: boolean) => {
|
||||
this.update({ megaMenuOpen });
|
||||
};
|
||||
|
||||
onToggleSearchBar = () => {
|
||||
public onToggleSearchBar = () => {
|
||||
const { searchBarHidden, kioskMode } = this.state.getValue();
|
||||
const newSearchBarHidden = !searchBarHidden;
|
||||
store.set(this.searchBarStorageKey, newSearchBarHidden);
|
||||
@@ -115,18 +115,18 @@ export class AppChromeService {
|
||||
this.update({ searchBarHidden: newSearchBarHidden, kioskMode: null });
|
||||
};
|
||||
|
||||
onToggleKioskMode = () => {
|
||||
public onToggleKioskMode = () => {
|
||||
const nextMode = this.getNextKioskMode();
|
||||
this.update({ kioskMode: nextMode });
|
||||
locationService.partial({ kiosk: this.getKioskUrlValue(nextMode) });
|
||||
};
|
||||
|
||||
exitKioskMode() {
|
||||
public exitKioskMode() {
|
||||
this.update({ kioskMode: undefined });
|
||||
locationService.partial({ kiosk: null });
|
||||
}
|
||||
|
||||
setKioskModeFromUrl(kiosk: UrlQueryValue) {
|
||||
public setKioskModeFromUrl(kiosk: UrlQueryValue) {
|
||||
switch (kiosk) {
|
||||
case 'tv':
|
||||
this.update({ kioskMode: KioskMode.TV });
|
||||
@@ -137,7 +137,7 @@ export class AppChromeService {
|
||||
}
|
||||
}
|
||||
|
||||
getKioskUrlValue(mode: KioskMode | null) {
|
||||
public getKioskUrlValue(mode: KioskMode | null) {
|
||||
switch (mode) {
|
||||
case KioskMode.TV:
|
||||
return 'tv';
|
||||
|
||||
@@ -53,7 +53,7 @@ export class DashboardScene extends SceneObjectBase<DashboardSceneState> {
|
||||
this.subscribeToEvent(SceneObjectStateChangedEvent, this.onChildStateChanged);
|
||||
}
|
||||
|
||||
onChildStateChanged = (event: SceneObjectStateChangedEvent) => {
|
||||
public onChildStateChanged = (event: SceneObjectStateChangedEvent) => {
|
||||
// Temporary hacky way to detect changes
|
||||
if (event.payload.changedObject instanceof SceneGridItem) {
|
||||
this.setState({ isDirty: true });
|
||||
|
||||
@@ -78,7 +78,7 @@ export class DashboardLoader extends StateManagerBase<DashboardLoaderState> {
|
||||
throw new Error('Dashboard not found');
|
||||
}
|
||||
|
||||
clearState() {
|
||||
public clearState() {
|
||||
this.setState({ dashboard: undefined, loadError: undefined, isLoading: false });
|
||||
}
|
||||
}
|
||||
|
||||
10
yarn.lock
10
yarn.lock
@@ -3765,9 +3765,9 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@grafana/eslint-config@npm:6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@grafana/eslint-config@npm:6.0.0"
|
||||
"@grafana/eslint-config@npm:6.0.1":
|
||||
version: 6.0.1
|
||||
resolution: "@grafana/eslint-config@npm:6.0.1"
|
||||
dependencies:
|
||||
"@typescript-eslint/eslint-plugin": 5.59.9
|
||||
"@typescript-eslint/parser": 5.59.9
|
||||
@@ -3777,7 +3777,7 @@ __metadata:
|
||||
eslint-plugin-react: 7.32.2
|
||||
eslint-plugin-react-hooks: 4.6.0
|
||||
typescript: 4.8.4
|
||||
checksum: a22d21282ba88a3b27d7a68ca6cbd01fe18c39aa3227b23079a0303d3c4265937c8371f8a0ea87acb843c9cec9fc82c649e2a8f47698613af8259edc85fd027c
|
||||
checksum: 6744cc4b48d7504f574798fc442e1c794f784bc408b435ed43cb1baef8d0ab83554c5ac2a6437af352ee5df241055050217d5a67e15491a6116555c92c349c31
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -19249,7 +19249,7 @@ __metadata:
|
||||
"@grafana/data": "workspace:*"
|
||||
"@grafana/e2e": "workspace:*"
|
||||
"@grafana/e2e-selectors": "workspace:*"
|
||||
"@grafana/eslint-config": 6.0.0
|
||||
"@grafana/eslint-config": 6.0.1
|
||||
"@grafana/eslint-plugin": "link:./packages/grafana-eslint-rules"
|
||||
"@grafana/experimental": 1.6.1
|
||||
"@grafana/faro-core": 1.1.2
|
||||
|
||||
Reference in New Issue
Block a user