@sumaris-net/ngx-components 1.22.6 → 1.22.9
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 +142 -592
- 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/public_api.js +1 -2
- package/esm2015/src/app/social/social.module.js +2 -2
- package/esm2015/src/app/social/user-event/user-event.model.js +5 -1
- package/esm2015/src/app/social/user-event/user-event.module.js +2 -10
- package/esm2015/src/app/social/user-event/user-event.service.js +5 -174
- package/esm2015/sumaris-net.ngx-components.js +7 -8
- package/fesm2015/sumaris-net.ngx-components.js +129 -511
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +0 -1
- package/src/app/social/user-event/user-event.model.d.ts +2 -0
- package/src/app/social/user-event/user-event.service.d.ts +1 -25
- package/sumaris-net.ngx-components.d.ts +6 -7
- package/sumaris-net.ngx-components.metadata.json +1 -1
- package/esm2015/src/app/social/user-event/user-events.table.js +0 -159
- package/src/app/social/user-event/user-events.table.d.ts +0 -58
|
@@ -30234,112 +30234,6 @@
|
|
|
30234
30234
|
SUBSCRIBE_JOB_PROGRESSION_ERROR: 50010
|
|
30235
30235
|
};
|
|
30236
30236
|
|
|
30237
|
-
var UserEvent_1;
|
|
30238
|
-
var UserEventTypes = {
|
|
30239
|
-
DEBUG_DATA: 'DEBUG_DATA',
|
|
30240
|
-
INBOX_MESSAGE: 'INBOX_MESSAGE'
|
|
30241
|
-
};
|
|
30242
|
-
// @dynamic
|
|
30243
|
-
exports.UserEvent = UserEvent_1 = /** @class */ (function (_super) {
|
|
30244
|
-
__extends(UserEvent, _super);
|
|
30245
|
-
function UserEvent() {
|
|
30246
|
-
return _super.call(this, UserEvent_1.TYPENAME) || this;
|
|
30247
|
-
}
|
|
30248
|
-
UserEvent.prototype.asObject = function (opts) {
|
|
30249
|
-
var target = _super.prototype.asObject.call(this, opts);
|
|
30250
|
-
target.creationDate = toDateISOString(this.creationDate);
|
|
30251
|
-
target.readDate = toDateISOString(this.readDate);
|
|
30252
|
-
// Serialize content
|
|
30253
|
-
if (typeof target.content === 'object') {
|
|
30254
|
-
target.content = JSON.stringify(target.content);
|
|
30255
|
-
}
|
|
30256
|
-
delete target.avatar;
|
|
30257
|
-
delete target.avatarIcon;
|
|
30258
|
-
delete target.icon;
|
|
30259
|
-
delete target.actions;
|
|
30260
|
-
return target;
|
|
30261
|
-
};
|
|
30262
|
-
UserEvent.prototype.fromObject = function (source) {
|
|
30263
|
-
Object.assign(this, source); // Copy all properties
|
|
30264
|
-
_super.prototype.fromObject.call(this, source);
|
|
30265
|
-
this.creationDate = fromDateISOString(source.creationDate);
|
|
30266
|
-
this.readDate = fromDateISOString(source.readDate);
|
|
30267
|
-
try {
|
|
30268
|
-
// Deserialize content
|
|
30269
|
-
if (typeof source.content === 'string' && source.content.startsWith('{')) {
|
|
30270
|
-
this.content = JSON.parse(source.content);
|
|
30271
|
-
}
|
|
30272
|
-
// Deserialize content.context
|
|
30273
|
-
if (this.content && typeof this.content.context === 'string' && this.content.context.startsWith('{')) {
|
|
30274
|
-
this.content.context = JSON.parse(this.content.context);
|
|
30275
|
-
}
|
|
30276
|
-
}
|
|
30277
|
-
catch (err) {
|
|
30278
|
-
console.error('Error during UserEvent deserialization', err);
|
|
30279
|
-
}
|
|
30280
|
-
};
|
|
30281
|
-
return UserEvent;
|
|
30282
|
-
}(Entity));
|
|
30283
|
-
exports.UserEvent = UserEvent_1 = __decorate([
|
|
30284
|
-
EntityClass({ typename: 'UserEventVO' })
|
|
30285
|
-
], exports.UserEvent);
|
|
30286
|
-
// @dynamic
|
|
30287
|
-
exports.UserEventFilter = /** @class */ (function (_super) {
|
|
30288
|
-
__extends(UserEventFilter, _super);
|
|
30289
|
-
function UserEventFilter() {
|
|
30290
|
-
var _this = _super.apply(this, __spread(arguments)) || this;
|
|
30291
|
-
_this.types = [];
|
|
30292
|
-
_this.levels = [];
|
|
30293
|
-
_this.issuers = [];
|
|
30294
|
-
_this.recipients = [];
|
|
30295
|
-
_this.startDate = null;
|
|
30296
|
-
_this.excludeRead = false;
|
|
30297
|
-
return _this;
|
|
30298
|
-
}
|
|
30299
|
-
UserEventFilter.prototype.fromObject = function (source, opts) {
|
|
30300
|
-
_super.prototype.fromObject.call(this, source, opts);
|
|
30301
|
-
this.types = source.types || [];
|
|
30302
|
-
this.levels = source.levels || [];
|
|
30303
|
-
this.issuers = source.issuers || [];
|
|
30304
|
-
this.recipients = source.recipients || [];
|
|
30305
|
-
this.startDate = fromDateISOString(source.startDate);
|
|
30306
|
-
this.excludeRead = source.excludeRead || false;
|
|
30307
|
-
};
|
|
30308
|
-
UserEventFilter.prototype.buildFilter = function () {
|
|
30309
|
-
var _this = this;
|
|
30310
|
-
var filterFns = _super.prototype.buildFilter.call(this);
|
|
30311
|
-
if (isNotEmptyArray(this.types)) {
|
|
30312
|
-
filterFns.push(function (t) { return _this.types.includes(t.type); });
|
|
30313
|
-
}
|
|
30314
|
-
if (isNotEmptyArray(this.levels)) {
|
|
30315
|
-
filterFns.push(function (t) { return _this.levels.includes(t.level); });
|
|
30316
|
-
}
|
|
30317
|
-
if (isNotEmptyArray(this.issuers)) {
|
|
30318
|
-
filterFns.push(function (t) { return _this.issuers.includes(t.issuer); });
|
|
30319
|
-
}
|
|
30320
|
-
if (isNotEmptyArray(this.recipients)) {
|
|
30321
|
-
filterFns.push(function (t) { return _this.recipients.includes(t.recipient); });
|
|
30322
|
-
}
|
|
30323
|
-
if (isNotNil(this.startDate)) {
|
|
30324
|
-
filterFns.push(function (t) { return _this.startDate.isSameOrBefore(t.creationDate); });
|
|
30325
|
-
}
|
|
30326
|
-
if (this.excludeRead === true) {
|
|
30327
|
-
filterFns.push(function (t) { return isNil(t.readSignature); }); // todo or t.signature ?
|
|
30328
|
-
}
|
|
30329
|
-
return filterFns;
|
|
30330
|
-
};
|
|
30331
|
-
return UserEventFilter;
|
|
30332
|
-
}(EntityFilter));
|
|
30333
|
-
exports.UserEventFilter = __decorate([
|
|
30334
|
-
EntityClass({ typename: 'UserEventFilterVO' })
|
|
30335
|
-
], exports.UserEventFilter);
|
|
30336
|
-
|
|
30337
|
-
var UserEventFragments = {
|
|
30338
|
-
userEvent: core.gql(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["fragment UserEventFragment on UserEventVO {\n id\n issuer\n updateDate\n creationDate\n eventType\n recipient\n content\n hash\n signature\n readSignature\n __typename\n }"], ["fragment UserEventFragment on UserEventVO {\n id\n issuer\n updateDate\n creationDate\n eventType\n recipient\n content\n hash\n signature\n readSignature\n __typename\n }"]))),
|
|
30339
|
-
lightUserEvent: core.gql(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["fragment LightUserEventFragment on UserEventVO {\n id\n issuer\n recipient\n updateDate\n creationDate\n eventType\n readSignature\n __typename\n }"], ["fragment LightUserEventFragment on UserEventVO {\n id\n issuer\n recipient\n updateDate\n creationDate\n eventType\n readSignature\n __typename\n }"])))
|
|
30340
|
-
};
|
|
30341
|
-
var templateObject_1$2, templateObject_2$2;
|
|
30342
|
-
|
|
30343
30237
|
var moment$6 = momentImported__namespace;
|
|
30344
30238
|
var USER_EVENT_SERVICE = new i0.InjectionToken('UserEventService');
|
|
30345
30239
|
var AbstractUserEventService = /** @class */ (function (_super) {
|
|
@@ -30371,31 +30265,21 @@
|
|
|
30371
30265
|
return __awaiter(this, void 0, void 0, function () {
|
|
30372
30266
|
var _this = this;
|
|
30373
30267
|
return __generator(this, function (_b) {
|
|
30374
|
-
|
|
30375
|
-
|
|
30376
|
-
|
|
30377
|
-
|
|
30378
|
-
|
|
30379
|
-
|
|
30380
|
-
|
|
30381
|
-
|
|
30382
|
-
|
|
30383
|
-
|
|
30384
|
-
|
|
30385
|
-
|
|
30386
|
-
|
|
30387
|
-
|
|
30388
|
-
|
|
30389
|
-
// First attempt if account is ready
|
|
30390
|
-
return [4 /*yield*/, this.accountService.ready()];
|
|
30391
|
-
case 1:
|
|
30392
|
-
// First attempt if account is ready
|
|
30393
|
-
_b.sent();
|
|
30394
|
-
if (this.accountService.isLogin()) {
|
|
30395
|
-
setTimeout(function () { return _this.onLogin(); });
|
|
30396
|
-
}
|
|
30397
|
-
return [2 /*return*/];
|
|
30398
|
-
}
|
|
30268
|
+
// Update component when refresh is need (=login events)
|
|
30269
|
+
this._subscriptions.add(rxjs.merge(this.accountService.onLogin, this.accountService.onLogout, rxjs.of() // Starts with - first attempt if account is ready
|
|
30270
|
+
)
|
|
30271
|
+
.pipe(
|
|
30272
|
+
// Wait account service ready (can be restarted)
|
|
30273
|
+
operators.mergeMap(function () { return _this.accountService.ready(); }), operators.map(function () { return _this.accountService.isLogin(); }), operators.distinctUntilChanged())
|
|
30274
|
+
.subscribe(function (login) {
|
|
30275
|
+
if (login) {
|
|
30276
|
+
_this.onLogin();
|
|
30277
|
+
}
|
|
30278
|
+
else {
|
|
30279
|
+
_this.onLogout();
|
|
30280
|
+
}
|
|
30281
|
+
}));
|
|
30282
|
+
return [2 /*return*/];
|
|
30399
30283
|
});
|
|
30400
30284
|
});
|
|
30401
30285
|
};
|
|
@@ -30919,342 +30803,6 @@
|
|
|
30919
30803
|
{ type: i1$2.TranslateService },
|
|
30920
30804
|
{ type: undefined }
|
|
30921
30805
|
]; };
|
|
30922
|
-
var userEventQueries = {
|
|
30923
|
-
loadAll: core.gql(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n query UserEvents($filter: UserEventFilterVOInput, $page: PageInput){\n data: userEvents(filter: $filter, page: $page){\n ...LightUserEventFragment\n }\n }\n ", "\n "], ["\n query UserEvents($filter: UserEventFilterVOInput, $page: PageInput){\n data: userEvents(filter: $filter, page: $page){\n ...LightUserEventFragment\n }\n }\n ", "\n "])), UserEventFragments.lightUserEvent),
|
|
30924
|
-
loadAllWithContent: core.gql(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query UserEventsWithContent($filter: UserEventFilterVOInput, $page: PageInput){\n data: userEvents(filter: $filter, page: $page){\n ...UserEventFragment\n }\n }\n ", "\n "], ["\n query UserEventsWithContent($filter: UserEventFilterVOInput, $page: PageInput){\n data: userEvents(filter: $filter, page: $page){\n ...UserEventFragment\n }\n }\n ", "\n "])), UserEventFragments.userEvent)
|
|
30925
|
-
};
|
|
30926
|
-
var userEventMutations = {
|
|
30927
|
-
deleteByIds: core.gql(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n mutation DeleteUserEvents($ids:[Int]){\n deleteUserEvents(ids: $ids)\n }\n "], ["\n mutation DeleteUserEvents($ids:[Int]){\n deleteUserEvents(ids: $ids)\n }\n "]))),
|
|
30928
|
-
save: core.gql(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation SaveUserEvent($data: UserEventVOInput){\n data: saveUserEvent(userEvent: $data){\n ...UserEventFragment\n }\n }\n ", "\n "], ["\n mutation SaveUserEvent($data: UserEventVOInput){\n data: saveUserEvent(userEvent: $data){\n ...UserEventFragment\n }\n }\n ", "\n "])), UserEventFragments.userEvent)
|
|
30929
|
-
};
|
|
30930
|
-
var UserEventService = /** @class */ (function (_super) {
|
|
30931
|
-
__extends(UserEventService, _super);
|
|
30932
|
-
function UserEventService(graphql, accountService, network, translate, toastController, environment) {
|
|
30933
|
-
var _this = _super.call(this, graphql, accountService, network, translate, {
|
|
30934
|
-
queries: userEventQueries,
|
|
30935
|
-
mutations: userEventMutations,
|
|
30936
|
-
production: environment === null || environment === void 0 ? void 0 : environment.production
|
|
30937
|
-
}) || this;
|
|
30938
|
-
_this.graphql = graphql;
|
|
30939
|
-
_this.accountService = accountService;
|
|
30940
|
-
_this.network = network;
|
|
30941
|
-
_this.translate = translate;
|
|
30942
|
-
_this.toastController = toastController;
|
|
30943
|
-
_this.environment = environment;
|
|
30944
|
-
return _this;
|
|
30945
|
-
}
|
|
30946
|
-
UserEventService.prototype.showToastErrorWithContext = function (opts) {
|
|
30947
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
30948
|
-
var message, res, context, userEvent, err_1;
|
|
30949
|
-
return __generator(this, function (_b) {
|
|
30950
|
-
switch (_b.label) {
|
|
30951
|
-
case 0:
|
|
30952
|
-
message = opts.message || (opts.error && opts.error.message || opts.error);
|
|
30953
|
-
// Make sure message a string
|
|
30954
|
-
if (!message || typeof message !== 'string') {
|
|
30955
|
-
message = 'ERROR.UNKNOWN_TECHNICAL_ERROR';
|
|
30956
|
-
}
|
|
30957
|
-
// If offline, display a simple alert
|
|
30958
|
-
if (this.network.offline) {
|
|
30959
|
-
this.showToast({ message: message, type: 'error' });
|
|
30960
|
-
return [2 /*return*/];
|
|
30961
|
-
}
|
|
30962
|
-
// Translate the message (to be able to extract details content)
|
|
30963
|
-
message = this.translate.instant(message);
|
|
30964
|
-
// Clean details parts
|
|
30965
|
-
if (message && message.indexOf('<small>') !== -1) {
|
|
30966
|
-
message = message.substr(0, message.indexOf('<small>') - 1);
|
|
30967
|
-
}
|
|
30968
|
-
return [4 /*yield*/, this.showToast({
|
|
30969
|
-
type: 'error',
|
|
30970
|
-
duration: 15000,
|
|
30971
|
-
message: message + '<br/><br/><b>' + this.translate.instant('CONFIRM.SEND_DEBUG_DATA') + '</b>',
|
|
30972
|
-
buttons: [{
|
|
30973
|
-
icon: 'bug',
|
|
30974
|
-
text: this.translate.instant('COMMON.BTN_SEND'),
|
|
30975
|
-
role: 'send'
|
|
30976
|
-
}]
|
|
30977
|
-
})];
|
|
30978
|
-
case 1:
|
|
30979
|
-
res = _b.sent();
|
|
30980
|
-
if (!res || res.role !== 'send')
|
|
30981
|
-
return [2 /*return*/];
|
|
30982
|
-
_b.label = 2;
|
|
30983
|
-
case 2:
|
|
30984
|
-
_b.trys.push([2, 6, , 7]);
|
|
30985
|
-
if (this._debug)
|
|
30986
|
-
console.debug('Sending debug data...');
|
|
30987
|
-
context = opts && opts.context;
|
|
30988
|
-
if (typeof context === 'function') {
|
|
30989
|
-
context = context();
|
|
30990
|
-
}
|
|
30991
|
-
if (!(context instanceof Promise)) return [3 /*break*/, 4];
|
|
30992
|
-
return [4 /*yield*/, context];
|
|
30993
|
-
case 3:
|
|
30994
|
-
context = _b.sent();
|
|
30995
|
-
_b.label = 4;
|
|
30996
|
-
case 4: return [4 /*yield*/, this.sendDataForDebug({
|
|
30997
|
-
message: message,
|
|
30998
|
-
error: opts.error || undefined,
|
|
30999
|
-
context: this.convertObjectToString(context)
|
|
31000
|
-
})];
|
|
31001
|
-
case 5:
|
|
31002
|
-
userEvent = _b.sent();
|
|
31003
|
-
console.info('Debug data successfully sent to admin', userEvent);
|
|
31004
|
-
this.showToast({
|
|
31005
|
-
type: 'info',
|
|
31006
|
-
message: 'INFO.DEBUG_DATA_SEND',
|
|
31007
|
-
showCloseButton: true
|
|
31008
|
-
});
|
|
31009
|
-
return [3 /*break*/, 7];
|
|
31010
|
-
case 6:
|
|
31011
|
-
err_1 = _b.sent();
|
|
31012
|
-
console.error('Error while sending debug data:', err_1);
|
|
31013
|
-
return [3 /*break*/, 7];
|
|
31014
|
-
case 7: return [2 /*return*/];
|
|
31015
|
-
}
|
|
31016
|
-
});
|
|
31017
|
-
});
|
|
31018
|
-
};
|
|
31019
|
-
UserEventService.prototype.sendDataForDebug = function (data) {
|
|
31020
|
-
var userEvent = new exports.UserEvent();
|
|
31021
|
-
userEvent.type = UserEventTypes.DEBUG_DATA;
|
|
31022
|
-
userEvent.content = this.convertObjectToString(data);
|
|
31023
|
-
return this.save(userEvent);
|
|
31024
|
-
};
|
|
31025
|
-
UserEventService.prototype.asFilter = function (filter) {
|
|
31026
|
-
return exports.UserEventFilter.fromObject(filter);
|
|
31027
|
-
};
|
|
31028
|
-
UserEventService.prototype.fromObject = function (source) {
|
|
31029
|
-
return exports.UserEvent.fromObject(source);
|
|
31030
|
-
};
|
|
31031
|
-
/* -- protected methods -- */
|
|
31032
|
-
UserEventService.prototype.convertObjectToString = function (data) {
|
|
31033
|
-
if (typeof data === 'string') {
|
|
31034
|
-
return data;
|
|
31035
|
-
}
|
|
31036
|
-
// Serialize content into string
|
|
31037
|
-
else if (typeof data === 'object') {
|
|
31038
|
-
if (data instanceof Entity) {
|
|
31039
|
-
return JSON.stringify(data.asObject({ keepTypename: true, keepLocalId: true, minify: false }));
|
|
31040
|
-
}
|
|
31041
|
-
else {
|
|
31042
|
-
return JSON.stringify(data);
|
|
31043
|
-
}
|
|
31044
|
-
}
|
|
31045
|
-
};
|
|
31046
|
-
UserEventService.prototype.showToast = function (opts) {
|
|
31047
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
31048
|
-
return __generator(this, function (_b) {
|
|
31049
|
-
switch (_b.label) {
|
|
31050
|
-
case 0:
|
|
31051
|
-
if (!this.toastController)
|
|
31052
|
-
throw new Error('Missing toastController in component\'s constructor');
|
|
31053
|
-
return [4 /*yield*/, Toasts.show(this.toastController, this.translate, opts)];
|
|
31054
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
31055
|
-
}
|
|
31056
|
-
});
|
|
31057
|
-
});
|
|
31058
|
-
};
|
|
31059
|
-
UserEventService.prototype.fillDefaultProperties = function (entity) {
|
|
31060
|
-
entity.issuer = this.accountService.account.pubkey;
|
|
31061
|
-
// TODO: compute hash (using cryptoService)
|
|
31062
|
-
// TODO: compute sign
|
|
31063
|
-
console.warn('TODO: sign user event before sending');
|
|
31064
|
-
};
|
|
31065
|
-
return UserEventService;
|
|
31066
|
-
}(AbstractUserEventService));
|
|
31067
|
-
UserEventService.decorators = [
|
|
31068
|
-
{ type: i0.Injectable }
|
|
31069
|
-
];
|
|
31070
|
-
UserEventService.ctorParameters = function () { return [
|
|
31071
|
-
{ type: GraphqlService },
|
|
31072
|
-
{ type: AccountService },
|
|
31073
|
-
{ type: NetworkService },
|
|
31074
|
-
{ type: i1$2.TranslateService },
|
|
31075
|
-
{ type: i1$5.ToastController },
|
|
31076
|
-
{ type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
31077
|
-
]; };
|
|
31078
|
-
var templateObject_1$3, templateObject_2$3, templateObject_3$2, templateObject_4$2;
|
|
31079
|
-
|
|
31080
|
-
var ICONS_MAP = {
|
|
31081
|
-
DEBUG_DATA: { matIcon: 'bug_report' },
|
|
31082
|
-
INBOX_MESSAGE: { matIcon: 'mail' }
|
|
31083
|
-
};
|
|
31084
|
-
// TODO: refactor with a registration done by data service:
|
|
31085
|
-
// - userEventService.registerEventAction({__typename: 'TripVO', ...})
|
|
31086
|
-
// - userEventService.getActionsFor(__typename): UserEventDetailAction
|
|
31087
|
-
/*const DETAILS_MAP: {[key: string]: UserEventAction<RootDataEntity<any>>} = {
|
|
31088
|
-
"TripVO": {
|
|
31089
|
-
icon: null,
|
|
31090
|
-
matIcon: "content_copy",
|
|
31091
|
-
action: 'copyToLocal',
|
|
31092
|
-
actionTitle: 'SOCIAL.USER_EVENT.BTN_COPY_TO_LOCAL',
|
|
31093
|
-
actionColor: 'primary',
|
|
31094
|
-
fromObject: Trip.fromObject,
|
|
31095
|
-
childrenFields: ['operation', 'landing']
|
|
31096
|
-
},
|
|
31097
|
-
"ObservedLocationVO": {
|
|
31098
|
-
icon: null,
|
|
31099
|
-
matIcon: "content_copy",
|
|
31100
|
-
action: 'copyToLocal',
|
|
31101
|
-
actionTitle: 'SOCIAL.USER_EVENT.BTN_COPY_TO_LOCAL',
|
|
31102
|
-
actionColor: 'primary',
|
|
31103
|
-
fromObject: ObservedLocation.fromObject,
|
|
31104
|
-
childrenFields: ['landings']
|
|
31105
|
-
}
|
|
31106
|
-
}*/
|
|
31107
|
-
var UserEventsTable = /** @class */ (function (_super) {
|
|
31108
|
-
__extends(UserEventsTable, _super);
|
|
31109
|
-
function UserEventsTable(injector, accountService, service, entities, cd, environment) {
|
|
31110
|
-
var _this = _super.call(this, injector,
|
|
31111
|
-
// columns
|
|
31112
|
-
RESERVED_START_COLUMNS
|
|
31113
|
-
.concat([
|
|
31114
|
-
'creationDate',
|
|
31115
|
-
'icon',
|
|
31116
|
-
'eventType',
|
|
31117
|
-
'message'
|
|
31118
|
-
])
|
|
31119
|
-
.concat(RESERVED_END_COLUMNS), null, null) || this;
|
|
31120
|
-
_this.accountService = accountService;
|
|
31121
|
-
_this.service = service;
|
|
31122
|
-
_this.entities = entities;
|
|
31123
|
-
_this.cd = cd;
|
|
31124
|
-
_this.environment = environment;
|
|
31125
|
-
_this.i18nColumnPrefix = 'SOCIAL.USER_EVENT.';
|
|
31126
|
-
_this.autoLoad = false; // this.start()
|
|
31127
|
-
_this.inlineEdition = false;
|
|
31128
|
-
_this.defaultSortBy = 'creationDate';
|
|
31129
|
-
_this.defaultSortDirection = 'desc';
|
|
31130
|
-
return _this;
|
|
31131
|
-
}
|
|
31132
|
-
UserEventsTable.prototype.ngOnInit = function () {
|
|
31133
|
-
_super.prototype.ngOnInit.call(this);
|
|
31134
|
-
// Load date/time pattern
|
|
31135
|
-
this.dateTimePattern = this.translate.instant('COMMON.DATE_TIME_PATTERN');
|
|
31136
|
-
this.withContent = toBoolean(this.withContent, false);
|
|
31137
|
-
var account = this.accountService.account;
|
|
31138
|
-
var pubkey = account && account.pubkey;
|
|
31139
|
-
this.isAdmin = this.accountService.isAdmin();
|
|
31140
|
-
this.canEdit = this.isAdmin || pubkey === this.recipient;
|
|
31141
|
-
this.canDelete = this.canEdit;
|
|
31142
|
-
this.setDatasource(new EntitiesTableDataSource(exports.UserEvent, this.service, null, {
|
|
31143
|
-
prependNewElements: false,
|
|
31144
|
-
suppressErrors: true,
|
|
31145
|
-
dataServiceOptions: {
|
|
31146
|
-
withContent: this.withContent
|
|
31147
|
-
}
|
|
31148
|
-
}));
|
|
31149
|
-
var filter = this.filter || new exports.UserEventFilter();
|
|
31150
|
-
filter.recipients = [this.recipient];
|
|
31151
|
-
this.setFilter(filter, { emitEvent: true });
|
|
31152
|
-
};
|
|
31153
|
-
UserEventsTable.prototype.start = function () {
|
|
31154
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
31155
|
-
return __generator(this, function (_a) {
|
|
31156
|
-
switch (_a.label) {
|
|
31157
|
-
case 0:
|
|
31158
|
-
console.debug('[user-event] Starting...');
|
|
31159
|
-
// Waiting account to be ready
|
|
31160
|
-
return [4 /*yield*/, this.accountService.ready()];
|
|
31161
|
-
case 1:
|
|
31162
|
-
// Waiting account to be ready
|
|
31163
|
-
_a.sent();
|
|
31164
|
-
// Load data
|
|
31165
|
-
this.onRefresh.emit();
|
|
31166
|
-
return [2 /*return*/];
|
|
31167
|
-
}
|
|
31168
|
-
});
|
|
31169
|
-
});
|
|
31170
|
-
};
|
|
31171
|
-
UserEventsTable.prototype.getIcon = function (source) {
|
|
31172
|
-
return ICONS_MAP[source.type];
|
|
31173
|
-
};
|
|
31174
|
-
UserEventsTable.prototype.getDetail = function (source) {
|
|
31175
|
-
if (!source)
|
|
31176
|
-
return undefined;
|
|
31177
|
-
if (source.content && source.type === UserEventTypes.DEBUG_DATA) {
|
|
31178
|
-
var context = source.content.context;
|
|
31179
|
-
if (context && context.__typename) {
|
|
31180
|
-
// const actions = this.service.getActionsByTypename(context.__typename);
|
|
31181
|
-
return {
|
|
31182
|
-
// actions,
|
|
31183
|
-
title: source.content.error && source.content.error.message || source.content.message,
|
|
31184
|
-
description: source.content.error && source.content.error.details || undefined
|
|
31185
|
-
};
|
|
31186
|
-
}
|
|
31187
|
-
}
|
|
31188
|
-
console.debug('TODO: implement getDetail() for event: ', source);
|
|
31189
|
-
return {};
|
|
31190
|
-
};
|
|
31191
|
-
UserEventsTable.prototype.doAction = function (action, row) {
|
|
31192
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
31193
|
-
var event, res, _a, err_1;
|
|
31194
|
-
return __generator(this, function (_b) {
|
|
31195
|
-
switch (_b.label) {
|
|
31196
|
-
case 0:
|
|
31197
|
-
event = row.currentData;
|
|
31198
|
-
// const context = event.content && event.content.context;
|
|
31199
|
-
this.markAsLoading();
|
|
31200
|
-
if (!(action && typeof action.executeAction === 'function')) return [3 /*break*/, 7];
|
|
31201
|
-
_b.label = 1;
|
|
31202
|
-
case 1:
|
|
31203
|
-
_b.trys.push([1, 5, 6, 7]);
|
|
31204
|
-
res = action.executeAction(event /*, context*/);
|
|
31205
|
-
if (!(res instanceof Promise)) return [3 /*break*/, 3];
|
|
31206
|
-
return [4 /*yield*/, res];
|
|
31207
|
-
case 2:
|
|
31208
|
-
_a = _b.sent();
|
|
31209
|
-
return [3 /*break*/, 4];
|
|
31210
|
-
case 3:
|
|
31211
|
-
_a = res;
|
|
31212
|
-
_b.label = 4;
|
|
31213
|
-
case 4:
|
|
31214
|
-
res = _a;
|
|
31215
|
-
return [3 /*break*/, 7];
|
|
31216
|
-
case 5:
|
|
31217
|
-
err_1 = _b.sent();
|
|
31218
|
-
this.setError(err_1 && err_1.message || err_1);
|
|
31219
|
-
console.error("[user-event] Failed to execute action " + action.name + ": " + (err_1 && err_1.message || err_1), err_1);
|
|
31220
|
-
return [3 /*break*/, 7];
|
|
31221
|
-
case 6:
|
|
31222
|
-
this.markAsLoaded();
|
|
31223
|
-
return [7 /*endfinally*/];
|
|
31224
|
-
case 7: return [2 /*return*/];
|
|
31225
|
-
}
|
|
31226
|
-
});
|
|
31227
|
-
});
|
|
31228
|
-
};
|
|
31229
|
-
return UserEventsTable;
|
|
31230
|
-
}(AppTable));
|
|
31231
|
-
UserEventsTable.decorators = [
|
|
31232
|
-
{ type: i0.Component, args: [{
|
|
31233
|
-
selector: 'app-user-events-table',
|
|
31234
|
-
template: "\n<!-- Type = options menu -->\n<mat-menu #optionsMenu=\"matMenu\" xPosition=\"after\">\n\n <!-- display columns -->\n <button mat-menu-item\n (click)=\"openSelectColumnsModal($event)\">\n <mat-icon>view_column</mat-icon>\n <ion-label translate>COMMON.DISPLAYED_COLUMNS_DOTS</ion-label>\n </button>\n\n</mat-menu>\n\n<!-- top header -->\n<mat-toolbar>\n\n <ng-container *ngIf=\"!selection.hasValue(); else hasSelection\">\n\n <button mat-icon-button [title]=\"'COMMON.BTN_REFRESH'|translate\" (click)=\"onRefresh.emit()\">\n <mat-icon>refresh</mat-icon>\n </button>\n\n </ng-container>\n\n <!-- if row selection -->\n <ng-template #hasSelection>\n\n <!-- delete -->\n <button mat-icon-button class=\"hidden-xs hidden-sm\" *ngIf=\"canDelete\"\n [title]=\"'COMMON.BTN_DELETE'|translate\" (click)=\"deleteSelection($event)\">\n <mat-icon>delete</mat-icon>\n </button>\n </ng-template>\n\n <!-- error -->\n <ion-item *ngIf=\"error\" hidden-xs hidden-sm hidden-mobile lines=\"none\">\n <ion-icon color=\"danger\" slot=\"start\" name=\"alert-circle\"></ion-icon>\n <ion-label color=\"danger\" class=\"error\" [innerHTML]=\"error|translate\"></ion-label>\n </ion-item>\n\n <div class=\"toolbar-spacer\"></div>\n\n <button mat-icon-button\n [title]=\"'COMMON.BTN_OPTIONS'|translate\"\n [matMenuTriggerFor]=\"optionsMenu\">\n <mat-icon>more_vert</mat-icon>\n </button>\n</mat-toolbar>\n\n\n<mat-table [dataSource]=\"dataSource\" matSort\n [matSortActive]=\"defaultSortBy\"\n [matSortDirection]=\"defaultSortDirection\"\n matSortDisableClear [trackBy]=\"trackByFn\">\n\n <!-- select -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef [class.cdk-visually-hidden]=\"!canEdit\">\n <mat-checkbox (change)=\"$event ? masterToggle() : null\" [checked]=\"selection.hasValue() && isAllSelected()\"\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\" [class.cdk-visually-hidden]=\"!canEdit\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null\" [checked]=\"selection.isSelected(row)\">\n </mat-checkbox>\n </mat-cell>\n </ng-container>\n\n <!-- id -->\n <ng-container matColumnDef=\"id\">\n <mat-header-cell *matHeaderCellDef mat-sort-header [class.cdk-visually-hidden]=\"!isAdmin\">\n <app-loading-spinner [loading]=\"loadingSubject|async\"><ion-label>#</ion-label></app-loading-spinner>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\" [class.cdk-visually-hidden]=\"!isAdmin\">{{ row.currentData.id | mathAbs }}</mat-cell>\n </ng-container>\n\n <!-- creationDate -->\n <ng-container matColumnDef=\"creationDate\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n <ion-label translate>SOCIAL.USER_EVENT.CREATION_DATE</ion-label>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <ion-text>\n {{row.currentData.creationDate | dateFromNow }}<br/>\n <ion-text color=\"medium\"><small>{{row.currentData.creationDate | dateFormat: {time: true} }}</small></ion-text>\n </ion-text>\n </mat-cell>\n </ng-container>\n\n <!-- icon -->\n <ng-container matColumnDef=\"icon\">\n <mat-header-cell *matHeaderCellDef>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row;\">\n <ng-container *ngIf=\"getIcon(row.currentData); let details\">\n <ion-icon slot=\"start\" *ngIf=\"details.icon\" [name]=\"details.icon\"></ion-icon>\n <mat-icon slot=\"start\" *ngIf=\"details.matIcon\">{{details.matIcon}}</mat-icon>\n </ng-container>\n </mat-cell>\n </ng-container>\n\n <!-- event type -->\n <ng-container matColumnDef=\"eventType\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n <ion-label translate>SOCIAL.USER_EVENT.EVENT_TYPE</ion-label>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row;\">\n <span>{{'SOCIAL.USER_EVENT.TYPE_ENUM.' + row.currentData.eventType | translate}}</span>\n </mat-cell>\n </ng-container>\n\n <!-- message -->\n <ng-container matColumnDef=\"message\">\n <mat-header-cell *matHeaderCellDef>\n <ion-label translate>SOCIAL.USER_EVENT.MESSAGE</ion-label>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row;\">\n <ng-container *ngIf=\"getDetail(row.currentData); let details\">\n <ion-text [innerHTML]=\"details.title|translate\">\n </ion-text>\n </ng-container>\n </mat-cell>\n </ng-container>\n\n <!-- Actions buttons column -->\n <ng-container matColumnDef=\"actions\">\n <mat-header-cell *matHeaderCellDef>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <ng-container *ngIf=\"getDetail(row.currentData); let details\">\n <button mat-icon-button color=\"light\"\n *ngFor=\"let action of details.actions\"\n [title]=\"action.title |translate\"\n [color]=\"action.color\"\n (click)=\"doAction(action, row)\">\n <app-icon slot=\"start\" *ngIf=\"action.iconRef\" [ref]=\"action.iconRef\"></app-icon>\n </button>\n </ng-container>\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns;\"\n class=\"mat-row-disabled\"\n (click)=\"clickRow($event, row)\"></mat-row>\n\n</mat-table>\n\n<ion-row class=\"ion-no-padding\">\n <ion-col></ion-col>\n <ion-col class=\"ion-no-padding\" size=\"auto\">\n <mat-paginator [length]=\"totalRowCount\" [pageSize]=\"defaultPageSize\" [pageSizeOptions]=\"defaultPageSizeOptions\" showFirstLastButtons>\n </mat-paginator>\n </ion-col>\n</ion-row>\n",
|
|
31235
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
31236
|
-
providers: [
|
|
31237
|
-
{
|
|
31238
|
-
provide: USER_EVENT_SERVICE, useClass: UserEventService
|
|
31239
|
-
}
|
|
31240
|
-
],
|
|
31241
|
-
styles: [".mat-header-row .mat-column-icon,.mat-row .mat-column-icon{max-width:40px;padding-left:0}.mat-header-row .mat-column-icon ion-icon,.mat-header-row .mat-column-icon mat-icon,.mat-row .mat-column-icon ion-icon,.mat-row .mat-column-icon mat-icon{font-size:1.2em;height:1.2em;width:1.2em}.mat-header-row .mat-column-creationDate,.mat-row .mat-column-creationDate{min-width:100px;max-width:120px}"]
|
|
31242
|
-
},] }
|
|
31243
|
-
];
|
|
31244
|
-
UserEventsTable.ctorParameters = function () { return [
|
|
31245
|
-
{ type: i0.Injector },
|
|
31246
|
-
{ type: AccountService },
|
|
31247
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [USER_EVENT_SERVICE,] }] },
|
|
31248
|
-
{ type: EntitiesStorage },
|
|
31249
|
-
{ type: i0.ChangeDetectorRef },
|
|
31250
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
31251
|
-
]; };
|
|
31252
|
-
UserEventsTable.propDecorators = {
|
|
31253
|
-
recipient: [{ type: i0.Input }],
|
|
31254
|
-
withContent: [{ type: i0.Input }],
|
|
31255
|
-
defaultSortBy: [{ type: i0.Input }],
|
|
31256
|
-
defaultSortDirection: [{ type: i0.Input }]
|
|
31257
|
-
};
|
|
31258
30806
|
|
|
31259
30807
|
var UserEventNotificationList = /** @class */ (function () {
|
|
31260
30808
|
function UserEventNotificationList(cd, popoverController, userEventService) {
|
|
@@ -31439,106 +30987,6 @@
|
|
|
31439
30987
|
disabled: [{ type: i0.Input }]
|
|
31440
30988
|
};
|
|
31441
30989
|
|
|
31442
|
-
var UserEventTestService = /** @class */ (function (_super) {
|
|
31443
|
-
__extends(UserEventTestService, _super);
|
|
31444
|
-
function UserEventTestService(graphql, accountService, network, translate, environment) {
|
|
31445
|
-
var _this = _super.call(this, graphql, accountService, network, translate, {
|
|
31446
|
-
queries: {
|
|
31447
|
-
loadAll: null,
|
|
31448
|
-
loadAllWithContent: null
|
|
31449
|
-
},
|
|
31450
|
-
production: environment === null || environment === void 0 ? void 0 : environment.production
|
|
31451
|
-
}) || this;
|
|
31452
|
-
_this.graphql = graphql;
|
|
31453
|
-
_this.accountService = accountService;
|
|
31454
|
-
_this.network = network;
|
|
31455
|
-
_this.translate = translate;
|
|
31456
|
-
_this.environment = environment;
|
|
31457
|
-
_this.userEvents = [];
|
|
31458
|
-
return _this;
|
|
31459
|
-
}
|
|
31460
|
-
UserEventTestService.prototype.fromObject = function (source) {
|
|
31461
|
-
return exports.UserEvent.fromObject(source);
|
|
31462
|
-
};
|
|
31463
|
-
UserEventTestService.prototype.add = function (entity) {
|
|
31464
|
-
entity = this.processUserEvent(entity);
|
|
31465
|
-
entity.id = this.userEvents.length + 1;
|
|
31466
|
-
this.userEvents.push(entity);
|
|
31467
|
-
this.count$.next(this.userEvents.length);
|
|
31468
|
-
};
|
|
31469
|
-
UserEventTestService.prototype.asFilter = function (filter) {
|
|
31470
|
-
return filter;
|
|
31471
|
-
};
|
|
31472
|
-
UserEventTestService.prototype.count = function (filter, options) {
|
|
31473
|
-
return Promise.resolve(this.userEvents.length);
|
|
31474
|
-
};
|
|
31475
|
-
UserEventTestService.prototype.delete = function (entity) {
|
|
31476
|
-
return Promise.resolve(undefined);
|
|
31477
|
-
};
|
|
31478
|
-
UserEventTestService.prototype.deleteAll = function (data, opts) {
|
|
31479
|
-
return Promise.resolve(undefined);
|
|
31480
|
-
};
|
|
31481
|
-
UserEventTestService.prototype.listenChanges = function (filter, options) {
|
|
31482
|
-
return rxjs.of();
|
|
31483
|
-
};
|
|
31484
|
-
UserEventTestService.prototype.save = function (entity, options) {
|
|
31485
|
-
var _a;
|
|
31486
|
-
var toSave = (_a = this.userEvents) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id == (entity === null || entity === void 0 ? void 0 : entity.id); });
|
|
31487
|
-
Object.assign(toSave, entity);
|
|
31488
|
-
return entity;
|
|
31489
|
-
};
|
|
31490
|
-
UserEventTestService.prototype.saveAll = function (data, opts) {
|
|
31491
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
31492
|
-
var _b, _c, entity, e_1_1;
|
|
31493
|
-
var e_1, _d;
|
|
31494
|
-
return __generator(this, function (_e) {
|
|
31495
|
-
switch (_e.label) {
|
|
31496
|
-
case 0:
|
|
31497
|
-
_e.trys.push([0, 5, 6, 7]);
|
|
31498
|
-
_b = __values((data || [])), _c = _b.next();
|
|
31499
|
-
_e.label = 1;
|
|
31500
|
-
case 1:
|
|
31501
|
-
if (!!_c.done) return [3 /*break*/, 4];
|
|
31502
|
-
entity = _c.value;
|
|
31503
|
-
return [4 /*yield*/, this.save(entity)];
|
|
31504
|
-
case 2:
|
|
31505
|
-
_e.sent();
|
|
31506
|
-
_e.label = 3;
|
|
31507
|
-
case 3:
|
|
31508
|
-
_c = _b.next();
|
|
31509
|
-
return [3 /*break*/, 1];
|
|
31510
|
-
case 4: return [3 /*break*/, 7];
|
|
31511
|
-
case 5:
|
|
31512
|
-
e_1_1 = _e.sent();
|
|
31513
|
-
e_1 = { error: e_1_1 };
|
|
31514
|
-
return [3 /*break*/, 7];
|
|
31515
|
-
case 6:
|
|
31516
|
-
try {
|
|
31517
|
-
if (_c && !_c.done && (_d = _b.return)) _d.call(_b);
|
|
31518
|
-
}
|
|
31519
|
-
finally { if (e_1) throw e_1.error; }
|
|
31520
|
-
return [7 /*endfinally*/];
|
|
31521
|
-
case 7: return [2 /*return*/, Promise.resolve(this.userEvents)];
|
|
31522
|
-
}
|
|
31523
|
-
});
|
|
31524
|
-
});
|
|
31525
|
-
};
|
|
31526
|
-
UserEventTestService.prototype.watchAll = function (offset, size, sortBy, sortDirection, filter, options) {
|
|
31527
|
-
return rxjs.of({ data: this.userEvents });
|
|
31528
|
-
};
|
|
31529
|
-
return UserEventTestService;
|
|
31530
|
-
}(AbstractUserEventService));
|
|
31531
|
-
UserEventTestService.decorators = [
|
|
31532
|
-
{ type: i0.Injectable }
|
|
31533
|
-
];
|
|
31534
|
-
UserEventTestService.ctorParameters = function () { return [
|
|
31535
|
-
{ type: GraphqlService },
|
|
31536
|
-
{ type: AccountService },
|
|
31537
|
-
{ type: NetworkService },
|
|
31538
|
-
{ type: i1$2.TranslateService },
|
|
31539
|
-
{ type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
31540
|
-
]; };
|
|
31541
|
-
|
|
31542
30990
|
var UserEventModule = /** @class */ (function () {
|
|
31543
30991
|
function UserEventModule() {
|
|
31544
30992
|
}
|
|
@@ -31552,16 +31000,11 @@
|
|
|
31552
31000
|
AppIconModule
|
|
31553
31001
|
],
|
|
31554
31002
|
declarations: [
|
|
31555
|
-
UserEventsTable,
|
|
31556
31003
|
UserEventNotificationComponent,
|
|
31557
|
-
UserEventNotificationList
|
|
31004
|
+
UserEventNotificationList
|
|
31558
31005
|
],
|
|
31559
31006
|
exports: [
|
|
31560
|
-
UserEventsTable,
|
|
31561
31007
|
UserEventNotificationComponent
|
|
31562
|
-
],
|
|
31563
|
-
providers: [
|
|
31564
|
-
{ provide: USER_EVENT_SERVICE, useClass: UserEventTestService }
|
|
31565
31008
|
]
|
|
31566
31009
|
},] }
|
|
31567
31010
|
];
|
|
@@ -31850,7 +31293,7 @@
|
|
|
31850
31293
|
], exports.JobProgression);
|
|
31851
31294
|
|
|
31852
31295
|
var JobProgressionServiceToken = new i0.InjectionToken('JobProgressionService');
|
|
31853
|
-
var jobProgressionSubscription = core.gql(templateObject_1$
|
|
31296
|
+
var jobProgressionSubscription = core.gql(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["subscription UpdateJobProgression($id: Int!, $interval: Int){\n data: updateJobProgression(id: $id, interval: $interval) {\n id\n name\n message\n current\n total\n }\n}"], ["subscription UpdateJobProgression($id: Int!, $interval: Int){\n data: updateJobProgression(id: $id, interval: $interval) {\n id\n name\n message\n current\n total\n }\n}"])));
|
|
31854
31297
|
var JobProgressionService = /** @class */ (function (_super) {
|
|
31855
31298
|
__extends(JobProgressionService, _super);
|
|
31856
31299
|
function JobProgressionService(graphql, environment) {
|
|
@@ -31890,7 +31333,7 @@
|
|
|
31890
31333
|
{ type: GraphqlService },
|
|
31891
31334
|
{ type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
31892
31335
|
]; };
|
|
31893
|
-
var templateObject_1$
|
|
31336
|
+
var templateObject_1$2;
|
|
31894
31337
|
|
|
31895
31338
|
var JobProgressionList = /** @class */ (function () {
|
|
31896
31339
|
function JobProgressionList() {
|
|
@@ -32158,13 +31601,123 @@
|
|
|
32158
31601
|
SharedModule,
|
|
32159
31602
|
UserEventModule,
|
|
32160
31603
|
JobModule,
|
|
32161
|
-
MessageModule
|
|
31604
|
+
MessageModule
|
|
32162
31605
|
],
|
|
32163
31606
|
},] }
|
|
32164
31607
|
];
|
|
32165
31608
|
|
|
31609
|
+
var UserEvent_1;
|
|
31610
|
+
var UserEventTypes = {
|
|
31611
|
+
DEBUG_DATA: 'DEBUG_DATA',
|
|
31612
|
+
INBOX_MESSAGE: 'INBOX_MESSAGE'
|
|
31613
|
+
};
|
|
31614
|
+
// @dynamic
|
|
31615
|
+
exports.UserEvent = UserEvent_1 = /** @class */ (function (_super) {
|
|
31616
|
+
__extends(UserEvent, _super);
|
|
31617
|
+
function UserEvent() {
|
|
31618
|
+
return _super.call(this, UserEvent_1.TYPENAME) || this;
|
|
31619
|
+
}
|
|
31620
|
+
UserEvent.prototype.asObject = function (opts) {
|
|
31621
|
+
var target = _super.prototype.asObject.call(this, opts);
|
|
31622
|
+
target.creationDate = toDateISOString(this.creationDate);
|
|
31623
|
+
target.readDate = toDateISOString(this.readDate);
|
|
31624
|
+
// Serialize content
|
|
31625
|
+
if (typeof target.content === 'object') {
|
|
31626
|
+
target.content = JSON.stringify(target.content);
|
|
31627
|
+
}
|
|
31628
|
+
delete target.avatar;
|
|
31629
|
+
delete target.avatarIcon;
|
|
31630
|
+
delete target.icon;
|
|
31631
|
+
delete target.actions;
|
|
31632
|
+
return target;
|
|
31633
|
+
};
|
|
31634
|
+
UserEvent.prototype.fromObject = function (source) {
|
|
31635
|
+
Object.assign(this, source); // Copy all properties
|
|
31636
|
+
_super.prototype.fromObject.call(this, source);
|
|
31637
|
+
this.creationDate = fromDateISOString(source.creationDate);
|
|
31638
|
+
this.readDate = fromDateISOString(source.readDate);
|
|
31639
|
+
try {
|
|
31640
|
+
// Deserialize content
|
|
31641
|
+
if (typeof source.content === 'string' && source.content.startsWith('{')) {
|
|
31642
|
+
this.content = JSON.parse(source.content);
|
|
31643
|
+
}
|
|
31644
|
+
// Deserialize content.context
|
|
31645
|
+
if (this.content && typeof this.content.context === 'string' && this.content.context.startsWith('{')) {
|
|
31646
|
+
this.content.context = JSON.parse(this.content.context);
|
|
31647
|
+
}
|
|
31648
|
+
}
|
|
31649
|
+
catch (err) {
|
|
31650
|
+
console.error('Error during UserEvent deserialization', err);
|
|
31651
|
+
}
|
|
31652
|
+
};
|
|
31653
|
+
return UserEvent;
|
|
31654
|
+
}(Entity));
|
|
31655
|
+
exports.UserEvent = UserEvent_1 = __decorate([
|
|
31656
|
+
EntityClass({ typename: 'UserEventVO' })
|
|
31657
|
+
], exports.UserEvent);
|
|
31658
|
+
// @dynamic
|
|
31659
|
+
exports.UserEventFilter = /** @class */ (function (_super) {
|
|
31660
|
+
__extends(UserEventFilter, _super);
|
|
31661
|
+
function UserEventFilter() {
|
|
31662
|
+
var _this = _super.apply(this, __spread(arguments)) || this;
|
|
31663
|
+
_this.types = [];
|
|
31664
|
+
_this.levels = [];
|
|
31665
|
+
_this.issuers = [];
|
|
31666
|
+
_this.recipients = [];
|
|
31667
|
+
_this.startDate = null;
|
|
31668
|
+
_this.excludeRead = false;
|
|
31669
|
+
return _this;
|
|
31670
|
+
}
|
|
31671
|
+
UserEventFilter.prototype.fromObject = function (source, opts) {
|
|
31672
|
+
_super.prototype.fromObject.call(this, source, opts);
|
|
31673
|
+
this.types = source.types || [];
|
|
31674
|
+
this.levels = source.levels || [];
|
|
31675
|
+
this.issuers = source.issuers || [];
|
|
31676
|
+
this.recipients = source.recipients || [];
|
|
31677
|
+
this.startDate = fromDateISOString(source.startDate);
|
|
31678
|
+
this.excludeRead = source.excludeRead || false;
|
|
31679
|
+
};
|
|
31680
|
+
UserEventFilter.prototype.buildFilter = function () {
|
|
31681
|
+
var _this = this;
|
|
31682
|
+
var filterFns = _super.prototype.buildFilter.call(this);
|
|
31683
|
+
if (isNotEmptyArray(this.types)) {
|
|
31684
|
+
filterFns.push(function (t) { return _this.types.includes(t.type); });
|
|
31685
|
+
}
|
|
31686
|
+
if (isNotEmptyArray(this.levels)) {
|
|
31687
|
+
filterFns.push(function (t) { return _this.levels.includes(t.level); });
|
|
31688
|
+
}
|
|
31689
|
+
if (isNotEmptyArray(this.issuers)) {
|
|
31690
|
+
filterFns.push(function (t) { return _this.issuers.includes(t.issuer); });
|
|
31691
|
+
}
|
|
31692
|
+
if (isNotEmptyArray(this.recipients)) {
|
|
31693
|
+
filterFns.push(function (t) { return _this.recipients.includes(t.recipient); });
|
|
31694
|
+
}
|
|
31695
|
+
if (isNotNil(this.startDate)) {
|
|
31696
|
+
filterFns.push(function (t) { return _this.startDate.isSameOrBefore(t.creationDate); });
|
|
31697
|
+
}
|
|
31698
|
+
if (this.excludeRead === true) {
|
|
31699
|
+
filterFns.push(function (t) { return isNil(t.readSignature); }); // todo or t.signature ?
|
|
31700
|
+
}
|
|
31701
|
+
return filterFns;
|
|
31702
|
+
};
|
|
31703
|
+
UserEventFilter.prototype.asObject = function (opts) {
|
|
31704
|
+
var target = _super.prototype.asObject.call(this, opts);
|
|
31705
|
+
return target;
|
|
31706
|
+
};
|
|
31707
|
+
return UserEventFilter;
|
|
31708
|
+
}(EntityFilter));
|
|
31709
|
+
exports.UserEventFilter = __decorate([
|
|
31710
|
+
EntityClass({ typename: 'UserEventFilterVO' })
|
|
31711
|
+
], exports.UserEventFilter);
|
|
31712
|
+
|
|
31713
|
+
var UserEventFragments = {
|
|
31714
|
+
userEvent: core.gql(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["fragment UserEventFragment on UserEventVO {\n id\n issuer\n updateDate\n creationDate\n eventType\n recipient\n content\n hash\n signature\n readSignature\n __typename\n }"], ["fragment UserEventFragment on UserEventVO {\n id\n issuer\n updateDate\n creationDate\n eventType\n recipient\n content\n hash\n signature\n readSignature\n __typename\n }"]))),
|
|
31715
|
+
lightUserEvent: core.gql(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["fragment LightUserEventFragment on UserEventVO {\n id\n issuer\n recipient\n updateDate\n creationDate\n eventType\n readSignature\n __typename\n }"], ["fragment LightUserEventFragment on UserEventVO {\n id\n issuer\n recipient\n updateDate\n creationDate\n eventType\n readSignature\n __typename\n }"])))
|
|
31716
|
+
};
|
|
31717
|
+
var templateObject_1$3, templateObject_2$2;
|
|
31718
|
+
|
|
32166
31719
|
var Mutations = {
|
|
32167
|
-
send: core.gql(templateObject_1$
|
|
31720
|
+
send: core.gql(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["mutation SendMessage($data: MessageVOInput){\n done: sendMessage(message: $data)\n }"], ["mutation SendMessage($data: MessageVOInput){\n done: sendMessage(message: $data)\n }"])))
|
|
32168
31721
|
};
|
|
32169
31722
|
var MessageService = /** @class */ (function (_super) {
|
|
32170
31723
|
__extends(MessageService, _super);
|
|
@@ -32248,7 +31801,7 @@
|
|
|
32248
31801
|
{ type: i1$5.ToastController },
|
|
32249
31802
|
{ type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
32250
31803
|
]; };
|
|
32251
|
-
var templateObject_1$
|
|
31804
|
+
var templateObject_1$4;
|
|
32252
31805
|
|
|
32253
31806
|
var PersonFilter_1;
|
|
32254
31807
|
// @dynamic
|
|
@@ -32307,15 +31860,15 @@
|
|
|
32307
31860
|
], exports.PersonFilter);
|
|
32308
31861
|
|
|
32309
31862
|
var PersonFragments = {
|
|
32310
|
-
person: core.gql(templateObject_1$
|
|
31863
|
+
person: core.gql(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["fragment PersonFragment on PersonVO {\n id\n firstName\n lastName\n email\n pubkey\n avatar\n statusId\n updateDate\n creationDate\n profiles\n username\n usernameExtranet\n department {\n id\n label\n name\n logo\n __typename\n }\n __typename\n }"], ["fragment PersonFragment on PersonVO {\n id\n firstName\n lastName\n email\n pubkey\n avatar\n statusId\n updateDate\n creationDate\n profiles\n username\n usernameExtranet\n department {\n id\n label\n name\n logo\n __typename\n }\n __typename\n }"])))
|
|
32311
31864
|
};
|
|
32312
31865
|
// Load persons query
|
|
32313
31866
|
var PersonQueries = {
|
|
32314
|
-
loadAll: core.gql(templateObject_2$
|
|
32315
|
-
loadAllWithTotal: core.gql(templateObject_3$
|
|
31867
|
+
loadAll: core.gql(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query Persons($offset: Int, $size: Int, $sortBy: String, $sortDirection: String, $filter: PersonFilterVOInput){\n data: persons(filter: $filter, offset: $offset, size: $size, sortBy: $sortBy, sortDirection: $sortDirection){\n ...PersonFragment\n }\n }\n ", ""], ["\n query Persons($offset: Int, $size: Int, $sortBy: String, $sortDirection: String, $filter: PersonFilterVOInput){\n data: persons(filter: $filter, offset: $offset, size: $size, sortBy: $sortBy, sortDirection: $sortDirection){\n ...PersonFragment\n }\n }\n ", ""])), PersonFragments.person),
|
|
31868
|
+
loadAllWithTotal: core.gql(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n query PersonsWithTotal($offset: Int, $size: Int, $sortBy: String, $sortDirection: String, $filter: PersonFilterVOInput){\n data: persons(filter: $filter, offset: $offset, size: $size, sortBy: $sortBy, sortDirection: $sortDirection){\n ...PersonFragment\n }\n total: personsCount(filter: $filter)\n }\n ", ""], ["\n query PersonsWithTotal($offset: Int, $size: Int, $sortBy: String, $sortDirection: String, $filter: PersonFilterVOInput){\n data: persons(filter: $filter, offset: $offset, size: $size, sortBy: $sortBy, sortDirection: $sortDirection){\n ...PersonFragment\n }\n total: personsCount(filter: $filter)\n }\n ", ""])), PersonFragments.person)
|
|
32316
31869
|
};
|
|
32317
31870
|
var PersonMutations = {
|
|
32318
|
-
saveAll: core.gql(templateObject_4$
|
|
31871
|
+
saveAll: core.gql(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n mutation savePersons($data:[PersonVOInput]){\n data: savePersons(persons: $data){\n ...PersonFragment\n }\n }\n ", ""], ["\n mutation savePersons($data:[PersonVOInput]){\n data: savePersons(persons: $data){\n ...PersonFragment\n }\n }\n ", ""])), PersonFragments.person),
|
|
32319
31872
|
deleteAll: core.gql(templateObject_5$2 || (templateObject_5$2 = __makeTemplateObject(["\n mutation deletePersons($ids:[Int]){\n deletePersons(ids: $ids)\n }"], ["\n mutation deletePersons($ids:[Int]){\n deletePersons(ids: $ids)\n }"])))
|
|
32320
31873
|
};
|
|
32321
31874
|
var PersonService = /** @class */ (function (_super_1) {
|
|
@@ -32447,7 +32000,7 @@
|
|
|
32447
32000
|
{ type: NetworkService },
|
|
32448
32001
|
{ type: EntitiesStorage }
|
|
32449
32002
|
]; };
|
|
32450
|
-
var templateObject_1$
|
|
32003
|
+
var templateObject_1$5, templateObject_2$3, templateObject_3$2, templateObject_4$2, templateObject_5$2;
|
|
32451
32004
|
|
|
32452
32005
|
var PersonValidatorService = /** @class */ (function () {
|
|
32453
32006
|
function PersonValidatorService(formBuilder, accountValidatorService) {
|
|
@@ -34581,9 +34134,7 @@
|
|
|
34581
34134
|
exports.UserEventFragments = UserEventFragments;
|
|
34582
34135
|
exports.UserEventModule = UserEventModule;
|
|
34583
34136
|
exports.UserEventNotificationComponent = UserEventNotificationComponent;
|
|
34584
|
-
exports.UserEventService = UserEventService;
|
|
34585
34137
|
exports.UserEventTypes = UserEventTypes;
|
|
34586
|
-
exports.UserEventsTable = UserEventsTable;
|
|
34587
34138
|
exports.UsersPage = UsersPage;
|
|
34588
34139
|
exports.accountToString = accountToString;
|
|
34589
34140
|
exports.adaptValueToControl = adaptValueToControl;
|
|
@@ -34747,13 +34298,12 @@
|
|
|
34747
34298
|
exports.ɵh = LocalSettingsValidatorService;
|
|
34748
34299
|
exports.ɵi = AppUpdateOfflineModeCard;
|
|
34749
34300
|
exports.ɵj = UserEventNotificationList;
|
|
34750
|
-
exports.ɵk =
|
|
34751
|
-
exports.ɵl =
|
|
34752
|
-
exports.ɵm =
|
|
34753
|
-
exports.ɵn =
|
|
34754
|
-
exports.ɵo =
|
|
34755
|
-
exports.ɵp =
|
|
34756
|
-
exports.ɵq = ToastTestingPage;
|
|
34301
|
+
exports.ɵk = JobProgressionList;
|
|
34302
|
+
exports.ɵl = DateTestPage;
|
|
34303
|
+
exports.ɵm = NumpadTestPage;
|
|
34304
|
+
exports.ɵn = MatBadgeIconTestPage;
|
|
34305
|
+
exports.ɵo = ToastTestingModule;
|
|
34306
|
+
exports.ɵp = ToastTestingPage;
|
|
34757
34307
|
|
|
34758
34308
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
34759
34309
|
|