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(web): Journeyman list - display national id field #15645

Merged
merged 8 commits into from
Aug 14, 2024

Conversation

RunarVestmann
Copy link
Member

@RunarVestmann RunarVestmann commented Aug 13, 2024

Journeyman list - display national id field

What

  • OpenAPI schema now lists a national id field for journeyman response
  • This PR maps that field and displays it in the frontend

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 header to the JourneymanList table for "Kennitala" (national ID).
    • Enhanced search functionality by including national ID in the search keys.
    • Improved data retrieval by including national ID in the GraphQL query for journeyman licenses.
    • Expanded data schema to accommodate new fields for personal identification.
    • Introduced nationalId property in the JourneymanLicence interface for better identification.
  • Bug Fixes

    • Removed publication date display logic to focus on national ID in the JourneymanList.

These changes enhance user experience by improving data visibility and retrieval capabilities.

@RunarVestmann RunarVestmann added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Aug 13, 2024
@RunarVestmann RunarVestmann requested review from a team as code owners August 13, 2024 12:31
Copy link
Contributor

coderabbitai bot commented Aug 13, 2024

Walkthrough

The recent modifications enhance the JourneymanList component and related functionalities by incorporating a new header for the national ID, shifting the display focus accordingly. Updates to the GraphQL query and JSON schema facilitate the retrieval and validation of this national ID, thereby expanding the application's data handling capabilities.

Changes

Files Change Summary
apps/web/components/connected/syslumenn/TableLists/JourneymanList/JourneymanList.tsx, apps/web/components/connected/syslumenn/TableLists/JourneymanList/queries.ts Added a new header for "Kennitala" and modified the displayed data to focus on national ID instead of date of publication. Updated GraphQL query to include nationalId.
libs/clients/syslumenn/src/clientConfig.json Added new fields "kennitala" (string) and "arfshlutfall" (number, decimal) to the JSON schema to capture additional data attributes.
libs/clients/syslumenn/src/lib/syslumennClient.types.ts, libs/clients/syslumenn/src/lib/syslumennClient.utils.ts Introduced nationalId as an optional property in the JourneymanLicence interface and added it as a parameter in the mapJourneymanLicence function, respectively.
libs/api/domains/syslumenn/src/lib/models/journeymanLicence.ts Added a new optional field nationalId to the JourneymanLicence class to accommodate national identification for journeyman licenses.

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

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

CodeRabbit Configuration 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 details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7787f48 and d6c2a93.

Files selected for processing (5)
  • apps/web/components/connected/syslumenn/TableLists/JourneymanList/JourneymanList.tsx (2 hunks)
  • apps/web/components/connected/syslumenn/TableLists/JourneymanList/queries.ts (1 hunks)
  • libs/clients/syslumenn/src/clientConfig.json (3 hunks)
  • libs/clients/syslumenn/src/lib/syslumennClient.types.ts (1 hunks)
  • libs/clients/syslumenn/src/lib/syslumennClient.utils.ts (1 hunks)
Additional context used
Path-based instructions (5)
apps/web/components/connected/syslumenn/TableLists/JourneymanList/queries.ts (1)

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

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
libs/clients/syslumenn/src/lib/syslumennClient.types.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."
apps/web/components/connected/syslumenn/TableLists/JourneymanList/JourneymanList.tsx (1)

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

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
libs/clients/syslumenn/src/lib/syslumennClient.utils.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/clients/syslumenn/src/clientConfig.json (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 (8)
apps/web/components/connected/syslumenn/TableLists/JourneymanList/queries.ts (1)

10-10: LGTM! Ensure API schema alignment.

The addition of nationalId to the GraphQL query looks good. Verify that the API schema has been updated to include nationalId.

libs/clients/syslumenn/src/lib/syslumennClient.types.ts (1)

400-400: LGTM! Verify optionality consistency.

The addition of nationalId as an optional property in the JourneymanLicence interface looks good. Ensure that this optionality is consistent across the codebase.

Verification successful

Optionality of nationalId is consistent across the codebase.

The nationalId property in the JourneymanLicence interface is consistently treated as optional in both TypeScript and GraphQL models.

  • TypeScript Interface: nationalId is optional in libs/clients/syslumenn/src/lib/syslumennClient.types.ts.
  • GraphQL Model: nationalId is optional in libs/api/domains/syslumenn/src/lib/models/journeymanLicence.ts.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the usage of `nationalId` is consistent with its optionality across the codebase.

# Test: Search for `JourneymanLicence` usage. Expect: Handling of `nationalId` as an optional property.
rg --type typescript 'JourneymanLicence'

Length of output: 75


Script:

#!/bin/bash
# Corrected script to search for `.ts` files instead of using an unrecognized file type.

# Test: Search for `JourneymanLicence` usage. Expect: Handling of `nationalId` as an optional property.
rg 'JourneymanLicence' --glob '*.ts' -A 5

Length of output: 6224

apps/web/components/connected/syslumenn/TableLists/JourneymanList/JourneymanList.tsx (2)

289-293: LGTM! Verify the display logic for nationalId.

The display of nationalId in the table looks good. Ensure that the data is correctly fetched and displayed.


265-265: Ensure consistency in header labeling.

The header label for dateOfPublication is still present. Confirm that this is intentional and aligns with the UI requirements.

Verification successful

Header Labeling for dateOfPublication is Consistent

The usage of dateOfPublication in the JourneymanList component is consistent with the header label 'Útgáfuár'. This aligns with the UI requirements as observed in the code. No inconsistencies were found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of header labeling in the `JourneymanList` component.

# Test: Check for occurrences of `dateOfPublication` in the component. Expect: Consistent use across headers and data display.
rg --type tsx 'dateOfPublication'

Length of output: 61


Script:

#!/bin/bash
# Description: Verify the consistency of header labeling in the `JourneymanList` component.

# Test: Check for occurrences of `dateOfPublication` in the component without specifying file type.
rg 'dateOfPublication'

Length of output: 2335

libs/clients/syslumenn/src/lib/syslumennClient.utils.ts (1)

559-561: LGTM! Verify the function usage in the codebase.

The inclusion of the nationalId field in the mapJourneymanLicence function is consistent with the data model and PR objectives.

Ensure that all usages of mapJourneymanLicence are updated to accommodate the new parameter.

Verification successful

Function Usage Verified

The mapJourneymanLicence function is used in libs/clients/syslumenn/src/lib/syslumennClient.service.ts and appears to be implemented correctly with the updated signature. No further changes are necessary.

  • File: libs/clients/syslumenn/src/lib/syslumennClient.service.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `mapJourneymanLicence` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type typescript -A 5 $'mapJourneymanLicence'

Length of output: 83


Script:

#!/bin/bash
# Description: Verify all function calls to `mapJourneymanLicence` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type ts -A 5 $'mapJourneymanLicence'

Length of output: 1583

libs/clients/syslumenn/src/clientConfig.json (3)

3213-3215: Addition of "kennitala" field is appropriate.

The "kennitala" field is correctly added as a string, aligning with its use as a personal identifier in the schema. Ensure that any corresponding application code is updated to handle this new field.


3438-3440: Addition of "kennitala" field is appropriate.

The "kennitala" field is correctly added as a string, consistent with its role as a personal identifier. Ensure that any related application logic is updated to utilize this field.


4636-4638: Addition of "arfshlutfall" field is appropriate.

The "arfshlutfall" field is added as a number with a decimal format, which is suitable for representing fractional values. Ensure that the application logic correctly handles this new field.

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 details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d6c2a93 and a328567.

Files selected for processing (2)
  • apps/web/components/connected/syslumenn/TableLists/JourneymanList/JourneymanList.tsx (6 hunks)
  • libs/api/domains/syslumenn/src/lib/models/journeymanLicence.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/web/components/connected/syslumenn/TableLists/JourneymanList/JourneymanList.tsx
Additional context used
Path-based instructions (1)
libs/api/domains/syslumenn/src/lib/models/journeymanLicence.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 (1)
libs/api/domains/syslumenn/src/lib/models/journeymanLicence.ts (1)

15-16: Addition of nationalId field is appropriate.

The nationalId field is correctly added as an optional field with a nullable GraphQL annotation, aligning with the PR's objectives. This enhances the JourneymanLicence class by allowing the representation of national identification.

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

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

Project coverage is 36.85%. Comparing base (ba5dc79) to head (6494185).
Report is 8 commits behind head on main.

Files Patch % Lines
...umenn/TableLists/JourneymanList/JourneymanList.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15645      +/-   ##
==========================================
- Coverage   36.85%   36.85%   -0.01%     
==========================================
  Files        6584     6584              
  Lines      134962   134963       +1     
  Branches    38533    38534       +1     
==========================================
- Hits        49745    49744       -1     
- Misses      85217    85219       +2     
Flag Coverage Δ
air-discount-scheme-backend 54.07% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.43% <ø> (ø)
api-catalogue-services 77.85% <ø> (ø)
api-domains-air-discount-scheme 36.85% <ø> (ø)
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 53.90% <ø> (ø)
api-domains-communications 40.57% <ø> (ø)
api-domains-criminal-record 48.08% <ø> (ø)
api-domains-driving-license 44.42% <ø> (ø)
api-domains-education 33.77% <ø> (ø)
api-domains-health-insurance 34.97% <ø> (ø)
api-domains-mortgage-certificate 36.00% <ø> (ø)
api-domains-payment-schedule 41.14% <ø> (ø)
application-api-files 57.08% <ø> (ø)
application-core 71.84% <ø> (ø)
application-system-api 41.86% <ø> (ø)
application-template-api-modules 23.80% <ø> (+<0.01%) ⬆️
application-templates-accident-notification 19.88% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 22.23% <ø> (ø)
application-templates-driving-license 16.03% <ø> (ø)
application-templates-financial-aid 12.12% <ø> (ø)
application-templates-general-petition 18.96% <ø> (ø)
application-templates-inheritance-report 4.64% <ø> (ø)
application-templates-parental-leave 28.41% <ø> (ø)
application-types 7.21% <ø> (ø)
application-ui-components 1.43% <ø> (ø)
application-ui-shell 21.35% <ø> (ø)
auth-admin-web 2.43% <ø> (ø)
auth-api-lib 14.72% <ø> (+0.09%) ⬆️
auth-nest-tools 30.44% <ø> (ø)
auth-react 23.02% <ø> (ø)
auth-shared 75.00% <ø> (ø)
clients-charge-fjs-v2 27.54% <ø> (ø)
clients-driving-license 40.94% <ø> (ø)
clients-driving-license-book 44.08% <ø> (ø)
clients-financial-statements-inao 49.40% <ø> (ø)
clients-license-client 1.84% <ø> (ø)
clients-middlewares 73.37% <ø> (+0.34%) ⬆️
clients-regulations 42.88% <ø> (ø)
clients-rsk-company-registry 30.64% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-zendesk 55.65% <ø> (ø)
cms 0.43% <ø> (ø)
cms-translations 39.68% <ø> (ø)
content-search-index-manager 95.65% <ø> (ø)
contentful-apps 6.05% <ø> (ø)
dokobit-signing 62.50% <ø> (+0.09%) ⬆️
download-service 44.77% <ø> (ø)
email-service 60.33% <ø> (+0.08%) ⬆️
feature-flags 90.40% <ø> (+0.07%) ⬆️
file-storage 53.45% <ø> (+0.11%) ⬆️
financial-aid-backend 56.39% <ø> (ø)
financial-aid-shared 19.03% <ø> (ø)
icelandic-names-registry-backend 54.14% <ø> (ø)
infra-tracing 43.24% <ø> (ø)
island-ui-core 28.79% <ø> (ø)
judicial-system-backend 56.06% <ø> (ø)
judicial-system-formatters 80.77% <ø> (ø)
judicial-system-message 66.46% <ø> (ø)
judicial-system-message-handler 66.36% <ø> (ø)
judicial-system-scheduler 58.37% <ø> (ø)
judicial-system-types 50.71% <ø> (ø)
judicial-system-web 28.06% <ø> (ø)
localization 10.15% <ø> (ø)
logging 48.43% <ø> (ø)
message-queue 67.78% <ø> (ø)
nest-audit 68.20% <ø> (ø)
nest-config 77.81% <ø> (+0.06%) ⬆️
nest-feature-flags 51.65% <ø> (ø)
nest-sequelize 94.44% <ø> (ø)
nest-swagger 51.71% <ø> (ø)
nova-sms 61.80% <ø> (ø)
portals-admin-regulations-admin 2.03% <ø> (ø)
portals-core 16.27% <ø> (ø)
regulations 16.78% <ø> (ø)
services-auth-admin-api 51.08% <ø> (ø)
services-auth-delegation-api 61.56% <ø> (ø)
services-auth-ids-api 54.58% <ø> (-0.03%) ⬇️
services-auth-personal-representative 48.31% <ø> (ø)
services-auth-personal-representative-public 44.18% <ø> (+0.01%) ⬆️
services-auth-public-api 51.05% <ø> (+0.01%) ⬆️
services-documents 60.94% <ø> (ø)
services-endorsements-api 54.83% <ø> (ø)
services-search-indexer 12.64% <ø> (ø)
services-sessions 65.49% <ø> (ø)
services-university-gateway 48.41% <ø> (ø)
services-user-profile 62.28% <ø> (ø)
shared-components 27.87% <ø> (ø)
shared-form-fields 31.83% <ø> (ø)
shared-mocking 64.62% <ø> (ø)
shared-pii 92.85% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 29.87% <ø> (ø)
skilavottord-ws 23.58% <ø> (ø)
web 1.89% <0.00%> (-0.01%) ⬇️

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

Files Coverage Δ
...ted/syslumenn/TableLists/JourneymanList/queries.ts 0.00% <ø> (ø)
...clients/syslumenn/src/lib/syslumennClient.types.ts 100.00% <ø> (ø)
...clients/syslumenn/src/lib/syslumennClient.utils.ts 48.62% <ø> (ø)
...umenn/TableLists/JourneymanList/JourneymanList.tsx 0.00% <0.00%> (ø)

... and 2 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 ba5dc79...6494185. Read the comment docs.

@datadog-island-is
Copy link

Datadog Report

All test runs 69a7f32 🔗

101 Total Test Services: 0 Failed, 99 Passed
⬆️ Test Sessions change in coverage: 3 increased, 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
air-discount-scheme-backend 0 0 0 81 0 30.07s N/A Link
air-discount-scheme-web 0 0 0 2 0 8.73s N/A Link
api 0 0 0 4 0 2.83s N/A Link
api-catalogue-services 0 0 0 23 0 11.73s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 22.73s N/A Link
api-domains-assets 0 0 0 3 0 14.95s N/A Link
api-domains-auth-admin 0 0 0 18 0 12.38s 1 no change Link
api-domains-communications 0 0 0 5 0 38.05s N/A Link
api-domains-criminal-record 0 0 0 5 0 9.68s 1 no change Link
api-domains-driving-license 0 0 0 23 0 36.26s N/A Link

@kodiakhq kodiakhq bot merged commit 4e9ddf3 into main Aug 14, 2024
253 checks passed
@kodiakhq kodiakhq bot deleted the feat/web-journeyman-list-national-id-field branch August 14, 2024 12:21
oskarjs pushed a commit that referenced this pull request Aug 20, 2024
* Add national id field to journeyman table view

* Display publication date

* Allow for national id search

* Add field to gql model

* Change table header display name

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
jonnigs pushed a commit that referenced this pull request Sep 2, 2024
* Add national id field to journeyman table view

* Display publication date

* Allow for national id search

* Add field to gql model

* Change table header display name

---------

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.

2 participants