PromucFlow_constructor/app/client/cypress/support/Constants.js
Keyur Paralkar 2ccd20e1e5
fix: column dragging and column reordering (#20928)
## Description

This PR implements the following changes:
- Move the drag events from the Parent component's useEffect to the
`HeaderCell` component.
- Refactored the code. Inside the table component, we refactored the
code such that when SSP is disabled the component uses `StaticTable` and
when SSP enabled then we use `VirtualTable`.
- It also includes the fix for the following issue. Whenever the user
has a scroll to the bottom of the page, on clicking of add new button it
is expected that the scroll should move to the top but it wasn't
happening.

> Add a TL;DR when description is extra long (helps content team)

Fixes #20858
> if no issue exists, please create an issue and ask the maintainers
about this first


## Type of change


- Bug fix (non-breaking change which fixes an issue)


## How Has This Been Tested?

- Manual
    - Test cases:
        - Column name should appear on update from the property pane
        - reorder whenever SSP is enabled
        - On column re-size
        - When a col is frozen
        - When a col is unfrozen
        - When all the headers or one of them is removed
        - When sorted also should work
        - Enable multi-row selection
        - When in preview mode and back and forth(Check the above cases)
        - When in Deployed mode
- Dragging of columns from the column header should work as expected
both in Deploy and Published mode.
- Cypress

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-03-05 19:49:44 +05:30

96 lines
2.4 KiB
JavaScript

export const modifierKey = Cypress.platform === "darwin" ? "meta" : "ctrl";
export const TABLE_COLUMN_ORDER_KEY = "tableWidgetColumnOrder";
export const TABLE_DATA = `{{[
{
"id": 2381224,
"email": "michael.lawson@reqres.in",
"userName": "Michael Lawson",
"productName": "Chicken Sandwich",
"orderAmount": 4.99
},
{
"id": 2736212,
"email": "lindsay.ferguson@reqres.in",
"userName": "Lindsay Ferguson",
"productName": "Tuna Salad",
"orderAmount": 9.99
},
{
"id": 6788734,
"email": "tobias.funke@reqres.in",
"userName": "Tobias Funke",
"productName": "Beef steak",
"orderAmount": 19.99
},
{
"id": 7434532,
"email": "byron.fields@reqres.in",
"userName": "Byron Fields",
"productName": "Chicken Sandwich",
"orderAmount": 4.99
},
{
"id": 7434532,
"email": "ryan.holmes@reqres.in",
"userName": "Ryan Holmes",
"productName": "Avocado Panini",
"orderAmount": 7.99
},
{
"id": 7434532,
"email": "byron.fields@reqres.in",
"userName": "Byron Fields",
"productName": "Chicken Sandwich",
"orderAmount": 4.99
},
{
"id": 7434532,
"email": "ryan.holmes@reqres.in",
"userName": "Ryan Holmes",
"productName": "Avocado Panini",
"orderAmount": 7.99
},
{
"id": 7434532,
"email": "byron.fields@reqres.in",
"userName": "Byron Fields",
"productName": "Chicken Sandwich",
"orderAmount": 4.99
},
{
"id": 7434532,
"email": "ryan.holmes@reqres.in",
"userName": "Ryan Holmes",
"productName": "Avocado Panini",
"orderAmount": 7.99
},
{
"id": 7434532,
"email": "byron.fields@reqres.in",
"userName": "Byron Fields",
"productName": "Chicken Sandwich",
"orderAmount": 4.99
},
{
"id": 7434532,
"email": "ryan.holmes@reqres.in",
"userName": "Ryan Holmes",
"productName": "Avocado Panini",
"orderAmount": 7.99
},
{
"id": 7434532,
"email": "byron.fields@reqres.in",
"userName": "Byron Fields",
"productName": "Chicken Sandwich",
"orderAmount": 4.99
},
{
"id": 7434532,
"email": "ryan.holmes@reqres.in",
"userName": "Ryan Holmes",
"productName": "Avocado Panini",
"orderAmount": 7.99
}
]}}`;