-
Notifications
You must be signed in to change notification settings - Fork 57
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(signature-collection): renaming templates to presidential specific #15328
Conversation
WalkthroughThe recent updates primarily focus on renaming various parts of the project related to the "Signature List" functionalities to "Presidential List." This involves changing import paths, enum values, type names, project configurations, and documentation. The changes aim to reflect a shift in the terminology used to better describe the application's features, ensuring consistency and clarity. Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15328 +/- ##
==========================================
- Coverage 37.04% 37.03% -0.01%
==========================================
Files 6539 6539
Lines 133085 133082 -3
Branches 38119 38119
==========================================
- Hits 49296 49293 -3
Misses 83789 83789 Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 101 Total Test Services: 0 Failed, 99 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (17)
|
There was a problem hiding this 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
Outside diff range and nitpick comments (1)
libs/application/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-signing/signature-list-signing.service.ts (1)
Line range hint
32-34
: Consider removing the unnecessary else clause for cleaner code.The else clause after a return statement in the previous branch is redundant and can be omitted to enhance code readability.
- } else { - throw new TemplateApiError(errorMessages.submitFailure, 405) - } + throw new TemplateApiError(errorMessages.submitFailure, 405)
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (20)
- libs/application/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-creation/emailGenerators/applicationSubmitted.ts (1 hunks)
- libs/application/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-creation/signature-list-creation.service.ts (2 hunks)
- libs/application/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-signing/signature-list-signing.service.ts (1 hunks)
- libs/application/template-loader/src/lib/templateLoaders.ts (1 hunks)
- libs/application/templates/signature-collection/README.md (1 hunks)
- libs/application/templates/signature-collection/presidential-list-creation/README.md (1 hunks)
- libs/application/templates/signature-collection/presidential-list-creation/jest.config.ts (2 hunks)
- libs/application/templates/signature-collection/presidential-list-creation/project.json (2 hunks)
- libs/application/templates/signature-collection/presidential-list-creation/src/forms/Draft.ts (1 hunks)
- libs/application/templates/signature-collection/presidential-list-creation/src/lib/CreateListTemplate.ts (2 hunks)
- libs/application/templates/signature-collection/presidential-list-creation/src/lib/dataSchema.ts (1 hunks)
- libs/application/templates/signature-collection/presidential-list-signing/README.md (1 hunks)
- libs/application/templates/signature-collection/presidential-list-signing/jest.config.ts (2 hunks)
- libs/application/templates/signature-collection/presidential-list-signing/project.json (2 hunks)
- libs/application/templates/signature-collection/presidential-list-signing/src/lib/SignListTemplate.ts (2 hunks)
- libs/application/templates/signature-collection/presidential-list-signing/src/lib/dataSchema.ts (1 hunks)
- libs/application/types/src/lib/ApplicationTypes.ts (2 hunks)
- libs/application/types/src/lib/InstitutionMapper.ts (1 hunks)
- libs/feature-flags/src/lib/features.ts (1 hunks)
- tsconfig.base.json (1 hunks)
Files skipped from review due to trivial changes (7)
- libs/application/templates/signature-collection/presidential-list-creation/README.md
- libs/application/templates/signature-collection/presidential-list-creation/src/lib/dataSchema.ts
- libs/application/templates/signature-collection/presidential-list-signing/README.md
- libs/application/templates/signature-collection/presidential-list-signing/jest.config.ts
- libs/application/templates/signature-collection/presidential-list-signing/src/lib/dataSchema.ts
- libs/application/types/src/lib/ApplicationTypes.ts
- libs/feature-flags/src/lib/features.ts
Additional context used
Path-based instructions (12)
libs/application/templates/signature-collection/README.md (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/signature-collection/presidential-list-creation/jest.config.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/signature-collection/presidential-list-signing/project.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."
libs/application/templates/signature-collection/presidential-list-creation/project.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."
libs/application/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-creation/emailGenerators/applicationSubmitted.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/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-creation/signature-list-creation.service.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/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-signing/signature-list-signing.service.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/signature-collection/presidential-list-creation/src/lib/CreateListTemplate.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/signature-collection/presidential-list-signing/src/lib/SignListTemplate.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/signature-collection/presidential-list-creation/src/forms/Draft.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/template-loader/src/lib/templateLoaders.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/types/src/lib/InstitutionMapper.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."
Biome
libs/application/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-creation/signature-list-creation.service.ts
[error] 25-25: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.libs/application/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-signing/signature-list-signing.service.ts
[error] 32-34: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)
Unsafe fix: Omit the else clause.
Additional comments not posted (17)
libs/application/templates/signature-collection/README.md (1)
5-9
: Updated documentation to reflect new terminology.The changes correctly update the terminology from "Signature List" to "Presidential List" and introduce "Parliamentary List". This aligns with the PR's objectives to prepare for the addition of Parliamentary elections.
libs/application/templates/signature-collection/presidential-list-creation/jest.config.ts (2)
3-3
: Updated displayName for Jest configuration.The
displayName
has been updated to match the new naming convention for the presidential list creation. This is a necessary change to keep the test configurations aligned with the project structure.
12-12
: Updated coverage directory path.The
coverageDirectory
path has been correctly updated to reflect the new directory structure. This ensures that code coverage metrics are stored in the correct location.libs/application/templates/signature-collection/presidential-list-signing/project.json (1)
2-2
: Updated project configuration to reflect new naming convention.The project configuration has been thoroughly updated to reflect the renaming from "signature-list-signing" to "presidential-list-signing". This includes updates to the project name, source root, lint patterns, coverage directory, Jest configuration, and localization command. These changes are crucial for maintaining the integrity of the build and test environments following the renaming.
Also applies to: 4-4, 13-13, 20-20, 23-23, 30-30
libs/application/templates/signature-collection/presidential-list-creation/project.json (1)
2-2
: Updated project configuration to reflect new naming convention.Like the previous file, this project configuration has been correctly updated to reflect the renaming from "signature-list-creation" to "presidential-list-creation". The updates include the project name, source root, lint patterns, coverage directory, Jest configuration, and localization command. These updates ensure that the project configuration remains consistent and functional with the new directory structure.
Also applies to: 4-4, 13-13, 20-20, 23-23, 30-30
libs/application/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-creation/emailGenerators/applicationSubmitted.ts (2)
2-2
: Import path is correctly updated to reflect the new structure.The change aligns with the PR's objective to rename components related to presidential elections.
5-5
: Function implementation is well-structured and clear.The function
generateApplicationSubmittedEmail
correctly handles the email generation based on the application data. The use of modern JavaScript features like destructuring and template literals enhances readability and maintainability.Also applies to: 8-32
libs/application/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-creation/signature-list-creation.service.ts (2)
16-16
: Import path is correctly updated to reflect the new structure.The change aligns with the PR's objective to rename components related to presidential elections.
29-29
: Constructor correctly updated to use the new application type.This change is necessary to align with the renaming in the application types, ensuring that the service operates under the correct context.
libs/application/template-api-modules/src/lib/modules/templates/signature-collection/signature-list-signing/signature-list-signing.service.ts (2)
10-10
: Import path is correctly updated to reflect the new structure.The change aligns with the PR's objective to rename components related to presidential elections.
18-18
: Constructor correctly updated to use the new application type.This change is necessary to align with the renaming in the application types, ensuring that the service operates under the correct context.
libs/application/templates/signature-collection/presidential-list-creation/src/lib/CreateListTemplate.ts (1)
31-31
: Template configuration correctly updated to use the new application type.This change is necessary to align with the renaming in the application types, ensuring that the template operates under the correct context.
libs/application/templates/signature-collection/presidential-list-signing/src/lib/SignListTemplate.ts (1)
31-31
: Updated application type to match the new template name.The change from
SIGNATURE_LIST_SIGNING
toPRESIDENTIAL_LIST_SIGNING
aligns with the PR's objective to rename templates specific to Presidential elections. This ensures consistency across the application's configuration and its usage.libs/application/templates/signature-collection/presidential-list-creation/src/forms/Draft.ts (1)
22-22
: Updated form ID to reflect the new template name.Renaming the form ID from
SignatureListCreationDraft
toPresidentialListCreationDraft
is consistent with the renaming strategy of the application. This change is crucial for maintaining the integrity of form references throughout the application lifecycle.libs/application/template-loader/src/lib/templateLoaders.ts (1)
132-138
: Template import paths updated to reflect new structure.The update of template import paths from
signature-collection/signature-list-creation
andsignature-list-signing
topresidential-list-creation
andpresidential-list-signing
ensures that the application correctly loads the new templates. This is essential for the application to function with the updated template names and paths.libs/application/types/src/lib/InstitutionMapper.ts (1)
210-214
: Updated application types in Institution Mapper.The mapping of
PRESIDENTIAL_LIST_CREATION
andPRESIDENTIAL_LIST_SIGNING
to their respective institution details is correctly updated. This ensures that the application can accurately retrieve institution details based on the new application types.
[APROVED]tsconfig.base.json (1)
481-482
: Path updates align with renaming strategyThe changes in the module paths correctly reflect the renaming from "signature-list" to "presidential-list" for both creation and signing components. Ensure that the new paths accurately point to the existing directories or files in the project.
Also applies to: 484-485
Verification successful
Path updates align with renaming strategy
The changes in the module paths correctly reflect the renaming from "signature-list" to "presidential-list" for both creation and signing components. The verification confirms that the new paths accurately point to the existing directories and files in the project.
libs/application/templates/signature-collection/presidential-list-creation/src/index.ts
libs/application/templates/signature-collection/presidential-list-signing/src/index.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the new paths in the tsconfig. # Check if the directories exist. if [ -d "libs/application/templates/signature-collection/presidential-list-creation/src" ] && [ -d "libs/application/templates/signature-collection/presidential-list-signing/src" ]; then echo "Directories exist." else echo "One or both directories do not exist." fiLength of output: 229
Script:
#!/bin/bash # Description: Verify the existence of the specific files in the new paths in the tsconfig. # Check if the specific files exist. if [ -f "libs/application/templates/signature-collection/presidential-list-creation/src/index.ts" ] && [ -f "libs/application/templates/signature-collection/presidential-list-signing/src/index.ts" ]; then echo "Files exist." else echo "One or both files do not exist." fiLength of output: 235
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core files LGTM.
This PR currently has a merge conflict. Please resolve this and then re-add the |
There was a problem hiding this 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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (6)
- libs/application/template-loader/src/lib/templateLoaders.ts (1 hunks)
- libs/application/templates/signature-collection/presidential-list-creation/src/forms/Done.ts (1 hunks)
- libs/application/templates/signature-collection/presidential-list-signing/src/lib/SignListTemplate.ts (2 hunks)
- libs/application/types/src/lib/ApplicationTypes.ts (2 hunks)
- libs/application/types/src/lib/InstitutionMapper.ts (1 hunks)
- tsconfig.base.json (1 hunks)
Files skipped from review as they are similar to previous changes (4)
- libs/application/template-loader/src/lib/templateLoaders.ts
- libs/application/types/src/lib/ApplicationTypes.ts
- libs/application/types/src/lib/InstitutionMapper.ts
- tsconfig.base.json
Additional context used
Path-based instructions (2)
libs/application/templates/signature-collection/presidential-list-creation/src/forms/Done.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/signature-collection/presidential-list-signing/src/lib/SignListTemplate.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."
GitHub Check: prepare
libs/application/templates/signature-collection/presidential-list-signing/src/lib/SignListTemplate.ts
[failure] 28-28:
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ ExampleForm: { slug: string; translation: string; }; Passport: { slug: string; translation: string; }; PassportAnnulment: { slug: string; translation: string; }; DrivingLearnersPermit: { slug: string; translation: string; }; ... 66 more ...; NewPrimarySchool: { ...; }; }'.
[failure] 28-28:
Property 'SIGNATURE_LIST_SIGNING' does not exist on type 'typeof ApplicationTypes'.
[failure] 28-28:
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ ExampleForm: { slug: string; translation: string; }; Passport: { slug: string; translation: string; }; PassportAnnulment: { slug: string; translation: string; }; DrivingLearnersPermit: { slug: string; translation: string; }; ... 66 more ...; NewPrimarySchool: { ...; }; }'.
[failure] 28-28:
Property 'SIGNATURE_LIST_SIGNING' does not exist on type 'typeof ApplicationTypes'.
[failure] 28-28:
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ ExampleForm: { slug: string; translation: string; }; Passport: { slug: string; translation: string; }; PassportAnnulment: { slug: string; translation: string; }; DrivingLearnersPermit: { slug: string; translation: string; }; ... 66 more ...; NewPrimarySchool: { ...; }; }'.
[failure] 28-28:
Property 'SIGNATURE_LIST_SIGNING' does not exist on type 'typeof ApplicationTypes'.
[failure] 28-28:
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ ExampleForm: { slug: string; translation: string; }; Passport: { slug: string; translation: string; }; PassportAnnulment: { slug: string; translation: string; }; DrivingLearnersPermit: { slug: string; translation: string; }; ... 66 more ...; NewPrimarySchool: { ...; }; }'.
[failure] 28-28:
Property 'SIGNATURE_LIST_SIGNING' does not exist on type 'typeof ApplicationTypes'.
[failure] 28-28:
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ ExampleForm: { slug: string; translation: string; }; Passport: { slug: string; translation: string; }; PassportAnnulment: { slug: string; translation: string; }; DrivingLearnersPermit: { slug: string; translation: string; }; ... 66 more ...; NewPrimarySchool: { ...; }; }'.
[failure] 28-28:
Property 'SIGNATURE_LIST_SIGNING' does not exist on type 'typeof ApplicationTypes'.
Additional comments not posted (3)
libs/application/templates/signature-collection/presidential-list-creation/src/forms/Done.ts (2)
Line range hint
1-1
: Check for potential impact due to removal ofcoreMessages
import.The removal of
coreMessages
import from@island.is/application/core
could potentially lead to issues if the messages are still referenced somewhere within this module or elsewhere in the application where this module's components are used.#!/bin/bash # Description: Check for references to `coreMessages` that might still exist in the application. # Test: Search for `coreMessages` usage across the application. rg 'coreMessages' --type ts
The
coreMessages
import was present in the initial commit of theDone.ts
file and was removed later. To ensure that this removal does not affect the functionality, we need to verify ifcoreMessages
was ever utilized within the file.#!/bin/bash # Description: Verify if `coreMessages` was used in the initial commit of the Done.ts file. # Extract the initial commit hash for Done.ts initial_commit_hash=$(git rev-list --max-parents=0 HEAD -- libs/application/templates/signature-collection/presidential-list-creation/src/forms/Done.ts) # Show the content of Done.ts in the initial commit git show $initial_commit_hash:libs/application/templates/signature-collection/presidential-list-creation/src/forms/Done.tslibs/application/templates/signature-collection/presidential-list-signing/src/lib/SignListTemplate.ts (1)
35-35
: RenamedApplicationTypes
usage to reflect new terminology.The
ApplicationTypes.SIGNATURE_LIST_SIGNING
has been correctly updated toApplicationTypes.PRESIDENTIAL_LIST_SIGNING
in the configuration. This change aligns with the renaming objectives of the PR.
...ication/templates/signature-collection/presidential-list-signing/src/lib/SignListTemplate.ts
Show resolved
Hide resolved
There was a problem hiding this 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
Files selected for processing (1)
- libs/application/templates/signature-collection/presidential-list-signing/src/lib/SignListTemplate.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- libs/application/templates/signature-collection/presidential-list-signing/src/lib/SignListTemplate.ts
#15328) * fix(signature-collection): renaming templates to presidential specific * minor tweaks * chore: nx format:write update dirty files * test commit * build fix --------- Co-authored-by: andes-it <builders@andes.is>
#15328) * fix(signature-collection): renaming templates to presidential specific * minor tweaks * chore: nx format:write update dirty files * test commit * build fix --------- Co-authored-by: andes-it <builders@andes.is>
As we will now be working on adding Parliamentary elections, renaming current templates to Presidential specific
Checklist:
Summary by CodeRabbit