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(regulations-admin): Only display modal on amending regs #14823

Merged
merged 2 commits into from
May 16, 2024

Conversation

thordurhhh
Copy link
Member

@thordurhhh thordurhhh commented May 16, 2024

What

Only display modal if regulation is amending

Why

Base regulations need no modal for text update, there is no text to diff from 🤷

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

  • Enhancements
    • Updated modal visibility condition in the EditBasics component to display only when the draft type is set to "amending".

@thordurhhh thordurhhh added the automerge Merge this PR as soon as all checks pass label May 16, 2024
@thordurhhh thordurhhh requested a review from a team as a code owner May 16, 2024 10:10
Copy link
Contributor

coderabbitai bot commented May 16, 2024

Walkthrough

The recent update modifies the EditBasics component in the admin portal's regulations section. Specifically, it changes the visibility condition for a modal. Now, the modal will only be visible if the draft.type is equal to RegulationDraftTypes.amending and the isModalVisible flag is true. This ensures the modal appears only under these specific conditions, refining the user interface behavior based on the draft type.

Changes

File Path Change Summary
.../admin/regulations-admin/src/components/EditBasics.tsx Updated the modal visibility condition to isVisible={draft.type.value === RegulationDraftTypes.amending && isModalVisible}.

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

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 36271b4 and bc8b32e.
Files selected for processing (1)
  • libs/portals/admin/regulations-admin/src/components/EditBasics.tsx (1 hunks)
Additional Context Used
Path-based Instructions (1)
libs/portals/admin/regulations-admin/src/components/EditBasics.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."
Additional comments not posted (1)
libs/portals/admin/regulations-admin/src/components/EditBasics.tsx (1)

230-233: LGTM! The modal visibility condition now correctly checks if the draft type is amending and isModalVisible is true.

@datadog-island-is
Copy link

datadog-island-is bot commented May 16, 2024

Datadog Report

All test runs 06b2b8d 🔗

34 Total Test Services: 0 Failed, 33 Passed
⬆️ Test Sessions change in coverage: 3 increased, 126 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 9.54s 1 no change Link
api 0 0 0 4 0 4.19s 1 no change Link
application-api-files 0 0 0 12 0 11.13s 1 no change Link
application-core 0 0 0 90 0 27.56s 1 no change Link
application-system-api 0 0 0 111 2 3m 8.31s 1 no change Link
application-template-api-modules 0 0 0 109 0 2m 29.39s 1 increased (+0.01%) Link
application-templates-accident-notification 0 0 0 95 0 43.26s 1 no change Link
application-templates-criminal-record 0 0 0 2 0 14.37s N/A Link
application-templates-driving-license 0 0 0 13 0 29.6s 1 no change Link
application-templates-example-payment 0 0 0 2 0 16.96s 1 no change Link

Copy link

codecov bot commented May 16, 2024

Codecov Report

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

Project coverage is 36.91%. Comparing base (aca4ec9) to head (cc4d061).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14823      +/-   ##
==========================================
- Coverage   36.91%   36.91%   -0.01%     
==========================================
  Files        6322     6322              
  Lines      128754   128755       +1     
  Branches    36736    36738       +2     
==========================================
  Hits        47535    47535              
- Misses      81219    81220       +1     
Flag Coverage Δ
air-discount-scheme-web 0.00% <ø> (ø)
api 3.48% <ø> (ø)
application-api-files 56.55% <ø> (ø)
application-core 71.46% <ø> (-0.35%) ⬇️
application-system-api 42.00% <ø> (ø)
application-templates-car-recycling 4.23% <ø> (ø)
application-templates-criminal-record 21.67% <ø> (ø)
application-templates-estate 11.74% <ø> (ø)
clients-charge-fjs-v2 22.58% <ø> (ø)
contentful-apps 6.24% <ø> (ø)

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

Files Coverage Δ
...in/regulations-admin/src/components/EditBasics.tsx 0.00% <0.00%> (ø)

... and 1 file 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 aca4ec9...cc4d061. Read the comment docs.

@kodiakhq kodiakhq bot merged commit f8d77f9 into main May 16, 2024
113 checks passed
@kodiakhq kodiakhq bot deleted the regulations-admin/modal-amending branch May 16, 2024 11:25
jonnigs pushed a commit that referenced this pull request May 17, 2024
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
jonnigs pushed a commit that referenced this pull request May 17, 2024
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Ballioli pushed a commit that referenced this pull request May 17, 2024
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
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