From 6c2cd59baad6b6513e0cb96e2d855fdf236ea2e1 Mon Sep 17 00:00:00 2001 From: HendrikThePendric Date: Tue, 20 Aug 2024 16:12:18 +0200 Subject: [PATCH] fix: allow setting a label to the subtitle input --- src/components/VisualizationOptions/Options/Subtitle.js | 8 +++++++- src/modules/options/pivotTableConfig.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/VisualizationOptions/Options/Subtitle.js b/src/components/VisualizationOptions/Options/Subtitle.js index 486c68b26b..9b421c8815 100644 --- a/src/components/VisualizationOptions/Options/Subtitle.js +++ b/src/components/VisualizationOptions/Options/Subtitle.js @@ -3,11 +3,12 @@ import PropTypes from 'prop-types' import React from 'react' import { TextBaseOption } from './TextBaseOption.js' -const Subtitle = ({ dataTest }) => ( +const Subtitle = ({ dataTest, label }) => ( ( /> ) +Subtitle.defaultProps = { + dataTest: 'visualization-option-subtitle', +} + Subtitle.propTypes = { dataTest: PropTypes.string, + label: PropTypes.string, } export default Subtitle diff --git a/src/modules/options/pivotTableConfig.js b/src/modules/options/pivotTableConfig.js index b5888dfc95..e84328a989 100644 --- a/src/modules/options/pivotTableConfig.js +++ b/src/modules/options/pivotTableConfig.js @@ -83,7 +83,7 @@ export default ({ key: 'style-section-1', content: React.Children.toArray([ , - <Subtitle dataTest="pivot-table-subtitle" />, + <Subtitle label={i18n.t('Table subtitle')} />, <DisplayDensity />, <FontSize />, <DigitGroupSeparator />,