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(parental-leave): Change type when applying for Dvalarstyrk #14392

Merged
merged 20 commits into from
Apr 30, 2024

Conversation

birkirkristmunds
Copy link
Member

@birkirkristmunds birkirkristmunds commented Apr 8, 2024

https://dit-iceland.atlassian.net/browse/UUFV-435

Why

Fix the type sent to VMST when applying for Dvalarstyrkur

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

  • Refactor
    • Streamlined the application process in the Parental Leave service, enhancing the flow and simplifying state management.
  • New Features
    • Enhanced state-specific logic handling in the Parental Leave module to better accommodate changes related to employer and period adjustments.
  • Improvements
    • Updated the Parental Leave Template to improve application validation and submission processes.

@birkirkristmunds birkirkristmunds requested a review from a team as a code owner April 8, 2024 10:29
Copy link
Contributor

coderabbitai bot commented Apr 8, 2024

Walkthrough

The updates aim to refine the logic for managing application states and actions within the parental leave system. Changes involve removing unnecessary parameters, enhancing state-specific logic, and introducing new utility functions to determine action names based on user inputs and application states. These modifications streamline code, improving the clarity and efficiency of state transitions and action determinations in the parental leave application process.

Changes

File Path Change Summary
.../template-api-modules/.../parental-leave.service.ts Removed previousState parameter in getApplicationAnswers, simplified actionNameFromParams.
.../template-api-modules/.../parental-leave.utils.ts Added States import, refactored checkActionName, added getType function.
.../templates/parental-leave/.../ParentalLeaveTemplate.ts Added 'setActionName' entry, removed params value assignment.
.../templates/parental-leave/.../parentalLeaveUtils.ts Updated summary, added getActionName to determine action type based on state and user choices.

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>.
    • 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 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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

Review Status

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between e82cb9b and 9f4dcd3.
Files selected for processing (1)
  • libs/application/templates/parental-leave/src/lib/ParentalLeaveTemplate.ts (1 hunks)
Additional Context Used
Path-based Instructions (1)
libs/application/templates/parental-leave/src/lib/ParentalLeaveTemplate.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 not posted (2)
libs/application/templates/parental-leave/src/lib/ParentalLeaveTemplate.ts (2)

866-866: The change from FileType.DOCUMENTPERIOD to FileType.DOCUMENT aligns with the PR objectives to meet VMST validation requirements.


863-869: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-866]

Ensure TypeScript types are consistently used throughout the file for props and exported types, enhancing maintainability and developer experience.

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

Attention: Patch coverage is 83.60656% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 37.03%. Comparing base (cfc06df) to head (704bfc1).
Report is 1 commits behind head on main.

❗ Current head 704bfc1 differs from pull request most recent head a0f94ff. Consider uploading reports for the commit a0f94ff to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14392      +/-   ##
==========================================
- Coverage   37.16%   37.03%   -0.13%     
==========================================
  Files        6237     6224      -13     
  Lines      126387   125939     -448     
  Branches    36159    36007     -152     
==========================================
- Hits        46977    46647     -330     
+ Misses      79410    79292     -118     
Flag Coverage Δ
api 3.47% <ø> (ø)
application-system-api 42.13% <39.34%> (+0.02%) ⬆️
application-template-api-modules 24.64% <54.09%> (+0.06%) ⬆️
application-templates-parental-leave 25.45% <75.00%> (-2.96%) ⬇️
application-ui-shell 21.72% <ø> (ø)

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

Files Coverage Δ
...rental-leave/src/lib/parentalLeaveTemplateUtils.ts 59.09% <100.00%> (+2.46%) ⬆️
...templates/parental-leave/parental-leave.service.ts 49.06% <93.33%> (+0.10%) ⬆️
...s/templates/parental-leave/parental-leave.utils.ts 84.21% <80.00%> (+4.70%) ⬆️
...es/parental-leave/src/lib/ParentalLeaveTemplate.ts 62.10% <80.00%> (-1.54%) ⬇️
...lates/parental-leave/src/lib/parentalLeaveUtils.ts 44.44% <80.00%> (-9.88%) ⬇️

... and 88 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 9bb7eaf...a0f94ff. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Apr 8, 2024

Datadog Report

All test runs 8a2b083 🔗

6 Total Test Services: 0 Failed, 6 Passed
🔻 Test Sessions change in coverage: 1 decreased (-3.48%), 2 increased, 6 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Code Coverage Change Test Service View
api 0 0 0 4 0 20.16ms 1 no change Link
application-system-api 0 0 0 111 2 1m 19.73s 1 increased (+0.01%) Link
application-template-api-modules 0 0 0 107 0 1m 9.91s 1 increased (+0.04%) Link
application-templates-parental-leave 0 0 0 93 62 14.57s 1 decreased (-3.48%) Link
application-ui-shell 0 0 0 74 0 41.89s 1 no change Link
web 0 0 0 84 0 3.71s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • application-templates-parental-leave - jest 29.78% (-3.48%) - Details

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

Review Status

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 9f4dcd3 and 97507a0.
Files selected for processing (1)
  • libs/application/templates/parental-leave/src/lib/ParentalLeaveTemplate.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/application/templates/parental-leave/src/lib/ParentalLeaveTemplate.ts

@birkirkristmunds birkirkristmunds added the automerge Merge this PR as soon as all checks pass label Apr 8, 2024
@kodiakhq kodiakhq bot removed the automerge Merge this PR as soon as all checks pass label Apr 10, 2024
Copy link
Contributor

kodiakhq bot commented Apr 10, 2024

This PR currently has a merge conflict. Please resolve this and then re-add the automerge label.

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

@birkirkristmunds birkirkristmunds added the automerge Merge this PR as soon as all checks pass label Apr 29, 2024
Copy link
Member

@karenbjorg karenbjorg left a comment

Choose a reason for hiding this comment

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

lgtm

@kodiakhq kodiakhq bot merged commit 3121924 into main Apr 30, 2024
34 checks passed
@kodiakhq kodiakhq bot deleted the fix/parental-leave-set-type-when-editing-application branch April 30, 2024 15:48
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