@sumaris-net/ngx-components 1.9.7 → 1.10.0

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.
Files changed (48) hide show
  1. package/bundles/sumaris-net.ngx-components.umd.js +100 -20
  2. package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
  3. package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
  4. package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
  5. package/esm2015/public_api.js +2 -2
  6. package/esm2015/src/app/core/form/editor.class.js +2 -2
  7. package/esm2015/src/app/core/graphql/graphql.service.js +4 -4
  8. package/esm2015/src/app/core/home/home.js +2 -2
  9. package/esm2015/src/app/core/install/install-upgrade-card.component.js +2 -2
  10. package/esm2015/src/app/core/services/account.service.js +8 -4
  11. package/esm2015/src/app/core/services/config.service.js +2 -2
  12. package/esm2015/src/app/core/services/network.service.js +5 -5
  13. package/esm2015/src/app/core/services/platform.service.js +3 -4
  14. package/esm2015/src/app/core/services/testing/referential-filter.model.js +23 -0
  15. package/esm2015/src/app/core/services/testing/referential.validator.js +44 -0
  16. package/esm2015/src/app/core/table/table.class.js +2 -2
  17. package/esm2015/src/app/shared/services/startable-service.class.js +4 -1
  18. package/esm2015/src/app/shared/shared.testing.module.js +9 -3
  19. package/esm2015/src/app/shared/toast/toast.testing.js +39 -0
  20. package/esm2015/src/app/shared/toast/toast.testing.module.js +33 -0
  21. package/esm2015/src/app/shared/toast/toasts.js +119 -0
  22. package/esm2015/src/app/social/services/user-event.service.js +2 -2
  23. package/esm2015/sumaris-net.ngx-components.js +9 -7
  24. package/fesm2015/sumaris-net.ngx-components.js +88 -15
  25. package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
  26. package/package.json +1 -1
  27. package/public_api.d.ts +1 -1
  28. package/src/app/core/form/editor.class.d.ts +1 -1
  29. package/src/app/core/home/home.d.ts +1 -1
  30. package/src/app/core/services/account.service.d.ts +4 -2
  31. package/src/app/core/services/config.service.d.ts +1 -1
  32. package/src/app/core/services/network.service.d.ts +1 -1
  33. package/src/app/core/services/platform.service.d.ts +1 -1
  34. package/src/app/core/services/testing/referential-filter.model.d.ts +9 -0
  35. package/src/app/core/services/testing/referential.validator.d.ts +19 -0
  36. package/src/app/core/table/table.class.d.ts +1 -1
  37. package/src/app/shared/services/startable-service.class.d.ts +1 -0
  38. package/src/app/shared/shared.testing.module.d.ts +2 -0
  39. package/src/app/shared/toast/toast.testing.d.ts +14 -0
  40. package/src/app/shared/toast/toast.testing.module.d.ts +2 -0
  41. package/src/app/shared/{toasts.d.ts → toast/toasts.d.ts} +0 -0
  42. package/src/app/social/services/user-event.service.d.ts +1 -1
  43. package/src/assets/i18n/en-US.json +4 -1
  44. package/src/assets/i18n/en.json +4 -1
  45. package/src/assets/i18n/fr.json +4 -1
  46. package/sumaris-net.ngx-components.d.ts +8 -6
  47. package/sumaris-net.ngx-components.metadata.json +1 -1
  48. package/esm2015/src/app/shared/toasts.js +0 -119
@@ -9414,6 +9414,9 @@
9414
9414
  this._subscription = this._subscription || new rxjs.Subscription();
9415
9415
  return this._subscription.add(sub);
9416
9416
  };
9417
+ StartableService.prototype.unregisterSubscription = function (sub) {
9418
+ this._subscription.remove(sub);
9419
+ };
9417
9420
  StartableService.prototype.ngOnStop = function () {
9418
9421
  return __awaiter(this, void 0, void 0, function () {
9419
9422
  return __generator(this, function (_a) {
@@ -12274,7 +12277,7 @@
12274
12277
  this.onNetworkStatusChanges.next(currentConnectionType);
12275
12278
  // Offline mode: alert the user
12276
12279
  if (currentConnectionType === 'none' && (!opts || opts.showToast !== false)) {
12277
- this.showToast({ message: 'NETWORK.INFO.OFFLINE_HELP' });
12280
+ this.showToast({ message: 'NETWORK.INFO.OFFLINE_HELP', type: 'warning' });
12278
12281
  }
12279
12282
  }
12280
12283
  }
@@ -12531,11 +12534,11 @@
12531
12534
  // Force offline mode
12532
12535
  this._forceOffline = true;
12533
12536
  // Alert the user
12534
- this.showToast({ message: 'NETWORK.INFO.OFFLINE_HELP' });
12537
+ this.showToast({ message: 'NETWORK.INFO.OFFLINE_HELP', type: 'warning' });
12535
12538
  }
12536
12539
  else {
12537
12540
  // Alert the user
12538
- this.showToast({ message: 'NETWORK.INFO.OFFLINE' });
12541
+ this.showToast({ message: 'NETWORK.INFO.OFFLINE', type: 'warning' });
12539
12542
  }
12540
12543
  // Stop the network service
12541
12544
  this.stop();
@@ -14858,7 +14861,7 @@
14858
14861
  case 0:
14859
14862
  client = (client || this.client);
14860
14863
  if (!client) return [3 /*break*/, 2];
14861
- console.info('[graphql] Clearing Apollo client\'s cache... ');
14864
+ console.info('[graphql] Cleaning cache... ');
14862
14865
  now = this._debug && Date.now();
14863
14866
  // Clearing the cache
14864
14867
  return [4 /*yield*/, client.cache.reset()];
@@ -14866,7 +14869,7 @@
14866
14869
  // Clearing the cache
14867
14870
  _a.sent();
14868
14871
  if (this._debug)
14869
- console.debug("[graphql] Apollo client's cache cleared, in " + (Date.now() - now) + "ms");
14872
+ console.debug("[graphql] Cleaning cache [OK] in " + (Date.now() - now) + "ms");
14870
14873
  _a.label = 2;
14871
14874
  case 2: return [2 /*return*/];
14872
14875
  }
@@ -15051,7 +15054,7 @@
15051
15054
  client = (client || this.apollo.client);
15052
15055
  if (!client)
15053
15056
  return [2 /*return*/];
15054
- console.info('[graphql] Resetting apollo client...');
15057
+ console.info('[graphql] Resetting Apollo client...');
15055
15058
  client.stop();
15056
15059
  return [4 /*yield*/, Promise.all([
15057
15060
  client.clearStore(),
@@ -15870,7 +15873,7 @@
15870
15873
  });
15871
15874
  });
15872
15875
  };
15873
- AccountService.prototype.reload = function () {
15876
+ AccountService.prototype.reload = function (opts) {
15874
15877
  return __awaiter(this, void 0, void 0, function () {
15875
15878
  var now, wasLogin, error_6;
15876
15879
  return __generator(this, function (_b) {
@@ -15896,6 +15899,10 @@
15896
15899
  // Emit login event to subscribers
15897
15900
  this.onLogin.next(this._data);
15898
15901
  this.onChange.next(this._data);
15902
+ // Display toast (without await, because not need to wait toast close event)
15903
+ if (!opts || opts.showToast !== false) {
15904
+ this.showToast({ message: 'ACCOUNT.INFO.RELOADED', type: 'info' });
15905
+ }
15899
15906
  return [2 /*return*/, this._data];
15900
15907
  case 4:
15901
15908
  error_6 = _b.sent();
@@ -16654,7 +16661,7 @@
16654
16661
  variables: variables,
16655
16662
  error: {
16656
16663
  code: ErrorCodes$2.SUBSCRIBE_ACCOUNT_ERROR,
16657
- message: 'ERROR.ACCOUNT.SUBSCRIBE_ACCOUNT_ERROR'
16664
+ message: 'ERROR.ACCOUNT.SUBSCRIBE_ERROR'
16658
16665
  }
16659
16666
  }).pipe(operators.map(function (_b) {
16660
16667
  var data = _b.data;
@@ -17671,8 +17678,7 @@
17671
17678
  case 3:
17672
17679
  now = Date.now();
17673
17680
  console.info("[platform] Starting storage migration...");
17674
- return [4 /*yield*/, this.showToast({ message: 'INFO.DATA_MIGRATION_STARTED',
17675
- duration: 30000 })];
17681
+ return [4 /*yield*/, this.showToast({ message: 'INFO.DATA_MIGRATION_STARTED', type: 'info', duration: 30000 })];
17676
17682
  case 4:
17677
17683
  toast_1 = _b.sent();
17678
17684
  _b.label = 5;
@@ -19800,7 +19806,7 @@
19800
19806
  },] }
19801
19807
  ];
19802
19808
 
19803
- var routes$1 = [
19809
+ var routes$2 = [
19804
19810
  {
19805
19811
  path: '',
19806
19812
  pathMatch: 'full',
@@ -19855,7 +19861,7 @@
19855
19861
  i1.ReactiveFormsModule,
19856
19862
  SharedMaterialModule,
19857
19863
  i1$2.TranslateModule.forChild(),
19858
- i3.RouterModule.forChild(routes$1)
19864
+ i3.RouterModule.forChild(routes$2)
19859
19865
  ],
19860
19866
  declarations: [
19861
19867
  MaterialTestingPage,
@@ -19881,6 +19887,75 @@
19881
19887
  },] }
19882
19888
  ];
19883
19889
 
19890
+ var ToastTestingPage = /** @class */ (function () {
19891
+ function ToastTestingPage(toastController, translate) {
19892
+ this.toastController = toastController;
19893
+ this.translate = translate;
19894
+ this.defaultOptions = {
19895
+ showCloseButton: false
19896
+ };
19897
+ }
19898
+ ToastTestingPage.prototype.showToast = function (opts) {
19899
+ return Toasts.show(this.toastController, this.translate, Object.assign(Object.assign(Object.assign({}, this.defaultOptions), { message: 'This is a message' }), opts));
19900
+ };
19901
+ ToastTestingPage.prototype.showInfo = function (opts) {
19902
+ return this.showToast(Object.assign({ type: 'info', message: 'This is a info text !' }, opts));
19903
+ };
19904
+ ToastTestingPage.prototype.showWarning = function (opts) {
19905
+ return this.showToast(Object.assign({ type: 'warning', message: 'This is a warning text !' }, opts));
19906
+ };
19907
+ ToastTestingPage.prototype.showError = function (opts) {
19908
+ return this.showToast(Object.assign({ type: 'error', message: 'This is a error text !' }, opts));
19909
+ };
19910
+ ToastTestingPage.prototype.toggleCloseButton = function () {
19911
+ this.defaultOptions.showCloseButton = !this.defaultOptions.showCloseButton;
19912
+ };
19913
+ return ToastTestingPage;
19914
+ }());
19915
+ ToastTestingPage.decorators = [
19916
+ { type: i0.Component, args: [{
19917
+ selector: 'toast-testing',
19918
+ template: "<ion-toolbar color=\"primary\">\n <ion-title>Toasts</ion-title>\n</ion-toolbar>\n\n<ion-content class=\"ion-padding\">\n\n <p>Toast examples:</p>\n\n <ion-button (click)=\"showToast()\" color=\"dark\">\n default\n </ion-button>\n\n <ion-button (click)=\"showInfo({duration: 100000})\" color=\"secondary\">\n info\n </ion-button>\n\n <ion-button (click)=\"showWarning()\" color=\"accent\">\n warning\n </ion-button>\n\n <ion-button (click)=\"showError()\" color=\"danger\">\n error\n </ion-button>\n\n <br/>\n\n\n <ion-list>\n\n\n <ion-item>\n <ion-checkbox slot=\"start\" [value]=\"defaultOptions.showCloseButton\" (ionChange)=\"toggleCloseButton()\"></ion-checkbox>\n <ion-label>Close button ?</ion-label>\n </ion-item>\n </ion-list>\n\n\n</ion-content>\n"
19919
+ },] }
19920
+ ];
19921
+ ToastTestingPage.ctorParameters = function () { return [
19922
+ { type: i1$5.ToastController },
19923
+ { type: i1$2.TranslateService }
19924
+ ]; };
19925
+
19926
+ var routes$1 = [
19927
+ {
19928
+ path: 'toast',
19929
+ pathMatch: 'full',
19930
+ component: ToastTestingPage
19931
+ }
19932
+ ];
19933
+ var ToastTestingModule = /** @class */ (function () {
19934
+ function ToastTestingModule() {
19935
+ }
19936
+ return ToastTestingModule;
19937
+ }());
19938
+ ToastTestingModule.decorators = [
19939
+ { type: i0.NgModule, args: [{
19940
+ imports: [
19941
+ i1$4.CommonModule,
19942
+ i1$5.IonicModule,
19943
+ i1$2.TranslateModule.forChild(),
19944
+ i3.RouterModule.forChild(routes$1)
19945
+ ],
19946
+ declarations: [
19947
+ ToastTestingPage
19948
+ ],
19949
+ exports: [
19950
+ i3.RouterModule,
19951
+ ToastTestingPage
19952
+ ]
19953
+ },] }
19954
+ ];
19955
+
19956
+ var SHARED_TESTING_PAGES = [
19957
+ { label: 'Toast', page: '/testing/shared/toast' }
19958
+ ];
19884
19959
  var SharedTestingModule = /** @class */ (function () {
19885
19960
  function SharedTestingModule() {
19886
19961
  }
@@ -19891,10 +19966,12 @@
19891
19966
  imports: [
19892
19967
  i1$4.CommonModule,
19893
19968
  i1$2.TranslateModule.forChild(),
19894
- MaterialTestingModule
19969
+ MaterialTestingModule,
19970
+ ToastTestingModule
19895
19971
  ],
19896
19972
  exports: [
19897
- MaterialTestingModule
19973
+ MaterialTestingModule,
19974
+ ToastTestingModule
19898
19975
  ]
19899
19976
  },] }
19900
19977
  ];
@@ -29371,6 +29448,7 @@
29371
29448
  exports.SETTINGS_SORTED_COLUMN = SETTINGS_SORTED_COLUMN;
29372
29449
  exports.SETTINGS_STORAGE_KEY = SETTINGS_STORAGE_KEY;
29373
29450
  exports.SETTINGS_TRANSIENT_PROPERTIES = SETTINGS_TRANSIENT_PROPERTIES;
29451
+ exports.SHARED_TESTING_PAGES = SHARED_TESTING_PAGES;
29374
29452
  exports.SPACE_PLACEHOLDER_CHAR = SPACE_PLACEHOLDER_CHAR;
29375
29453
  exports.SelectPeerModal = SelectPeerModal;
29376
29454
  exports.SettingsPage = SettingsPage;
@@ -29561,12 +29639,14 @@
29561
29639
  exports["ɵd"] = MatBadgeIconDirective;
29562
29640
  exports["ɵe"] = isFocusableElement;
29563
29641
  exports["ɵf"] = MatBadgeIconTestPage;
29564
- exports["ɵg"] = RegisterForm;
29565
- exports["ɵh"] = AccountValidatorService;
29566
- exports["ɵi"] = RegisterModal;
29567
- exports["ɵj"] = UserSettingsValidatorService;
29568
- exports["ɵk"] = LocalSettingsValidatorService;
29569
- exports["ɵl"] = AppIconComponent;
29642
+ exports["ɵg"] = ToastTestingModule;
29643
+ exports["ɵh"] = ToastTestingPage;
29644
+ exports["ɵi"] = RegisterForm;
29645
+ exports["ɵj"] = AccountValidatorService;
29646
+ exports["ɵk"] = RegisterModal;
29647
+ exports["ɵl"] = UserSettingsValidatorService;
29648
+ exports["ɵm"] = LocalSettingsValidatorService;
29649
+ exports["ɵn"] = AppIconComponent;
29570
29650
 
29571
29651
  Object.defineProperty(exports, '__esModule', { value: true });
29572
29652