Eslint: Remove scenes rule for member accessability (#71087)

This commit is contained in:
Torkel Ödegaard
2023-07-06 09:22:02 +02:00
committed by GitHub
parent 901495a54a
commit f6f3d97288
7 changed files with 11 additions and 17 deletions

View File

@@ -11,12 +11,12 @@ export interface SceneRadioToggleState extends SceneObjectState {
}
export class SceneRadioToggle extends SceneObjectBase<SceneRadioToggleState> {
public onChange = (value: string) => {
onChange = (value: string) => {
this.setState({ value });
this.state.onChange(value);
};
public static Component = ({ model }: SceneComponentProps<SceneRadioToggle>) => {
static Component = ({ model }: SceneComponentProps<SceneRadioToggle>) => {
const { options, value } = model.useState();
return <RadioButtonGroup options={options} value={value} onChange={model.onChange} />;

View File

@@ -8,11 +8,11 @@ export interface SceneSearchBoxState extends SceneObjectState {
}
export class SceneSearchBox extends SceneObjectBase<SceneSearchBoxState> {
public onChange = (evt: React.FormEvent<HTMLInputElement>) => {
onChange = (evt: React.FormEvent<HTMLInputElement>) => {
this.setState({ value: evt.currentTarget.value });
};
public static Component = ({ model }: SceneComponentProps<SceneSearchBox>) => {
static Component = ({ model }: SceneComponentProps<SceneSearchBox>) => {
const { value } = model.useState();
return <Input width={25} placeholder="Search..." value={value} onChange={model.onChange} />;

View File

@@ -71,7 +71,7 @@ export interface HandlerDrilldownViewBehaviorState extends SceneObjectState {
export class HandlerDrilldownViewBehavior extends SceneObjectBase<HandlerDrilldownViewBehaviorState> {
protected _urlSync = new SceneObjectUrlSyncConfig(this, { keys: ['handler'] });
public constructor() {
constructor() {
super({});
this.addActivationHandler(() => {
@@ -107,11 +107,11 @@ export class HandlerDrilldownViewBehavior extends SceneObjectBase<HandlerDrilldo
});
}
public getUrlState() {
getUrlState() {
return { handler: this.state.handler };
}
public updateFromUrl(values: SceneObjectUrlValues) {
updateFromUrl(values: SceneObjectUrlValues) {
if (typeof values.handler === 'string' || values.handler === undefined) {
this.setState({ handler: values.handler });
}

View File

@@ -17,7 +17,7 @@ interface DashboardSceneState extends SceneObjectState {
}
export class DashboardScene extends SceneObjectBase<DashboardSceneState> {
public static Component = DashboardSceneRenderer;
static Component = DashboardSceneRenderer;
}
function DashboardSceneRenderer({ model }: SceneComponentProps<DashboardScene>) {

View File

@@ -44,7 +44,7 @@ export interface DashboardLoaderState {
export class DashboardLoader extends StateManagerBase<DashboardLoaderState> {
private cache: Record<string, DashboardScene> = {};
public async load(uid: string) {
async load(uid: string) {
const fromCache = this.cache[uid];
if (fromCache) {
this.setState({ dashboard: fromCache });
@@ -82,7 +82,7 @@ export class DashboardLoader extends StateManagerBase<DashboardLoaderState> {
this.setState({ dashboard, isLoading: false });
}
public clearState() {
clearState() {
this.setState({ dashboard: undefined, loadError: undefined, isLoading: false });
}
}

View File

@@ -20,7 +20,7 @@ export class ShareQueryDataProvider extends SceneObjectBase<ShareQueryDataProvid
private _querySub: Unsubscribable | undefined;
private _sourceDataDeactivationHandler?: SceneDeactivationHandler;
public constructor(state: ShareQueryDataProviderState) {
constructor(state: ShareQueryDataProviderState) {
super(state);
this.addActivationHandler(() => {