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

Improve error message for undefined report formats on report detailspage #2367

Merged
merged 5 commits into from
Aug 6, 2020
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/).
- Deleting a single entity now removes its ID from store [#1839](https://github.com/greenbone/gsa/pull/1839)

### Fixed
- Show proper error message on report detailspage when no report format is available [#2367](https://github.com/greenbone/gsa/pull/2367)
- Don't use stored result list page filter at report results tab [#2366](https://github.com/greenbone/gsa/pull/2366)
- Fixed flickering reports [#2359](https://github.com/greenbone/gsa/pull/2359)
- Fixed "Hosts scanned" in report details disappearing during page refresh [#2357](https://github.com/greenbone/gsa/pull/2357)
Expand Down
1 change: 1 addition & 0 deletions gsa/public/locales/gsa-de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,7 @@
"The maximum of {{num}} hosts was exceeded. If there are more hosts associated with this process, they will not be taken into account.": "Das Maximum von {{num}} Hosts wurde überschritten. Sollten weitere Hosts mit diesem Prozess verknüpft sein, werden sie nicht mitberücksichtigt.",
"The name must include at least one alphanumeric character or one of .,-/_# and space.": "Der Name muss mindestens ein alphanumerisches Zeichen oder eines von .,-/_# und Leerzeichen enthalten.",
"The port range needs numerical values for start and end!": "Der Portbereich benötigt numerische Werte für Start und Ende!",
"The report cannot be displayed because no Greenbone Vulnerability Manager report format is available. This could be due to a missing feed. Please update the feed, check the \"feed import owner\" setting, or contact your system administrator.": "Der Bericht kann nicht angezeigt werden, weil dem Greenbone Vulnerability Manager kein Berichtformat zur Verfügung steht. Dies könnte an einem fehlenden Feed liegen. Bitte aktualisieren Sie den Feed, überprüfen die \"Feed Import Besitzer\"-Einstellungen, oder kontaktieren Ihren Systemadministrator.",
"The report is empty. The filter does not match any of the {{all}} results.": "Der Bericht ist leer. Der Filter passt zu keinem der {{all}} Ergebnisse.",
"The scan did not collect any results": "Der Scan hat keine Ergebnisse gesammelt",
"The scan is still running and no results have arrived yet": "Der Scan läuft noch und es sind noch keine Ergebnisse eingetroffen",
Expand Down
2 changes: 0 additions & 2 deletions gsa/src/web/components/error/errorpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ const ErrorDetails = styled.div`
background-color: ${Theme.white};
padding: 5px;
max-height: 200px;
overflow: auto;
overflow-x: auto;
white-space: pre;
`;

const ErrorPanel = ({error, message, info}) => {
Expand Down
11 changes: 11 additions & 0 deletions gsa/src/web/pages/reports/detailspage.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,17 @@ class ReportDetails extends React.Component {
// if no report format id is available we would create an infinite
// render loop here
this.setState({reportFormatId});
} else {
// if there is no report format at all, throw a proper error message
// instead of just showing x is undefined JS stacktrace
const noReportFormatError = _(
'The report cannot be displayed because' +
' no Greenbone Vulnerability Manager report format is available.' +
' This could be due to a missing feed. Please update the feed, ' +
'check the "feed import owner" setting, or contact your system ' +
'administrator.',
);
throw new Error(noReportFormatError);
}
}

Expand Down