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(signature-collection): Application for Parliamentary Create List #15333

Merged
merged 82 commits into from
Jul 5, 2024

Conversation

albinagu
Copy link
Member

@albinagu albinagu commented Jun 24, 2024

Still a WIP - behind feature flag
Feature branch: https://signaturecollectionparliamentary-beta.dev01.devland.is/umsoknir/althingis-medmaelasofnun/

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 form for creating a parliamentary list with sections for introductory information, external data collection approval, constituency, managers and supervisors, overview, and list creation.
    • Added new message definitions for various aspects of parliamentary list creation using react-intl.
  • Bug Fixes

    • Included error messages for age, citizenship, residency, activity, ownership, and service denial scenarios.
  • Enhancements

    • Defined constants, enums, and types for event handling, application states, roles, API actions, response structures, and personnel details related to managing parliamentary lists creation.

Copy link
Contributor

coderabbitai bot commented Jun 24, 2024

Walkthrough

This set of changes introduces a new form structure for creating a parliamentary list, encapsulated in the Prerequisites.ts file. It defines necessary sections and fields for constituency selection, manager and supervisor details, and overview screens. Additionally, it standardizes application state constants, event types, error messages, and internationalized messages.

Changes

File Change Summary
libs/application/templates/signature-collection/parliamentary-list-creation/src/forms/Prerequisites.ts Introduced form structure for parliamentary list creation including sections for data collection, constituency, managers, and overview.
libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/constants.ts Added type definitions, enums, and constants for events, states, roles, API actions, response structures, and personnel information for list creation.
libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/errors.ts Introduced error messages for various scenarios like age, citizenship, residency, activity status, ownership, and service denial with internationalization.
libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/messages.ts Added internationalized message definitions for different sections and functionalities of the parliamentary list creation application.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Form as Prerequisites Form
    participant Api as API
    participant State as State Manager

    User->>Form: Start application
    Form->>Form: Show data collection screen
    User->>Form: Approve data collection
    Form->>Api: Fetch necessary data
    Api-->>Form: Return data
    Form->>Form: Display constituency selection
    User->>Form: Select constituency
    Form->>Form: Display manager & supervisor details form
    User->>Form: Enter manager & supervisor details
    Form->>Form: Show overview
    User->>Form: Review and submit
    Form->>Api: Submit application
    Api-->>Form: Acknowledge submission
    Form->>State: Update state to PREREQUISITES
    State-->>Form: Confirmation
    Form-->>User: Display confirmation message
Loading

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

@albinagu albinagu added the deploy-feature Deploys features to dev label Jun 24, 2024
@datadog-island-is
Copy link

datadog-island-is bot commented Jun 24, 2024

Datadog Report

All test runs 8ea73d1 🔗

21 Total Test Services: 0 Failed, 21 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.03%), 85 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 8.65s 1 no change Link
api 0 0 0 4 0 4.16s 1 no change Link
application-api-files 0 0 0 12 0 8.75s 1 no change Link
application-core 0 0 0 90 0 31.8s 1 no change Link
application-system-api 0 0 0 111 2 2m 57.71s 1 no change Link
application-template-api-modules 0 0 0 109 0 1m 43.91s 1 no change Link
application-templates-accident-notification 0 0 0 98 0 23.3s 1 no change Link
application-templates-criminal-record 0 0 0 2 0 15.25s 1 no change Link
application-templates-driving-license 0 0 0 13 0 24.21s 1 no change Link
application-templates-example-payment 0 0 0 2 0 20.44s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • application-ui-shell - jest 28.01% (-0.03%) - Details

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

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

Project coverage is 37.00%. Comparing base (bd185f2) to head (a7ada54).
Report is 10 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15333      +/-   ##
==========================================
- Coverage   37.01%   37.00%   -0.02%     
==========================================
  Files        6540     6542       +2     
  Lines      133720   133757      +37     
  Branches    38255    38301      +46     
==========================================
- Hits        49502    49501       -1     
- Misses      84218    84256      +38     
Flag Coverage Δ
air-discount-scheme-backend 54.06% <100.00%> (+0.01%) ⬆️
air-discount-scheme-web 0.00% <ø> (ø)
api 3.44% <ø> (ø)
api-domains-air-discount-scheme 36.78% <100.00%> (+0.03%) ⬆️
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 53.90% <ø> (ø)
api-domains-communications 40.56% <100.00%> (-0.20%) ⬇️
api-domains-criminal-record 48.00% <100.00%> (+0.03%) ⬆️
api-domains-driving-license 44.52% <100.00%> (+0.01%) ⬆️
api-domains-education 33.71% <100.00%> (+0.03%) ⬆️
api-domains-health-insurance 34.88% <100.00%> (-0.01%) ⬇️
api-domains-mortgage-certificate 35.31% <100.00%> (-0.01%) ⬇️
application-api-files 56.99% <100.00%> (+0.05%) ⬆️
application-core 72.02% <100.00%> (+0.02%) ⬆️
application-system-api 41.85% <66.66%> (+0.01%) ⬆️
application-template-api-modules 23.88% <100.00%> (-0.01%) ⬇️
application-templates-accident-notification 19.93% <ø> (ø)
application-templates-car-recycling 4.23% <ø> (ø)
application-templates-criminal-record 22.35% <ø> (ø)
application-templates-driving-license 15.89% <ø> (ø)
application-templates-estate 11.94% <ø> (-0.01%) ⬇️
application-templates-example-payment 21.01% <ø> (ø)
application-templates-financial-aid 12.14% <ø> (ø)
application-templates-general-petition 19.05% <ø> (ø)
application-templates-health-insurance 23.46% <ø> (ø)
application-templates-inheritance-report 4.65% <ø> (ø)
application-templates-marriage-conditions 10.56% <ø> (ø)
application-templates-mortgage-certificate 45.18% <100.00%> (+0.03%) ⬆️
application-templates-parental-leave 28.34% <ø> (-0.12%) ⬇️
application-types 7.26% <0.00%> (-0.02%) ⬇️
application-ui-components 1.43% <ø> (ø)
application-ui-shell 21.54% <ø> (-0.01%) ⬇️
auth-api-lib 14.71% <100.00%> (+0.05%) ⬆️
clients-charge-fjs-v2 27.54% <ø> (ø)
clients-driving-license 41.03% <100.00%> (+0.04%) ⬆️
clients-driving-license-book 44.02% <100.00%> (-0.03%) ⬇️
clients-financial-statements-inao 49.21% <100.00%> (+0.03%) ⬆️
clients-license-client 1.84% <ø> (ø)
clients-regulations 42.80% <100.00%> (+0.04%) ⬆️
clients-rsk-company-registry 30.64% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.70% <100.00%> (+0.02%) ⬆️
cms 0.43% <ø> (ø)
cms-translations 39.68% <100.00%> (+<0.01%) ⬆️
dokobit-signing 62.31% <100.00%> (+0.09%) ⬆️
download-service 44.76% <100.00%> (+0.01%) ⬆️
feature-flags 31.22% <100.00%> (-58.94%) ⬇️
file-storage 52.29% <100.00%> (+0.12%) ⬆️
financial-aid-backend 56.56% <100.00%> (+0.01%) ⬆️
judicial-system-api 18.15% <ø> (ø)
judicial-system-audit-trail 44.17% <100.00%> (-23.68%) ⬇️
judicial-system-backend 56.03% <100.00%> (+<0.01%) ⬆️
judicial-system-message 66.33% <100.00%> (+0.06%) ⬆️
judicial-system-message-handler 66.07% <100.00%> (+0.03%) ⬆️
judicial-system-scheduler 58.15% <100.00%> (+0.11%) ⬆️
judicial-system-web 28.23% <ø> (-0.05%) ⬇️
license-api 43.40% <100.00%> (+0.07%) ⬆️
nest-config 77.67% <100.00%> (+0.06%) ⬆️
nest-feature-flags 51.52% <100.00%> (+0.06%) ⬆️
portals-admin-regulations-admin 2.03% <ø> (ø)
portals-core 16.33% <ø> (-0.01%) ⬇️
services-auth-admin-api 51.12% <100.00%> (+<0.01%) ⬆️
services-auth-delegation-api 61.61% <100.00%> (+<0.01%) ⬆️
services-auth-ids-api 54.66% <100.00%> (-0.01%) ⬇️
services-auth-personal-representative 48.29% <100.00%> (+<0.01%) ⬆️
services-auth-personal-representative-public 44.14% <100.00%> (+<0.01%) ⬆️
services-auth-public-api 51.09% <100.00%> (+<0.01%) ⬆️
services-endorsements-api 55.49% <100.00%> (+0.01%) ⬆️
services-sessions 65.44% <100.00%> (+0.01%) ⬆️
services-university-gateway 48.60% <100.00%> (+0.15%) ⬆️
services-user-notification 48.05% <100.00%> (+0.04%) ⬆️
services-user-profile 62.48% <100.00%> (+<0.01%) ⬆️
web 1.89% <ø> (ø)

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

Files Coverage Δ
libs/application/types/src/lib/ApplicationTypes.ts 100.00% <100.00%> (ø)
...ibs/application/types/src/lib/InstitutionMapper.ts 100.00% <ø> (ø)
libs/feature-flags/src/lib/features.ts 100.00% <100.00%> (ø)
...ication/template-loader/src/lib/templateLoaders.ts 8.00% <0.00%> (-0.11%) ⬇️

... and 40 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 257a0e8...a7ada54. Read the comment docs.

Copy link
Contributor

github-actions bot commented Jun 24, 2024

Affected services are: air-discount-scheme-api,air-discount-scheme-backend,api,application-system-api,download-service,financial-aid-api,financial-aid-backend,financial-aid-open-api,judicial-system-api,judicial-system-digital-mailbox-api,judicial-system-backend,judicial-system-message-handler,judicial-system-robot-api,judicial-system-scheduler,judicial-system-xrd-api,license-api,regulations-admin-backend,services-auth-admin-api,services-auth-delegation-api,services-auth-ids-api,services-auth-personal-representative,services-auth-personal-representative-public,services-auth-public-api,services-endorsements-api,services-search-indexer,services-sessions,services-university-gateway,services-user-notification,services-user-profile,air-discount-scheme-web,skilavottord-web,web,application-system-form,island-ui-storybook,portals-admin,service-portal,system-e2e,

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 052dc3c and a7ada54.

Files selected for processing (3)
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/forms/Draft.ts (1 hunks)
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/index.ts (1 hunks)
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/createCollectionTemplate.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/forms/Draft.ts
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/index.ts
Additional context used
Path-based instructions (1)
libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/createCollectionTemplate.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 (8)
libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/createCollectionTemplate.ts (8)

20-24: LGTM! WeekLifeCycle configuration is appropriate.

The lifecycle configuration for a week is correctly defined.


26-39: LGTM! Template configuration is well-defined.

The template configuration for the parliamentary list creation application is comprehensive and correctly defined.


40-79: LGTM! State machine configuration for PREREQUISITES state is well-defined.

The state machine configuration for the PREREQUISITES state is comprehensive and correctly defined.


80-116: LGTM! State machine configuration for DRAFT state is well-defined.

The state machine configuration for the DRAFT state is comprehensive and correctly defined.


142-150: LGTM! mapUserToRole function is correctly defined.

The function maps the user to the applicant role correctly.


153-153: LGTM! Export statement is correctly defined.

The file correctly exports createListTemplate as the default export.


117-139: Verify the commented-out onEntry block in DONE state.

The onEntry block is commented out. Verify if this is intentional and if it needs to be implemented.


1-19: Ensure all imports are necessary and correctly referenced.

All imports seem to be relevant to the functionality provided in this file. However, verify if all the imported modules are used and necessary.

Verification successful

All imports are necessary and correctly referenced.

All imported modules in the file createCollectionTemplate.ts are utilized within the file, confirming their necessity.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if all imported modules are used in the file.

# Test: List all imports and check their usage in the file.
rg --type python 'import' libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/createCollectionTemplate.ts

Length of output: 168


Script:

#!/bin/bash
# Description: Verify if all imported modules are used in the file.

# Test: List all imports and check their usage in the file.
rg --type typescript 'import' libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/createCollectionTemplate.ts

Length of output: 176


Script:

#!/bin/bash
# Description: Verify if all imported modules are used in the file.

# List all imports in the file.
imports=$(rg --type ts '^import' libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/createCollectionTemplate.ts)

# Check usage of each import.
for import in $(echo "$imports" | awk '{print $2}'); do
  echo "Checking usage for import: $import"
  rg "$import" libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/createCollectionTemplate.ts
done

Length of output: 2665


Script:

#!/bin/bash
# Description: Verify if all imported modules are used in the file.

# List all imports in the file.
imports=$(rg --type ts '^import' libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/createCollectionTemplate.ts)

# Extract module names and check their usage in the file.
echo "$imports" | awk -F '[{}]' '{for(i=2;i<=NF;i+=2) print $i}' | tr ',' '\n' | while read -r module; do
  module=$(echo "$module" | xargs) # Trim whitespace
  if [ -n "$module" ]; then
    echo "Checking usage for module: $module"
    rg "\b$module\b" libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/createCollectionTemplate.ts
  fi
done

Length of output: 4010

@albinagu albinagu added deprecated:automerge (Disabled) Merge this PR as soon as all checks pass and removed deploy-feature Deploys features to dev labels Jul 5, 2024
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 a7ada54 and d6a6370.

Files selected for processing (4)
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/forms/Prerequisites.ts (1 hunks)
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/constants.ts (1 hunks)
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/errors.ts (1 hunks)
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/messages.ts (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/forms/Prerequisites.ts
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/constants.ts
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/errors.ts
  • libs/application/templates/signature-collection/parliamentary-list-creation/src/lib/messages.ts

@kodiakhq kodiakhq bot merged commit 8d22fae into main Jul 5, 2024
176 checks passed
@kodiakhq kodiakhq bot deleted the signature_collection_parliamentary branch July 5, 2024 09:19
oskarjs pushed a commit that referenced this pull request Aug 20, 2024
…#15333)

* initial commit

* chore: nx format:write update dirty files

* merge fix

* chore: nx format:write update dirty files

* test

* temp

* temp2

* fix(ui-fields): TableRepeaterField with NationalIdWithName component

* hehe, revert

* tweak

* tweak for item type

* chore: nx format:write update dirty files

* lint

* person in table repeater

* small refactor moving functions to utils

* tweaks

* tweaks

* cleanup

* temp

* chore: nx format:write update dirty files

* rabbit

* cleanup2

* tables

* texts

* fix for undefined

* t

* review tweaks

* chore: nx format:write update dirty files

* tweak overview

* refactor

* cleanup

* keep handleCustomMappedValues in utils tho

* tweak

* added comment in utils

* rabbit review

* cleanup

* dataschema

* format

* tweaks

* tweaks vol 2

* removed any's

* linting tweaks

* adding translationNamespaces

* removed custom component

* chore: nx format:write update dirty files

* renamed template

* review tweaks

---------

Co-authored-by: andes-it <[email protected]>
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.

5 participants