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): affected date selection, remove propose from reg user topbar #16440

Merged
merged 6 commits into from
Oct 29, 2024

Conversation

thordurhhh
Copy link
Member

@thordurhhh thordurhhh commented Oct 16, 2024

What

Change affected date selection, remove propose from reg user topbar

Why

  • Affected date has no restrictions, but will show warning when user is selecting something out of the ordinary.
  • Proposal to review should not be available in top bar.

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

    • Improved date selection logic in the EditMeta component for a more straightforward effective date input.
    • Removed the propose button from the SaveDeleteButtons component, streamlining the user interface.
  • Bug Fixes

    • Ensured default dates are set correctly in the EditMeta component when not defined.

@thordurhhh thordurhhh requested a review from a team as a code owner October 16, 2024 21:31
Copy link
Contributor

coderabbitai bot commented Oct 16, 2024

Walkthrough

The changes in this pull request involve modifications to the EditMeta and SaveDeleteButtons components. In EditMeta, the date selection logic for the effective date has been simplified by removing the minDate property and directly using draft.effectiveDate.value. In SaveDeleteButtons, the conditional rendering for the propose button has been commented out, effectively removing it from the output. The overall structure and functionality of both components remain intact.

Changes

File Path Change Summary
libs/portals/admin/regulations-admin/src/components/EditMeta.tsx Simplified date selection logic by removing minDate and directly using draft.effectiveDate.value.
libs/portals/admin/regulations-admin/src/components/SaveDeleteButtons.tsx Commented out the conditional rendering for the propose button, removing it from the output.

Possibly related PRs

Suggested labels

automerge, high priority

Suggested reviewers

  • thorkellmani
  • disaerna

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.

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

🧹 Outside diff range and nitpick comments (1)
libs/portals/admin/regulations-admin/src/components/SaveDeleteButtons.tsx (1)

Line range hint 45-58: Consider removing commented-out code and updating component interface

The removal of the 'propose' button aligns with the PR objective. However, there are a few points to consider:

  1. Instead of commenting out the code, it's generally better to remove it entirely. If needed, the code can be retrieved from version control history.
  2. The propose prop is still part of the component's interface (SaveDeleteButtonsProps) but is no longer used. Consider removing it to keep the interface clean and up-to-date.
  3. Check for any unused imports that may have been related to the 'propose' functionality and remove them if found.

These changes will improve code cleanliness and maintainability while still adhering to the coding guidelines for reusability and effective tree-shaking.

Here's a suggested refactor:

  1. Remove the commented-out code entirely.
  2. Update the SaveDeleteButtonsProps type to remove the propose property.
  3. Remove any unused imports related to the 'propose' functionality.

Would you like me to provide a code snippet for these changes?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 61171c2 and b6ac2d6.

📒 Files selected for processing (2)
  • libs/portals/admin/regulations-admin/src/components/EditMeta.tsx (1 hunks)
  • libs/portals/admin/regulations-admin/src/components/SaveDeleteButtons.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
libs/portals/admin/regulations-admin/src/components/EditMeta.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/portals/admin/regulations-admin/src/components/SaveDeleteButtons.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 (1)
libs/portals/admin/regulations-admin/src/components/EditMeta.tsx (1)

122-122: Verify the implications of unrestricted date selection

The change aligns with the PR objective of allowing unrestricted date selection for the effective date. However, consider the following points:

  1. Removing the minDate restriction and the getNextWorkday function allows for more flexible date selection, which is the intended behavior.
  2. This flexibility might lead to users selecting unusual or potentially problematic dates.

To ensure this change doesn't introduce unexpected behavior, please verify:

  1. The warning mechanism mentioned in the PR objectives is implemented correctly.
  2. There are no other parts of the application that rely on the effective date being a workday or after a certain date.

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

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

Project coverage is 36.64%. Comparing base (3a35311) to head (78506dd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...portals/admin/regulations-admin/src/utils/index.ts 0.00% 22 Missing ⚠️
...ations-admin/src/components/EditReviewOverview.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16440      +/-   ##
==========================================
- Coverage   36.78%   36.64%   -0.14%     
==========================================
  Files        6858     6814      -44     
  Lines      142408   141072    -1336     
  Branches    40618    40222     -396     
==========================================
- Hits        52378    51691     -687     
+ Misses      90030    89381     -649     
Flag Coverage Δ
nest-aws ?
nest-core ?
portals-admin-regulations-admin 1.84% <0.00%> (-0.02%) ⬇️
web 1.79% <ø> (ø)

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

Files with missing lines Coverage Δ
...dmin/regulations-admin/src/components/EditMeta.tsx 0.00% <ø> (ø)
...lations-admin/src/components/SaveDeleteButtons.tsx 0.00% <ø> (ø)
...ortals/admin/regulations-admin/src/lib/messages.ts 0.00% <ø> (ø)
...ations-admin/src/components/EditReviewOverview.tsx 0.00% <0.00%> (ø)
...portals/admin/regulations-admin/src/utils/index.ts 0.00% <0.00%> (ø)

... and 394 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 3a35311...78506dd. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Oct 16, 2024

Datadog Report

All test runs fc769e8 🔗

2 Total Test Services: 0 Failed, 2 Passed
➡️ Test Sessions change in coverage: 3 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
portals-admin-regulations-admin 0 0 0 24 0 16.11s 1 no change Link
web 0 0 0 84 0 33.14s 1 no change Link

@thordurhhh thordurhhh added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Oct 28, 2024
Copy link
Member

@thorkellmani thorkellmani left a comment

Choose a reason for hiding this comment

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

LGTM

@thorkellmani thorkellmani removed the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Oct 29, 2024
@thordurhhh thordurhhh added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Oct 29, 2024
@kodiakhq kodiakhq bot merged commit d3b3f0c into main Oct 29, 2024
33 checks passed
@kodiakhq kodiakhq bot deleted the regulations-admin/date-affected-anytime branch October 29, 2024 09:08
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.

2 participants