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

Loading indication for content composers #1613

Merged
merged 4 commits into from
Sep 5, 2019
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
logged in [#1508](https://github.com/greenbone/gsa/pull/1508)

### Fixed
- Fix showing loading indicator in content composers [#1613](https://github.com/greenbone/gsa/pull/1613)
- Enable downloading csv in table dashboard [#1611](https://github.com/greenbone/gsa/pull/1611)
- Fixed 404 URL handling in gsad which caused a XSS vulnerability [#1603](https://github.com/greenbone/gsa/pull/1603)
- Fixed status of Tickets for task.isInTrash() and isOrphan [#1592](https://github.com/greenbone/gsa/pull/1592)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ exports[`DialogTwoButtonFooter tests should render 1`] = `
</div>
`;

exports[`DialogTwoButtonFooter tests should render loading 1`] = `
exports[`DialogTwoButtonFooter tests should render loading and disable cancel button 1`] = `
.c2 {
display: -webkit-box;
display: -webkit-flex;
Expand Down Expand Up @@ -273,6 +273,7 @@ exports[`DialogTwoButtonFooter tests should render loading 1`] = `
<button
class="c3 c4 c5"
data-testid="dialog-close-button"
disabled=""
title="Cancel"
>
Cancel
Expand Down
4 changes: 3 additions & 1 deletion gsa/src/web/components/dialog/__tests__/twobuttonfooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,21 @@ describe('DialogTwoButtonFooter tests', () => {
expect(button).toHaveStyleRule('background', Theme.lightGreen);
});

test('should render loading', () => {
test('should render loading and disable cancel button', () => {
const {element} = render(
<DialogTwoButtonFooter rightButtonTitle="Foo" loading={true} />,
);

expect(element).toMatchSnapshot();

const button = element.querySelector('button[title="Foo"]');
const buttonLeft = element.querySelector('button[title="Cancel"]');

expect(button).toHaveStyleRule(
'background',
`${Theme.lightGreen} url(/img/loading.gif) center center no-repeat`,
);
expect(buttonLeft).toHaveAttribute('disabled');
});

test('should render footer with default title', () => {
Expand Down
1 change: 1 addition & 0 deletions gsa/src/web/components/dialog/twobuttonfooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const DialogTwoButtonFooter = ({
<StyledLayout align={['end', 'center']} shrink="0">
<Button
data-testid="dialog-close-button"
disabled={loading}
onClick={onLeftButtonClick}
title={leftButtonTitle}
>
Expand Down
2 changes: 1 addition & 1 deletion gsa/src/web/pages/reports/alertactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class AlertActions extends React.Component {
});
}

gmp.report
return gmp.report
.alert({
report_id: report.id,
alert_id: alertId,
Expand Down
2 changes: 1 addition & 1 deletion gsa/src/web/pages/reports/detailspage.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class ReportDetails extends React.Component {

this.handleInteraction();

gmp.report
return gmp.report
.download(entity, {
reportFormatId,
deltaReportId,
Expand Down