Skip to content

Commit

Permalink
Merge pull request #2367 from swaterkamp/UndefRepForm
Browse files Browse the repository at this point in the history
Improve error message for undefined report formats on report detailspage
  • Loading branch information
swaterkamp authored Aug 6, 2020
2 parents 8cc8f34 + 35352fa commit 48443d6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
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

0 comments on commit 48443d6

Please sign in to comment.