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

feat: add subtitle field to pivot table options [DHIS2-16158] (V39) #3180

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 2 additions & 0 deletions packages/app/src/modules/options/pivotTableConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import ShowDimensionLabels from '../../components/VisualizationOptions/Options/S
import ShowHierarchy from '../../components/VisualizationOptions/Options/ShowHierarchy.js'
import SkipRounding from '../../components/VisualizationOptions/Options/SkipRounding.js'
import SortOrder from '../../components/VisualizationOptions/Options/SortOrder.js'
import Subtitle from '../../components/VisualizationOptions/Options/Subtitle.js'
import Title from '../../components/VisualizationOptions/Options/Title.js'
import TopLimit from '../../components/VisualizationOptions/Options/TopLimit.js'
import getAdvancedTemplate from './sections/templates/advanced.js'
Expand Down Expand Up @@ -76,6 +77,7 @@ export default ({ hasDimensionItemsInColumns, hasDimensionItemsInRows }) => [
key: 'style-section-1',
content: React.Children.toArray([
<Title label={i18n.t('Table title')} />,
<Subtitle label={i18n.t('Table subtitle')} />,
<DisplayDensity />,
<FontSize />,
<DigitGroupSeparator />,
Expand Down
Loading