saasufy-components 4.0.0 → 4.1.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/app-router.js CHANGED
@@ -244,7 +244,6 @@ export class AppRouter extends SocketConsumer {
244
244
  routeArgs = {};
245
245
  }
246
246
 
247
-
248
247
  let pageState = JSON.stringify({
249
248
  route,
250
249
  routeArgs
@@ -1,5 +1,9 @@
1
1
  import { SocketConsumer } from './socket.js';
2
- import { convertStringToFieldParams, getTypeCastFunction } from './utils.js';
2
+ import {
3
+ convertStringToFieldParams,
4
+ getTypeCastFunction,
5
+ formatError
6
+ } from './utils.js';
3
7
  import AGCollection from '/node_modules/ag-collection/ag-collection.js';
4
8
 
5
9
  class CollectionAdderForm extends SocketConsumer {
@@ -122,7 +126,7 @@ class CollectionAdderForm extends SocketConsumer {
122
126
  if (messageContainer) {
123
127
  messageContainer.classList.add('error');
124
128
  messageContainer.classList.remove('success');
125
- messageContainer.textContent = error.message;
129
+ messageContainer.textContent = formatError(error);
126
130
  }
127
131
  this.dispatchEvent(
128
132
  new CustomEvent('error', {
@@ -1,5 +1,9 @@
1
1
  import { SocketConsumer } from './socket.js';
2
- import { convertStringToFieldParams, getTypeCastFunction } from './utils.js';
2
+ import {
3
+ convertStringToFieldParams,
4
+ getTypeCastFunction,
5
+ formatError
6
+ } from './utils.js';
3
7
  import AGCollection from '/node_modules/ag-collection/ag-collection.js';
4
8
 
5
9
  class CollectionAdder extends SocketConsumer {
@@ -122,7 +126,7 @@ class CollectionAdder extends SocketConsumer {
122
126
  } catch (error) {
123
127
  messageContainer.classList.add('error');
124
128
  messageContainer.classList.remove('success');
125
- messageContainer.textContent = error.message;
129
+ messageContainer.textContent = formatError(error);
126
130
  this.dispatchEvent(
127
131
  new CustomEvent('error', {
128
132
  detail: error
package/model-input.js CHANGED
@@ -1,5 +1,10 @@
1
1
  import { SocketConsumer } from './socket.js';
2
- import { debouncer, updateConsumerElements, convertStringToFieldParams } from './utils.js';
2
+ import {
3
+ debouncer,
4
+ updateConsumerElements,
5
+ convertStringToFieldParams,
6
+ formatError
7
+ } from './utils.js';
3
8
  import AGModel from '/node_modules/ag-model/ag-model.js';
4
9
 
5
10
  class ModelInput extends SocketConsumer {
@@ -379,7 +384,7 @@ class ModelInput extends SocketConsumer {
379
384
  } catch (error) {
380
385
  inputElement.classList.add(errorStyleClass);
381
386
  inputElement.classList.remove(successStyleClass);
382
- showErrorMessage(fieldName, error.message);
387
+ showErrorMessage(fieldName, formatError(error));
383
388
  }
384
389
  }, debounceDelay);
385
390
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "4.0.0",
3
+ "version": "4.1.1",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,7 +20,7 @@
20
20
  "ag-collection": "^5.2.0",
21
21
  "ag-model": "^3.1.0",
22
22
  "capitalisk-auth-client": "^1.5.1",
23
- "socketcluster-client": "^19.1.2",
23
+ "socketcluster-client": "^19.2.1",
24
24
  "uuid": "^8.3.2"
25
25
  },
26
26
  "bugs": {
package/utils.js CHANGED
@@ -422,6 +422,10 @@ export function convertStringToFieldParams(string) {
422
422
  };
423
423
  }
424
424
 
425
+ export function formatError(error) {
426
+ return error.code === 1009 ? 'Resource exceeded the maximum size' : error.message;
427
+ }
428
+
425
429
  export function wait(duration) {
426
430
  return new Promise((resolve) => setTimeout(resolve, duration));
427
431
  }