appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

fix:Unpredictable movements of the dates in the date picker included

Open somangshu opened this issue 1 year ago β€’ 7 comments

…in the table widget; are decreased by 1 day #25081

Description

[!TIP]
Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

Fixes #25081
or
Fixes https://github.com/appsmithorg/appsmith/issues/25081

[!WARNING]
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.Table"

:mag: Cypress test results

[!TIP] 🟒 🟒 🟒 All cypress tests have passed! πŸŽ‰ πŸŽ‰ πŸŽ‰ Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10738431328 Commit: 73bbacc535844a362475cf43d5e42685a3b21504 Cypress dashboard. Tags: @tag.Table Spec:


Fri, 06 Sep 2024 13:15:17 UTC

Communication

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

  • [ ] Yes
  • [ ] No

SCREENSHOTS: Screenshot from 2024-05-31 17-52-19

Video:Fixing the issue

Summary by CodeRabbit

  • New Features

    • Introduced new test logic for Table Widget V2 to handle adding new rows and editing date columns.
    • Added new test suites to validate the functionality of the Date column in Table Widget V2, ensuring robust interaction and correct date formatting.
  • Bug Fixes

    • Improved date handling in Table Widget V2 to ensure proper formatting and consistency when new rows are added.

somangshu avatar Jun 18 '24 17:06 somangshu

Walkthrough

These changes enhance the testing framework for the Table Widget V2, specifically focusing on the addition of new rows and editing date columns. The modifications improve interactions with date pickers and ensure data consistency. Additionally, the DateCell.tsx file has been optimized for better management of the formattedDate assignment during the processing of new rows.

Changes

Files Summary
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/AddNewRowEditColumn_spec.ts Introduced test logic for Table Widget V2 to add new rows and edit date columns, including setup, property toggling, editing columns, and data verification.
app/client/src/widgets/TableWidgetV2/component/cellComponents/DateCell.tsx Refactored the onDateSelected function to initialize formattedDate early and updated calls to updateNewRowValues to ensure correct date formatting.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/DateColumnAddNewRow_EditRow_spec.ts Added a test suite to validate the Date column functionality, including adding new rows, editing date values, and verifying correct date display.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/DateColumn_ISOFormat_AddNewRow_EditRow_spec.ts Introduced a test suite focused on validating the Date column's ISO format during new row addition and editing, ensuring correct date handling.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TableWidget
    participant AddRowTest
    participant DateCell

    User->>+TableWidget: Initiate adding new row
    TableWidget->>AddRowTest: Setup before tests
    AddRowTest->>TableWidget: Toggle properties and edit column
    User->>+TableWidget: Enter values and interact with date picker
    TableWidget->>+DateCell: onDateSelected(date)
    DateCell->>DateCell: Initialize formattedDate
    DateCell->>TableWidget: updateNewRowValues with formattedDate
    TableWidget->>User: Display updated table with new row and formatted dates
    User->>+AddRowTest: Verify data consistency
    AddRowTest->>User: Confirm test passed

Possibly related issues

  • appsmithorg/appsmith#35146: The changes in this PR may help address the flakiness in the mysql_spec.ts tests by enhancing the stability of date handling in the Table Widget V2.

Poem

In the realm of widgets, where dates take flight,
New rows are added, and all feels right.
With tests that dance and data that gleams,
A coder's delight, fulfilling their dreams.
Each click and toggle, a symphony plays,
In the world of code, we celebrate the ways!


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.

coderabbitai[bot] avatar Jun 18 '24 17:06 coderabbitai[bot]

@somangshu this is new spec , we need to check for flakiness as well. we need to run this spec on EE at least 10 times to make sure there is no flakiness once it passes on CE. One can do this with adding new spec file path to "limited-test.txt" file and running with /ci-test-limit

ApekshaBhosale avatar Jun 19 '24 16:06 ApekshaBhosale

@ApekshaBhosale that seems really cumbersome.

somangshu avatar Jun 20 '24 06:06 somangshu

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

github-actions[bot] avatar Jun 27 '24 16:06 github-actions[bot]

/build-deploy-preview skip-tests=true

jacquesikot avatar Aug 23 '24 10:08 jacquesikot

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

github-actions[bot] avatar Aug 23 '24 10:08 github-actions[bot]

Deploy-Preview-URL: https://ce-34314.dp.appsmith.com

github-actions[bot] avatar Aug 23 '24 10:08 github-actions[bot]

@somangshu Test are failing and can you please share me contributor PR in desc or here?

sagar-qa007 avatar Sep 16 '24 05:09 sagar-qa007

not sure. @rahulbarwal has been managing this, probably he knows. Otherwise, the branch name is Issue-25081-fix/Unpredictable-movements-of-the-dates-in-the-date-picker-included-in-the-table-widget-are-decreased-by-1-day

This should allow you to search the PR

somangshu avatar Sep 16 '24 06:09 somangshu

@sagar-qa007 we have taken the ownership of this PR. I'll be taking care of the failing specs.

rahulbarwal avatar Sep 16 '24 10:09 rahulbarwal

This issue is addressed in this PR - #36455

jacquesikot avatar Sep 24 '24 07:09 jacquesikot