-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(permission) more detailed error message when user has no access …
…to a project or the project is not found. fixes #783 Signed-off-by: David Edler <[email protected]>
- Loading branch information
Showing
4 changed files
with
52 additions
and
5 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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { FC } from "react"; | ||
import { Row, Col } from "@canonical/react-components"; | ||
import CustomLayout from "./CustomLayout"; | ||
|
||
const NoProject: FC = () => { | ||
const url = location.pathname; | ||
const project = url.startsWith("/ui/project/") | ||
? url.split("/")[3] | ||
: "default"; | ||
|
||
return ( | ||
<CustomLayout mainClassName="no-match"> | ||
<Row> | ||
<Col size={6} className="col-start-large-4"> | ||
<h1 className="p-heading--4">Project not found</h1> | ||
<p> | ||
The project <code>{project}</code> is missing or you do not have | ||
access. | ||
<br /> | ||
If you think this is an error in our product, please{" "} | ||
<a | ||
href="https://github.com/canonical/lxd-ui/issues/new" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
title="Report a bug" | ||
> | ||
Report a bug | ||
</a> | ||
. | ||
</p> | ||
</Col> | ||
</Row> | ||
</CustomLayout> | ||
); | ||
}; | ||
|
||
export default NoProject; |
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