Skip to content

Commit

Permalink
Merge pull request #141 from mercedes-benz/develop
Browse files Browse the repository at this point in the history
Spring Release 37
  • Loading branch information
m-o-n-i-s-h authored Sep 27, 2024
2 parents ee5371e + 9bb0502 commit c9e2899
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ const NeoCard = ({
extensions, // A set of enabled extensions.
globalParameters, // Query parameters that are globally set for the entire dashboard.
dashboardSettings, // Dictionary of settings for the entire dashboard.
onRemovePressed, // action to take when the card is removed. (passed from parent)
onClonePressed, // action to take when user presses the clone button
onRemovePressed, // action to take when the card is removed. (passed from parent).
onClonePressed, // action to take when user presses the clone button.
onReportHelpButtonPressed, // action to take when someone clicks the 'help' button in the report settings.
onTitleUpdate, // action to take when the card title is updated.
onTypeUpdate, // action to take when the card report type is updated.
Expand All @@ -51,8 +51,8 @@ const NeoCard = ({
onGlobalParameterUpdate, // action to take when a report updates a dashboard parameter.
onToggleCardSettings, // action to take when the card settings button is clicked.
onToggleReportSettings, // action to take when the report settings (advanced settings) button is clicked.
onDatabaseChanged, // action to take when the user changes the database related to the card
loadDatabaseListFromNeo4j, // Thunk to get the list of databases
onDatabaseChanged, // action to take when the user changes the database related to the card.
loadDatabaseListFromNeo4j, // Thunk to get the list of databases.
createNotification, // Thunk to create a global notification pop-up.
onPutItem, // Method to remove report from ui and move it to toolbox
}) => {
Expand Down
2 changes: 2 additions & 0 deletions src/report/Report.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ export const NeoReport = ({
);
} else if (status == QueryStatus.OVER_LOAD) {
return <NeoCodeViewerComponent value={`Loading took too long. Please reload report or complete page.`} />;
} else if (status == QueryStatus.INACTIVE) {
return <NeoCodeViewerComponent value={`Access token timed out. Please reload report or complete page.`} />;
}
return (
<NeoCodeViewerComponent
Expand Down
8 changes: 8 additions & 0 deletions src/report/ReportQueryRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export enum QueryStatus {
COMPLETE, // There is data returned, and we can visualize it all.
COMPLETE_TRUNCATED, // There is data returned, but it's too much so we truncate it.
ERROR, // Something broke, likely the cypher query is invalid.
INACTIVE, // If dashboard is inactive for too long and we use a custom message instead of error message from backend. (VULCAN-819)
}

// TODO: create a readOnly version of this method or inject a property
Expand Down Expand Up @@ -151,6 +152,13 @@ export async function runCypherQuery(
return 'Loading took too long. Please reload page.';
}

if (e.message.startsWith('WebSocket connection failure.')) {
setStatus(QueryStatus.INACTIVE);
setRecords([{ error: 'Access token timed out. Please reload report or complete page.' }]);
transaction.rollback();
return 'Access token timed out. Please reload report or complete page.';
}

setStatus(QueryStatus.ERROR);
// Process other errors.
if (setRecords) {
Expand Down

0 comments on commit c9e2899

Please sign in to comment.