generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Add link to home page from error pages #719
Merged
afwilcox
merged 4 commits into
release/noble-sea-lemon
from
CE-1080-add-link-to-error-pages
Oct 23, 2024
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import NotAuthorized from "./not-authorized"; | ||
import { NotFound } from "./not-found"; | ||
import NotFound from "./not-found"; | ||
|
||
export { NotFound }; | ||
|
||
export default NotAuthorized; | ||
export { NotAuthorized }; |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { FC } from "react"; | ||
import { Footer, Header } from "../../containers/layout"; | ||
import { BsPersonFillSlash } from "react-icons/bs"; | ||
import { Link } from "react-router-dom"; | ||
|
||
const NotAuthorized: FC = () => { | ||
return ( | ||
|
@@ -10,8 +11,19 @@ const NotAuthorized: FC = () => { | |
<div className="error-container"> | ||
<div className="message"> | ||
<BsPersonFillSlash /> | ||
<h1 className="comp-padding-top-25">Sorry, you are not authorized to access this site</h1>If you think you | ||
should have access, please contact <a href="mailto:[email protected]">[email protected]</a> | ||
<div className="message-details"> | ||
<h1 className="comp-padding-top-25">Sorry, you are not authorized to access this site.</h1> | ||
|
||
<p> | ||
If you believe you should have access, return to the <Link to="/complaints/">home page</Link> to try | ||
logging in again. | ||
</p> | ||
|
||
<p> | ||
If the problem persists, contact the Compliance & Enforcement Digital Services team at{" "} | ||
<a href="mailto:[email protected]">[email protected]</a>. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
35 changes: 33 additions & 2 deletions
35
frontend/src/app/components/containers/pages/not-found.tsx
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 |
---|---|---|
@@ -1,3 +1,34 @@ | ||
export const NotFound = () => { | ||
return <h1>The page or content you are looking for is not found.</h1>; | ||
import { FC } from "react"; | ||
import { Footer, Header } from "../../containers/layout"; | ||
import { BsFileEarmarkX } from "react-icons/bs"; | ||
import { Link } from "react-router-dom"; | ||
|
||
const NotFound: FC = () => { | ||
return ( | ||
<div className="comp-app-container"> | ||
<Header /> | ||
|
||
<div className="error-container"> | ||
<div className="message"> | ||
<BsFileEarmarkX /> | ||
<div className="message-details"> | ||
<h1 className="comp-padding-top-25">The page or content you are looking for is not found.</h1> | ||
|
||
<p> | ||
Return to the <Link to="/complaints/">home page</Link> to try again. | ||
</p> | ||
|
||
<p> | ||
If the problem persists, contact the Compliance & Enforcement Digital Services team at{" "} | ||
<a href="mailto:[email protected]">[email protected]</a>. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<Footer /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default NotFound; |
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 |
---|---|---|
|
@@ -55,9 +55,20 @@ const GenericErrorBoundary: FC<props> = ({ children }) => { | |
<div className="message"> | ||
<TbFaceIdError /> | ||
{/* <br /> */} | ||
<h1 className="comp-padding-top-25">System error</h1>Please refresh the page to try again. If you still have | ||
problems, contact the Compliance & Enforcement Digital Services team at{" "} | ||
<a href="mailto:[email protected]">[email protected]</a> | ||
<div className="message-details"> | ||
<h1 className="comp-padding-top-25">System error</h1> | ||
|
||
{/* <!-- The link in this section can't use react router as it | ||
sits above the Routes in index.ts --> */} | ||
<p> | ||
Refresh the page or return to the <a href="/">home page</a> to try again. | ||
</p> | ||
|
||
<p> | ||
If the problem persists, contact the Compliance & Enforcement Digital Services team at{" "} | ||
<a href="mailto:[email protected]">[email protected]</a>. | ||
</p> | ||
</div> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,42 @@ | ||
.error-container { | ||
margin-top: auto; | ||
position: relative; | ||
display: flex; | ||
align-items: center; /* Center items */ | ||
justify-content: center; /* Center horizontally */ | ||
height: 100vh; /* Full height of the viewport */ | ||
|
||
.message { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
display: flex; | ||
flex-direction: column; /* Stack all children vertically */ | ||
align-items: center; /* Center items */ | ||
text-align: center; /* Center text on small screens */ | ||
|
||
svg { | ||
height: 175px; | ||
height: 175px; /* Set size of icon */ | ||
width: 175px; | ||
float: left; | ||
padding-right: 25px; | ||
margin-bottom: 25px; /* Space between SVG and text on mobile */ | ||
} | ||
} | ||
} | ||
|
||
/* Media query for larger screens */ | ||
@media (min-width: 768px) { | ||
.error-container { | ||
flex-direction: row; /* Align horizontally on larger screens */ | ||
|
||
.message { | ||
flex-direction: row; /* Align horizontally on larger screens*/ | ||
align-items: center; /* Align SVG and text vertically */ | ||
text-align: left; /* Align text to the left on larger screens */ | ||
|
||
svg { | ||
margin-bottom: 0; /* Remove bottom margin */ | ||
margin-right: 25px; /* Space between SVG and text */ | ||
} | ||
|
||
/* We want the title and subsequent paragraphs to stack beside the icon */ | ||
.message-details { | ||
flex-direction: column; /* Align all messages vertically */ | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit pick - this is grammatically incorrect. I personally would say "The page or content you are looking for has not been found."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to "could not be found" as per conversation with Neil.