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(ojoi): UI updates and updating client config #15256

Merged
merged 7 commits into from
Jun 19, 2024
Merged

Conversation

jonbjarnio
Copy link
Member

@jonbjarnio jonbjarnio commented Jun 18, 2024

What

  • Fixed and updated UI bugs
  • updated application client config and added getPrice method

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 method to fetch and display the price of cases in the application.
  • Enhancements

    • Improved layout and styling for committee signatures and various input components.
    • Updated the HTMLEditor component to include a title attribute for better accessibility.
  • Bug Fixes

    • Simplified the onAdd function in the AddChannel component for better usability.
  • GraphQL Updates

    • Added a new GET_PRICE_QUERY to fetch pricing information.
  • Documentation

    • Updated message definitions for better clarity in the editor input labels.

@jonbjarnio jonbjarnio requested a review from a team as a code owner June 18, 2024 13:41
Copy link
Contributor

coderabbitai bot commented Jun 18, 2024

Walkthrough

The updates encompass new features and enhancements related to the Official Journal of Iceland application. A primary new feature is a method to fetch and return pricing information. Additional minor modifications refine the user interface, enhance visual organization, and streamline interaction logic within various components.

Changes

File(s) Change Summary
ojoiApplication.resolver.ts Added getPrice method to fetch price based on id.
ojoiApplication.service.ts Added getPrice method in service class for invoking ojoiApplicationService.getPrice().
getPrice.response.ts Introduced CaseGetPriceResponse class with a price field.
AddChannel.tsx Updated the onAdd function to no longer accept a Channel parameter, and simplified the save button handler.
HTMLEditor.css.ts Renamed CSS class .signature__textAbove to .signature__above.
Committee.tsx Restructured layout of input components within the CommitteeSignature function.
Signatures.css.ts Introduced and adjusted styles for committee and other input groups.
Advert.tsx Added a title attribute to the HTMLEditor component.
Publishing.tsx Removed unused imports, and updated onAddChannel function.
Signatures.tsx Added AdditionalSignature component and functions for handling additional signatures.
Summary.tsx Revised GraphQL queries and component usage.
queries.ts Added new GraphQL query GET_PRICE_QUERY for fetching price info.
advert.ts Updated with a new message definition for editor input label.
clientConfig.json Added new endpoint /api/v1/applications/{id}/price, and updates to API schemas.
ojoiApplicationClient.service.ts Added pricing functionality and logging enhancements, including a getPrice method for retrieving case prices.

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.

@jonbjarnio jonbjarnio added the automerge Merge this PR as soon as all checks pass label Jun 18, 2024
Copy link
Member

@thordurhhh thordurhhh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

@datadog-island-is
Copy link

datadog-island-is bot commented Jun 18, 2024

Datadog Report

All test runs 88e485d 🔗

4 Total Test Services: 0 Failed, 4 Passed
➡️ Test Sessions change in coverage: 10 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 3.13s 1 no change Link
application-system-api 0 0 0 111 2 3m 15.97s 1 no change Link
application-template-api-modules 0 0 0 109 0 2m 5.2s 1 no change Link
application-ui-shell 0 0 0 74 0 1m 0.06s 1 no change Link

Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 47.36842% with 10 lines in your changes missing coverage. Please review.

Project coverage is 37.14%. Comparing base (af0efbd) to head (1b217ea).
Report is 4 commits behind head on main.

Current head 1b217ea differs from pull request most recent head 4c09729

Please upload reports for the commit 4c09729 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15256      +/-   ##
==========================================
- Coverage   37.15%   37.14%   -0.01%     
==========================================
  Files        6474     6470       -4     
  Lines      131819   131435     -384     
  Branches    37686    37552     -134     
==========================================
- Hits        48972    48820     -152     
+ Misses      82847    82615     -232     
Flag Coverage Δ
api 3.48% <ø> (ø)
application-system-api 42.11% <47.36%> (+<0.01%) ⬆️
application-template-api-modules 24.22% <ø> (-0.01%) ⬇️
application-ui-shell 21.60% <ø> (ø)

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

Files Coverage Δ
...celand-application/src/models/getPrice.response.ts 75.00% <75.00%> (ø)
...nd-application/src/lib/ojoiApplication.resolver.ts 69.23% <50.00%> (-3.50%) ⬇️
...and-application/src/lib/ojoiApplication.service.ts 33.33% <0.00%> (-6.67%) ⬇️
...plication/src/lib/ojoiApplicationClient.service.ts 33.33% <44.44%> (+2.56%) ⬆️

... and 33 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 d01878c...4c09729. Read the comment docs.

@jonbjarnio jonbjarnio removed the automerge Merge this PR as soon as all checks pass label Jun 18, 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: 2

Outside diff range and nitpick comments (1)
libs/application/templates/official-journal-of-iceland/src/fields/Signatures.tsx (1)

97-104: The implementation of updateAdditionalSignature using setState is correct. However, consider using a more descriptive variable name than newSignature to enhance code readability.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a37e90f and 742c86d.

Files selected for processing (15)
  • libs/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.resolver.ts (2 hunks)
  • libs/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.service.ts (1 hunks)
  • libs/api/domains/official-journal-of-iceland-application/src/models/getPrice.response.ts (1 hunks)
  • libs/application/templates/official-journal-of-iceland/src/components/communicationChannels/AddChannel.tsx (2 hunks)
  • libs/application/templates/official-journal-of-iceland/src/components/htmlEditor/HTMLEditor.css.ts (1 hunks)
  • libs/application/templates/official-journal-of-iceland/src/components/signatures/Committee.tsx (1 hunks)
  • libs/application/templates/official-journal-of-iceland/src/components/signatures/Signatures.css.ts (2 hunks)
  • libs/application/templates/official-journal-of-iceland/src/fields/Advert.tsx (1 hunks)
  • libs/application/templates/official-journal-of-iceland/src/fields/Publishing.tsx (2 hunks)
  • libs/application/templates/official-journal-of-iceland/src/fields/Signatures.tsx (3 hunks)
  • libs/application/templates/official-journal-of-iceland/src/fields/Summary.tsx (3 hunks)
  • libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts (1 hunks)
  • libs/application/templates/official-journal-of-iceland/src/lib/messages/advert.ts (1 hunks)
  • libs/clients/official-journal-of-iceland/application/src/clientConfig.json (3 hunks)
  • libs/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.service.ts (2 hunks)
Files not reviewed due to errors (1)
  • libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts (no review received)
Files skipped from review due to trivial changes (1)
  • libs/application/templates/official-journal-of-iceland/src/components/signatures/Signatures.css.ts
Additional context used
Path-based instructions (14)
libs/api/domains/official-journal-of-iceland-application/src/models/getPrice.response.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/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.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/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.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/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.resolver.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/official-journal-of-iceland/src/components/communicationChannels/AddChannel.tsx (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/official-journal-of-iceland/src/fields/Summary.tsx (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/official-journal-of-iceland/src/lib/messages/advert.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/official-journal-of-iceland/src/graphql/queries.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/official-journal-of-iceland/src/fields/Signatures.tsx (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/official-journal-of-iceland/application/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."
libs/application/templates/official-journal-of-iceland/src/fields/Advert.tsx (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/official-journal-of-iceland/src/fields/Publishing.tsx (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/official-journal-of-iceland/src/components/signatures/Committee.tsx (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/official-journal-of-iceland/src/components/htmlEditor/HTMLEditor.css.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/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.resolver.ts

[error] 26-26: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.


[error] 33-33: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.


[error] 40-40: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.


[error] 47-47: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.

Additional comments not posted (14)
libs/api/domains/official-journal-of-iceland-application/src/models/getPrice.response.ts (1)

3-7: The definition of CaseGetPriceResponse is well-implemented, adhering to GraphQL standards with appropriate use of decorators.

libs/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.service.ts (1)

30-34: The getPrice method correctly delegates to the client service, maintaining clean separation of concerns.

libs/application/templates/official-journal-of-iceland/src/fields/Summary.tsx (1)

6-7: Ensure the new GET_PRICE_QUERY is correctly integrated and returns the expected data format.

Verification successful

The GET_PRICE_QUERY is defined correctly in queries.ts and is used in Summary.tsx. The query fetches the price data based on an ID parameter, and its integration appears to be correct.

  • queries.ts:
    • Definition of GET_PRICE_QUERY:
      export const GET_PRICE_QUERY = gql`
        query GetPrice($id: String!) {
          officialJournalOfIcelandApplicationGetPrice(id: $id) {
            price
          }
        }
      `
  • Summary.tsx:
    • Usage of GET_PRICE_QUERY with useQuery.

The new GET_PRICE_QUERY is correctly defined and integrated into the Summary.tsx file.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the GraphQL query `GET_PRICE_QUERY` returns the expected data format.

# Test: Search for the query usage and expected data structure.
rg --type typescript $'GET_PRICE_QUERY'

Length of output: 73



Script:

#!/bin/bash
# Description: Verify the GraphQL query `GET_PRICE_QUERY` returns the expected data format.

# Test: Search for the query usage and expected data structure.
rg --type ts 'GET_PRICE_QUERY'

Length of output: 377



Script:

#!/bin/bash
# Description: Extract the definition of `GET_PRICE_QUERY` from `queries.ts`.

# Test: Display the definition of `GET_PRICE_QUERY`.
rg --type ts --context 10 'GET_PRICE_QUERY' libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts

Length of output: 479

libs/application/templates/official-journal-of-iceland/src/fields/Signatures.tsx (3)

106-109: The debounce implementation for updateAdditionalSignature is appropriate. Ensure the DEBOUNCE_INPUT_TIMER constant is set to a suitable value to balance responsiveness and performance.


20-20: Ensure that the AdditionalSignature component is properly exported from its module to avoid import errors.

Verification successful

The AdditionalSignature component is properly exported from its module.

  • libs/application/templates/official-journal-of-iceland/src/components/signatures/Additional.tsx: export const AdditionalSignature = ({
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that AdditionalSignature is properly exported from its module.

# Test: Search for the export statement of AdditionalSignature in its module.
rg --type typescript $'export.*AdditionalSignature' -- 'libs/application/templates/official-journal-of-iceland/src/components/signatures/'

Length of output: 172



Script:

#!/bin/bash
# Description: Verify that AdditionalSignature is properly exported from its module.

# Test: Search for the export statement of AdditionalSignature in its module.
rg --type ts $'export.*AdditionalSignature' -- 'libs/application/templates/official-journal-of-iceland/src/components/signatures/'

Length of output: 263


188-193: The integration of the AdditionalSignature component in the UI is done correctly. Verify the debouncedAdditionalSignatureUpdate function handles state updates efficiently without causing unnecessary re-renders.

libs/clients/official-journal-of-iceland/application/src/clientConfig.json (2)

4-29: The new API endpoint configuration for /api/v1/applications/{id}/price is well-defined. Ensure that the CasePriceResponse schema accurately reflects the data structure returned by this endpoint.


125-131: The CasePriceResponse schema is appropriately defined with the necessary fields. Confirm that all services using this endpoint expect and handle the defined price field correctly.

Verification successful

The getPrice method in ojoiApplicationClient.service.ts handles the price field of CasePriceResponse correctly. It attempts to fetch the price and, in case of an error, defaults to a price of 0, ensuring the price field is always present.

  • libs/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.service.ts:37-45
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all services using the CasePriceResponse schema handle the `price` field correctly.

# Test: Search for usage of CasePriceResponse in the codebase.
rg --type typescript 'CasePriceResponse' -- 'libs/clients/official-journal-of-iceland/application/src/'

Length of output: 136



Script:

#!/bin/bash
# Description: Verify that all services using the CasePriceResponse schema handle the `price` field correctly.

# Test: Search for usage of CasePriceResponse in the codebase.
rg --type ts 'CasePriceResponse' -- 'libs/clients/official-journal-of-iceland/application/src/'

Length of output: 374



Script:

#!/bin/bash
# Description: Extract the implementation of the `getPrice` method from `ojoiApplicationClient.service.ts`.

# Test: Search for the `getPrice` method implementation.
ast-grep --lang typescript --pattern $'class $_ {
  $$$
  async getPrice($_): Promise<CasePriceResponse> {
    $$$
  }
  $$$
}' libs/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.service.ts

Length of output: 4437

libs/application/templates/official-journal-of-iceland/src/fields/Advert.tsx (1)

263-263: The addition of the title prop to the HTMLEditor component is correctly implemented. Verify that the advert.inputs.editor.label is correctly internationalized and accessible in the current context.

Verification successful

The advert.inputs.editor.label is correctly internationalized and defined in the libs/application/templates/official-journal-of-iceland/src/lib/messages/advert.ts file.

  • libs/application/templates/official-journal-of-iceland/src/lib/messages/advert.ts: id: 'ojoi.application:advert.inputs.editor.label'
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the internationalization of `advert.inputs.editor.label`.

# Test: Search for the definition and usage of `advert.inputs.editor.label` to ensure it's internationalized.
rg --type typescript 'advert.inputs.editor.label' -- 'libs/application/templates/official-journal-of-iceland/src/lib/messages/'

Length of output: 160



Script:

#!/bin/bash
# Description: Verify the internationalization of `advert.inputs.editor.label`.

# Test: Search for the definition and usage of `advert.inputs.editor.label` to ensure it's internationalized.
rg --type ts 'advert.inputs.editor.label' -- 'libs/application/templates/official-journal-of-iceland/src/lib/messages/'

Length of output: 258

libs/application/templates/official-journal-of-iceland/src/fields/Publishing.tsx (1)

137-149: The modification to the onAddChannel function to include phone numbers is correctly implemented. Ensure that the phone field is validated elsewhere in the application to prevent invalid data entry.

Verification successful

The validation logic for the phone field is implemented in the libs/application/templates/official-journal-of-iceland/src/lib/utils.ts file. The function isValidPhone uses libphonenumber-js to validate phone numbers.

  • libs/application/templates/official-journal-of-iceland/src/lib/utils.ts: isValidPhone
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the validation of the `phone` field in the application.

# Test: Search for validation logic for the `phone` field.
rg --type typescript 'phone' -- 'libs/application/templates/official-journal-of-iceland/src/fields/'

Length of output: 133



Script:

#!/bin/bash
# Description: Verify the validation of the `phone` field in the application.

# Test: Search for validation logic for the `phone` field.
rg --type ts 'phone' -- 'libs/application/templates/official-journal-of-iceland/src/fields/'

Length of output: 528



Script:

#!/bin/bash
# Description: Verify the validation of the `phone` field in the application.

# Test: Search for validation logic for the `phone` field across the entire repository.
rg --type ts 'phone' -- 'libs/application/templates/official-journal-of-iceland/'

Length of output: 3279

libs/application/templates/official-journal-of-iceland/src/components/signatures/Committee.tsx (3)

85-116: The use of Box components with flexGrow={1} to wrap InputController and DatePickerController enhances the layout flexibility. This change aligns with best practices for responsive design.


214-273: The dynamic rendering and management of committee members is well-implemented. The use of map for rendering and the conditional rendering in onRemoveCommitteeMember function are appropriate. However, consider disabling the removal button for the first two members directly in the JSX to simplify the logic and enhance readability.
[REFACTOR_SUGGESTion]

- {index > 1 && (
+ {index > 1 ? (
    <Button
      variant="utility"
      icon="trash"
      onClick={() => onRemoveCommitteeMember(index)}
    />
  ) : null}

122-206: The restructuring of input fields within Box components for the chairman's details improves the modularity and readability of the code. Ensure that the error handling via getErrorViaPath is thoroughly tested, especially since dynamic key access in forms can be prone to mistakes if not handled correctly.

Verification successful

The error handling using getErrorViaPath is properly implemented in the Committee.tsx file, as evidenced by the consistent usage across various form fields. Each field's error handling checks for the presence of errors and retrieves the appropriate error message dynamically.

  • Instances of getErrorViaPath are used correctly with the form fields, ensuring that any errors are captured and displayed appropriately.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify error handling in dynamic form fields.

# Test: Search for error handling usage in Committee.tsx. Expect: Proper implementation without errors.
rg --type typescript $'getErrorViaPath' ./libs/application/templates/official-journal-of-iceland/src/components/signatures/Committee.tsx

Length of output: 170



Script:

#!/bin/bash
# Description: Verify error handling in dynamic form fields.

# Test: Search for error handling usage in Committee.tsx. Expect: Proper implementation without errors.
rg --type ts 'getErrorViaPath' ./libs/application/templates/official-journal-of-iceland/src/components/signatures/Committee.tsx

Length of output: 509



Script:

#!/bin/bash
# Description: Extract lines around the usage of getErrorViaPath in Committee.tsx to verify error handling.

# Extract lines around getErrorViaPath to check for proper error handling implementation.
rg --type ts 'getErrorViaPath' ./libs/application/templates/official-journal-of-iceland/src/components/signatures/Committee.tsx -A 3 -B 3

Length of output: 2223

libs/application/templates/official-journal-of-iceland/src/components/htmlEditor/HTMLEditor.css.ts (1)

571-571: Renaming the CSS class .signature__textAbove to .signature__above improves clarity and consistency with naming conventions. Ensure all references to this class in the project are updated to reflect this change.

Verification successful

The verification confirms that all references to the old class name .signature__textAbove have been updated to .signature__above.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all references to the old class name are updated.

# Test: Search for old class name usage. Expect: No occurrences of the old class name.
rg --type css $'.signature__textAbove' ./libs/application/templates/official-journal-of-iceland/src/components/htmlEditor

Length of output: 120



Script:

#!/bin/bash
# Description: Verify that all references to the old class name are updated across the entire project.

# Test: Search for old class name usage in all file types. Expect: No occurrences of the old class name.
rg '.signature__textAbove'

Length of output: 26

@jonbjarnio jonbjarnio added the automerge Merge this PR as soon as all checks pass label Jun 18, 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: 6

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a37e90f and d2f71e8.

Files selected for processing (15)
  • libs/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.resolver.ts (2 hunks)
  • libs/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.service.ts (1 hunks)
  • libs/api/domains/official-journal-of-iceland-application/src/models/getPrice.response.ts (1 hunks)
  • libs/application/templates/official-journal-of-iceland/src/components/communicationChannels/AddChannel.tsx (2 hunks)
  • libs/application/templates/official-journal-of-iceland/src/components/htmlEditor/HTMLEditor.css.ts (1 hunks)
  • libs/application/templates/official-journal-of-iceland/src/components/signatures/Committee.tsx (1 hunks)
  • libs/application/templates/official-journal-of-iceland/src/components/signatures/Signatures.css.ts (2 hunks)
  • libs/application/templates/official-journal-of-iceland/src/fields/Advert.tsx (1 hunks)
  • libs/application/templates/official-journal-of-iceland/src/fields/Publishing.tsx (2 hunks)
  • libs/application/templates/official-journal-of-iceland/src/fields/Signatures.tsx (3 hunks)
  • libs/application/templates/official-journal-of-iceland/src/fields/Summary.tsx (3 hunks)
  • libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts (1 hunks)
  • libs/application/templates/official-journal-of-iceland/src/lib/messages/advert.ts (1 hunks)
  • libs/clients/official-journal-of-iceland/application/src/clientConfig.json (3 hunks)
  • libs/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.service.ts (2 hunks)
Additional context used
Path-based instructions (15)
libs/api/domains/official-journal-of-iceland-application/src/models/getPrice.response.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/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.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/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.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/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.resolver.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/official-journal-of-iceland/src/components/communicationChannels/AddChannel.tsx (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/official-journal-of-iceland/src/fields/Summary.tsx (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/official-journal-of-iceland/src/components/signatures/Signatures.css.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/official-journal-of-iceland/src/lib/messages/advert.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/official-journal-of-iceland/src/graphql/queries.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/official-journal-of-iceland/src/fields/Signatures.tsx (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/official-journal-of-iceland/application/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."
libs/application/templates/official-journal-of-iceland/src/fields/Advert.tsx (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/official-journal-of-iceland/src/fields/Publishing.tsx (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/official-journal-of-iceland/src/components/signatures/Committee.tsx (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/official-journal-of-iceland/src/components/htmlEditor/HTMLEditor.css.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/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.service.ts

[error] 20-20: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.

libs/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.resolver.ts

[error] 26-26: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.


[error] 33-33: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.


[error] 40-40: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.


[error] 47-47: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.

Additional comments not posted (16)
libs/api/domains/official-journal-of-iceland-application/src/models/getPrice.response.ts (1)

3-7: The GraphQL type for the price field is correctly set to Int, aligning with the best practices for handling numerical data that does not require decimal precision.

libs/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.service.ts (1)

43-54: The implementation of the getPrice method includes robust error handling and logging, which are good practices for reliability and observability.

libs/api/domains/official-journal-of-iceland-application/src/lib/ojoiApplication.resolver.ts (1)

44-49: The getPrice query is correctly implemented with appropriate use of guards and feature flags, ensuring secure and conditional access.

Tools
Biome

[error] 47-47: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.

libs/application/templates/official-journal-of-iceland/src/components/communicationChannels/AddChannel.tsx (1)

62-62: The onClick handler correctly aligns with the updated onAdd function signature, enhancing code simplicity and maintainability.

libs/application/templates/official-journal-of-iceland/src/fields/Summary.tsx (2)

6-9: The addition of GET_PRICE_QUERY and its usage is correctly implemented to support the new pricing functionality. Ensure proper error handling for the GraphQL query.

Also applies to: 31-33


35-35: Displaying the estimated price using the fetched data enhances the user experience. Consider adding a fallback value for price in case the data fetch fails or returns null.

Also applies to: 70-70

libs/application/templates/official-journal-of-iceland/src/components/signatures/Signatures.css.ts (1)

Line range hint 47-80: The newly added CSS styles for committee input groups are well-structured and enhance the visual consistency of the UI.

libs/application/templates/official-journal-of-iceland/src/lib/messages/advert.ts (1)

97-103: The new message definition for the editor input is clear and enhances the clarity and accessibility of the UI.

libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts (1)

3-9: The GET_PRICE_QUERY is well-defined and follows GraphQL best practices. Ensure that the officialJournalOfIcelandApplicationGetPrice resolver is implemented correctly on the server-side to handle this query.

libs/application/templates/official-journal-of-iceland/src/fields/Signatures.tsx (2)

20-20: The integration of the AdditionalSignature component appears to be correctly implemented. Ensure that the AdditionalSignature component itself properly handles the props it receives, especially the debouncedAdditionalSignatureUpdate function which is critical for performance.

Also applies to: 188-193


97-110: The debouncing implementation for updateAdditionalSignature is a good practice to optimize performance, particularly for high-frequency events like typing. Make sure to test this thoroughly to ensure that there are no delays or missed updates in the UI.

libs/clients/official-journal-of-iceland/application/src/clientConfig.json (2)

4-29: The new API endpoint /api/v1/applications/{id}/price is well-documented and follows OpenAPI standards. Ensure that the backend correctly implements this endpoint according to the specified operationId getPrice and schema CasePriceResponse.


125-131: The CasePriceResponse schema is appropriately defined with required fields. This ensures that the API will consistently return the necessary data. Consider adding a non-empty description for the 200 response to enhance the API documentation.

libs/application/templates/official-journal-of-iceland/src/fields/Advert.tsx (1)

263-263: Adding the title attribute to the HTMLEditor component enhances accessibility and user experience by providing additional context to screen readers. Ensure that the label is appropriately localized and that it dynamically updates based on user interactions or other state changes.

libs/application/templates/official-journal-of-iceland/src/components/signatures/Committee.tsx (1)

85-102: Ensure consistent use of localization for input fields.

While the label for the InputController uses a localized string, the placeholder property does not seem to be localized. It's important to maintain consistency in localization across all user-facing text to ensure a seamless user experience across different locales.

Verification successful

The verification confirms that there are no non-localized placeholder attributes in the specified file.

  • libs/application/templates/official-journal-of-iceland/src/components/signatures/Committee.tsx
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify localization consistency in input fields.

# Test: Search for non-localized placeholders. Expect: No occurrences.
rg --type typescript 'placeholder="[^{]*"' libs/application/templates/official-journal-of-iceland/src/components/signatures/

Length of output: 161



Script:

#!/bin/bash
# Description: Verify localization consistency in input fields.

# Test: Search for non-localized placeholders. Expect: No occurrences.
rg --type ts 'placeholder="[^{]*"' libs/application/templates/official-journal-of-iceland/src/components/signatures/

Length of output: 118

libs/application/templates/official-journal-of-iceland/src/components/htmlEditor/HTMLEditor.css.ts (1)

571-571: CSS class name changed correctly to reflect design specifications.

The change from .signature__textAbove to .signature__above aligns with the CSS naming conventions and correctly reflects the design specifications. This change should help improve the readability and maintainability of the CSS.

@jonbjarnio
Copy link
Member Author

@coderabbitai resolve

Copy link
Contributor

coderabbitai bot commented Jun 18, 2024

Actions performed

Comments resolved and changes approved.

@jonbjarnio jonbjarnio added automerge Merge this PR as soon as all checks pass and removed automerge Merge this PR as soon as all checks pass labels Jun 18, 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: 3

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d2f71e8 and 1b217ea.

Files selected for processing (2)
  • libs/application/templates/official-journal-of-iceland/src/fields/Summary.tsx (3 hunks)
  • libs/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.service.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • libs/application/templates/official-journal-of-iceland/src/fields/Summary.tsx
Additional context used
Path-based instructions (1)
libs/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.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."
Biome
libs/clients/official-journal-of-iceland/application/src/lib/ojoiApplicationClient.service.ts

[error] 20-20: 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 the unsafeParameterDecoratorsEnabled option to true in your configuration file.

@kodiakhq kodiakhq bot merged commit 9d96821 into main Jun 19, 2024
23 checks passed
@kodiakhq kodiakhq bot deleted the fix/ojoi-ui-bugs branch June 19, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants