-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: rename constant value * fix: update analytics dep
- Loading branch information
1 parent
ac05af6
commit 033be21
Showing
8 changed files
with
97 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
packages/app/src/components/Layout/PivotTableLayout/PivotTableLayout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from 'react' | ||
import i18n from '@dhis2/d2-i18n' | ||
import { | ||
AXIS_ID_COLUMNS, | ||
AXIS_ID_ROWS, | ||
AXIS_ID_FILTERS, | ||
} from '@dhis2/analytics' | ||
|
||
import DefaultAxis from '../DefaultLayout/DefaultAxis' | ||
import defaultAxisStyles from '../DefaultLayout/styles/DefaultAxis.style' | ||
import defaultLayoutStyles from '../DefaultLayout/styles/DefaultLayout.style' | ||
import pivotTableLayoutStyles from './styles/PivotTableLayout.style' | ||
|
||
const Layout = () => ( | ||
<div id="layout-ct" style={defaultLayoutStyles.ct}> | ||
<div | ||
id="axis-group-1" | ||
style={{ | ||
...defaultLayoutStyles.axisGroup, | ||
...pivotTableLayoutStyles.axisGroupLeft, | ||
}} | ||
> | ||
<DefaultAxis | ||
axisId={AXIS_ID_COLUMNS} | ||
label={i18n.t('Columns')} | ||
style={{ | ||
...defaultLayoutStyles.columns, | ||
...defaultAxisStyles.axisContainerLeft, | ||
}} | ||
/> | ||
<DefaultAxis | ||
axisId={AXIS_ID_ROWS} | ||
label={i18n.t('Rows')} | ||
style={{ | ||
...defaultLayoutStyles.rows, | ||
...defaultAxisStyles.axisContainerLeft, | ||
}} | ||
/> | ||
</div> | ||
<div | ||
id="axis-group-2" | ||
style={{ | ||
...defaultLayoutStyles.axisGroup, | ||
...pivotTableLayoutStyles.axisGroupRight, | ||
}} | ||
> | ||
<DefaultAxis | ||
axisId={AXIS_ID_FILTERS} | ||
style={defaultLayoutStyles.filters} | ||
/> | ||
</div> | ||
</div> | ||
) | ||
|
||
Layout.displayName = 'Layout' | ||
|
||
export default Layout |
14 changes: 14 additions & 0 deletions
14
packages/app/src/components/Layout/PivotTableLayout/styles/PivotTableLayout.style.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Axis | ||
export const FILTER_AXIS_WIDTH = '50%' | ||
|
||
// Axis (generated) | ||
export const DIMENSION_AXIS_WIDTH = `${100 - parseInt(FILTER_AXIS_WIDTH, 10)}%` | ||
|
||
export default { | ||
axisGroupLeft: { | ||
flexBasis: DIMENSION_AXIS_WIDTH, | ||
}, | ||
axisGroupRight: { | ||
flexBasis: FILTER_AXIS_WIDTH, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters