saasufy-components 1.3.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.
- package/collection-browser.js +8 -4
- package/package.json +1 -1
package/collection-browser.js
CHANGED
|
@@ -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(
|
|
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),
|