PromucFlow_constructor/app/client/cypress/fixtures/exported-app.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

322 lines
11 KiB
JSON

{
"clientSchemaVersion": 1,
"serverSchemaVersion": 1,
"exportedApplication": {
"name": "d85f5e74",
"isPublic": false,
"appIsExample": false,
"unreadCommentThreads": 0,
"color": "#D9E7FF",
"icon": "cloud",
"slug": "d85f5e74",
"evaluationVersion": 2,
"new": true
},
"datasourceList": [],
"pageList": [
{
"userPermissions": [
"read:pages",
"manage:pages"
],
"gitSyncId": "6200c8457d76221d03e360e0_6200c8457d76221d03e360e2",
"unpublishedPage": {
"name": "Page1",
"slug": "page1",
"layouts": [
{
"id": "Page1",
"userPermissions": [],
"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,
"minHeight": 1292,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"backgroundColor": "#FFFFFF",
"widgetName": "Container1",
"rightColumn": 8,
"orientation": "VERTICAL",
"snapColumns": 16,
"widgetId": "mxbaasg65u",
"containerStyle": "card",
"topRow": 0,
"bottomRow": 9,
"parentRowSpace": 38,
"isVisible": true,
"type": "CONTAINER_WIDGET",
"isLoading": false,
"parentColumnSpace": 75.25,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"backgroundColor": "transparent",
"widgetName": "59gdivzv7s",
"rightColumn": 602,
"orientation": "VERTICAL",
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "bxekwxgc1i",
"containerStyle": "none",
"topRow": 0,
"bottomRow": 342,
"parentRowSpace": 1,
"isVisible": true,
"type": "CANVAS_WIDGET",
"canExtend": false,
"isLoading": false,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"image": "",
"widgetName": "Image1",
"rightColumn": 10,
"widgetId": "glksllew0g",
"topRow": 2,
"bottomRow": 5,
"parentRowSpace": 38,
"isVisible": true,
"type": "IMAGE_WIDGET",
"parentId": "bxekwxgc1i",
"isLoading": false,
"parentColumnSpace": 34.6875,
"imageShape": "RECTANGLE",
"leftColumn": 6,
"defaultImage": "https://res.cloudinary.com/drako999/image/upload/v1589196259/default.png"
}
]
}
]
},
{
"backgroundColor": "#FFFFFF",
"widgetName": "Container3",
"rightColumn": 16,
"orientation": "VERTICAL",
"snapColumns": 16,
"widgetId": "i331vll2mg",
"containerStyle": "card",
"topRow": 9,
"bottomRow": 23,
"parentRowSpace": 38,
"isVisible": true,
"type": "CONTAINER_WIDGET",
"isLoading": false,
"parentColumnSpace": 75.25,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": [
{
"backgroundColor": "transparent",
"widgetName": "rhfg2vf1n5",
"rightColumn": 1204,
"orientation": "VERTICAL",
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "rglduihhzk",
"containerStyle": "none",
"topRow": 0,
"bottomRow": 532,
"parentRowSpace": 1,
"isVisible": true,
"type": "CANVAS_WIDGET",
"canExtend": false,
"isLoading": false,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"widgetName": "Chart1",
"rightColumn": 8,
"allowScroll": false,
"widgetId": "hwi9cwhg43",
"topRow": 1,
"bottomRow": 9,
"parentRowSpace": 38,
"isVisible": true,
"type": "CHART_WIDGET",
"parentId": "rglduihhzk",
"isLoading": 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
}
]
}
],
"yAxisName": "Total Order Revenue $",
"parentColumnSpace": 71.75,
"chartName": "Sales on working days",
"leftColumn": 2,
"dynamicBindingPathList": [],
"xAxisName": "Last Week",
"chartType": "LINE_CHART"
}
]
}
]
},
{
"backgroundColor": "#FFFFFF",
"widgetName": "Container4",
"rightColumn": 16,
"orientation": "VERTICAL",
"snapColumns": 16,
"widgetId": "qznzsquf70",
"containerStyle": "card",
"topRow": 0,
"bottomRow": 9,
"parentRowSpace": 38,
"isVisible": true,
"type": "CONTAINER_WIDGET",
"isLoading": false,
"parentColumnSpace": 75.25,
"dynamicBindingPathList": [],
"leftColumn": 8,
"children": [
{
"backgroundColor": "transparent",
"widgetName": "3bn6uv0vy4",
"rightColumn": 602,
"orientation": "VERTICAL",
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "7vm5mdu8ey",
"containerStyle": "none",
"topRow": 0,
"bottomRow": 342,
"parentRowSpace": 1,
"isVisible": true,
"type": "CANVAS_WIDGET",
"canExtend": false,
"isLoading": false,
"parentColumnSpace": 1,
"leftColumn": 0,
"children": [
{
"widgetName": "Text1",
"rightColumn": 7,
"textAlign": "LEFT",
"widgetId": "9xcfqahpw2",
"topRow": 3,
"bottomRow": 4,
"parentRowSpace": 38,
"isVisible": true,
"type": "TEXT_WIDGET",
"parentId": "7vm5mdu8ey",
"isLoading": false,
"parentColumnSpace": 34.6875,
"leftColumn": 3,
"text": "Label"
}
]
}
]
}
]
},
"layoutOnLoadActions": [],
"new": false
}
],
"userPermissions": []
},
"publishedPage": {
"name": "Page1",
"slug": "page1",
"layouts": [
{
"id": "Page1",
"userPermissions": [],
"dsl": {
"widgetName": "MainContainer",
"backgroundColor": "none",
"rightColumn": 1224,
"snapColumns": 16,
"detachFromLayout": true,
"widgetId": "0",
"topRow": 0,
"bottomRow": 1254,
"containerStyle": "none",
"snapRows": 33,
"parentRowSpace": 1,
"type": "CANVAS_WIDGET",
"canExtend": true,
"version": 4,
"minHeight": 1292,
"parentColumnSpace": 1,
"dynamicBindingPathList": [],
"leftColumn": 0,
"children": []
},
"new": false
}
],
"userPermissions": []
},
"new": true
}
],
"publishedDefaultPageName": "Page1",
"unpublishedDefaultPageName": "Page1",
"actionList": [],
"actionCollectionList": [],
"decryptedFields": {},
"editModeTheme": {
"name": "Classic",
"new": true,
"isSystemTheme": true
},
"publishedTheme": {
"name": "Classic",
"new": true,
"isSystemTheme": true
},
"publishedLayoutmongoEscapedWidgets": {},
"unpublishedLayoutmongoEscapedWidgets": {}
}