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

Fix adding and removing host assets #1397

Merged
merged 2 commits into from
May 13, 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 @@ -43,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Cleanup get_report function in gsad [#1263](https://github.com/greenbone/gsa/pull/1263)

### Fixed
- Fix adding and removing host assets at the report details [#1397](https://github.com/greenbone/gsa/pull/1397)
- Fix displaying the observer group name at tasks list page [#1393](https://github.com/greenbone/gsa/pull/1393)
- Improve EditScanConfigDialog performance (delete styles from svg-Icons) [#1388](https://github.com/greenbone/gsa/pull/1388)
- Fix race condition in EditUserSettingsDialog and loading all default filters [#1383](https://github.com/greenbone/gsa/pull/1383)
Expand Down
12 changes: 6 additions & 6 deletions gsa/src/web/pages/reports/detailspage.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,28 +351,28 @@ class ReportDetails extends React.Component {
}

handleAddToAssets() {
const {gmp, showSuccessMessage} = this.props;
const {entity, filter} = this.state;
const {gmp, showSuccessMessage, entity, reportFilter: filter} = this.props;

this.handleInteraction();

gmp.report.addAssets(entity, {filter}).then(response => {
gmp.report.addAssets(entity, {filter}).then(() => {
showSuccessMessage(
_(
'Report content added to Assets with QoD>=70% and Overrides enabled.',
),
);
this.reload();
}, this.handleError);
}

handleRemoveFromAssets() {
const {gmp, showSuccessMessage} = this.props;
const {entity, filter} = this.state;
const {gmp, showSuccessMessage, entity, reportFilter: filter} = this.props;

this.handleInteraction();

gmp.report.removeAssets(entity, {filter}).then(response => {
gmp.report.removeAssets(entity, {filter}).then(() => {
showSuccessMessage(_('Report content removed from Assets.'));
this.reload();
}, this.handleError);
}

Expand Down