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(work-accident-notification): work accident bug fixes #16922

Merged
merged 8 commits into from
Nov 18, 2024

Conversation

sigruntg
Copy link
Member

@sigruntg sigruntg commented Nov 18, 2024

Bug fixes

Attach a link to issue if relevant

What

  • Laga autofill vandamál með að skipta í sundur id.
  • Má ekki vera framtíðardagsetning
  • Bæta við að hægt sé að breyta um ár í dagatali (var til, vantaði bara min og max year í form field props) <-- Norda kóði
  • Bæta við betri texta ef að notandi fer meira en 36 tíma aftur.
  • Laga input villur - svör ekki að haldast inni
  • Bætti við extract strings inní project, en virkar ekki að kalla í extract strings hjá neinu verkefni núna.

image

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

    • Enhanced date field functionality with minYear and maxYear parameters for better date selection control.
    • Default values added for file upload fields to improve user experience.
    • New extract-strings target added for string extraction in templates.
  • Bug Fixes

    • Improved handling of accident location selection to ensure relevant options are displayed based on user input.
  • Documentation

    • Updated messages for accident reporting to provide clearer guidance.
  • Chores

    • Removed unused hidden input fields from forms to streamline the user interface.

@sigruntg sigruntg added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Nov 18, 2024
@sigruntg sigruntg requested review from a team as code owners November 18, 2024 15:01
Copy link
Contributor

coderabbitai bot commented Nov 18, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces several enhancements across multiple files, focusing on field-building functions and form structure within the application. Key changes include the addition of new parameters for date fields, updates to file upload fields with default values, and modifications to hidden input fields. The restructuring of data access in services reflects a shift towards basicInformation. Additionally, new properties for date constraints and identifiers for form fields have been implemented, along with the introduction of a new target in the project configuration for string extraction.

Changes

File Change Summary
libs/application/core/src/lib/fieldBuilders.ts Updated field-building functions: added minYear and maxYear to buildDateField; added defaults for uploadHeader, uploadDescription, and uploadButtonLabel in buildFileUploadField; added title to hidden input functions; enhanced configurability in buildNationalIdWithNameField.
libs/application/template-api-modules/src/lib/modules/templates/aosh/work-accident-notification/work-accident-notification.service.ts Removed getValueList import; updated data extraction from answers to focus on basicInformation.
libs/application/templates/aosh/work-accident-notification/project.json Added new target extract-strings for string extraction from TypeScript/JavaScript files.
libs/application/templates/aosh/work-accident-notification/src/fields/AccidentLocation/index.tsx Modified state management for accident location selection; updated name attributes for Controller components; disabled minor group selection when no major group is selected.
libs/application/templates/aosh/work-accident-notification/src/fields/EmployeeStartTimeError/index.tsx Added formatDate and getValueViaPath functions; updated error handling logic to check startOfWorkdayDate and startTime.
libs/application/templates/aosh/work-accident-notification/src/forms/WorkAccidentNotificationForm/AccidentSection/about.ts Added maxDate to buildDateField for accident date; removed hidden input for accidentLocationParentGroup; simplified id for buildCustomField.
libs/application/templates/aosh/work-accident-notification/src/forms/WorkAccidentNotificationForm/EmployeeSection/employee.ts Removed multiple buildHiddenInput calls for occupation fields; added maxDate, minYear, and maxYear to buildDateField for startDate.
libs/application/templates/aosh/work-accident-notification/src/forms/WorkAccidentNotificationForm/InformationSection/companySection.ts Updated field identifiers from companyInformation to basicInformation; added readOnly attribute to specific fields.
libs/application/templates/aosh/work-accident-notification/src/forms/WorkAccidentNotificationForm/prerequisitesSection.ts Removed buildHiddenInput import, indicating its functionality is no longer used.
libs/application/templates/aosh/work-accident-notification/src/lib/dataSchema.ts Introduced basicCompanySchema and updated companySchema; added basicInformation field to WorkAccidentNotificationAnswersSchema.
libs/application/templates/aosh/work-accident-notification/src/lib/messages/accident.ts Modified default messages for accident description placeholders to enhance clarity and specificity.
libs/application/templates/aosh/work-accident-notification/src/utils/getCompanyInformationForOverview.ts Updated function to retrieve basicCompany data instead of company, altering the source of several return values.
libs/application/templates/aosh/work-accident-notification/src/utils/index.ts Added export for formatDate function.
libs/application/types/src/lib/Fields.ts Added minYear and maxYear properties to DateField interface.
libs/application/ui-fields/src/lib/DateFormField/DateFormField.tsx Introduced minYear and maxYear properties in DateFormField component, passed to DatePickerController.

Possibly related PRs

Suggested reviewers

  • sigruntg
  • thordurhhh

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 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 36.46%. Comparing base (760b5fe) to head (dba6699).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...notification/work-accident-notification.service.ts 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #16922   +/-   ##
=======================================
  Coverage   36.46%   36.46%           
=======================================
  Files        6903     6903           
  Lines      144580   144580           
  Branches    41284    41284           
=======================================
  Hits        52718    52718           
  Misses      91862    91862           
Flag Coverage Δ
air-discount-scheme-web 0.00% <ø> (ø)
api 3.34% <ø> (ø)
application-api-files 62.35% <ø> (ø)
application-core 70.75% <ø> (-0.32%) ⬇️
application-system-api 41.02% <0.00%> (ø)
application-template-api-modules 27.73% <0.00%> (+<0.01%) ⬆️
application-templates-accident-notification 28.98% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 25.87% <ø> (ø)
application-templates-driving-license 18.14% <ø> (ø)
application-templates-estate 12.14% <ø> (ø)
application-templates-example-payment 24.80% <ø> (ø)
application-templates-financial-aid 15.48% <ø> (ø)
application-templates-general-petition 23.07% <ø> (ø)
application-templates-inheritance-report 6.52% <ø> (ø)
application-templates-marriage-conditions 15.04% <ø> (ø)
application-templates-mortgage-certificate 43.36% <ø> (ø)
application-templates-parental-leave 29.86% <ø> (ø)
application-types 6.60% <ø> (ø)
application-ui-components 1.27% <ø> (ø)
application-ui-shell 20.83% <ø> (ø)
clients-charge-fjs-v2 24.11% <ø> (ø)
web 1.77% <ø> (ø)

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

Files with missing lines Coverage Δ
libs/application/core/src/lib/fieldBuilders.ts 41.14% <ø> (ø)
libs/application/types/src/lib/Fields.ts 100.00% <ø> (ø)
.../ui-fields/src/lib/DateFormField/DateFormField.tsx 3.12% <ø> (ø)
...notification/work-accident-notification.service.ts 28.94% <0.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 760b5fe...dba6699. Read the comment docs.

@datadog-island-is
Copy link

Datadog Report

All test runs e78f70b 🔗

21 Total Test Services: 0 Failed, 20 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.2%), 91 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
air-discount-scheme-web 0 0 0 2 0 6.97s 1 no change Link
api 0 0 0 4 0 3.47s 1 no change Link
application-api-files 0 0 0 2 0 4.36s 1 no change Link
application-core 0 0 0 97 0 14.68s 1 decreased (-0.2%) Link
application-system-api 0 0 0 112 2 3m 20.12s 1 no change Link
application-template-api-modules 0 0 0 116 0 2m 3.17s 1 no change Link
application-templates-accident-notification 0 0 0 148 0 15.03s 1 no change Link
application-templates-criminal-record 0 0 0 2 0 12.01s 1 no change Link
application-templates-driving-license 0 0 0 13 0 17.68s 1 no change Link
application-templates-example-payment 0 0 0 2 0 13.37s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • application-core - jest 78.49% (-0.2%) - Details

@kodiakhq kodiakhq bot merged commit d33043f into main Nov 18, 2024
85 checks passed
@kodiakhq kodiakhq bot deleted the fix/work-accident-bug-fixes branch November 18, 2024 15:23
jonnigs pushed a commit that referenced this pull request Nov 26, 2024
* moving part of companyinfo to basicinfo to stop autofill

* some fixes

* extract strings

* fix inputs being empty on back button click

---------

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
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants