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(application-system): Add company search to repeaters #17473

Merged
merged 3 commits into from
Jan 13, 2025

Conversation

norda-gunni
Copy link
Member

@norda-gunni norda-gunni commented Jan 13, 2025

...

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

    • Enhanced nationalIdWithName field with new search capabilities
    • Added ability to search for companies and persons in repeater and table repeater configurations
  • Improvements

    • Expanded RepeaterItem type to support more flexible search options
    • Updated component to log search configuration details

@norda-gunni norda-gunni requested a review from a team as a code owner January 13, 2025 08:42
Copy link
Contributor

coderabbitai bot commented Jan 13, 2025

Walkthrough

The pull request introduces two new properties, searchCompanies and searchPersons, to the nationalIdWithName field across multiple files. These properties are added to the RepeaterItem type in the type definitions and implemented in the configuration files for fields and components. The changes enable searching capabilities for companies and persons within the nationalIdWithName field, expanding its functionality without altering the existing core logic.

Changes

File Change Summary
libs/application/types/src/lib/Fields.ts Added optional boolean properties searchCompanies and searchPersons to RepeaterItem type
libs/application/templates/reference-template/src/forms/exampleForm/... Updated nationalIdWithName field in fieldsRepeaterSubsection and tableRepeaterSubsection with searchCompanies: true and searchPersons: true
libs/application/ui-components/src/components/NationalIdWithName/NationalIdWithName.tsx Added console logs for searchPersons and searchCompanies values

Possibly related PRs

Suggested labels

automerge

Suggested reviewers

  • HjorturJ
  • jonnigs
  • Toti91

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between acfeb49 and e93ae16.

📒 Files selected for processing (4)
  • libs/application/templates/reference-template/src/forms/exampleForm/tablesAndRepeatersSection/fieldsRepeaterSubsection.ts (1 hunks)
  • libs/application/templates/reference-template/src/forms/exampleForm/tablesAndRepeatersSection/tableRepeaterSubsection.ts (2 hunks)
  • libs/application/types/src/lib/Fields.ts (1 hunks)
  • libs/application/ui-components/src/components/NationalIdWithName/NationalIdWithName.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • libs/application/ui-components/src/components/NationalIdWithName/NationalIdWithName.tsx
🧰 Additional context used
📓 Path-based instructions (3)
libs/application/types/src/lib/Fields.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/application/templates/reference-template/src/forms/exampleForm/tablesAndRepeatersSection/fieldsRepeaterSubsection.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/application/templates/reference-template/src/forms/exampleForm/tablesAndRepeatersSection/tableRepeaterSubsection.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 (4)
libs/application/types/src/lib/Fields.ts (1)

106-107: LGTM! Type definitions are well-structured.

The new optional boolean properties searchCompanies and searchPersons are properly typed and maintain backward compatibility.

libs/application/templates/reference-template/src/forms/exampleForm/tablesAndRepeatersSection/fieldsRepeaterSubsection.ts (1)

68-69: LGTM! Search capabilities properly configured.

The implementation correctly enables both company and person search functionality in the nationalIdWithName field.

libs/application/templates/reference-template/src/forms/exampleForm/tablesAndRepeatersSection/tableRepeaterSubsection.ts (2)

27-27: LGTM! Documentation updated appropriately.

The description clearly communicates the new company search capability.


107-108: LGTM! Search configuration matches fieldsRepeaterSubsection.

The implementation consistently enables both company and person search across repeater types.

Finishing Touches

  • 📝 Generate Docstrings (Beta)

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@norda-gunni norda-gunni changed the title feat(application-system: )Add company search to repeaters feat(application-system): Add company search to repeaters Jan 13, 2025
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.68%. Comparing base (622271a) to head (662ea9b).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17473      +/-   ##
==========================================
+ Coverage   35.66%   35.68%   +0.01%     
==========================================
  Files        6977     6977              
  Lines      149769   149612     -157     
  Branches    42819    42750      -69     
==========================================
- Hits        53421    53392      -29     
+ Misses      96348    96220     -128     
Flag Coverage Δ
air-discount-scheme-backend 48.29% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.33% <ø> (ø)
api-domains-air-discount-scheme 38.11% <ø> (ø)
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 48.49% <ø> (ø)
api-domains-communications 39.49% <ø> (ø)
api-domains-criminal-record 48.11% <ø> (ø)
api-domains-driving-license 44.91% <ø> (ø)
api-domains-education 31.35% <ø> (ø)
api-domains-health-insurance 35.56% <ø> (ø)
api-domains-mortgage-certificate 35.30% <ø> (ø)
api-domains-payment-schedule 42.23% <ø> (ø)
application-api-files 62.06% <ø> (ø)
application-core 75.66% <ø> (ø)
application-system-api 38.75% <ø> (-0.01%) ⬇️
application-template-api-modules 27.55% <ø> (ø)
application-templates-accident-notification 27.60% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 25.79% <ø> (ø)
application-templates-driving-license 18.15% <ø> (ø)
application-templates-estate 13.64% <ø> (ø)
application-templates-example-payment 24.66% <ø> (ø)
application-templates-financial-aid 14.47% <ø> (ø)
application-templates-general-petition 23.13% <ø> (ø)
application-templates-inheritance-report 6.59% <ø> (ø)
application-templates-marriage-conditions 15.21% <ø> (ø)
application-templates-mortgage-certificate 43.73% <ø> (ø)
application-templates-parental-leave 29.92% <ø> (ø)
application-types 6.47% <ø> (ø)
application-ui-components 1.21% <ø> (ø)
application-ui-shell 22.19% <ø> (ø)
clients-charge-fjs-v2 28.88% <ø> (ø)
clients-driving-license 40.99% <ø> (ø)
clients-driving-license-book 43.98% <ø> (ø)
clients-financial-statements-inao 49.78% <ø> (ø)
clients-regulations 43.08% <ø> (ø)
clients-rsk-company-registry 31.18% <ø> (ø)
clients-rsk-personal-tax-return 38.32% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.52% <ø> (ø)
clients-zendesk 50.81% <ø> (ø)
cms 0.39% <ø> (ø)
cms-translations 38.81% <ø> (ø)
dokobit-signing 62.35% <ø> (ø)
email-service 60.31% <ø> (ø)
feature-flags 90.97% <ø> (ø)
file-storage 46.18% <ø> (ø)
financial-aid-backend 51.47% <ø> (ø)
judicial-system-api 20.23% <ø> (ø)
judicial-system-audit-trail 69.19% <ø> (ø)
judicial-system-backend 55.87% <ø> (ø)
judicial-system-message 66.78% <ø> (ø)
judicial-system-message-handler 48.59% <ø> (ø)
judicial-system-scheduler 71.24% <ø> (ø)
license-api 42.98% <ø> (+0.01%) ⬆️
nest-config 76.58% <ø> (ø)
nest-feature-flags 51.18% <ø> (ø)
nova-sms 61.70% <ø> (ø)
portals-admin-regulations-admin 1.80% <ø> (ø)
portals-core 19.59% <ø> (ø)
services-auth-admin-api 52.55% <ø> (ø)
services-auth-delegation-api 58.56% <ø> (+0.09%) ⬆️
services-auth-ids-api 52.61% <ø> (+0.01%) ⬆️
services-auth-public-api 49.45% <ø> (ø)
services-sessions 65.39% <ø> (-0.05%) ⬇️
services-university-gateway 49.49% <ø> (-0.09%) ⬇️
services-user-notification 46.53% <ø> (-0.03%) ⬇️
services-user-profile 56.99% <ø> (ø)
web 2.39% <ø> (ø)

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

Files with missing lines Coverage Δ
libs/application/types/src/lib/Fields.ts 100.00% <ø> (ø)

... and 9 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 622271a...662ea9b. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Jan 13, 2025

Datadog Report

All test runs 188b117 🔗

10 Total Test Services: 1 Failed, 9 Passed
🔻 Test Sessions change in coverage: 2 decreased, 1 increased (+0.03%), 197 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
services-auth-ids-api 8 0 0 255 0 1m 25.63s 1 no change Link
air-discount-scheme-backend 0 0 0 63 0 22.59s N/A Link
air-discount-scheme-web 0 0 0 2 0 6.59s N/A Link
api 0 0 0 4 0 2.39s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 16.42s N/A Link
api-domains-assets 0 0 0 3 0 9.65s N/A Link
api-domains-auth-admin 0 0 0 18 0 10.53s N/A Link
api-domains-communications 0 0 0 5 0 30.81s N/A Link
api-domains-criminal-record 0 0 0 5 0 8.56s 1 no change Link
api-domains-driving-license 0 0 0 23 0 27.74s N/A Link

❌ Failed Tests (8)

This report shows up to 5 failed tests.

  • DelegationsController national registry v3 featureflag: true Given a user is authenticated GET with general mandate delegation type for company should return all general mandate scopes and all procuration scopes - apps/services/auth/ids-api/src/app/delegations/test/delegations.controller.spec.ts - Details

    Expand for error
     Validation error
    
  • DelegationsController national registry v3 featureflag: true Given a user is authenticated GET with general mandate delegation type for company should return all general mandate scopes, and not procuration scopes since from nationalId is person - apps/services/auth/ids-api/src/app/delegations/test/delegations.controller.spec.ts - Details

    Expand for error
     Validation error
    
  • DelegationsController national registry v3 featureflag: true Given a user is authenticated GET with general mandate delegation type for company should return all general mandate scopes and other preset scopes - apps/services/auth/ids-api/src/app/delegations/test/delegations.controller.spec.ts - Details

    Expand for error
     Validation error
    
  • DelegationsController national registry v3 featureflag: true Given a user is authenticated GET with general mandate delegation type for company should return mergedDelegationDTO with the generalMandate - apps/services/auth/ids-api/src/app/delegations/test/delegations.controller.spec.ts - Details

    Expand for error
     Validation error
    
  • DelegationsController national registry v3 featureflag: true Given a user is authenticated GET with general mandate delegation type should get all general mandate scopes - apps/services/auth/ids-api/src/app/delegations/test/delegations.controller.spec.ts - Details

    Expand for error
     Validation error
    

🔻 Code Coverage Decreases vs Default Branch (2)

  • services-university-gateway - jest 45.28% (-0.03%) - Details
  • services-user-notification - jest 68.85% (-0.01%) - Details

@norda-gunni norda-gunni added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Jan 13, 2025
@kodiakhq kodiakhq bot merged commit df04363 into main Jan 13, 2025
207 checks passed
@kodiakhq kodiakhq bot deleted the as-add-company-search-to-repeaters branch January 13, 2025 11:11
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.

2 participants