-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tupaiaWeb): RN-1402: Ability to generate continuous PDF for dash…
…board export (#5894) * setup controls * Working exports * Add page numbers * Update DisplayOptionsSettings.tsx * Only show format options on whole dashboard export * Remove unused vars * Fix logo height --------- Co-authored-by: Andrew <[email protected]>
- Loading branch information
Showing
16 changed files
with
194 additions
and
50 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
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
45 changes: 45 additions & 0 deletions
45
packages/tupaia-web/src/features/ExportSettings/DisplayFormatSettings.tsx
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,45 @@ | ||
/** | ||
* Tupaia | ||
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { FormControl, FormControlLabel, Radio, RadioGroup } from '@material-ui/core'; | ||
import { useExportSettings } from './ExportSettingsContext'; | ||
import { ExportSettingLabel } from './ExportSettingLabel'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
const RadioItem = styled(FormControlLabel)` | ||
padding-block-end: 0.625rem; | ||
&:first-child { | ||
padding-block-start: 0.625rem; | ||
} | ||
.MuiButtonBase-root { | ||
padding-block: 0; | ||
} | ||
`; | ||
|
||
export const DisplayFormatSettings = () => { | ||
const { separatePagePerItem, updateSeparatePagePerItem } = useExportSettings(); | ||
|
||
return ( | ||
<Wrapper> | ||
<FormControl component="fieldset"> | ||
<ExportSettingLabel as="legend">Format</ExportSettingLabel> | ||
<RadioGroup | ||
name="separatePagePerItem" | ||
value={separatePagePerItem} | ||
onChange={updateSeparatePagePerItem} | ||
> | ||
<RadioItem value={true} control={<Radio color="primary" />} label="One per page" /> | ||
<RadioItem value={false} control={<Radio color="primary" />} label="Print continuous" /> | ||
</RadioGroup> | ||
</FormControl> | ||
</Wrapper> | ||
); | ||
}; |
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
Oops, something went wrong.