@sumaris-net/ngx-components 1.21.0-beta20 → 1.21.0-beta21
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/bundles/sumaris-net.ngx-components.umd.js +11 -8
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/social/user-event/testing/user-event.testing.service.js +2 -2
- package/esm2015/src/app/social/user-event/user-event.service.js +11 -8
- package/fesm2015/sumaris-net.ngx-components.js +11 -8
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/social/user-event/user-event.service.d.ts +5 -3
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -30182,9 +30182,9 @@
|
|
|
30182
30182
|
_this.mutations = mutations;
|
|
30183
30183
|
_this.subscriptions = subscriptions;
|
|
30184
30184
|
_this.environment = environment;
|
|
30185
|
-
_this.
|
|
30186
|
-
_this._subscriptions = new rxjs.Subscription();
|
|
30185
|
+
_this.count$ = new rxjs.BehaviorSubject(0);
|
|
30187
30186
|
_this.listeners = [];
|
|
30187
|
+
_this._subscriptions = new rxjs.Subscription();
|
|
30188
30188
|
_this._logPrefix = '[user-event-service] ';
|
|
30189
30189
|
// For DEV only
|
|
30190
30190
|
_this._debug = !(environment === null || environment === void 0 ? void 0 : environment.production);
|
|
@@ -30192,7 +30192,7 @@
|
|
|
30192
30192
|
}
|
|
30193
30193
|
Object.defineProperty(AbstractUserEventService.prototype, "userEventCount", {
|
|
30194
30194
|
get: function () {
|
|
30195
|
-
return this.
|
|
30195
|
+
return this.count$.asObservable();
|
|
30196
30196
|
},
|
|
30197
30197
|
enumerable: false,
|
|
30198
30198
|
configurable: true
|
|
@@ -30291,7 +30291,7 @@
|
|
|
30291
30291
|
data: entity
|
|
30292
30292
|
});
|
|
30293
30293
|
// Update count
|
|
30294
|
-
this.
|
|
30294
|
+
this.count$.next(this.count$.value + 1);
|
|
30295
30295
|
};
|
|
30296
30296
|
AbstractUserEventService.prototype.count = function (filter, options) {
|
|
30297
30297
|
var _a;
|
|
@@ -30332,6 +30332,8 @@
|
|
|
30332
30332
|
}
|
|
30333
30333
|
if (!filter)
|
|
30334
30334
|
filter = this.defaultFilter();
|
|
30335
|
+
// Apply last reset date as start date
|
|
30336
|
+
filter.startDate = this.resetCountDate;
|
|
30335
30337
|
filter = this.asFilter(filter);
|
|
30336
30338
|
if (this._debug)
|
|
30337
30339
|
console.debug(this._logPrefix + "[WS] Listening count changes for user events with filter:", filter);
|
|
@@ -30348,7 +30350,7 @@
|
|
|
30348
30350
|
if (total && _this._debug)
|
|
30349
30351
|
console.debug(_this._logPrefix + "Received new user events count:", total);
|
|
30350
30352
|
// update count
|
|
30351
|
-
_this.
|
|
30353
|
+
_this.count$.next(total);
|
|
30352
30354
|
return total;
|
|
30353
30355
|
}));
|
|
30354
30356
|
};
|
|
@@ -30648,7 +30650,8 @@
|
|
|
30648
30650
|
this.listeners.push(listener);
|
|
30649
30651
|
};
|
|
30650
30652
|
AbstractUserEventService.prototype.resetCount = function () {
|
|
30651
|
-
this.
|
|
30653
|
+
this.count$.next(undefined);
|
|
30654
|
+
this.resetCountDate = moment$6();
|
|
30652
30655
|
};
|
|
30653
30656
|
/* -- protected methods -- */
|
|
30654
30657
|
AbstractUserEventService.prototype.onLogin = function () {
|
|
@@ -30662,7 +30665,7 @@
|
|
|
30662
30665
|
if (this._debug)
|
|
30663
30666
|
console.debug(this._logPrefix + "Receiving user events count", count);
|
|
30664
30667
|
// Update count
|
|
30665
|
-
this.
|
|
30668
|
+
this.count$.next(count);
|
|
30666
30669
|
// Then listen changes
|
|
30667
30670
|
this._listenSubscription = this.listenCountChanges(undefined).subscribe();
|
|
30668
30671
|
return [2 /*return*/];
|
|
@@ -31299,7 +31302,7 @@
|
|
|
31299
31302
|
entity = this.processUserEvent(entity);
|
|
31300
31303
|
entity.id = this.userEvents.length + 1;
|
|
31301
31304
|
this.userEvents.push(entity);
|
|
31302
|
-
this.
|
|
31305
|
+
this.count$.next(this.userEvents.length);
|
|
31303
31306
|
};
|
|
31304
31307
|
UserEventTestService.prototype.asFilter = function (filter) {
|
|
31305
31308
|
return filter;
|