Skip to content

Commit

Permalink
Fix filter in Report Results view cannot be saved
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahd93 committed Apr 24, 2019
1 parent 9ea3028 commit e4fa26d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
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"]
}
}
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 e4fa26d

Please sign in to comment.