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(social-insurance): UI changes #16942

Merged
merged 8 commits into from
Nov 24, 2024
Merged

feat(social-insurance): UI changes #16942

merged 8 commits into from
Nov 24, 2024

Conversation

thorkellmani
Copy link
Member

@thorkellmani thorkellmani commented Nov 19, 2024

...

Attach a link to issue if relevant

What

Specify what you're trying to achieve

Why

Specify why you need to achieve this

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

    • Introduced a static mapping for income plans, providing a consistent output structure.
    • Enhanced the IncomePlan component to dynamically adjust URLs based on the income plan's status.
  • Bug Fixes

    • Removed the FootNote component to improve footer display logic.
  • Refactor

    • Replaced the Box component with IntroWrapper for better structure.

Copy link
Contributor

coderabbitai bot commented Nov 19, 2024

Walkthrough

The changes in this pull request involve significant modifications to the mapIncomePlanDto function in the incomePlan.dto.ts file, transitioning from a dynamic mapping of input data to a static return of a predefined IncomePlanDto object. Additionally, the IncomePlan component in IncomePlan.tsx has been restructured, replacing the Box component with IntroWrapper, removing the FootNote component, and altering the logic for the cta.url property based on the income plan's status.

Changes

File Change Summary
libs/clients/social-insurance-administration/src/lib/dto/incomePlan.dto.ts Introduced a new static implementation of mapIncomePlanDto, returning a hardcoded IncomePlanDto object.
libs/portals/my-pages/social-insurance-maintenance/src/screens/IncomePlan/IncomePlan.tsx Replaced Box with IntroWrapper, removed FootNote, and modified cta.url logic based on socialInsuranceIncomePlan status.

Possibly related PRs


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

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 35.91%. Comparing base (1805590) to head (01cc907).

Files with missing lines Patch % Lines
...rance-administration/src/lib/dto/incomePlan.dto.ts 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16942      +/-   ##
==========================================
+ Coverage   35.62%   35.91%   +0.28%     
==========================================
  Files        6915     6913       -2     
  Lines      146037   145323     -714     
  Branches    41457    41350     -107     
==========================================
+ Hits        52021    52188     +167     
+ Misses      94016    93135     -881     
Flag Coverage Δ
api 3.34% <ø> (ø)
application-system-api 38.69% <50.00%> (+<0.01%) ⬆️
application-template-api-modules 27.72% <50.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
...rance-administration/src/lib/dto/incomePlan.dto.ts 50.00% <50.00%> (+33.33%) ⬆️

... and 93 files with indirect coverage changes


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 1805590...01cc907. Read the comment docs.

---- 🚨 Try these New Features:

@datadog-island-is
Copy link

datadog-island-is bot commented Nov 19, 2024

Datadog Report

All test runs c5ebdd1 🔗

3 Total Test Services: 0 Failed, 3 Passed
➡️ Test Sessions change in coverage: 8 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 3.17s 1 no change Link
application-system-api 0 0 0 34 0 2m 35.62s 1 no change Link
application-template-api-modules 0 0 0 116 0 2m 1.9s 1 no change Link

@thorkellmani thorkellmani added automerge Merge this PR as soon as all checks pass deploy-feature Deploys features to dev labels Nov 22, 2024
@thorkellmani thorkellmani marked this pull request as ready for review November 22, 2024 13:50
@thorkellmani thorkellmani requested review from a team as code owners November 22, 2024 13:50
@thorkellmani thorkellmani marked this pull request as draft November 22, 2024 13:51
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: 2

🧹 Outside diff range and nitpick comments (4)
libs/clients/social-insurance-administration/src/lib/dto/incomePlan.dto.ts (2)

Line range hint 15-24: Remove commented out code.

Instead of keeping the old implementation in comments, rely on version control history to track these changes. This helps maintain cleaner and more maintainable code.

-/*
-export const mapIncomePlanDto = (
-  data: TrWebCommonsExternalPortalsApiModelsIncomePlanIncomePlanDto,
-): IncomePlanDto | undefined => ({
-  year: data.year ?? undefined,
-  registrationDate: data.registrationDate ?? undefined,
-  status: data.status as IncomePlanStatus,
-  origin: data.origin ?? undefined,
-  incomeTypeLines: data.incomeTypeLines ?? undefined,
-}) */

26-56: Verify alignment with PR objectives.

The PR description mentions UI changes, but this modification to the DTO mapping layer seems to be a significant data layer change. This could have unintended consequences on the UI behavior and should be clarified.

Please clarify:

  1. Is this change temporary for testing purposes?
  2. How does this data layer change relate to the UI changes mentioned in the PR?
  3. What's the impact on other components that might be consuming this DTO?
libs/portals/my-pages/social-insurance-maintenance/src/screens/IncomePlan/IncomePlan.tsx (2)

Line range hint 1-16: Remove unused FootNote import

The FootNote component is imported but not used in the code. Remove it to improve tree-shaking effectiveness.

- import {
-   ActionCard,
-   CardLoader,
-   FootNote,
-   IntroHeader,
-   IntroWrapper,
-   LinkButton,
-   m as coreMessages,
-   formatDate,
- } from '@island.is/portals/my-pages/core'
+ import {
+   ActionCard,
+   CardLoader,
+   IntroHeader,
+   IntroWrapper,
+   LinkButton,
+   m as coreMessages,
+   formatDate,
+ } from '@island.is/portals/my-pages/core'

Line range hint 1-183: Consider extracting URL generation logic

To improve modularity and reusability across the NextJS apps, consider extracting the URL generation logic into a shared utility function. This would centralize the logic and make it easier to maintain across different parts of the application.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1805590 and 01cc907.

📒 Files selected for processing (2)
  • libs/clients/social-insurance-administration/src/lib/dto/incomePlan.dto.ts (2 hunks)
  • libs/portals/my-pages/social-insurance-maintenance/src/screens/IncomePlan/IncomePlan.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
libs/clients/social-insurance-administration/src/lib/dto/incomePlan.dto.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/portals/my-pages/social-insurance-maintenance/src/screens/IncomePlan/IncomePlan.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."
🔇 Additional comments (2)
libs/clients/social-insurance-administration/src/lib/dto/incomePlan.dto.ts (1)

26-28: ⚠️ Potential issue

Unused parameter 'data' should be removed if not needed.

The function accepts a parameter but never uses it. If this is intentional, remove the parameter to avoid confusion.

-export const mapIncomePlanDto = (
-  data: TrWebCommonsExternalPortalsApiModelsIncomePlanIncomePlanDto,
-): IncomePlanDto | undefined => ({
+export const mapIncomePlanDto = (): IncomePlanDto | undefined => ({

Likely invalid or redundant comment.

libs/portals/my-pages/social-insurance-maintenance/src/screens/IncomePlan/IncomePlan.tsx (1)

79-86: Well-structured component composition

The replacement of Box with IntroWrapper improves reusability and provides better semantic structure with properly typed props. The service provider information is cleanly integrated.

Copy link
Contributor

github-actions bot commented Nov 22, 2024

Affected services are: service-portal,
Feature deployment of your services will begin shortly. Your feature will be accessible here:
https://fixpayment-plan-display-beta.dev01.devland.is/minarsidur

Deployed services: service-portal.
Excluded services: ``

@thorkellmani thorkellmani marked this pull request as ready for review November 22, 2024 15:46
@thorkellmani thorkellmani removed the deploy-feature Deploys features to dev label Nov 22, 2024
@kodiakhq kodiakhq bot merged commit 9122895 into main Nov 24, 2024
26 checks passed
@kodiakhq kodiakhq bot deleted the fix/payment-plan-display branch November 24, 2024 11:56
jonnigs pushed a commit that referenced this pull request Nov 26, 2024
* feat: ini

* fix: switch link

* chore: remove mocks

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
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