PromucFlow_constructor/app/client/cypress/support
Jacques Ikot 6f27959bce
fix: Invalid Date Display in Table Widget's Date Column When Using Unix Timestamp (ms) (#36455)
## Description

**Problem**
When populating a table widget with data that includes dates in Unix
timestamp (milliseconds) format, setting the column type to "Date," the
input format to "Unix timestamp (ms)," and selecting a display format
leads to an issue during inline editing. While the date picker behaves
correctly, selecting a new date results in the table cell showing an
"Invalid Date" error.

**Root Cause**
The platform currently uses DateInputFormat.MILLISECONDS for Unix
timestamp (ms) formatting. However, this value is not a valid option for
the moment.format() function, which expects the input format to be 'x'
for Unix timestamps in milliseconds. This mismatch leads to the "Invalid
Date" error.

**Solution**
Modify the logic to map DateInputFormat.MILLISECONDS to the correct
moment format string 'x'.
Adjust the table's transformDataPureFn to correctly process and display
dates in Unix timestamp (ms) format after inline edits, ensuring the
moment library can handle the input properly.

**Outcome**
This fix ensures that when a user selects a date via the date picker in
inline editing mode, the selected date is displayed correctly in the
table without any errors.


Fixes #35631, #25081

## Automation

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

### 🔍 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/11101758400>
> Commit: 6a3cae774f3824bd2ee126b501bfa4b6d71ae0c8
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11101758400&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity, @tag.Binding, @tag.Table, @tag.Datepicker`
> Spec:
> <hr>Mon, 30 Sep 2024 08:54:58 UTC
<!-- end of auto-generated comment: Cypress test results  -->


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


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

## Summary by CodeRabbit

- **New Features**
- Enhanced date column editing in table widgets to accept Unix
timestamps in milliseconds without errors.
	- Introduced a new enumeration for improved date formatting options.
- Added mock data structures for testing various date formats and
transformations in the table widget.
- New method for generating formatted date strings for tomorrow in both
verbose and ISO formats.

- **Bug Fixes**
- Improved validation logic for date inputs in the table, ensuring
proper handling of different date formats.

- **Tests**
- Added new test cases to validate date handling and input formats in
the table widget.
- Introduced a new test suite for transforming table data based on
specified column metadata.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-30 10:02:42 +01:00
..
ee chore: code splitting for multiple env feature (#25479) 2023-07-21 12:53:17 +07:00
Objects test: fix canvas context property pane (#36356) 2024-09-18 17:31:40 +05:30
Pages fix: Invalid Date Display in Table Widget's Date Column When Using Unix Timestamp (ms) (#36455) 2024-09-30 10:02:42 +01:00
AdminSettingsCommands.js chore: Make edit launch buttons as links & add upgrade ramps for session timeout setting (#31862) 2024-03-21 15:37:13 +05:30
ApiCommands.js test:replace assertPageSave with AssertAutoSave (#33972) 2024-06-06 13:11:03 +05:30
commands.js chore: change snapshot package (#35867) 2024-09-12 11:09:42 +03:00
Constants.js chore: Anvil cypress tests (#30580) 2024-01-31 11:02:38 +05:30
dataSourceCommands.js test: updated dataSourceCommands file (#33628) 2024-05-28 14:43:26 +05:30
e2e.js chore: change snapshot package (#35867) 2024-09-12 11:09:42 +03:00
gitSync.js test: updated js methods to refer ts locators for Git Tests (#34577) 2024-06-28 16:34:07 +05:30
index.d.ts chore: add latestDeployPreview command to index.d.ts file in cypress suite (#35837) 2024-08-22 13:58:29 +05:30
queryCommands.js test: updated queryCommands file (#33629) 2024-05-27 23:10:06 +05:30
RapidMode.ts fix: Fix default selected row on a page change when primary key is selected in a table and is unavailable in new data (#23863) 2023-06-23 10:27:48 +05:30
themeCommands.js test: updated themeCommands (#33632) 2024-05-27 23:10:20 +05:30
timeout.js fix: Text getting clipped for Italic font in Table Widget V1 (#15549) 2022-08-16 11:12:31 +05:30
widgetCommands.js feat: Remove editable checkbox from PrimaryColumnsControlV2 and update imports (#34586) 2024-07-12 15:29:01 +05:30
WorkspaceCommands.js test: updated workspace commands (#33630) 2024-05-27 23:10:42 +05:30