Skip to content
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: [110] add error pages #149

Merged
merged 4 commits into from
Aug 31, 2024
Merged

Conversation

Cihatata
Copy link
Contributor

Issues #110
When I looked at the project, I saw this as an entry-level issue and wanted to do it.

I think page not found(404) and no authorization(403) pages should be separate. They mean different things and the url names should be different. That's why I made it as two different pages. I separated the texts in the design.
image

Copy link
Contributor

coderabbitai bot commented Aug 18, 2024

Walkthrough

The changes improve error handling in the application by establishing dedicated routes for 403 and 404 error pages. New components, constants, and styles enhance user communication during errors, providing clear messages and navigation options. This update ensures users receive guidance when facing access issues or missing pages, significantly enhancing overall usability.

Changes

File(s) Change Summary
frontend/src/App.jsx Added routes for Error403 and Error404 components to handle unauthorized and not found errors.
frontend/src/scenes/errors/403.jsx, 404.jsx Introduced Error403 and Error404 components for displaying relevant error messages with navigation options.
frontend/src/scenes/errors/Error.jsx Added a reusable Error component for displaying error messages using props for dynamic content.
frontend/src/scenes/errors/Error.module.scss New SCSS styles for error components, enhancing their visual presentation and layout.
frontend/src/scenes/errors/constant.js Introduced constants for error messages and navigation URLs for 403 and 404 errors to standardize feedback.
frontend/setupTests.js Configured Jest testing utilities to enhance the testing environment for the application.
frontend/src/tests/components/Error/Error.test.jsx Added unit tests for ErrorComponent to ensure correct rendering and functionality.
frontend/vite.config.js Updated the testing setup to include a new configuration file for pre-test initialization.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Outside diff range, codebase verification and nitpick comments (1)
frontend/src/scenes/errors/Error.jsx (1)

9-15: Consider moving button styles to a CSS module.

Using a CSS module for styles can improve maintainability and consistency across components.

- const errorButtonStyle = {
-   borderRadius: '8px',
-   marginTop: '58px',
-   fontSize: '13px',
-   lineHeight: '24px',
-   padding: '5px 27px'
- }
+ const errorButtonStyle = styles.errorButton;

Add the following to Error.module.scss:

.errorButton {
  border-radius: 8px;
  margin-top: 58px;
  font-size: 13px;
  line-height: 24px;
  padding: 5px 27px;
}

frontend/src/scenes/errors/403.jsx Outdated Show resolved Hide resolved
frontend/src/scenes/errors/404.jsx Outdated Show resolved Hide resolved
frontend/src/scenes/errors/Error.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

@uparkalau uparkalau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good . Could you please add a test using vitest
It is under test folder frontend\src\tests

@Cihatata
Copy link
Contributor Author

It looks good . Could you please add a test using vitest It is under test folder frontend\src\tests

I added test cases

@Cihatata Cihatata requested a review from uparkalau August 21, 2024 08:11
@erenfn erenfn changed the base branch from master to develop August 22, 2024 11:20
@erenfn erenfn self-requested a review August 22, 2024 11:27
erenfn
erenfn previously approved these changes Aug 22, 2024
@Cihatata
Copy link
Contributor Author

Is there anything expected from me for this PR?

@uparkalau
Copy link
Contributor

Is there anything expected from me for this PR?

Yes please delete jest library and use vitest as I requested in previous comment.

frontend/vite.config.js Outdated Show resolved Hide resolved
Copy link
Contributor

@uparkalau uparkalau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, mark all conversation resolved when you done

@uparkalau
Copy link
Contributor

Is there anything expected from me for this PR?

How is it going?

@Cihatata
Copy link
Contributor Author

Cihatata commented Aug 28, 2024

Is there anything expected from me for this PR?

How is it going?

I got errors with toHaveStyle when I was doing the issue, so I added the setupTest file. I'll see if there's a different way.

@Cihatata
Copy link
Contributor Author

Fixed your comments @uparkalau

erenfn
erenfn previously approved these changes Aug 30, 2024
Copy link
Collaborator

@erenfn erenfn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do git pull from develop and it is good to go

@uparkalau
Copy link
Contributor

IT looks good. Accept new changes from the develop branch and you can merge it.

uparkalau
uparkalau previously approved these changes Aug 30, 2024
@Cihatata Cihatata dismissed stale reviews from uparkalau and erenfn via 66bd998 August 30, 2024 15:31
@Cihatata Cihatata requested a review from erenfn August 30, 2024 15:31
@Cihatata
Copy link
Contributor Author

I updated branch. Can you check again?

@Cihatata Cihatata requested a review from uparkalau August 30, 2024 15:32
@Cihatata
Copy link
Contributor Author

Do git pull from develop and it is good to go
updated branch

@uparkalau
Copy link
Contributor

It looks good . Could you please add a test using vitest It is under test folder frontend\src\tests

I added test cases

Yes, you can merge it.
Thank you.

@Cihatata
Copy link
Contributor Author

It looks good . Could you please add a test using vitest It is under test folder frontend\src\tests

I added test cases

Yes, you can merge it. Thank you.

Thank you, I am waiting approve from @erenfn

@Cihatata
Copy link
Contributor Author

I cant show Merge button I guess I don't have access. Can you merge it?
image

@uparkalau uparkalau merged commit 724b7b2 into bluewave-labs:develop Aug 31, 2024
1 check passed
@uparkalau uparkalau linked an issue Sep 3, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error pages design / implementation
4 participants