mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Canvas: Add all options to inline editor (#52834)
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { FC, useCallback } from 'react';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
import { AppEvents, StandardEditorProps, StandardEditorsRegistryItem, StringFieldConfigSettings } from '@grafana/data';
|
||||
import { config, getBackendSrv } from '@grafana/runtime';
|
||||
@@ -39,8 +39,9 @@ export const callApi = (api: APIEditorConfig, isTest = false) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const APIEditor: FC<StandardEditorProps<APIEditorConfig, any, any>> = (props) => {
|
||||
const { value, context, onChange } = props;
|
||||
type Props = StandardEditorProps<APIEditorConfig, any, any>;
|
||||
|
||||
export function APIEditor({ value, context, onChange }: Props) {
|
||||
const labelWidth = 9;
|
||||
|
||||
const onEndpointChange = useCallback(
|
||||
@@ -117,4 +118,4 @@ export const APIEditor: FC<StandardEditorProps<APIEditorConfig, any, any>> = (pr
|
||||
) : (
|
||||
<>Must enable disableSanitizeHtml feature flag to access</>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { FC } from 'react';
|
||||
import React from 'react';
|
||||
import { useObservable } from 'react-use';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@@ -31,7 +31,9 @@ const verticalOptions: Array<SelectableValue<VerticalConstraint>> = [
|
||||
{ label: 'Scale', value: VerticalConstraint.Scale },
|
||||
];
|
||||
|
||||
export const PlacementEditor: FC<StandardEditorProps<any, CanvasEditorOptions, PanelOptions>> = ({ item }) => {
|
||||
type Props = StandardEditorProps<any, CanvasEditorOptions, PanelOptions>;
|
||||
|
||||
export function PlacementEditor({ item }: Props) {
|
||||
const settings = item.settings;
|
||||
|
||||
// Will force a rerender whenever the subject changes
|
||||
@@ -136,4 +138,4 @@ export const PlacementEditor: FC<StandardEditorProps<any, CanvasEditorOptions, P
|
||||
</Field>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user