Skip to content

Commit 6de423d

Browse files
authored
fix(ui): Allow beta tag in panel header (#18439)
1 parent 888d06b commit 6de423d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/sentry/static/sentry/app/components/betaTag.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import space from 'app/styles/space';
77
import {t} from 'app/locale';
88

99
type Props = {
10-
title?: string;
10+
title?: string | null;
1111
};
1212

1313
const BetaTag = ({
1414
title = t('This feature is in beta and may change in the future.'),
1515
}: Props) => (
16-
<Tooltip title={title} position="right">
16+
<Tooltip title={title} disabled={!title} position="right">
1717
<StyledTag priority="beta" size="small">
1818
{t('beta')}
1919
</StyledTag>

src/sentry/static/sentry/app/views/settings/components/forms/formPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type Props = {
1111
/**
1212
* Panel title
1313
*/
14-
title?: string;
14+
title?: React.ReactNode;
1515

1616
/**
1717
* List of fields to render
@@ -59,7 +59,7 @@ export default class FormPanel extends React.Component<Props> {
5959
} = this.props;
6060

6161
return (
62-
<Panel key={title} id={sanitizeQuerySelector(title ?? '')}>
62+
<Panel id={typeof title === 'string' ? sanitizeQuerySelector(title) : undefined}>
6363
{title && <PanelHeader>{title}</PanelHeader>}
6464
<PanelBody>
6565
{typeof renderHeader === 'function' && renderHeader({title, fields})}

src/sentry/static/sentry/app/views/settings/components/forms/jsonForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ class JsonForm extends React.Component<Props, State> {
157157
return (
158158
<Box {...otherProps}>
159159
{typeof forms !== 'undefined' &&
160-
forms.map(formGroup => (
160+
forms.map((formGroup, i) => (
161161
<FormPanel
162-
key={formGroup.title}
162+
key={i}
163163
title={formGroup.title}
164164
fields={formGroup.fields}
165165
{...formPanelProps}

src/sentry/static/sentry/app/views/settings/components/forms/type.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ export type Field = (
140140
export type FieldObject = Field | Function;
141141

142142
export type JsonFormObject = {
143-
title?: string;
143+
title?: React.ReactNode;
144144
fields: FieldObject[];
145145
};

0 commit comments

Comments
 (0)