Skip to content

Commit

Permalink
Tag reports could not be exported to PDF. Fixes #885.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniessink committed Dec 18, 2019
1 parent d900944 commit c4164c3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
50 changes: 25 additions & 25 deletions components/frontend/src/report/ReportTitle.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useState} from 'react';
import React, { useState } from 'react';
import { Button, Grid, Icon, Segment } from 'semantic-ui-react';
import { StringInput } from '../fields/StringInput';
import { HeaderWithDetails } from '../widgets/HeaderWithDetails';
import { ChangeLog } from '../changelog/ChangeLog';
import { DeleteButton } from '../widgets/Button';
import { delete_report, get_report_pdf, set_report_attribute} from '../api/report';
import { delete_report, get_report_pdf, set_report_attribute } from '../api/report';
import { ReadOnlyOrEditable } from '../context/ReadOnly';

function download_pdf(report_uuid, callback) {
Expand Down Expand Up @@ -44,36 +44,36 @@ export function ReportTitle(props) {
<Grid.Row>
<Grid.Column>
<ChangeLog
report_uuid={props.report.report_uuid}
timestamp={props.report.timestamp}
report_uuid={props.report.report_uuid}
timestamp={props.report.timestamp}
/>
</Grid.Column>
</Grid.Row>
<ReadOnlyOrEditable editableComponent={
<Grid.Row>
<Grid.Column>
<Button
basic
floated="left"
icon
loading={loading}
onClick={() => {
if (!loading) {
setLoading(true);
download_pdf(props.report.report_uuid, () => {setLoading(false)})}
}
<Grid.Row>
<Grid.Column>
<Button
basic
floated="left"
icon
loading={loading}
onClick={() => {
if (!loading) {
setLoading(true);
download_pdf(props.report.report_uuid, () => { setLoading(false) })
}
primary
>
<Icon name="file pdf" /> Download report as PDF
</Button>
}}
primary
>
<Icon name="file pdf" /> Download report as PDF
</Button>
<ReadOnlyOrEditable editableComponent={
<DeleteButton
item_type='report'
onClick={() => delete_report(props.report.report_uuid, props.go_home)}
/>
</Grid.Column>
</Grid.Row>}
/>
/>}
/>
</Grid.Column>
</Grid.Row>
</Grid>
</Segment>
</HeaderWithDetails>
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Typo in metric pie chart tooltip ("Uknown"). Fixes [#857](https://github.com/ICTU/quality-time/issues/857).
- User documentation incorrectly said that the dashboard layout is persisted in the browser. It is kept in the database since version 1.0.0. Fixes [#860](https://github.com/ICTU/quality-time/issues/860).
- Add report title to subject names in tag reports so it's clear from which report each subject comes. Fixes [#880](https://github.com/ICTU/quality-time/issues/880).
- Tag reports could not be exported to PDF. Fixes [#885](https://github.com/ICTU/quality-time/issues/885).

## [1.2.0] - [2019-12-10]

Expand Down

0 comments on commit c4164c3

Please sign in to comment.