PromucFlow_constructor/app/client/cypress/fixtures/displayWidgetDsl.json
Hetu Nandu aa9b19c995
refactor: Widget Selection (#19643)
## Description

This change is a refactor of widget selection logic. It consolidates all
the business logic to make it easy to maintain. It also improves the
performance a bit.

It touched a lot of features as we heavily rely on this 

```
Select one
Select multiple with drag
Select multiple with shift
Select multiple with cmd/ctrl
Selections should be on the same level of hierarchy
Unselect all by clicking on the canvas
Unselect all by pressing esc
Select all with cmd + a
Paste in main container
Paste in another container
Undo
Redo
Modal Selection
Modal child selection
Context switching
cmd click
snipping mode
new widget suggestion
onboarding
```

> Refactor widget selection logic

Fixes #19570

## Type of change

- Refactor


## How Has This Been Tested?

All existing tests should pass

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

### Issues raised during DP testing

https://github.com/appsmithorg/appsmith/pull/19643#issuecomment-1383570810

https://github.com/appsmithorg/appsmith/pull/19643#issuecomment-1383607820

https://github.com/appsmithorg/appsmith/pull/19643#issuecomment-1385095478
[Bug bash
issues](https://www.notion.so/appsmith/610aa302f3e146a7b090b7dc6bc63ef9?v=0d277a9b07bf4aac9d717bcaf138c33a)

## Checklist:
### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] 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-01-28 07:47:06 +05:30

244 lines
7.1 KiB
JSON

{
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1224,
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 1292,
"containerStyle": "none",
"snapRows": 33,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"dynamicBindingPathList": [],
"minHeight": 1292,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"backgroundColor": "#FFFFFF",
"widgetName": "Container1",
"type": "CONTAINER_WIDGET",
"containerStyle": "card",
"isVisible": true,
"isLoading": false,
"parentColumnSpace": 75.25,
"parentRowSpace": 38,
"dynamicBindingPathList": [],
"leftColumn": 0,
"rightColumn": 8,
"topRow": 0,
"bottomRow": 9,
"snapColumns": 16,
"orientation": "VERTICAL",
"children": [
{
"backgroundColor": "transparent",
"widgetName": "59gdivzv7s",
"type": "CANVAS_WIDGET",
"containerStyle": "none",
"isVisible": true,
"isLoading": false,
"parentColumnSpace": 1,
"parentRowSpace": 1,
"leftColumn": 0,
"rightColumn": 602,
"topRow": 0,
"bottomRow": 342,
"snapColumns": 16,
"orientation": "VERTICAL",
"children": [
{
"isVisible": true,
"defaultImage": "https://res.cloudinary.com/drako999/image/upload/v1589196259/default.png",
"imageShape": "RECTANGLE",
"image": "",
"widgetName": "Image1",
"type": "IMAGE_WIDGET",
"isLoading": false,
"parentColumnSpace": 34.6875,
"parentRowSpace": 38,
"leftColumn": 6,
"rightColumn": 10,
"topRow": 2,
"bottomRow": 5,
"parentId": "bxekwxgc1i",
"widgetId": "glksllew0g"
}
],
"widgetId": "bxekwxgc1i",
"detachFromLayout": true,
"canExtend": false,
"parentId": "mxbaasg65u"
}
],
"widgetId": "mxbaasg65u",
"parentId": "0"
},
{
"backgroundColor": "#FFFFFF",
"widgetName": "Container3",
"type": "CONTAINER_WIDGET",
"containerStyle": "card",
"isVisible": true,
"isLoading": false,
"parentColumnSpace": 75.25,
"parentRowSpace": 38,
"dynamicBindingPathList": [],
"leftColumn": 0,
"rightColumn": 16,
"topRow": 9,
"bottomRow": 23,
"snapColumns": 16,
"orientation": "VERTICAL",
"children": [
{
"backgroundColor": "transparent",
"widgetName": "rhfg2vf1n5",
"type": "CANVAS_WIDGET",
"containerStyle": "none",
"isVisible": true,
"isLoading": false,
"parentColumnSpace": 1,
"parentRowSpace": 1,
"leftColumn": 0,
"rightColumn": 1204,
"topRow": 0,
"bottomRow": 532,
"snapColumns": 16,
"orientation": "VERTICAL",
"children": [
{
"isVisible": true,
"widgetName": "Chart1",
"chartType": "LINE_CHART",
"chartName": "Sales on working days",
"allowScroll": false,
"chartData": [
{
"seriesName": "Sales",
"data": [
{
"x": "Mon",
"y": 10000
},
{
"x": "Tue",
"y": 12000
},
{
"x": "Wed",
"y": 32000
},
{
"x": "Thu",
"y": 28000
},
{
"x": "Fri",
"y": 14000
},
{
"x": "Sat",
"y": 19000
},
{
"x": "Sun",
"y": 36000
}
]
}
],
"xAxisName": "Last Week",
"yAxisName": "Total Order Revenue $",
"type": "CHART_WIDGET",
"isLoading": false,
"parentColumnSpace": 71.75,
"parentRowSpace": 38,
"leftColumn": 2,
"rightColumn": 8,
"topRow": 1,
"bottomRow": 9,
"parentId": "rglduihhzk",
"widgetId": "hwi9cwhg43",
"dynamicBindingPathList": []
}
],
"widgetId": "rglduihhzk",
"detachFromLayout": true,
"canExtend": false,
"parentId": "i331vll2mg"
}
],
"widgetId": "i331vll2mg",
"parentId": "0"
},
{
"backgroundColor": "#FFFFFF",
"widgetName": "Container4",
"type": "CONTAINER_WIDGET",
"containerStyle": "card",
"isVisible": true,
"isLoading": false,
"parentColumnSpace": 75.25,
"parentRowSpace": 38,
"dynamicBindingPathList": [],
"leftColumn": 8,
"rightColumn": 16,
"topRow": 0,
"bottomRow": 9,
"snapColumns": 16,
"orientation": "VERTICAL",
"children": [
{
"backgroundColor": "transparent",
"widgetName": "3bn6uv0vy4",
"type": "CANVAS_WIDGET",
"containerStyle": "none",
"isVisible": true,
"isLoading": false,
"parentColumnSpace": 1,
"parentRowSpace": 1,
"leftColumn": 0,
"rightColumn": 602,
"topRow": 0,
"bottomRow": 342,
"snapColumns": 16,
"orientation": "VERTICAL",
"children": [
{
"isVisible": true,
"text": "Label",
"textAlign": "LEFT",
"widgetName": "Text1",
"type": "TEXT_WIDGET",
"isLoading": false,
"parentColumnSpace": 34.6875,
"parentRowSpace": 38,
"leftColumn": 3,
"rightColumn": 7,
"topRow": 3,
"bottomRow": 4,
"parentId": "7vm5mdu8ey",
"widgetId": "9xcfqahpw2"
}
],
"widgetId": "7vm5mdu8ey",
"detachFromLayout": true,
"canExtend": false,
"parentId": "qznzsquf70"
}
],
"widgetId": "qznzsquf70",
"parentId": "0"
}
]
},
"layoutOnLoadActions": []
}