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

556-feat: Widget not found #667

Merged
merged 5 commits into from
Dec 6, 2024
Merged

556-feat: Widget not found #667

merged 5 commits into from
Dec 6, 2024

Conversation

YulikK
Copy link
Collaborator

@YulikK YulikK commented Nov 29, 2024

What type of PR is this? (select all that apply)

  • πŸ• Feature
  • πŸ› Bug Fix
  • 🚧 Breaking Change
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ“ Documentation Update

Description

  • remove widget
  • move page element to page view
  • make css module and refactor style properties
  • add playwright test for not-found page
  • reorganize mentorship routes

Related Tickets & Documents

Screenshots, Recordings

Please replace this line with any relevant images for UI changes.

Added/updated tests?

  • πŸ‘Œ Yes
  • πŸ™…β€β™‚οΈ No, because they aren't needed
  • πŸ™‹β€β™‚οΈ No, because I need help

[optional] Are there any post deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

Summary by CodeRabbit

  • New Features

    • Introduced a new mentorship course route with metadata and static parameters.
    • Added a main mentorship page with predefined mentorship course data.
    • Implemented a new "Not Found" component with user-friendly messaging and navigation options.
  • Bug Fixes

    • Updated the Not Found page structure and styling for improved user experience.
  • Documentation

    • Enhanced styles for the Not Found page to improve layout and responsiveness.
  • Chores

    • Removed outdated files related to the Not Found component to streamline the codebase.

@YulikK YulikK self-assigned this Nov 29, 2024
@github-actions github-actions bot changed the title Feat/556 widget not found 556-feat: Widget not found Nov 29, 2024
@YulikK
Copy link
Collaborator Author

YulikK commented Nov 29, 2024

run visual now

@YulikK
Copy link
Collaborator Author

YulikK commented Nov 29, 2024

run visual now

Copy link

Lighthouse Report:

  • Performance: 99 / 100
  • Accessibility: 99 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

Copy link

Lighthouse Report:

  • Performance: 99 / 100
  • Accessibility: 99 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

src/app/mentorship/page.tsx Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Dec 4, 2024

Lighthouse Report:

  • Performance: 53 / 100
  • Accessibility: 99 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@YulikK YulikK requested a review from SpaNb4 December 4, 2024 12:33
@KristiBo KristiBo marked this pull request as ready for review December 5, 2024 14:20
Copy link
Contributor

coderabbitai bot commented Dec 5, 2024

πŸ“ Walkthrough
πŸ“ Walkthrough

Walkthrough

The changes involve the removal of the existing mentorship page functionality and the introduction of a new mentorship course route within a Next.js application. The previous page.tsx file for mentorship was deleted, while new page.tsx files were created for both the mentorship course and the main mentorship route. Additionally, the NotFound component has been restructured and relocated, accompanied by updates to styling and testing.

Changes

File Path Change Summary
src/app/[...mentorship]/page.tsx Removed functions and types related to the mentorship page.
src/app/mentorship/[course]/page.tsx Added functionality for mentorship course route, including metadata generation and course data handling.
src/app/mentorship/page.tsx Introduced a new mentorship route with metadata generation and rendering of default mentorship data.
src/app/not-found.tsx Updated import path for NotFound component.
src/views/not-found.tsx Deleted the old NotFound component.
src/views/not-found/not-found.module.scss Added new styles for the "not found" view.
src/views/not-found/not-found.tsx Introduced a new NotFound component with updated structure and content.
src/widgets/not-found/index.ts Deleted the import/export file for the NotFound component.
src/widgets/not-found/ui/not-found.scss Deleted old styles for the NotFound component.
src/widgets/not-found/ui/not-found.tsx Deleted the old NotFound component implementation.
src/shared/__tests__/visual/not-found.spec.ts Added new Playwright test suite for the "Not Found" page.

Assessment against linked issues

Objective Addressed Explanation
Refactor not-found.tsx's scss (##556) ❌ No refactoring of SCSS as per the specified guidelines.
Create unit test for NotFound component (##556) βœ…
Replace div's with HTML5 tags (##556) ❌ No changes to HTML structure were made.
Add descriptive alt attribute (##556) ❌ No alt attributes were added to images.
Move not-found folder to pages (##556) ❌ Folder restructuring was not completed.

Possibly related PRs

Suggested reviewers

  • dzmitry-varabei
  • andron13
  • natanchik
  • Quiddlee
  • SpaNb4
  • ansivgit

πŸ“œ Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 2799556 and 250b283.

πŸ“’ Files selected for processing (1)
  • src/views/not-found/not-found.module.scss (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/views/not-found/not-found.module.scss

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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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: 6

🧹 Outside diff range and nitpick comments (3)
src/views/not-found/not-found.module.scss (1)

1-18: Extract magic numbers into variables

Consider extracting magic numbers into semantic variables for better maintainability.

+ $spacing-large: 30px;
+ $image-max-width: 170px;
+ $content-max-width: 480px;

.not-found {
  display: flex;
  flex-direction: column;
-  gap: 30px;
+  gap: $spacing-large;
  min-height: 100vh;
}

.not-found-image {
-  max-width: 170px;
+  max-width: $image-max-width;
  height: auto;
}

.not-found-paragraph {
-  max-width: 480px;
+  max-width: $content-max-width;
src/app/mentorship/page.tsx (1)

5-9: Consider enhancing metadata for SEO.

The metadata could include additional SEO-friendly properties like description, keywords, and OpenGraph tags.

 export async function generateMetadata(): Promise<Metadata> {
   const title = `Mentorship Β· The Rolling Scopes School`;
-
-  return { title };
+  return {
+    title,
+    description: 'Explore mentorship opportunities at The Rolling Scopes School',
+    openGraph: {
+      title,
+      description: 'Explore mentorship opportunities at The Rolling Scopes School',
+    },
+  };
 }
src/app/mentorship/[course]/page.tsx (1)

18-31: Improve course matching precision.

Using includes for path matching could lead to false positives. Consider using exact matching.

   const mentorshipCourse =
-    mentorshipCourses.find((item) => item.detailsUrl.includes(`/${course}`))
+    mentorshipCourses.find((item) => 
+      item.detailsUrl.split('/').pop() === course)
     || mentorshipCoursesDefault;
πŸ“œ Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between bc2e937 and 2799556.

πŸ“’ Files selected for processing (11)
  • src/app/[...mentorship]/page.tsx (0 hunks)
  • src/app/mentorship/[course]/page.tsx (1 hunks)
  • src/app/mentorship/page.tsx (1 hunks)
  • src/app/not-found.tsx (1 hunks)
  • src/shared/__tests__/visual/not-found.spec.ts (1 hunks)
  • src/views/not-found.tsx (0 hunks)
  • src/views/not-found/not-found.module.scss (1 hunks)
  • src/views/not-found/not-found.tsx (1 hunks)
  • src/widgets/not-found/index.ts (0 hunks)
  • src/widgets/not-found/ui/not-found.scss (0 hunks)
  • src/widgets/not-found/ui/not-found.tsx (0 hunks)
πŸ’€ Files with no reviewable changes (5)
  • src/widgets/not-found/index.ts
  • src/views/not-found.tsx
  • src/widgets/not-found/ui/not-found.tsx
  • src/widgets/not-found/ui/not-found.scss
  • src/app/[...mentorship]/page.tsx
πŸ”‡ Additional comments (7)
src/app/not-found.tsx (1)

2-2: LGTM: Import path updated correctly

The import path change reflects the new file structure, aligning with the PR objective of reorganizing the not-found component.

src/views/not-found/not-found.tsx (3)

1-9: LGTM! Well-organized imports and proper CSS modules setup.


11-28: Great implementation with semantic HTML and accessibility!

The component follows best practices with:

  • Semantic main tag
  • Descriptive alt text
  • Proper test ID for E2E testing

7-7: Verify CSS module implementation

Let's check if the CSS module follows the requirements of removing parent selectors.

Also applies to: 13-18

βœ… Verification successful

CSS module implementation is correct

The CSS module follows best practices with no parent selectors. It uses flat class names and includes proper media query usage.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check CSS module for parent selectors
cat src/views/not-found/not-found.module.scss

Length of output: 291

src/app/mentorship/page.tsx (2)

1-3: LGTM! Imports are well-structured.


11-13: LGTM! Component follows Next.js best practices.

src/app/mentorship/[course]/page.tsx (1)

1-3: LGTM! Imports are properly organized.

src/views/not-found/not-found.module.scss Outdated Show resolved Hide resolved
src/shared/__tests__/visual/not-found.spec.ts Show resolved Hide resolved
src/shared/__tests__/visual/not-found.spec.ts Show resolved Hide resolved
src/views/not-found/not-found.tsx Show resolved Hide resolved
src/app/mentorship/[course]/page.tsx Show resolved Hide resolved
src/app/mentorship/[course]/page.tsx Show resolved Hide resolved
Copy link

github-actions bot commented Dec 6, 2024

Lighthouse Report:

  • Performance: 73 / 100
  • Accessibility: 99 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@YulikK YulikK merged commit e2a0332 into main Dec 6, 2024
3 checks passed
@YulikK YulikK deleted the feat/556-widget-not-found branch December 6, 2024 11:38
@coderabbitai coderabbitai bot mentioned this pull request Dec 6, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

FSD: Widget NotFound
5 participants