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

Report details sorting #929

Merged
merged 3 commits into from
Sep 11, 2018
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: 0 additions & 1 deletion gsa/src/web/pages/reports/applicationstable.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import CpeIcon from '../../components/icon/cpeicon';
const Header = ({
currentSortBy,
currentSortDir,
links = true,
sort = true,
onSortChange,
}) => {
Expand Down
213 changes: 194 additions & 19 deletions gsa/src/web/pages/reports/detailscontent.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ const PageContent = ({
isLoading = true,
reportFormats,
reportFormatId,
sorting,
showError,
showErrorMessage,
showSuccessMessage,
Expand All @@ -273,6 +274,7 @@ const PageContent = ({
onRemoveFromAssetsClick,
onReportDownloadClick,
onReportFormatChange,
onSortChange,
onTagSuccess,
onTargetEditClick,
}) => {
Expand Down Expand Up @@ -393,7 +395,7 @@ const PageContent = ({
>
<TabList
active={activeTab}
align={['start', 'stretch']}i
align={['start', 'stretch']}
onActivateTab={onActivateTab}
>
<Tab>
Expand Down Expand Up @@ -494,13 +496,17 @@ const PageContent = ({
hasTarget={!isContainer}
progress={task.progress}
results={results.entities}
sortField={sorting.results.sortField}
sortReverse={sorting.results.sortReverse}
status={status}
onFilterAddLogLevelClick={onFilterAddLogLevelClick}
onFilterDecreaseMinQoDClick={onFilterDecreaseMinQoDClick}
onFilterRemoveSeverityClick={onFilterRemoveSeverityClick}
onFilterEditClick={onFilterEditClick}
onFilterRemoveClick={onFilterRemoveClick}
onInteraction={onInteraction}
onSortChange={sortField =>
onSortChange('results', sortField)}
onTargetEditClick={onTargetEditClick}
/>
</TabPanel>
Expand All @@ -509,13 +515,34 @@ const PageContent = ({
counts={hosts.counts}
entities={hosts.entities}
filter={filter}
sortField={sorting.hosts.sortField}
sortReverse={sorting.hosts.sortReverse}
sortFunctions={hosts_sort_functions}
onInteraction={onInteraction}
>
{props => (
{({
entities,
entitiesCounts,
sortBy,
sortDir,
onFirstClick,
onLastClick,
onNextClick,
onPreviousClick,
}) => (
<HostsTable
{...props}
entities={entities}
entitiesCounts={entitiesCounts}
filter={filter}
sortBy={sortBy}
sortDir={sortDir}
toggleDetailsIcon={false}
onFirstClick={onFirstClick}
onLastClick={onLastClick}
onNextClick={onNextClick}
onPreviousClick={onPreviousClick}
onSortChange={
sortField => onSortChange('hosts', sortField)}
/>
)}
</ReportEntitiesContainer>
Expand All @@ -525,13 +552,34 @@ const PageContent = ({
counts={ports.counts}
entities={ports.entities}
filter={filter}
sortField={sorting.ports.sortField}
sortFunctions={ports_sort_functions}
sortReverse={sorting.ports.sortReverse}
onInteraction={onInteraction}
>
{props => (
{({
entities,
entitiesCounts,
sortBy,
sortDir,
onFirstClick,
onLastClick,
onNextClick,
onPreviousClick,
}) => (
<PortsTable
{...props}
entities={entities}
entitiesCounts={entitiesCounts}
filter={filter}
sortBy={sortBy}
sortDir={sortDir}
toggleDetailsIcon={false}
onFirstClick={onFirstClick}
onLastClick={onLastClick}
onNextClick={onNextClick}
onPreviousClick={onPreviousClick}
onSortChange={
sortField => onSortChange('ports', sortField)}
/>
)}
</ReportEntitiesContainer>
Expand All @@ -541,30 +589,71 @@ const PageContent = ({
counts={applications.counts}
entities={applications.entities}
filter={filter}
sortField={sorting.apps.sortField}
sortFunctions={apps_sort_functions}
sortReverse={sorting.apps.sortReverse}
onInteraction={onInteraction}
>
{props => (
{({
entities,
entitiesCounts,
sortBy,
sortDir,
onFirstClick,
onLastClick,
onNextClick,
onPreviousClick,
}) => (
<ApplicationsTable
{...props}
entities={entities}
entitiesCounts={entitiesCounts}
filter={filter}
sortBy={sortBy}
sortDir={sortDir}
toggleDetailsIcon={false}
onFirstClick={onFirstClick}
onLastClick={onLastClick}
onNextClick={onNextClick}
onPreviousClick={onPreviousClick}
onSortChange={
sortField => onSortChange('apps', sortField)}
/>
)}
</ReportEntitiesContainer>
</TabPanel>
<TabPanel>
<ReportEntitiesContainer
{...operatingsystems}
counts={operatingsystems.counts}
entities={operatingsystems.entities}
filter={filter}
sortFunctions={operatingssystems_sort_functions}
sortField={sorting.os.sortField}
sortReverse={sorting.os.sortReverse}
onInteraction={onInteraction}
>
{props => (
{({
entities,
entitiesCounts,
sortBy,
sortDir,
onFirstClick,
onLastClick,
onNextClick,
onPreviousClick,
}) => (
<OperatingSystemsTable
{...props}
entities={entities}
entitiesCounts={entitiesCounts}
filter={filter}
sortBy={sortBy}
sortDir={sortDir}
toggleDetailsIcon={false}
onFirstClick={onFirstClick}
onLastClick={onLastClick}
onNextClick={onNextClick}
onPreviousClick={onPreviousClick}
onSortChange={
sortField => onSortChange('os', sortField)}
/>
)}
</ReportEntitiesContainer>
Expand All @@ -575,12 +664,33 @@ const PageContent = ({
entities={cves.entities}
filter={filter}
sortFunctions={cves_sort_functions}
sortField={sorting.cves.sortField}
sortReverse={sorting.cves.sortReverse}
onInteraction={onInteraction}
>
{props => (
{({
entities,
entitiesCounts,
sortBy,
sortDir,
onFirstClick,
onLastClick,
onNextClick,
onPreviousClick,
}) => (
<CvesTable
{...props}
entities={entities}
entitiesCounts={entitiesCounts}
filter={filter}
sortBy={sortBy}
sortDir={sortDir}
toggleDetailsIcon={false}
onFirstClick={onFirstClick}
onLastClick={onLastClick}
onNextClick={onNextClick}
onPreviousClick={onPreviousClick}
onSortChange={
sortField => onSortChange('cves', sortField)}
/>
)}
</ReportEntitiesContainer>
Expand All @@ -591,12 +701,33 @@ const PageContent = ({
entities={closed_cves.entities}
filter={filter}
sortFunctions={closed_cves_sort_functions}
sortField={sorting.closedcves.sortField}
sortReverse={sorting.closedcves.sortReverse}
onInteraction={onInteraction}
>
{props => (
{({
entities,
entitiesCounts,
sortBy,
sortDir,
onFirstClick,
onLastClick,
onNextClick,
onPreviousClick,
}) => (
<ClosedCvesTable
{...props}
entities={entities}
entitiesCounts={entitiesCounts}
filter={filter}
sortBy={sortBy}
sortDir={sortDir}
toggleDetailsIcon={false}
onFirstClick={onFirstClick}
onLastClick={onLastClick}
onNextClick={onNextClick}
onPreviousClick={onPreviousClick}
onSortChange={
sortField => onSortChange('closedcves', sortField)}
/>
)}
</ReportEntitiesContainer>
Expand All @@ -607,14 +738,35 @@ const PageContent = ({
entities={tls_certificates.entities}
filter={filter}
sortFunctions={tls_certificates_sort_functions}
sortField={sorting.tlscerts.sortField}
sortReverse={sorting.tlscerts.sortReverse}
onInteraction={onInteraction}
>
{props => (
{({
entities,
entitiesCounts,
sortBy,
sortDir,
onFirstClick,
onLastClick,
onNextClick,
onPreviousClick,
}) => (
<TLSCertificatesTable
{...props}
entities={entities}
entitiesCounts={entitiesCounts}
filter={filter}
sortBy={sortBy}
sortDir={sortDir}
toggleDetailsIcon={false}
onFirstClick={onFirstClick}
onLastClick={onLastClick}
onNextClick={onNextClick}
onPreviousClick={onPreviousClick}
onSortChange={
sortField => onSortChange('tlscerts', sortField)}
onTlsCertificateDownloadClick={
onTlsCertificateDownloadClick}
toggleDetailsIcon={false}
/>
)}
</ReportEntitiesContainer>
Expand All @@ -625,12 +777,33 @@ const PageContent = ({
entities={errors.entities}
filter={filter}
sortFunctions={errors_sort_functions}
sortField={sorting.errors.sortField}
sortReverse={sorting.errors.sortReverse}
onInteraction={onInteraction}
>
{props => (
{({
entities,
entitiesCounts,
sortBy,
sortDir,
onFirstClick,
onLastClick,
onNextClick,
onPreviousClick,
}) => (
<ErrorsTable
{...props}
entities={entities}
entitiesCounts={entitiesCounts}
filter={filter}
sortBy={sortBy}
sortDir={sortDir}
toggleDetailsIcon={false}
onFirstClick={onFirstClick}
onLastClick={onLastClick}
onNextClick={onNextClick}
onPreviousClick={onPreviousClick}
onSortChange={
sortField => onSortChange('errors', sortField)}
/>
)}
</ReportEntitiesContainer>
Expand Down Expand Up @@ -663,6 +836,7 @@ PageContent.propTypes = {
showError: PropTypes.func.isRequired,
showErrorMessage: PropTypes.func.isRequired,
showSuccessMessage: PropTypes.func.isRequired,
sorting: PropTypes.object,
updating: PropTypes.bool,
onActivateTab: PropTypes.func.isRequired,
onAddToAssetsClick: PropTypes.func.isRequired,
Expand All @@ -679,6 +853,7 @@ PageContent.propTypes = {
onRemoveFromAssetsClick: PropTypes.func.isRequired,
onReportDownloadClick: PropTypes.func.isRequired,
onReportFormatChange: PropTypes.func.isRequired,
onSortChange: PropTypes.func.isRequired,
onTagSuccess: PropTypes.func.isRequired,
onTargetEditClick: PropTypes.func.isRequired,
onTlsCertificateDownloadClick: PropTypes.func.isRequired,
Expand Down
Loading