Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas: Promote Button to beta #76582

Merged
merged 4 commits into from Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 2 additions & 8 deletions public/app/features/canvas/elements/button.tsx
Expand Up @@ -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}
Expand Down Expand Up @@ -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,
Expand Down
Expand Up @@ -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';
Expand Down Expand Up @@ -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}>
Expand Down Expand Up @@ -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</>
);
}