Skip to content

Commit

Permalink
fix: missing Pivot options (#665)
Browse files Browse the repository at this point in the history
* Adds "Display organisation unit hierarchy" to the Style tab of the Options dialog for Pivot
* Adds "Only include completed events" to the Data tab of the Options dialog for Pivot
  • Loading branch information
martinkrulltott committed Feb 13, 2020
1 parent 0d05612 commit 6aea633
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import React from 'react'

import i18n from '@dhis2/d2-i18n'
import { Label } from '@dhis2/ui-core'

import CheckboxBaseOption from './CheckboxBaseOption'

const CompletedOnly = () => (
<CheckboxBaseOption
label={i18n.t('Include only completed events')}
option={{
name: 'completedOnly',
}}
/>
<div>
<Label>{i18n.t('Event data')}</Label>
<CheckboxBaseOption
label={i18n.t('Only include completed events')}
option={{
name: 'completedOnly',
}}
/>
</div>
)

export default CompletedOnly
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react'

import i18n from '@dhis2/d2-i18n'

import CheckboxBaseOption from './CheckboxBaseOption'

const ShowHierarchy = () => (
<CheckboxBaseOption
label={i18n.t('Show hierarchy')}
label={i18n.t('Display organisation unit hierarchy')}
option={{
name: 'showHierarchy',
}}
Expand Down
8 changes: 8 additions & 0 deletions packages/app/src/modules/options/pivotTableConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import Regression from '../../components/VisualizationOptions/Options/Regression
import Cumulative from '../../components/VisualizationOptions/Options/Cumulative'
import SortOrder from '../../components/VisualizationOptions/Options/SortOrder'
import TopLimit from '../../components/VisualizationOptions/Options/TopLimit'
import ShowHierarchy from '../../components/VisualizationOptions/Options/ShowHierarchy'
import CompletedOnly from '../../components/VisualizationOptions/Options/CompletedOnly'

export default [
{
Expand Down Expand Up @@ -62,6 +64,7 @@ export default [
content: React.Children.toArray([
<AggregationType />,
<NumberType />,
<CompletedOnly />,
]),
},
],
Expand Down Expand Up @@ -89,6 +92,11 @@ export default [
<DigitGroupSeparator />,
]),
},
{
key: 'style-section-2',
label: i18n.t('Labels'),
content: React.Children.toArray([<ShowHierarchy />]),
},
],
},
{
Expand Down

0 comments on commit 6aea633

Please sign in to comment.