Skip to content

Commit

Permalink
Merge pull request #1303 from sarahd93/report_results_filter_gsa8
Browse files Browse the repository at this point in the history
Fix filter in Report Results view cannot be saved
  • Loading branch information
swaterkamp authored Apr 24, 2019
2 parents 1125329 + 5284aed commit edd0aee
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ 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 filter in Report Results view cannot be saved & Fix error for create filter with no available results [#1303](https://github.com/greenbone/gsa/pull/1303)
- Fix creating permissions via the create multiple permissions dialog [#1302](https://github.com/greenbone/gsa/pull/1302)
- Fix showing host in Scanner dialog [#1301](https://github.com/greenbone/gsa/pull/1301)
- Fix detailslinks in AllSecInfo [#1299](https://github.com/greenbone/gsa/pull/1299)
Expand Down
14 changes: 14 additions & 0 deletions gsa/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"gmp/*": ["./gmp/*"],
"web/*": ["./web/*"]
}
},
"exclude": ["build", "coverage", "node_modules"],
"typeAcquisition": {
"enable": true,
"include": ["jest"]
}
}
2 changes: 1 addition & 1 deletion gsa/src/web/entities/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ class EntitiesContainer extends React.Component {
<React.Fragment>
{children({
...other,
createFilterType: entitiesType,
createFilterType: this.props.gmpname,
entities,
entitiesCounts,
entitiesSelected: selected,
Expand Down
22 changes: 21 additions & 1 deletion gsa/src/web/pages/reports/detailsfilterdialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,25 @@ import SolutionTypeGroup from 'web/components/powerfilter/solutiontypegroup';
import withFilterDialog from 'web/components/powerfilter/withFilterDialog';
import FilterDialogPropTypes from 'web/components/powerfilter/dialogproptypes';
import SeverityLevelsGroup from 'web/components/powerfilter/severitylevelsgroup';
import CreateNamedFilterGroup from 'web/components/powerfilter/createnamedfiltergroup';

/* eslint-enable */

import DeltaResultsFilterGroup from './deltaresultsfiltergroup';

import compose from 'web/utils/compose';
import withCapabilities from 'web/utils/withCapabilities';

const FilterDialog = ({
delta = false,
filter,
filterstring,
onFilterStringChange,
onFilterValueChange,
capabilities,
filterName,
saveNamedFilter,
onValueChange,
}) => {
const result_hosts_only = filter.get('result_hosts_only');
return (
Expand Down Expand Up @@ -93,12 +101,24 @@ const FilterDialog = ({
<FirstResultGroup filter={filter} onChange={onFilterValueChange} />

<ResultsPerPageGroup filter={filter} onChange={onFilterValueChange} />

{capabilities.mayCreate('filter') && (
<CreateNamedFilterGroup
filter={filter}
filterName={filterName}
saveNamedFilter={saveNamedFilter}
onValueChange={onValueChange}
/>
)}
</Layout>
);
};

FilterDialog.propTypes = FilterDialogPropTypes;

export default withFilterDialog()(FilterDialog);
export default compose(
withCapabilities,
withFilterDialog(),
)(FilterDialog);

// vim: set ts=2 sw=2 tw=80:
3 changes: 2 additions & 1 deletion gsa/src/web/pages/reports/detailspage.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ class ReportDetails extends React.Component {

handleFilterCreated(filter) {
this.handleInteraction();

this.load(filter);
this.props.loadFilters();
}
Expand Down Expand Up @@ -607,6 +606,8 @@ class ReportDetails extends React.Component {
delta={isDefined(report) && report.isDeltaReport()}
onFilterChanged={this.handleFilterChange}
onCloseClick={this.handleFilterDialogClose}
createFilterType="result"
onFilterCreated={this.handleFilterCreated}
/>
)}
{showDownloadReportDialog && (
Expand Down

0 comments on commit edd0aee

Please sign in to comment.