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(signature-collection): sign list done screen prettier #16178

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

albinagu
Copy link
Member

@albinagu albinagu commented Sep 26, 2024

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 new SVG illustration of a man sitting on a bench for enhanced visual appeal.
    • Added a dynamic alert message field to the form, improving user feedback.
    • Included an image field displaying the new illustration within the form.
  • Bug Fixes

    • Corrected a grammatical error in the Icelandic message text for improved clarity.

@albinagu albinagu requested a review from a team as a code owner September 26, 2024 14:57
Copy link
Contributor

coderabbitai bot commented Sep 26, 2024

Walkthrough

The changes introduced in this pull request involve the addition of a new React component, ManOnBenchIllustration, which renders an SVG illustration of a man sitting on a bench. Additionally, modifications were made to the Done form component, including the introduction of new fields for alert messages and image display. A grammatical correction was also applied to a message definition in the messages.ts file. These updates enhance the functionality and user interface of the signature collection feature.

Changes

File Change Summary
libs/application/templates/signature-collection/parliamentary-list-signing/assets/ManOnBenchIllustration.tsx Added a new React component ManOnBenchIllustration that renders an SVG illustration.
libs/application/templates/signature-collection/parliamentary-list-signing/src/forms/Done.ts Modified the form structure by adding buildAlertMessageField and buildImageField, and adjusting the position of buildMessageWithLinkButtonField.
libs/application/templates/signature-collection/parliamentary-list-signing/src/lib/messages.ts Updated the defaultMessage of linkFieldMessage to correct a grammatical error in Icelandic.

Possibly related PRs

Suggested labels

deploy-feature

Suggested reviewers

  • albinagu
  • kksteini

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@albinagu albinagu added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Sep 26, 2024
@datadog-island-is
Copy link

datadog-island-is bot commented Sep 26, 2024

Datadog Report

All test runs 78a85f2 🔗

4 Total Test Services: 0 Failed, 4 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.01%), 7 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.01s 1 no change Link
application-system-api 0 0 0 111 2 3m 36.29s 1 no change Link
application-template-api-modules 0 0 0 109 0 1m 58.94s 1 decreased (-0.01%) Link
application-ui-shell 0 0 0 74 0 39.74s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • application-template-api-modules - jest 25.7% (-0.01%) - Details

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

🧹 Outside diff range and nitpick comments (3)
libs/application/templates/signature-collection/parliamentary-list-signing/src/forms/Done.ts (2)

14-14: LGTM: New illustration import enhances visual appeal

The addition of ManOnBenchIllustration is a good way to improve the user interface. It follows our naming conventions and is imported from a local asset, which is great for maintainability.

Consider moving this illustration to a shared asset folder if it might be reused across different parts of the application. This would further improve reusability and consistency.


42-52: LGTM: New alert message field enhances user feedback

The addition of buildAlertMessageField is a great improvement to the user interface. It provides personalized feedback by incorporating the user's name from the application answers. The use of TypeScript for the application parameter and the reuse of core building blocks align well with our coding guidelines.

Consider extracting the message generation logic into a separate function for better maintainability and potential reuse. For example:

const generateDoneMessage = (application: Application) => ({
  ...m.listSignedDescription,
  values: {
    name: (application.answers as Answers).list.name,
  },
});

// Then in the field definition:
message: generateDoneMessage,

This would make the code more modular and easier to test.

libs/application/templates/signature-collection/parliamentary-list-signing/assets/ManOnBenchIllustration.tsx (1)

17-19: Consider externalizing SVG styles for better maintainability

Defining styles directly inside the <style> tag within the SVG can make it harder to maintain and reuse styles. Consider externalizing the styles using CSS or styled-components to improve maintainability.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 60a4187 and e207d6e.

📒 Files selected for processing (3)
  • libs/application/templates/signature-collection/parliamentary-list-signing/assets/ManOnBenchIllustration.tsx (1 hunks)
  • libs/application/templates/signature-collection/parliamentary-list-signing/src/forms/Done.ts (2 hunks)
  • libs/application/templates/signature-collection/parliamentary-list-signing/src/lib/messages.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • libs/application/templates/signature-collection/parliamentary-list-signing/src/lib/messages.ts
🧰 Additional context used
📓 Path-based instructions (2)
libs/application/templates/signature-collection/parliamentary-list-signing/assets/ManOnBenchIllustration.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/signature-collection/parliamentary-list-signing/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."
🔇 Additional comments (4)
libs/application/templates/signature-collection/parliamentary-list-signing/src/forms/Done.ts (4)

7-8: LGTM: New imports enhance form building capabilities

The addition of buildImageField and buildAlertMessageField imports from the core application library aligns with our guidelines for reusability and consistency across NextJS apps. These new fields will likely improve the user interface of the "sign list done" screen.


53-58: LGTM: New image field improves visual design

The addition of buildImageField with the ManOnBenchIllustration is an excellent enhancement to the user interface. It utilizes a reusable component from the core library, aligning with our guidelines for consistency and reusability. The specific width and position properties ensure a consistent layout across different screen sizes.


65-71: LGTM: Repositioned link button improves form flow

The repositioning of the buildMessageWithLinkButtonField within the children array likely improves the overall flow and user experience of the form. The field maintains its functionality to link to the service portal, and its continued use demonstrates good adherence to our guidelines for component reusability.


Line range hint 1-85: Overall assessment: Excellent improvements to the Done form

The changes in this file significantly enhance the "sign list done" screen, aligning well with the PR objectives. Key improvements include:

  1. Addition of a personalized alert message
  2. Integration of an illustrative image
  3. Improved positioning of the link to the service portal

These changes adhere to our coding guidelines by:

  • Utilizing reusable components from the core library
  • Employing TypeScript for type safety
  • Maintaining consistency in naming conventions and import structure

The modifications will likely result in a more visually appealing and user-friendly interface, contributing to a better overall user experience in the signature collection process.

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.69%. Comparing base (60a4187) to head (f06cd47).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #16178   +/-   ##
=======================================
  Coverage   36.69%   36.69%           
=======================================
  Files        6776     6776           
  Lines      139586   139586           
  Branches    39680    39680           
=======================================
  Hits        51222    51222           
  Misses      88364    88364           
Flag Coverage Δ
api 3.39% <ø> (ø)
application-system-api 41.63% <ø> (ø)
application-template-api-modules 23.71% <ø> (+0.01%) ⬆️
application-ui-shell 21.29% <ø> (ø)

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

Files with missing lines Coverage Δ
...ion/parliamentary-list-signing/src/lib/messages.ts 100.00% <ø> (ø)

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 e6601c0...f06cd47. Read the comment docs.

@kodiakhq kodiakhq bot merged commit 55d69bb into main Sep 26, 2024
39 checks passed
@kodiakhq kodiakhq bot deleted the signlist_prettier branch September 26, 2024 15:47
thoreyjona pushed a commit that referenced this pull request Oct 2, 2024
* fix(signature-collection): sign list done screen prettier

* chore: nx format:write update dirty files

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: andes-it <[email protected]>
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.

3 participants