saasufy-components 1.2.0 → 1.3.1

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.
@@ -171,22 +171,26 @@ class CollectionBrowser extends SocketConsumer {
171
171
 
172
172
  render() {
173
173
  let collectionType = this.getAttribute('collection-type');
174
- let collectionFields = this.getAttribute('collection-fields');
174
+ let collectionFields = this.getAttribute('collection-fields') || '';
175
175
  let collectionView = this.getAttribute('collection-view');
176
176
  let collectionPageSize = this.getAttribute('collection-page-size');
177
- let collectionViewParams = this.getAttribute('collection-view-params');
177
+ let collectionViewParams = this.getAttribute('collection-view-params') || '';
178
178
  let collectionPageOffset = this.getAttribute('collection-page-offset');
179
179
  let hideErrorLogs = this.hasAttribute('hide-error-logs');
180
180
  let collectionReloadDelay = Number(
181
181
  this.getAttribute('collection-reload-delay') || DEFAULT_RELOAD_DELAY
182
182
  );
183
- let viewParams = Object.fromEntries(collectionViewParams.split(',').map((pair) => pair.split('=')));
183
+ let viewParams = Object.fromEntries(
184
+ collectionViewParams.split(',')
185
+ .map(pair => pair.split('='))
186
+ .filter(([field]) => field)
187
+ );
184
188
  if (this.collection) this.collection.destroy();
185
189
 
186
190
  this.collection = new AGCollection({
187
191
  socket: this.socket,
188
192
  type: collectionType,
189
- fields: collectionFields.split(',').map(field => field.trim()),
193
+ fields: collectionFields.split(',').map(field => field.trim()).filter(field => field),
190
194
  view: collectionView,
191
195
  viewParams,
192
196
  pageSize: Number(collectionPageSize || 10),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,8 +17,8 @@
17
17
  "author": "Jonathan Gros-Dubois",
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "ag-collection": "^3.2.1",
21
- "ag-model": "^1.3.6",
20
+ "ag-collection": "^3.3.0",
21
+ "ag-model": "^1.4.1",
22
22
  "expr-eval": "^2.0.2",
23
23
  "socketcluster-client": "^19.0.2"
24
24
  },