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

HLM 5902 #62

Merged
merged 5 commits into from
May 17, 2024
Merged

HLM 5902 #62

merged 5 commits into from
May 17, 2024

Conversation

Swathi-eGov
Copy link
Contributor

No description provided.

Copy link
Contributor

coderabbitai bot commented May 17, 2024

Walkthrough

The recent updates focus on enhancing dropdown and toast functionalities across multiple components and styles. Key improvements include CSS updates for dropdown checkboxes, toast messages, and added key navigation for dropdown options. Additionally, the Dropdown.js and MultiSelectDropdown.js components have been refined to handle different dropdown variants and key-based selection logic. The version numbers in the stylesheet URLs have also been updated to reflect these changes.

Changes

File Path Change Summary
react/css/README.md Updated dropdown checkbox CSS, added spacers, and updated toast info CSS in versions 1.8.2-coreui.11 to 1.8.2-coreui.14.
react/css/src/.../multiSelectDropdownV2.scss Changed border width from a theme variable to a fixed value.
react/example/public/index.html Updated CSS stylesheet version number from 1.8.2-coreui.13 to 1.8.2-coreui.14.
react/ui-components/README.md Updated multiselectdropdown functionality and added key navigation for dropdown options in version 0.0.1-beta.20.
react/ui-components/src/atoms/Dropdown.js Enhanced selectOption function to handle different dropdown variants and adjusted option lengths.
react/ui-components/src/atoms/ErrorBoundary.js Changed Toast import from @egovernments/digit-ui-components to a local import "./Toast".
react/ui-components/src/atoms/MultiSelectDropdown.js Added dependency in useEffect, modified handleOutsideClickAndSubmitSimultaneously, and introduced selectOptionThroughKeys function.

🐇
In the dropdown's gentle sway,
New options light the way.
Toasts now sing a brighter tune,
As spacers give them room.
Key navigation's here to stay,
Making choices clear as day.
🌟


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: 2

Out of diff range and nitpick comments (6)
react/ui-components/README.md (3)

Line range hint 42-42: Add a blank line above the "Changelog" heading for better readability.

+ 
# Changelog

Line range hint 57-57: Remove extra blank lines to maintain consistent formatting.

- 

Also applies to: 100-100


Line range hint 84-84: Replace bare URLs with markdown links for better readability and accessibility.

- Digit Core Repo (https://github.com/egovernments/Core-Platform/tree/digit-ui-core)
+ Digit Core Repo [here](https://github.com/egovernments/Core-Platform/tree/digit-ui-core).

Also applies to: 92-92

react/css/README.md (3)

Line range hint 85-85: Remove duplicate phrase "Digit Core" for clarity.

- ## Published from DIGIT Core Digit Core Repo
+ ## Published from DIGIT Core Repo

Line range hint 86-86: Replace bare URL with markdown link for better readability and accessibility.

- Digit Core Repo (https://github.com/egovernments/Digit-Core/tree/digit-ui-core)
+ Digit Core Repo [here](https://github.com/egovernments/Digit-Core/tree/digit-ui-core).

Line range hint 90-90: Ensure the file ends with a single newline character.

+
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between bf3538c and fea8bd6.
Files ignored due to path filters (9)
  • react/css/package.json is excluded by !**/*.json
  • react/example/package.json is excluded by !**/*.json
  • react/modules/Project/package.json is excluded by !**/*.json
  • react/modules/core/package.json is excluded by !**/*.json
  • react/modules/sample/package.json is excluded by !**/*.json
  • react/package.json is excluded by !**/*.json
  • react/ui-components/package.json is excluded by !**/*.json
  • react/ui-components/yarn-error.log is excluded by !**/*.log, !**/*.log
  • react/yarn-error.log is excluded by !**/*.log, !**/*.log
Files selected for processing (7)
  • react/css/README.md (1 hunks)
  • react/css/src/digitv2/components/multiSelectDropdownV2.scss (1 hunks)
  • react/example/public/index.html (1 hunks)
  • react/ui-components/README.md (1 hunks)
  • react/ui-components/src/atoms/Dropdown.js (2 hunks)
  • react/ui-components/src/atoms/ErrorBoundary.js (1 hunks)
  • react/ui-components/src/atoms/MultiSelectDropdown.js (8 hunks)
Files skipped from review due to trivial changes (3)
  • react/css/src/digitv2/components/multiSelectDropdownV2.scss
  • react/example/public/index.html
  • react/ui-components/src/atoms/ErrorBoundary.js
Additional comments not posted (7)
react/ui-components/README.md (1)

61-61: Update in changelog reflects the new features added to the multiselectdropdown component.

react/css/README.md (1)

45-45: Update in changelog reflects the new CSS changes for dropdown components.

react/ui-components/src/atoms/Dropdown.js (1)

193-199: The updated selectOption function correctly handles different dropdown variants based on the props.variant. Ensure this functionality is covered by unit tests.

react/ui-components/src/atoms/MultiSelectDropdown.js (4)

27-27: Added categorySelectAllLabel prop to handle labels for category select all functionality. Ensure this prop is properly documented and used consistently across the component.


127-127: The useEffect hook now handles category selection state based on the options and selected state. Verify that this logic correctly updates the state in all scenarios.


251-259: The handleCategorySelection function now dispatches actions to update the selected state based on category options. This is a critical functionality; ensure it is covered by comprehensive unit tests.


Line range hint 309-328: The keyChange function handles navigation through options using keyboard arrows. This function is crucial for user experience; verify its behavior in different scenarios.

@@ -42,6 +42,7 @@ frontend/micro-ui/web/public/index.html
# Changelog
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a blank line above the "Changelog" heading for better readability.

+ 
# Changelog

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
# Changelog
# Changelog

Comment on lines +288 to +304
const selectOptionThroughKeys = (e, option) => {
let checked = alreadyQueuedSelectedState.find(
(selectedOption) => selectedOption.code === option.code
)
? true
: false;
if (!checked) {
dispatch({
type: "ADD_TO_SELECTED_EVENT_QUEUE",
payload: [null, option],
});
} else {
dispatch({
type: "REMOVE_FROM_SELECTED_EVENT_QUEUE",
payload: [null, option],
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Verify the coverage of selectOptionThroughKeys function

The search did not yield any test files that explicitly cover the selectOptionThroughKeys function or keyboard interactions for the MultiSelectDropdown component. This suggests that the function might not be adequately tested for keyboard interactions.

  • Action Required: Ensure that the selectOptionThroughKeys function is thoroughly tested for keyboard interactions. This is crucial for accessibility.

Suggested Steps:

  1. Add Unit Tests: Create unit tests specifically for the selectOptionThroughKeys function to cover various keyboard interactions.
  2. Integration Tests: Ensure that the MultiSelectDropdown component is tested in scenarios involving keyboard navigation and selection.
Analysis chain

The selectOptionThroughKeys function allows selection through keyboard interactions. This is a key accessibility feature; ensure it is tested thoroughly.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify unit tests cover the selectOptionThroughKeys functionality.

# Test: Search for unit tests related to keyboard interactions. Expect: Tests covering key interactions.
rg --type javascript $'describe("keyboard interactions",'

Length of output: 151



Script:

#!/bin/bash
# Description: Verify unit tests cover the selectOptionThroughKeys functionality.

# Test: Search for unit tests related to keyboard interactions. Expect: Tests covering key interactions.
rg --type javascript 'describe\("keyboard interactions"'

Length of output: 93



Script:

#!/bin/bash
# Description: Verify unit tests cover the selectOptionThroughKeys functionality.

# Test: Search for unit tests related to keyboard interactions. Expect: Tests covering key interactions.
rg --type js 'describe\("keyboard interactions"'

Length of output: 50



Script:

#!/bin/bash
# Description: Verify unit tests cover the selectOptionThroughKeys functionality.

# Test: Search for unit tests that directly reference the selectOptionThroughKeys function.
rg --type js 'selectOptionThroughKeys'

Length of output: 258



Script:

#!/bin/bash
# Description: Verify unit tests cover the MultiSelectDropdown component.

# Test: Search for unit tests that reference the MultiSelectDropdown component.
rg --type js 'MultiSelectDropdown'

Length of output: 4245



Script:

#!/bin/bash
# Description: Verify if story files cover keyboard interactions for the MultiSelectDropdown component.

# Test: Search for keyboard interaction tests in story files.
rg --type js 'keyboard' react/ui-components/src/atoms/stories/MultiSelectDropdown.stories.js

Length of output: 92



Script:

#!/bin/bash
# Description: Verify if test files cover the MultiSelectDropdown component.

# Test: Search for test files that reference the MultiSelectDropdown component.
rg --type js 'MultiSelectDropdown' --files-with-matches | xargs rg 'test'

Length of output: 71



Script:

#!/bin/bash
# Description: Verify if there are any test files in the repository.

# Test: Search for test files in the repository.
fd --type f --extension js --exec rg 'test'

Length of output: 6421

@jagankumar-egov jagankumar-egov merged commit a885237 into develop May 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants