Skip to content

Commit

Permalink
fix: allow setting a label to the subtitle input
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikThePendric committed Aug 20, 2024
1 parent ef849d2 commit 6c2cd59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/components/VisualizationOptions/Options/Subtitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@ import PropTypes from 'prop-types'
import React from 'react'
import { TextBaseOption } from './TextBaseOption.js'

const Subtitle = ({ dataTest }) => (
const Subtitle = ({ dataTest, label }) => (
<TextBaseOption
type="text"
width="280px"
placeholder={i18n.t('Add a subtitle')}
label={label}
option={{
name: 'subtitle',
}}
dataTest={dataTest}
/>
)

Subtitle.defaultProps = {
dataTest: 'visualization-option-subtitle',
}

Subtitle.propTypes = {
dataTest: PropTypes.string,
label: PropTypes.string,
}

export default Subtitle
2 changes: 1 addition & 1 deletion src/modules/options/pivotTableConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default ({
key: 'style-section-1',
content: React.Children.toArray([
<Title label={i18n.t('Table title')} />,
<Subtitle dataTest="pivot-table-subtitle" />,
<Subtitle label={i18n.t('Table subtitle')} />,
<DisplayDensity />,
<FontSize />,
<DigitGroupSeparator />,
Expand Down

0 comments on commit 6c2cd59

Please sign in to comment.