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: isRequired validation property for table select column #36375

Merged

Conversation

jacquesikot
Copy link
Contributor

@jacquesikot jacquesikot commented Sep 17, 2024

Description

Problem
The select column of the table widget does not have a validation property within its property pane to allow users add an isRequired validation to the table select column.

Solution
Added a Validation section to the table select column's property pane, which includes an isRequired toggle. When enabled, this feature will trigger a visual indication (error border colour) around the select widget if a required field is left unselected during "Add new row" or inline editing.

Fixes #30091

Automation

/ok-to-test tags="@tag.Widget, @tag.Table, @tag.Binding, @tag.Sanity, @tag.Select"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10957896180
Commit: d2597e6
Cypress dashboard.
Tags: @tag.Widget, @tag.Table, @tag.Binding, @tag.Sanity, @tag.Select
Spec:


Fri, 20 Sep 2024 12:23:29 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced end-to-end tests for Select column validation in Table widgets.
    • Enhanced validation logic to support Select column types in the Table widget.
    • Added visual feedback for required Select fields during row addition and inline editing.
    • Improved locator for single-select widget button control to enhance UI interaction.
  • Bug Fixes

    • Improved error handling and visual representation for invalid editable Select cells.
  • Documentation

    • Updated validation configuration to include Select column types for better usability.
  • Refactor

    • Enhanced code clarity for styled components related to Select fields.
    • Modified method to improve versatility in handling table interactions.

@jacquesikot jacquesikot added the Widgets & Accelerators Pod Issues related to widgets & Accelerators label Sep 17, 2024
@jacquesikot jacquesikot self-assigned this Sep 17, 2024
@github-actions github-actions bot added Enhancement New feature or request Table Inline Edit Issues related to inline editing Table Widget Widgets Product This label groups issues related to widgets labels Sep 17, 2024
Copy link
Contributor

coderabbitai bot commented Sep 17, 2024

Walkthrough

This pull request introduces enhancements to the Table widget's Select column type, focusing on validation features. It includes the addition of end-to-end tests to ensure required field validation, updates to styled components for clearer error handling, and modifications to the component logic to support editable cell validation. Furthermore, it expands the validation configuration to include the Select column type, improving the overall robustness and usability of the Table widget.

Changes

Files Change Summary
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Table_select_validation_spec.ts Added end-to-end tests for validating Select column behavior, including required field checks.
app/client/cypress/support/Pages/Table.ts Modified ClickOnEditIcon method to include isSelectColumn parameter for enhanced functionality.
app/client/src/widgets/SelectWidget/component/index.styled.tsx Restructured conditional logic for error styling in StyledSingleDropDown for better readability.
app/client/src/widgets/TableWidgetV2/component/cellComponents/SelectCell.tsx Introduced isEditableCellValid to manage editable cell validity and error states.
app/client/src/widgets/TableWidgetV2/widget/derived.js Added "select" to validatableColumns array to support validation for Select column types.
app/client/src/widgets/TableWidgetV2/widget/index.tsx Introduced isEditableCellValid property to enhance validation logic for editable cells.
app/client/src/widgets/TableWidgetV2/widget/propertyConfig/PanelConfig/Validation.ts Added ColumnTypes.SELECT to accepted column types for validation configuration.
app/client/src/widgets/TableWidgetV2/widget/propertyConfig/PanelConfig/Validations/Common.ts Updated visibility logic to include ColumnTypes.SELECT alongside ColumnTypes.DATE.
app/client/cypress/locators/commonlocators.json Added new locator for singleSelectWidgetButtonControl to enhance UI interaction capabilities.

Assessment against linked issues

Objective Addressed Explanation
Support validation section and required toggle for Select column type (30091)

Possibly related issues

Possibly related PRs

Suggested labels

Table Widget V2, Needs Triaging, Production, High

🎉 In the land of tables, a change takes flight,
Select columns now sparkle, with validation so bright!
Tests are in place, errors are clear,
A robust widget for all, bringing users cheer!
With each dropdown choice, confidence grows,
In this world of data, the best surely shows! 🌟


Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 17f9fbc and d2597e6.

Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Table_select_validation_spec.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Table_select_validation_spec.ts

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.

@github-actions github-actions bot added Bug Something isn't working and removed Enhancement New feature or request labels Sep 17, 2024
@jacquesikot jacquesikot added the ok-to-test Required label for CI label Sep 17, 2024
@github-actions github-actions bot added the Enhancement New feature or request label Sep 17, 2024
@github-actions github-actions bot removed the Enhancement New feature or request label Sep 17, 2024
@jacquesikot
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10903438831.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36375.
recreate: .

@github-actions github-actions bot added Enhancement New feature or request and removed Enhancement New feature or request labels Sep 17, 2024
@jacquesikot jacquesikot merged commit 8fe96c9 into release Sep 23, 2024
42 checks passed
@jacquesikot jacquesikot deleted the fix/validation-and-required-property-for-table-select-column branch September 23, 2024 07:44
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
…org#36375)

## Description

**Problem**
The select column of the table widget does not have a validation
property within its property pane to allow users add an isRequired
validation to the table select column.

**Solution**
Added a Validation section to the table select column's property pane,
which includes an isRequired toggle. When enabled, this feature will
trigger a visual indication (error border colour) around the select
widget if a required field is left unselected during "Add new row" or
inline editing.


Fixes appsmithorg#30091 

## Automation

/ok-to-test tags="@tag.Widget, @tag.Table, @tag.Binding, @tag.Sanity,
@tag.Select"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10957896180>
> Commit: d2597e6
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10957896180&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Widget, @tag.Table, @tag.Binding, @tag.Sanity,
@tag.Select`
> Spec:
> <hr>Fri, 20 Sep 2024 12:23:29 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced end-to-end tests for Select column validation in Table
widgets.
- Enhanced validation logic to support Select column types in the Table
widget.
- Added visual feedback for required Select fields during row addition
and inline editing.
- Improved locator for single-select widget button control to enhance UI
interaction.

- **Bug Fixes**
- Improved error handling and visual representation for invalid editable
Select cells.

- **Documentation**
- Updated validation configuration to include Select column types for
better usability.

- **Refactor**
	- Enhanced code clarity for styled components related to Select fields.
- Modified method to improve versatility in handling table interactions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Sai Charan <[email protected]>
Co-authored-by: Pawan Kumar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Enhancement New feature or request ok-to-test Required label for CI Table Inline Edit Issues related to inline editing Table Widget Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Support Validation Section and Required Toggle for Select Column Type
4 participants