parse-dashboard 7.3.0-alpha.2 → 7.3.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,46 @@
1
+ const CACHE_NAME = 'dashboard-cache-v1';
2
+
3
+ self.addEventListener('install', () => {
4
+ self.skipWaiting();
5
+ });
6
+
7
+ self.addEventListener('activate', event => {
8
+ event.waitUntil(
9
+ Promise.all([
10
+ self.clients.claim(),
11
+ caches.keys().then(cacheNames => {
12
+ return Promise.all(
13
+ cacheNames.map(cacheName => {
14
+ if (cacheName !== CACHE_NAME) {
15
+ return caches.delete(cacheName);
16
+ }
17
+ })
18
+ );
19
+ })
20
+ ])
21
+ );
22
+ });
23
+
24
+ self.addEventListener('fetch', event => {
25
+ const req = event.request;
26
+ if (req.destination === 'script' || req.destination === 'style' || req.url.includes('/bundles/')) {
27
+ event.respondWith(
28
+ caches.match(req).then(cached => {
29
+ return (
30
+ cached ||
31
+ fetch(req).then(resp => {
32
+ const resClone = resp.clone();
33
+ caches.open(CACHE_NAME).then(cache => cache.put(req, resClone));
34
+ return resp;
35
+ })
36
+ );
37
+ })
38
+ );
39
+ }
40
+ });
41
+
42
+ self.addEventListener('message', event => {
43
+ if (event.data === 'unregister') {
44
+ self.registration.unregister();
45
+ }
46
+ });
package/README.md CHANGED
@@ -43,6 +43,7 @@ Parse Dashboard is a standalone dashboard for managing your [Parse Server](https
43
43
  - [Custom order in the filter popup](#custom-order-in-the-filter-popup)
44
44
  - [Persistent Filters](#persistent-filters)
45
45
  - [Scripts](#scripts)
46
+ - [Resource Cache](#resource-cache)
46
47
  - [Running as Express Middleware](#running-as-express-middleware)
47
48
  - [Deploying Parse Dashboard](#deploying-parse-dashboard)
48
49
  - [Preparing for Deployment](#preparing-for-deployment)
@@ -61,19 +62,23 @@ Parse Dashboard is a standalone dashboard for managing your [Parse Server](https
61
62
  - [Data Browser](#data-browser)
62
63
  - [Filters](#filters)
63
64
  - [Info Panel](#info-panel)
64
- - [Segments](#segments)
65
- - [Text Item](#text-item)
66
- - [Key-Value Item](#key-value-item)
67
- - [Table Item](#table-item)
68
- - [Image Item](#image-item)
69
- - [Video Item](#video-item)
70
- - [Audio Item](#audio-item)
71
- - [Button Item](#button-item)
72
- - [Panel Item](#panel-item)
65
+ - [Response](#response)
66
+ - [Segments](#segments)
67
+ - [Text Item](#text-item)
68
+ - [Key-Value Item](#key-value-item)
69
+ - [Table Item](#table-item)
70
+ - [Image Item](#image-item)
71
+ - [Video Item](#video-item)
72
+ - [Audio Item](#audio-item)
73
+ - [Button Item](#button-item)
74
+ - [Panel Item](#panel-item)
75
+ - [Prefetching](#prefetching)
76
+ - [Freeze Columns](#freeze-columns)
73
77
  - [Browse as User](#browse-as-user)
74
78
  - [Change Pointer Key](#change-pointer-key)
75
79
  - [Limitations](#limitations)
76
80
  - [CSV Export](#csv-export)
81
+ - [Views](#views)
77
82
  - [Contributing](#contributing)
78
83
 
79
84
  # Getting Started
@@ -138,6 +143,8 @@ Parse Dashboard is continuously tested with the most recent releases of Node.js
138
143
  | `infoPanel[*].title` | String | no | - | `User Details` | The panel title. |
139
144
  | `infoPanel[*].classes` | Array<String> | no | - | `["_User"]` | The classes for which the info panel should be displayed. |
140
145
  | `infoPanel[*].cloudCodeFunction` | String | no | - | `getUserDetails` | The Cloud Code Function which received the selected object in the data browser and returns the response to be displayed in the info panel. |
146
+ | `infoPanel[*].prefetchObjects` | Number | yes | `0` | `2` | Number of next rows to prefetch when browsing sequential rows. For example, `2` means the next 2 rows will be fetched in advance. |
147
+ | `infoPanel[*].prefetchStale` | Number | yes | `0` | `10` | Duration in seconds after which prefetched data is discarded as stale. |
141
148
  | `apps.scripts` | Array<Object> | yes | `[]` | `[{ ... }, { ... }]` | The scripts that can be executed for that app. |
142
149
  | `apps.scripts.title` | String | no | - | `'Delete User'` | The title that will be displayed in the data browser context menu and the script run confirmation dialog. |
143
150
  | `apps.scripts.classes` | Array<String> | no | - | `['_User']` | The classes of Parse Objects for which the scripts can be executed. |
@@ -504,6 +511,37 @@ Parse.Cloud.define('deleteAccount', async (req) => {
504
511
 
505
512
  </details>
506
513
 
514
+ ### Resource Cache
515
+
516
+ Parse Dashboard can cache its resources such as bundles in the browser, so that opening the dashboard in another tab does not reload the dashboard resources from the server but from the local browser cache. Caching only starts after login in the dashboard.
517
+
518
+ | Parameter | Type | Optional | Default | Example | Description |
519
+ |-----------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
520
+ | `enableResourceCache` | Boolean | yes | `false` | `true` | Enables caching of dashboard resources in the browser for faster dashboard loading in additional browser tabs. |
521
+
522
+
523
+ Example configuration:
524
+
525
+ ```javascript
526
+ const dashboard = new ParseDashboard({
527
+ enableResourceCache: true,
528
+ apps: [
529
+ {
530
+ serverURL: 'http://localhost:1337/parse',
531
+ appId: 'myAppId',
532
+ masterKey: 'myMasterKey',
533
+ appName: 'MyApp'
534
+ }
535
+ ]
536
+ });
537
+ ```
538
+
539
+ > [!Warning]
540
+ > This feature can make it more difficult to push dashboard updates to users. Enabling the resource cache will start a browser service worker that caches dashboard resources locally only once. As long as the service worker is running, it will prevent loading any dashboard updates from the server, even if the user reloads the browser tab. The service worker is automatically stopped, once the last dashboard browser tab is closed. On the opening of the first dashboard browser tab, a new service worker is started and the dashboard resources are loaded from the server.
541
+
542
+ > [!Note]
543
+ > For developers: during dashboard development, the resource cache should be disabled to ensure reloading the dashboard tab in the browser loads the new dashboard bundle with any changes you made in the source code. You can inspect the service worker in the developer tools of most browsers. For example in Google Chrome, go to *Developer Tools > Application tab > Service workers* to see whether the dashboard service worker is currently running and to debug it.
544
+
507
545
  # Running as Express Middleware
508
546
 
509
547
  Instead of starting Parse Dashboard with the CLI, you can also run it as an [express](https://github.com/expressjs/express) middleware.
@@ -871,7 +909,9 @@ The following example dashboard configuration shows an info panel for the `_User
871
909
  {
872
910
  "title": "User Details",
873
911
  "classes": ["_User"],
874
- "cloudCodeFunction": "getUserDetails"
912
+ "cloudCodeFunction": "getUserDetails",
913
+ "prefetchObjects": 2,
914
+ "prefetchStale": 10
875
915
  }
876
916
  ]
877
917
  }
@@ -880,7 +920,9 @@ The following example dashboard configuration shows an info panel for the `_User
880
920
 
881
921
  The Cloud Code Function receives the selected object in the payload and returns a response that can include various items.
882
922
 
883
- #### Segments
923
+ #### Response
924
+
925
+ ##### Segments
884
926
 
885
927
  The info panel can contain multiple segments to display different groups of information.
886
928
 
@@ -916,7 +958,7 @@ Example:
916
958
 
917
959
  The items array can include various types of content such as text, key-value pairs, tables, images, videos, audios, and buttons. Each type offers a different way to display information within the info panel, allowing for a customizable and rich user experience. Below is a detailed explanation of each type.
918
960
 
919
- #### Text Item
961
+ ##### Text Item
920
962
 
921
963
  A simple text field.
922
964
 
@@ -936,7 +978,7 @@ Example:
936
978
  }
937
979
  ```
938
980
 
939
- #### Key-Value Item
981
+ ##### Key-Value Item
940
982
 
941
983
  A text item that consists of a key and a value. The value can optionally be linked to a URL.
942
984
 
@@ -947,6 +989,7 @@ A text item that consists of a key and a value. The value can optionally be link
947
989
  | `value` | String | - | No | The value text to display. |
948
990
  | `url` | String | `undefined` | Yes | The URL that will be opened in a new browser tab when clicking on the value text. It can be set to an absolute URL or a relative URL in which case the base URL is `<PROTOCOL>://<HOST>/<MOUNT_PATH>/`. |
949
991
  | `isRelativeUrl` | Boolean | `false` | Yes | Set this to `true` when linking to another dashboard page, in which case the base URL for the relative URL will be `<PROTOCOL>://<HOST>/<MOUNT_PATH>/apps/<APP_NAME>/`. |
992
+ | `values` | Array | - | Yes | Additional values to display after `value`. Each item is an object with `value`, optional `url` and `isRelativeUrl`. |
950
993
  | `style` | Object | - | Yes | The CSS style definition. |
951
994
 
952
995
  Examples:
@@ -979,6 +1022,17 @@ Examples:
979
1022
  }
980
1023
  ```
981
1024
 
1025
+ ```json
1026
+ {
1027
+ "type": "keyValue",
1028
+ "key": "Purchase Value",
1029
+ "value": "123",
1030
+ "url": "browser/Purchase",
1031
+ "isRelativeUrl": true,
1032
+ "values": [{ "value": "456" }]
1033
+ }
1034
+ ```
1035
+
982
1036
  To navigate to a specific object using a relative URL, the query parameters must be URL encoded:
983
1037
 
984
1038
  ```js
@@ -995,7 +1049,7 @@ const item = {
995
1049
  }
996
1050
  ```
997
1051
 
998
- #### Table Item
1052
+ ##### Table Item
999
1053
 
1000
1054
  A table with columns and rows to display data in a structured format.
1001
1055
 
@@ -1037,7 +1091,7 @@ Example:
1037
1091
  }
1038
1092
  ```
1039
1093
 
1040
- #### Image Item
1094
+ ##### Image Item
1041
1095
 
1042
1096
  An image to be displayed in the panel.
1043
1097
 
@@ -1057,7 +1111,7 @@ Example:
1057
1111
  }
1058
1112
  ```
1059
1113
 
1060
- #### Video Item
1114
+ ##### Video Item
1061
1115
 
1062
1116
  A video to be displayed in the panel.
1063
1117
 
@@ -1077,7 +1131,7 @@ Example:
1077
1131
  }
1078
1132
  ```
1079
1133
 
1080
- #### Audio Item
1134
+ ##### Audio Item
1081
1135
 
1082
1136
  An audio file to be played in the panel.
1083
1137
 
@@ -1097,7 +1151,7 @@ Example:
1097
1151
  }
1098
1152
  ```
1099
1153
 
1100
- #### Button Item
1154
+ ##### Button Item
1101
1155
 
1102
1156
  A button that triggers an action when clicked.
1103
1157
 
@@ -1132,7 +1186,7 @@ Example:
1132
1186
  }
1133
1187
  ```
1134
1188
 
1135
- #### Panel Item
1189
+ ##### Panel Item
1136
1190
 
1137
1191
  A sub-panel whose data is loaded on-demand by expanding the item.
1138
1192
 
@@ -1154,6 +1208,23 @@ Example:
1154
1208
  }
1155
1209
  ```
1156
1210
 
1211
+ #### Prefetching
1212
+
1213
+ To reduce the time for info panel data to appear, data can be prefetched.
1214
+
1215
+ | Parameter | Type | Optional | Default | Example | Description |
1216
+ |--------------------------------|--------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------|
1217
+ | `infoPanel[*].prefetchObjects` | Number | yes | `0` | `2` | Number of next rows to prefetch when browsing sequential rows. For example, `2` means the next 2 rows will be fetched in advance. |
1218
+ | `infoPanel[*].prefetchStale` | Number | yes | `0` | `10` | Duration in seconds after which prefetched data is discarded as stale. |
1219
+
1220
+ Prefetching is particularly useful when navigating through lists of objects. To optimize performance and avoid unnecessary data loading, prefetching is triggered only after the user has moved through 3 consecutive rows using the keyboard down-arrow key or by mouse click.
1221
+
1222
+ ### Freeze Columns
1223
+
1224
+ ▶️ *Core > Browser > Freeze column*
1225
+
1226
+ Right-click on a table column header to freeze columns from the left up to the clicked column in the data browser. When scrolling horizontally, the frozen columns remain visible while the other columns scroll underneath.
1227
+
1157
1228
  ## Browse as User
1158
1229
 
1159
1230
  ▶️ *Core > Browser > Browse*
@@ -1182,6 +1253,12 @@ This feature allows you to change how a pointer is represented in the browser. B
1182
1253
  This feature will take either selected rows or all rows of an individual class and saves them to a CSV file, which is then downloaded. CSV headers are added to the top of the file matching the column names.
1183
1254
 
1184
1255
  > ⚠️ There is currently a 10,000 row limit when exporting all data. If more than 10,000 rows are present in the class, the CSV file will only contain 10,000 rows.
1256
+ ## Views
1257
+
1258
+ ▶️ *Core > Views*
1259
+
1260
+ Views are saved queries that display aggregated data from your classes. Create a view by providing a name, selecting a class and defining an aggregation pipeline. Optionally enable the object counter to show how many items match the view. Saved views appear in the sidebar, where you can select, edit, or delete them.
1261
+
1185
1262
 
1186
1263
  # Contributing
1187
1264
 
@@ -1193,4 +1270,4 @@ As of April 5, 2017, Parse, LLC has transferred this code to the parse-community
1193
1270
 
1194
1271
  [license-svg]: https://img.shields.io/badge/license-BSD-lightgrey.svg
1195
1272
  [license-link]: LICENSE
1196
- [open-collective-link]: https://opencollective.com/parse-server
1273
+ [open-collective-link]: https://opencollective.com/parse-server
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse-dashboard",
3
- "version": "7.3.0-alpha.2",
3
+ "version": "7.3.0-alpha.21",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/parse-community/parse-dashboard"
@@ -41,7 +41,7 @@
41
41
  "body-parser": "2.2.0",
42
42
  "commander": "13.1.0",
43
43
  "connect-flash": "0.1.1",
44
- "cookie-session": "2.1.0",
44
+ "cookie-session": "2.1.1",
45
45
  "copy-to-clipboard": "3.3.3",
46
46
  "core-js": "3.42.0",
47
47
  "csurf": "1.11.0",
@@ -49,7 +49,7 @@
49
49
  "fast-deep-equal": "3.1.3",
50
50
  "graphiql": "2.0.8",
51
51
  "graphql": "16.11.0",
52
- "immutable": "5.1.2",
52
+ "immutable": "5.1.3",
53
53
  "immutable-devtools": "0.1.5",
54
54
  "inquirer": "12.6.3",
55
55
  "js-beautify": "1.15.4",
@@ -66,7 +66,7 @@
66
66
  "react-dnd": "10.0.2",
67
67
  "react-dnd-html5-backend": "16.0.1",
68
68
  "react-dom": "16.14.0",
69
- "react-draggable": "4.4.6",
69
+ "react-draggable": "4.5.0",
70
70
  "react-helmet": "6.1.0",
71
71
  "react-json-view": "1.21.3",
72
72
  "react-popper-tooltip": "4.4.2",
@@ -77,12 +77,12 @@
77
77
  "devDependencies": {
78
78
  "@actions/core": "1.11.1",
79
79
  "@babel/core": "7.27.4",
80
- "@babel/eslint-parser": "7.27.5",
80
+ "@babel/eslint-parser": "7.28.0",
81
81
  "@babel/plugin-proposal-decorators": "7.27.1",
82
- "@babel/plugin-transform-runtime": "7.27.3",
82
+ "@babel/plugin-transform-runtime": "7.28.0",
83
83
  "@babel/preset-env": "7.27.2",
84
84
  "@babel/preset-react": "7.27.1",
85
- "@eslint/compat": "1.2.9",
85
+ "@eslint/compat": "1.3.1",
86
86
  "@saithodev/semantic-release-backmerge": "4.0.1",
87
87
  "@semantic-release/changelog": "6.0.3",
88
88
  "@semantic-release/commit-analyzer": "13.0.1",
@@ -95,7 +95,7 @@
95
95
  "babel-loader": "10.0.0",
96
96
  "css-loader": "6.7.3",
97
97
  "eslint": "9.28.0",
98
- "eslint-plugin-jest": "28.14.0",
98
+ "eslint-plugin-jest": "29.0.1",
99
99
  "eslint-plugin-react": "7.37.5",
100
100
  "globals": "16.2.0",
101
101
  "http-server": "14.1.1",
@@ -106,13 +106,13 @@
106
106
  "marked": "15.0.12",
107
107
  "null-loader": "4.0.1",
108
108
  "prettier": "3.5.3",
109
- "puppeteer": "24.9.0",
109
+ "puppeteer": "24.12.1",
110
110
  "react-test-renderer": "16.13.1",
111
111
  "request": "2.88.2",
112
- "request-promise": "4.2.5",
113
- "sass": "1.89.1",
112
+ "request-promise": "4.2.6",
113
+ "sass": "1.89.2",
114
114
  "sass-loader": "13.2.0",
115
- "semantic-release": "24.2.3",
115
+ "semantic-release": "24.2.7",
116
116
  "semver": "7.7.2",
117
117
  "style-loader": "3.3.1",
118
118
  "svg-prep": "1.0.4",