ToolJet/server/templates/customer-dashboard/definition.json
Gandharv 6c90a1667b
Feature: undo/redo for canvas 🔥 (#1446)
* feat: add restore shortcut when component is deleted

* change toast messages to hot toast from toastify

* change toast messages to hot toast from toastify

* change toast messages to hot toast from toastify

* on key press match clear the pressed keys

* add react hotkeys hook and delete use-shortcuts custom hook

* change toast messages to hot toast from toastify

* add immer lib

* applyPatches from immer + add undo redo on appdefination changes

* remove notification on undo

* add can-undo + can-redo checks

* add missing can-redo to handlePatchAdd

* add component versioning on componentDefinitionChanged

* set default value of loading state to interpolated boolean false for table

* set canUndo on initial load to false

* fix last element not getting removed on undo

* Remove console log

* add migration to change loadingState for existing tables

* set loadingstate value based on the previous value

* fix: app crash on inspector opening

* add check for selectedComponentId inside components def

* update template definitions for loadingState

* fix alert for success, error, info for button notifications
2021-12-11 04:41:24 +05:30

399 lines
14 KiB
JSON

{
"id": "78391197-8d81-40fe-ae2f-78a8b2c97e30",
"name": "Customer Dashboard",
"slug": null,
"isPublic": false,
"organizationId": "7471c14a-c11a-416a-94b2-863125bc69d7",
"currentVersionId": null,
"userId": "319a2ca8-395e-4f77-8998-78358f78b716",
"createdAt": "2021-12-09T10:00:40.049Z",
"updatedAt": "2021-12-09T10:00:40.136Z",
"dataQueries": [
{
"id": "cd789375-9d88-4880-a941-301faff6844a",
"name": "chartData",
"kind": "postgresql",
"options": {
"mode": "sql",
"query": "select created_at::date, COUNT(*) from customers GROUP BY created_at::date ORDER BY created_at::date ASC;",
"enableTransformation": true,
"transformation": "return data.map(row => {\n return { \"x\": row.created_at, \"y\": parseInt(row.count) } \n});",
"runOnPageLoad": true
},
"dataSourceId": "1258859c-9657-4e48-bf89-aaf1b1166979",
"appId": "78391197-8d81-40fe-ae2f-78a8b2c97e30",
"createdAt": "2021-12-09T10:00:40.047Z",
"updatedAt": "2021-12-09T10:00:40.047Z"
},
{
"id": "1c1dfc69-4048-4e81-8213-a6c436a0de30",
"name": "fetchCustomers",
"kind": "postgresql",
"options": {
"mode": "sql",
"query": "SELECT * FROM customers;",
"runOnPageLoad": true
},
"dataSourceId": "1258859c-9657-4e48-bf89-aaf1b1166979",
"appId": "78391197-8d81-40fe-ae2f-78a8b2c97e30",
"createdAt": "2021-12-09T10:00:40.047Z",
"updatedAt": "2021-12-09T10:00:40.047Z"
}
],
"dataSources": [
{
"id": "1258859c-9657-4e48-bf89-aaf1b1166979",
"name": "PostgreSQL",
"kind": "postgresql",
"options": {
"host": {
"value": "sample-data.cye0quy9d2fs.us-east-2.rds.amazonaws.com",
"encrypted": false
},
"port": { "value": 5432, "encrypted": false },
"database": { "value": "postgres", "encrypted": false },
"username": { "value": "postgres", "encrypted": false },
"password": {
"credential_id": "1e4f4085-d85f-452d-a458-863fb772ba46",
"encrypted": true
},
"ssl_enabled": { "value": true, "encrypted": false }
},
"appId": "78391197-8d81-40fe-ae2f-78a8b2c97e30",
"createdAt": "2021-12-09T10:00:40.099Z",
"updatedAt": "2021-12-09T10:00:40.099Z"
}
],
"appVersions": [
{
"id": "f6f31f2f-0298-4f32-ace3-8aa8b668730a",
"name": "v0",
"definition": {
"components": {
"b0319b2d-c580-4830-8ee4-d1920b944020": {
"top": 510,
"left": 30,
"width": 714,
"height": 658,
"component": {
"name": "table1",
"displayName": "Table",
"description": "Display paginated tabular data",
"component": "Table",
"properties": {
"title": { "type": "string", "displayName": "Title" },
"data": { "type": "code", "displayName": "Table data" },
"loadingState": {
"type": "code",
"displayName": "Loading state"
},
"columns": { "type": "array", "displayName": "Table Columns" },
"serverSidePagination": {
"type": "toggle",
"displayName": "Server Side Pagination"
},
"actionButtonBackgroundColor": {
"type": "color",
"displayName": "Background Color"
},
"actionButtonTextColor": {
"type": "color",
"displayName": "Text Color"
}
},
"defaultSize": { "width": 810, "height": 300 },
"events": {
"onRowClicked": { "displayName": "On row clicked" },
"onBulkUpdate": { "displayName": "Bulk update query" },
"onPageChanged": { "displayName": "On page changed query" }
},
"styles": {
"textColor": { "type": "color", "displayName": "Text Color" }
},
"exposedVariables": {
"selectedRow": {},
"changeSet": {},
"dataUpdates": [],
"pageIndex": 0
},
"definition": {
"properties": {
"title": { "value": "Table" },
"visible": { "value": true },
"loadingState": { "value": false },
"data": { "value": "{{queries.fetchCustomers.data}}" },
"serverSidePagination": { "value": true },
"columns": {
"value": [
{ "name": "id" },
{ "name": "name" },
{ "name": "email" }
]
},
"columnSizes": { "id": 167 },
"showBulkSelector": { "value": false },
"highlightSelectedRow": { "value": false }
},
"events": [],
"styles": {
"textColor": { "value": "" },
"cellSize": { "value": "compact" }
},
"others": {
"showOnDesktop": { "value": true },
"showOnMobile": { "value": false }
}
}
},
"layouts": {
"desktop": {
"top": 510,
"left": 2.321981424148607,
"width": 23.763157894736842,
"height": 658
}
}
},
"ead4cb23-ae0b-4c8a-8875-13fa47643762": {
"top": 60,
"left": 30,
"width": 1220,
"height": 400,
"component": {
"icon": "https://www.svgrepo.com/show/36266/chart.svg",
"name": "chart1",
"displayName": "Chart",
"description": "Display charts",
"component": "Chart",
"defaultSize": { "width": 600, "height": 400 },
"properties": {
"title": { "type": "string", "displayName": "Title" },
"data": { "type": "json", "displayName": "Data" },
"loadingState": {
"type": "code",
"displayName": "Loading State"
},
"markerColor": {
"type": "color",
"displayName": "Marker color"
},
"showGridLines": {
"type": "toggle",
"displayName": "Show grid lines"
},
"type": {
"type": "select",
"displayName": "Chart type",
"options": [
{ "name": "Line", "value": "line" },
{ "name": "Bar", "value": "bar" },
{ "name": "Pie", "value": "pie" }
]
}
},
"events": {},
"styles": {},
"exposedVariables": { "show": null },
"definition": {
"properties": {
"title": { "value": "Daily signups" },
"markerColor": { "value": "#CDE1F8" },
"showGridLines": { "value": true },
"loadingState": { "value": "{{false}}" },
"type": { "value": "bar" },
"data": { "value": "{{queries.chartData.data}}" }
},
"events": [],
"styles": {},
"others": {
"showOnDesktop": { "value": true },
"showOnMobile": { "value": false }
}
}
},
"layouts": {
"desktop": {
"top": 60,
"left": 2.321981424148607,
"width": 40.60371517027864,
"height": 400
}
}
}
},
"globalSettings": {
"hideHeader": false,
"canvasMaxWidth": 1292,
"canvasBackgroundColor": "#edeff5"
}
},
"appId": "78391197-8d81-40fe-ae2f-78a8b2c97e30",
"createdAt": "2021-12-09T10:00:40.121Z",
"updatedAt": "2021-12-09T10:01:17.071Z"
}
],
"editingVersion": {
"id": "f6f31f2f-0298-4f32-ace3-8aa8b668730a",
"name": "v0",
"definition": {
"components": {
"b0319b2d-c580-4830-8ee4-d1920b944020": {
"top": 510,
"left": 30,
"width": 714,
"height": 658,
"component": {
"name": "table1",
"displayName": "Table",
"description": "Display paginated tabular data",
"component": "Table",
"properties": {
"title": { "type": "string", "displayName": "Title" },
"data": { "type": "code", "displayName": "Table data" },
"loadingState": {
"type": "code",
"displayName": "Loading state"
},
"columns": { "type": "array", "displayName": "Table Columns" },
"serverSidePagination": {
"type": "toggle",
"displayName": "Server Side Pagination"
},
"actionButtonBackgroundColor": {
"type": "color",
"displayName": "Background Color"
},
"actionButtonTextColor": {
"type": "color",
"displayName": "Text Color"
}
},
"defaultSize": { "width": 810, "height": 300 },
"events": {
"onRowClicked": { "displayName": "On row clicked" },
"onBulkUpdate": { "displayName": "Bulk update query" },
"onPageChanged": { "displayName": "On page changed query" }
},
"styles": {
"textColor": { "type": "color", "displayName": "Text Color" }
},
"exposedVariables": {
"selectedRow": {},
"changeSet": {},
"dataUpdates": [],
"pageIndex": 0
},
"definition": {
"properties": {
"title": { "value": "Table" },
"visible": { "value": true },
"loadingState": { "value": "{{false}}" },
"data": { "value": "{{queries.fetchCustomers.data}}" },
"serverSidePagination": { "value": true },
"columns": {
"value": [
{ "name": "id" },
{ "name": "name" },
{ "name": "email" }
]
},
"columnSizes": { "id": 167 },
"showBulkSelector": { "value": false },
"highlightSelectedRow": { "value": false }
},
"events": [],
"styles": {
"textColor": { "value": "" },
"cellSize": { "value": "compact" }
},
"others": {
"showOnDesktop": { "value": true },
"showOnMobile": { "value": false }
}
}
},
"layouts": {
"desktop": {
"top": 510,
"left": 2.321981424148607,
"width": 23.763157894736842,
"height": 658
}
}
},
"ead4cb23-ae0b-4c8a-8875-13fa47643762": {
"top": 60,
"left": 30,
"width": 1220,
"height": 400,
"component": {
"icon": "https://www.svgrepo.com/show/36266/chart.svg",
"name": "chart1",
"displayName": "Chart",
"description": "Display charts",
"component": "Chart",
"defaultSize": { "width": 600, "height": 400 },
"properties": {
"title": { "type": "string", "displayName": "Title" },
"data": { "type": "json", "displayName": "Data" },
"loadingState": {
"type": "code",
"displayName": "Loading State"
},
"markerColor": { "type": "color", "displayName": "Marker color" },
"showGridLines": {
"type": "toggle",
"displayName": "Show grid lines"
},
"type": {
"type": "select",
"displayName": "Chart type",
"options": [
{ "name": "Line", "value": "line" },
{ "name": "Bar", "value": "bar" },
{ "name": "Pie", "value": "pie" }
]
}
},
"events": {},
"styles": {},
"exposedVariables": { "show": null },
"definition": {
"properties": {
"title": { "value": "Daily signups" },
"markerColor": { "value": "#CDE1F8" },
"showGridLines": { "value": true },
"loadingState": { "value": "{{false}}" },
"type": { "value": "bar" },
"data": { "value": "{{queries.chartData.data}}" }
},
"events": [],
"styles": {},
"others": {
"showOnDesktop": { "value": true },
"showOnMobile": { "value": false }
}
}
},
"layouts": {
"desktop": {
"top": 60,
"left": 2.321981424148607,
"width": 40.60371517027864,
"height": 400
}
}
}
},
"globalSettings": {
"hideHeader": false,
"canvasMaxWidth": 1292,
"canvasBackgroundColor": "#edeff5"
}
},
"appId": "78391197-8d81-40fe-ae2f-78a8b2c97e30",
"createdAt": "2021-12-09T10:00:40.121Z",
"updatedAt": "2021-12-09T10:01:17.071Z"
},
"tooljetVersion": "0.10.0"
}