generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORV2-1682 Display CorrelationId in Unexpected Error Page (#1665)
- Loading branch information
1 parent
bc5fd5c
commit c606867
Showing
16 changed files
with
238 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,9 @@ | |
&__link { | ||
margin-left: 0.25rem; | ||
} | ||
|
||
&__correlation-id { | ||
font-weight: bold; | ||
margin-bottom: 0px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,49 @@ import "./UniversalUnexpected.scss"; | |
import { ONROUTE_WEBPAGE_LINKS } from "../../routes/constants"; | ||
import { ErrorPage } from "../components/error/ErrorPage"; | ||
import { CustomExternalLink } from "../components/links/CustomExternalLink"; | ||
import { useLocation } from "react-router-dom"; | ||
|
||
export const UniversalUnexpected = () => { | ||
const { state } = useLocation(); | ||
if (!state?.correlationId) { | ||
return ( | ||
<ErrorPage | ||
errorTitle="Unexpected Error" | ||
msgNode={ | ||
<div className="unexpected-error-msg"> | ||
<span className="unexpected-error-msg__text">Please return to</span> | ||
|
||
<CustomExternalLink | ||
className="unexpected-error-msg__link" | ||
href={ONROUTE_WEBPAGE_LINKS.HOME} | ||
> | ||
onRouteBC | ||
</CustomExternalLink> | ||
</div> | ||
} | ||
/> | ||
); | ||
} | ||
return ( | ||
<ErrorPage | ||
errorTitle="Unexpected Error" | ||
msgNode={ | ||
<div className="unexpected-error-msg"> | ||
<span className="unexpected-error-msg__text"> | ||
Please return to | ||
If this problem persists, please email | ||
</span> | ||
|
||
<CustomExternalLink | ||
className="unexpected-error-msg__link" | ||
href={ONROUTE_WEBPAGE_LINKS.HOME} | ||
> | ||
onRouteBC | ||
<br></br> | ||
<span className="unexpected-error-msg__text"> | ||
the error reference number below to | ||
</span> | ||
<CustomExternalLink className="unexpected-error-msg__link"> | ||
[email protected] | ||
</CustomExternalLink> | ||
|
||
<p className="unexpected-error-msg__correlation-id"> | ||
{/** Display just the first segment of the correlation id */} | ||
{state.correlationId.split("-")[0].toUpperCase()} | ||
</p> | ||
</div> | ||
} | ||
/> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.