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

Updated numeric type to disable input and use only buttons and made date and time fields clickable #67

Merged
merged 2 commits into from
May 21, 2024

Conversation

Swathi-eGov
Copy link
Contributor

No description provided.

Copy link
Contributor

coderabbitai bot commented May 21, 2024

Walkthrough

The recent updates across the React project focus on enhancing the user experience by modifying numeric input fields to use buttons instead of direct input, and improving the interaction with date and time fields. Additionally, new configuration options and CSS styles have been introduced to support these changes, alongside updates to storybook examples to reflect the new functionalities.

Changes

File Path Change Summary
react/css/README.md Updated to describe the change in numeric input behavior to use buttons only in version 1.8.2-coreui.16.
react/css/src/digitv2/components/... Added .numeric-buttons-only style to disable pointer events and change cursor for numeric inputs.
react/example/public/index.html Updated CSS file link to version 1.8.2-coreui.16.
react/modules/sample/src/configs/... Introduced a new configuration object disableTextField with various properties.
react/ui-components/README.md Documented the changes in numeric input and clickable date/time fields in version 0.0.1-beta.24.
react/ui-components/src/atoms/TextInput.js Removed openPicker function and updated onClick event handler to directly handle date/time picker opening.
react/ui-components/src/hoc/stories/... Added disableTextField: false to commonArgs in InputFields.stories.js.

🐇
Buttons for numbers, dates that click,
Configs and styles, all so slick.
Inputs now with ease do flow,
A rabbit's joy in code does show.
Cheers to updates, neat and bright,
Code improvements, pure delight!
🌸


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

Outside diff range and nitpick comments (3)
react/css/README.md (1)

Line range hint 41-92: Correct formatting issues for better readability and adherence to markdown best practices.

- ## Published from DIGIT Core 
- Digit Core Repo (https://github.com/egovernments/Digit-Core/tree/digit-ui-core)
+ ## Published from DIGIT Core
+ 
+ Digit Core Repo (https://github.com/egovernments/Digit-Core/tree/digit-ui-core)
+ 
react/ui-components/README.md (1)

Line range hint 42-116: Correct formatting issues for better readability and adherence to markdown best practices.

- # Local Development
- Use Node 14 version 
+ # Local Development
+ 
+ Use Node 14 version
+ 
react/ui-components/src/atoms/TextInput.js (1)

Line range hint 295-395: The update to directly open the date or time picker aligns with the PR objectives. Consider improving error handling by providing user feedback or logging more details.

- console.error("Error opening picker:", error);
+ console.error("Error opening picker. Details:", error.message);
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8c9ff1c and 2cd32c1.
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/textInputV2.scss (1 hunks)
  • react/example/public/index.html (1 hunks)
  • react/modules/sample/src/configs/SampleConfig.js (1 hunks)
  • react/ui-components/README.md (1 hunks)
  • react/ui-components/src/atoms/TextInput.js (4 hunks)
  • react/ui-components/src/hoc/stories/InputFields.stories.js (1 hunks)
Files skipped from review due to trivial changes (3)
  • react/css/src/digitv2/components/textInputV2.scss
  • react/example/public/index.html
  • react/ui-components/src/hoc/stories/InputFields.stories.js
Additional Context Used
LanguageTool (2)
react/css/README.md (1)

Near line 87: This phrase is duplicated. You should probably use “DIGIT Core” only once.
Context: ...ishnakole-wtt-egov] ## Published from DIGIT Core Digit Core Repo (https://github.com/egovernments/D...

react/ui-components/README.md (1)

Near line 18: A comma might be missing here.
Context: ...ssion's ``` ## Usage After adding the dependency make sure you have this dependency in ...

Additional comments not posted (3)
react/css/README.md (1)

45-45: Changelog update is accurate and aligns with the PR objectives.

react/ui-components/README.md (1)

61-61: Changelog update is accurate and aligns with the PR objectives.

react/modules/sample/src/configs/SampleConfig.js (1)

448-454: The new configuration for disabling text fields in numeric inputs looks well-integrated and follows the existing configuration structure.

Verification successful

The disableTextField configuration is referenced in the following files:

  • react/ui-components/src/hoc/stories/InputFields.stories.js
  • react/ui-components/src/atoms/TextInput.js
  • react/modules/sample/src/configs/SampleConfig.js

To ensure the correct implementation and functionality, let's review the specific lines in InputFields.stories.js and TextInput.js.


The disableTextField configuration is correctly referenced and utilized in the following files:

  • react/ui-components/src/hoc/stories/InputFields.stories.js: Used in a storybook configuration.
  • react/ui-components/src/atoms/TextInput.js: Used to conditionally apply the numeric-buttons-only class, affecting the UI rendering.

These references confirm that the disableTextField configuration is integrated and functioning as intended.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the new configuration `disableTextField` is being utilized in the UI components.

# Test: Search for the usage of `disableTextField` in the project. Expect: References in component files.
rg --type js 'disableTextField'

Length of output: 506



Script:

#!/bin/bash
# Display the specific lines where `disableTextField` is referenced in `InputFields.stories.js` and `TextInput.js`.

# Extract lines from `InputFields.stories.js`
rg --type js --context 5 'disableTextField' react/ui-components/src/hoc/stories/InputFields.stories.js

# Extract lines from `TextInput.js`
rg --type js --context 5 'disableTextField' react/ui-components/src/atoms/TextInput.js

Length of output: 991

@jagankumar-egov jagankumar-egov merged commit 9ae4007 into develop May 21, 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