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

[WEB-2443] fix: issue properties dropdown #5592

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Sep 12, 2024

Changes:

This PR resolves the issue with the properties dropdown, where users were still able to access it even when it was disabled.

Reference:

[WEB-2443]

Summary by CodeRabbit

  • New Features
    • Introduced a disabled property across various dropdown components (Cycle, Date Range, Date, Estimate, Member, Module, Priority, Project, State, and Issue Property Labels) to enhance user interaction control.
    • Buttons within these dropdowns can now be conditionally disabled, improving user experience by preventing actions when the dropdown is not usable.

Copy link
Contributor

coderabbitai bot commented Sep 12, 2024

Walkthrough

The pull request introduces a disabled property to multiple dropdown components within the application. This property is applied to various button elements across different components, allowing them to be conditionally rendered in a non-interactive state. The changes enhance user control over dropdown interactions by preventing actions when the dropdowns are not usable.

Changes

Files Change Summary
web/core/components/dropdowns/cycle/index.tsx Added disabled prop to CycleDropdown buttons.
web/core/components/dropdowns/date-range.tsx Added disabled prop to DateRangeDropdown button.
web/core/components/dropdowns/date.tsx Added disabled prop to DateDropdown.
web/core/components/dropdowns/estimate.tsx Added disabled prop to two buttons in EstimateDropdown.
web/core/components/dropdowns/member/index.tsx Added disabled prop to buttons in MemberDropdown.
web/core/components/dropdowns/module/index.tsx Added disabled prop to buttons in ModuleDropdown.
web/core/components/dropdowns/priority.tsx Added disabled prop to buttons in PriorityDropdown.
web/core/components/dropdowns/project.tsx Added disabled prop to buttons in ProjectDropdown.
web/core/components/dropdowns/state.tsx Added disabled prop to buttons in StateDropdown.
web/core/components/issues/issue-layouts/properties/labels.tsx Added disabled prop to button in IssuePropertyLabels.

Possibly related PRs

Poem

🐇 In a world of dropdowns, oh so bright,
A disabled prop brings new delight.
Buttons now pause, when they should not play,
Enhancing the flow, in a user-friendly way.
Hooray for the changes, let’s hop with glee,
For dropdowns that listen, just like you and me! 🌟


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 33dd5fe and 26034e4.

Files selected for processing (10)
  • web/core/components/dropdowns/cycle/index.tsx (2 hunks)
  • web/core/components/dropdowns/date-range.tsx (1 hunks)
  • web/core/components/dropdowns/date.tsx (1 hunks)
  • web/core/components/dropdowns/estimate.tsx (2 hunks)
  • web/core/components/dropdowns/member/index.tsx (2 hunks)
  • web/core/components/dropdowns/module/index.tsx (2 hunks)
  • web/core/components/dropdowns/priority.tsx (2 hunks)
  • web/core/components/dropdowns/project.tsx (2 hunks)
  • web/core/components/dropdowns/state.tsx (2 hunks)
  • web/core/components/issues/issue-layouts/properties/labels.tsx (1 hunks)
Additional comments not posted (18)
web/core/components/dropdowns/cycle/index.tsx (2)

87-87: LGTM!

The addition of the disabled attribute to the button element is correct and consistent with the PR objective. It will prevent the button from being interactive when the disabled prop is true.


104-104: LGTM!

Similar to the previous button, the addition of the disabled attribute here is correct and consistent with the PR objective. It will prevent the button from being interactive when the disabled prop is true.

web/core/components/dropdowns/member/index.tsx (2)

109-109: LGTM!

The addition of the disabled prop to the button element is a good enhancement. It allows the button to be conditionally disabled based on the component's state, improving the usability by providing visual feedback and preventing user actions when the dropdown is not usable. This change aligns with the PR objective and the AI-generated summary.


126-126: LGTM!

Similar to the previous code segment, the addition of the disabled prop to this button element is a good enhancement. It allows the button to be conditionally disabled based on the component's state, improving the usability by providing visual feedback and preventing user actions when the dropdown is not usable. This change aligns with the PR objective and the AI-generated summary, and maintains consistency with the previous code segment.

web/core/components/dropdowns/date.tsx (1)

118-118: LGTM!

The addition of the disabled property to the button element is implemented correctly. It aligns with the component's expected behavior and enhances the functionality by providing a way to prevent user interaction when the dropdown is in a disabled state.

web/core/components/dropdowns/date-range.tsx (2)

149-149: LGTM!

The disabled prop is correctly added to the button element, which aligns with the PR objective to conditionally disable the dropdown button. The default value of false ensures that the button is enabled by default, which is a sensible choice.


Line range hint 28-28: LGTM!

The disabled prop is correctly added to the Props type with an optional boolean type and a default value of false. This change is necessary to support the new functionality of conditionally disabling the dropdown button and is consistent with the usage of the disabled prop in the component.

web/core/components/dropdowns/project.tsx (2)

127-127: LGTM!

The addition of the disabled prop to the button element is correct and consistent with the PR objective. It allows the button to be conditionally rendered in a non-interactive state based on the disabled prop value.


144-144: LGTM!

The addition of the disabled prop to the button element is correct and consistent with the PR objective. It allows the button to be conditionally rendered in a non-interactive state based on the disabled prop value. The button's class name is also conditionally set based on the disabled prop value to apply the appropriate cursor style.

web/core/components/dropdowns/state.tsx (2)

138-138: LGTM!

The addition of the disabled prop to the button element correctly propagates the component's disabled state, allowing the button to be conditionally disabled. This aligns with the PR objective.


155-155: Looks good!

The disabled prop is correctly added to the default dropdown button, allowing it to be conditionally disabled based on the component's disabled state. This change is consistent with the PR objective and the previous button implementation.

web/core/components/dropdowns/module/index.tsx (2)

237-237: LGTM!

The addition of the disabled prop to the button element is a good fix for the issue described in the PR. It allows the button to be conditionally disabled based on the disabled prop passed to the ModuleDropdown component, preventing user interaction when the dropdown is in a disabled state.


254-254: Looks good!

Adding the disabled prop to this button element as well ensures consistent behavior across the ModuleDropdown component. Both button instances will now respect the disabled state, preventing user interaction when the dropdown is disabled. This change improves the component's robustness and aligns with the PR objective.

web/core/components/dropdowns/estimate.tsx (2)

157-157: LGTM!

The addition of the disabled prop to the button element allows the dropdown to be conditionally disabled based on the disabled prop passed to the EstimateDropdown component. This change aligns with the PR objective of preventing access to the dropdown when it is intended to be disabled.


174-174: LGTM!

The addition of the disabled prop to the button element that uses the DropdownButton component allows the dropdown to be conditionally disabled based on the disabled prop passed to the EstimateDropdown component. This change aligns with the PR objective of preventing access to the dropdown when it is intended to be disabled. It's good to see the disabled prop being applied consistently to both button rendering scenarios (custom button and default DropdownButton).

web/core/components/issues/issue-layouts/properties/labels.tsx (1)

244-244: LGTM!

The addition of the disabled prop to the button element is correctly implemented and aligns with the component's functionality. This change improves the user experience by visually indicating the button's state and preventing user interactions when the button is disabled.

web/core/components/dropdowns/priority.tsx (2)

382-382: LGTM!

The addition of the disabled prop correctly disables the button when a custom button is provided. This change aligns with the PR objective of preventing access to the dropdown when it is intended to be disabled.


399-399: LGTM!

The addition of the disabled prop correctly disables the default button when a custom button is not provided. This change aligns with the PR objective of preventing access to the dropdown when it is intended to be disabled.


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 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.

CodeRabbit Configuration 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants