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

fix(my-pages): law and order breadcrumbs + button filter #16668

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

disaerna
Copy link
Member

@disaerna disaerna commented Oct 31, 2024

My pages

  • Fix breadcrumbs navigation for law and order
  • Fix button in digital mailbox

Screenshots / Gifs

Attach Screenshots / Gifs to help reviewers understand the scope of the pull request

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Added a new property largeButton to the Filter component for enhanced styling flexibility.
    • Introduced a new localized message for referencing court cases: 'Mín dómsmál'.
  • Improvements

    • Updated navigation item name from m.courtCases to m.myCourtCases for clarity.
    • Removed breadcrumb visibility control from the navigation item for a cleaner interface.
  • Style

    • Adjusted CSS styles to apply to only direct child elements, refining the visual hierarchy of components.

@disaerna disaerna requested a review from a team as a code owner October 31, 2024 11:34
@disaerna disaerna added the automerge Merge this PR as soon as all checks pass label Oct 31, 2024
Copy link
Contributor

coderabbitai bot commented Oct 31, 2024

Walkthrough

This pull request introduces several changes across multiple files in the service portal. Notable modifications include updates to CSS styles in Filter.css.ts, the addition of a new property to the FilterProps interface in Filter.tsx, the addition of a new message for localization in messages.ts, and modifications to the navigation structure in navigation.ts. These changes enhance component flexibility, expand localization capabilities, and adjust the user interface navigation hierarchy.

Changes

File Path Change Summary
libs/service-portal/core/src/components/Filter/Filter.css.ts Updated selector in lgBtn style to target only direct child span elements.
libs/service-portal/core/src/components/Filter/Filter.tsx Added largeButton?: boolean property to FilterProps interface; updated Button size in popover variant.
libs/service-portal/core/src/lib/messages.ts Added new message myCourtCases with id: 'service.portal:my-court-cases' and defaultMessage: 'Mín dómsmál'.
libs/service-portal/law-and-order/src/lib/navigation.ts Renamed child navigation item from m.courtCases to m.myCourtCases; removed breadcrumbHide property.

Possibly related PRs

Suggested reviewers

  • thordurhhh: Suggested reviewer for this pull request.

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.

@datadog-island-is
Copy link

datadog-island-is bot commented Oct 31, 2024

Datadog Report

All test runs b551577 🔗

5 Total Test Services: 0 Failed, 4 Passed
⬆️ Test Sessions change in coverage: 1 increased (+0.01%), 24 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 2.4s 1 no change Link
application-system-api 0 0 0 120 2 3m 18.18s 1 no change Link
application-template-api-modules 0 0 0 123 0 2m 6.72s 1 increased (+0.01%) Link
service-portal-core 0 0 0 5 0 1.77s N/A Link
service-portal-health 0 0 0 0 0 478.18ms 1 no change Link

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: 1

🧹 Outside diff range and nitpick comments (2)
libs/service-portal/core/src/components/Filter/Filter.css.ts (1)

21-23: LGTM! Consider adding a comment to document the style's purpose.

The child combinator selector improves style specificity by targeting only direct span children, preventing unintended style application to nested spans.

Add a comment to explain why the span needs 100% height:

+// Ensure direct span children fill the button height for proper alignment
globalStyle(`${lgBtn} > span`, {
  height: '100%',
})
libs/service-portal/core/src/components/Filter/Filter.tsx (1)

Line range hint 1-21: Add JSDoc comment for the new largeButton prop.

To maintain consistency with other props and improve code maintainability, please add documentation for the new prop.

  additionalFilters?: ReactNode

+  /** Whether to apply large button styling. */
  largeButton?: boolean
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between bda8f93 and 88ba87d.

📒 Files selected for processing (4)
  • libs/service-portal/core/src/components/Filter/Filter.css.ts (1 hunks)
  • libs/service-portal/core/src/components/Filter/Filter.tsx (1 hunks)
  • libs/service-portal/core/src/lib/messages.ts (1 hunks)
  • libs/service-portal/law-and-order/src/lib/navigation.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
libs/service-portal/core/src/components/Filter/Filter.css.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/service-portal/core/src/components/Filter/Filter.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/service-portal/core/src/lib/messages.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/lib/navigation.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
🔇 Additional comments (3)
libs/service-portal/law-and-order/src/lib/navigation.ts (1)

18-18: LGTM! The navigation changes improve breadcrumb visibility.

The rename to myCourtCases and removal of breadcrumb hiding improves navigation clarity by making the section more personally relevant and visible in the breadcrumb trail.

Let's verify the message exists in the localization file:

✅ Verification successful

The navigation change is properly localized

The message key myCourtCases is correctly defined in the core messages file with the ID 'service.portal:my-court-cases', ensuring proper localization support for the navigation item.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the myCourtCases message exists in messages.ts
# Expected: Should find the message definition

rg "myCourtCases.*=.*{" libs/service-portal/core/src/lib/messages.ts

Length of output: 170


Script:

#!/bin/bash
# Let's try a different approach to find the message definition
# First, let's check if the file exists
fd "messages.ts" libs/service-portal/law-and-order

# Then let's search for myCourtCases in a more reliable way
rg -l "myCourtCases" libs/service-portal/law-and-order

# Also check core messages
rg -l "myCourtCases" libs/service-portal/core

Length of output: 306


Script:

#!/bin/bash
# Let's check the content of both message files to verify the definition
rg -A 1 "myCourtCases" libs/service-portal/law-and-order/src/lib/messages.ts
rg -A 1 "myCourtCases" libs/service-portal/core/src/lib/messages.ts

Length of output: 203

libs/service-portal/core/src/components/Filter/Filter.tsx (1)

Line range hint 1-300: Well-structured and reusable component implementation.

The component follows best practices for reusability across NextJS apps:

  • Strong TypeScript typing
  • Clear component composition
  • Good separation of concerns
  • Effective context usage
libs/service-portal/core/src/lib/messages.ts (1)

1659-1662: LGTM! The new message follows i18n best practices.

The addition of myCourtCases message follows the established patterns:

  • Proper namespace prefix in the ID
  • Consistent casing and formatting
  • Exported through the centralized messages object

Copy link
Member

@thordurhhh thordurhhh left a comment

Choose a reason for hiding this comment

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

lovely 🙌

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.67%. Comparing base (5d1f145) to head (447fd6e).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #16668   +/-   ##
=======================================
  Coverage   36.67%   36.67%           
=======================================
  Files        6858     6858           
  Lines      142787   142787           
  Branches    40703    40703           
=======================================
  Hits        52364    52364           
  Misses      90423    90423           
Flag Coverage Δ
api 3.37% <ø> (ø)
application-system-api 41.32% <ø> (ø)
application-template-api-modules 27.80% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rvice-portal/core/src/components/Filter/Filter.tsx 0.00% <ø> (ø)
libs/service-portal/core/src/lib/messages.ts 50.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d1f145...447fd6e. Read the comment docs.

@kodiakhq kodiakhq bot merged commit 72d681b into main Oct 31, 2024
46 checks passed
@kodiakhq kodiakhq bot deleted the my-pages/law-and-order-breadcrumbs branch October 31, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants