mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 01:42:12 +08:00
Canvas: Promote Button to beta (#76582)
This commit is contained in:
@ -56,13 +56,7 @@ const ButtonDisplay = ({ data }: CanvasElementProps<ButtonConfig, ButtonData>) =
|
||||
};
|
||||
|
||||
return (
|
||||
<Button
|
||||
type="submit"
|
||||
variant={data?.style?.variant}
|
||||
onClick={onClick}
|
||||
className={styles.button}
|
||||
disabled={!data?.api?.endpoint}
|
||||
>
|
||||
<Button type="submit" variant={data?.style?.variant} onClick={onClick} className={styles.button}>
|
||||
<span>
|
||||
{isLoading && <Spinner inline={true} className={styles.buttonSpinner} />}
|
||||
{data?.text}
|
||||
@ -94,7 +88,7 @@ export const buttonItem: CanvasElementItem<ButtonConfig, ButtonData> = {
|
||||
id: 'button',
|
||||
name: 'Button',
|
||||
description: 'Button',
|
||||
state: PluginState.alpha,
|
||||
state: PluginState.beta,
|
||||
|
||||
standardEditorConfig: {
|
||||
background: false,
|
||||
|
@ -6,7 +6,6 @@ import {
|
||||
StringFieldConfigSettings,
|
||||
SelectableValue,
|
||||
} from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Button, Field, InlineField, InlineFieldRow, JSONFormatter, RadioButtonGroup, Select } from '@grafana/ui';
|
||||
import { StringValueEditor } from 'app/core/components/OptionsUI/string';
|
||||
import { defaultApiConfig } from 'app/features/canvas/elements/button';
|
||||
@ -141,7 +140,7 @@ export function APIEditor({ value, context, onChange }: Props) {
|
||||
return;
|
||||
};
|
||||
|
||||
return config.disableSanitizeHtml ? (
|
||||
return (
|
||||
<>
|
||||
<InlineFieldRow>
|
||||
<InlineField label="Endpoint" labelWidth={LABEL_WIDTH} grow={true}>
|
||||
@ -195,7 +194,5 @@ export function APIEditor({ value, context, onChange }: Props) {
|
||||
value?.contentType === defaultApiConfig.contentType &&
|
||||
renderJSON(value?.data ?? '{}')}
|
||||
</>
|
||||
) : (
|
||||
<>Must enable disableSanitizeHtml feature flag to access</>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user