@sumaris-net/ngx-components 1.21.0-beta9 → 1.21.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.
- package/bundles/sumaris-net.ngx-components.umd.js +475 -1174
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +9 -0
- package/esm2015/public_api.js +3 -8
- package/esm2015/src/app/core/account/account.js +2 -2
- package/esm2015/src/app/core/auth/form/form-auth.js +4 -2
- package/esm2015/src/app/core/form/editor.class.js +7 -1
- package/esm2015/src/app/core/form/entity-editor-modal.class.js +17 -6
- package/esm2015/src/app/core/form/entity-editor.class.js +1 -1
- package/esm2015/src/app/core/form/form.class.js +62 -33
- package/esm2015/src/app/core/graphql/graphql.service.js +5 -3
- package/esm2015/src/app/core/icon/icon.component.js +2 -5
- package/esm2015/src/app/core/menu/menu.component.js +2 -2
- package/esm2015/src/app/core/services/local-settings.service.js +2 -2
- package/esm2015/src/app/core/table/table.class.js +18 -23
- package/esm2015/src/app/shared/functions.js +1 -60
- package/esm2015/src/app/shared/material/autocomplete/material.autocomplete.js +5 -4
- package/esm2015/src/app/shared/material/autocomplete/testing/autocomplete.test.js +10 -7
- package/esm2015/src/app/shared/material/chips/material.chips.js +3 -2
- package/esm2015/src/app/shared/material/chips/testing/chips.test.js +3 -2
- package/esm2015/src/app/shared/material/datetime/material.date.js +3 -2
- package/esm2015/src/app/shared/material/datetime/material.datetime.js +3 -2
- package/esm2015/src/app/shared/observables.js +13 -7
- package/esm2015/src/app/shared/pipes/arrays.pipe.js +1 -1
- package/esm2015/src/app/shared/pipes/form.pipes.js +4 -6
- package/esm2015/src/app/shared/pipes/highlight.pipe.js +4 -4
- package/esm2015/src/app/shared/pipes/string.pipes.js +7 -18
- package/esm2015/src/app/shared/services/memory-entity-service.class.js +13 -1
- package/esm2015/src/app/shared/services.js +61 -0
- package/esm2015/src/app/shared/types.js +1 -1
- package/esm2015/src/app/social/social.errors.js +2 -5
- package/esm2015/src/app/social/social.module.js +15 -10
- package/esm2015/src/app/social/user-event/user-event.model.js +2 -58
- package/esm2015/src/app/social/user-event/user-event.service.js +167 -295
- package/esm2015/src/app/social/user-event/user-events.table.js +12 -17
- package/esm2015/sumaris-net.ngx-components.js +6 -8
- package/fesm2015/sumaris-net.ngx-components.js +387 -972
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +3 -2
- package/public_api.d.ts +2 -7
- package/src/app/core/auth/form/form-auth.d.ts +1 -1
- package/src/app/core/form/editor.class.d.ts +14 -1
- package/src/app/core/form/entity-editor-modal.class.d.ts +1 -0
- package/src/app/core/form/entity-editor.class.d.ts +6 -2
- package/src/app/core/form/form.class.d.ts +32 -19
- package/src/app/core/icon/icon.component.d.ts +4 -4
- package/src/app/core/table/table.class.d.ts +15 -14
- package/src/app/shared/functions.d.ts +0 -9
- package/src/app/shared/material/autocomplete/testing/autocomplete.test.d.ts +1 -2
- package/src/app/shared/material/badge/badge-icon.test.d.ts +1 -1
- package/src/app/shared/observables.d.ts +1 -0
- package/src/app/shared/pipes/form.pipes.d.ts +1 -2
- package/src/app/shared/services/memory-entity-service.class.d.ts +6 -0
- package/src/app/shared/services.d.ts +9 -0
- package/src/app/shared/types.d.ts +0 -4
- package/src/app/social/social.errors.d.ts +0 -3
- package/src/app/social/social.module.d.ts +0 -8
- package/src/app/social/user-event/user-event.model.d.ts +6 -51
- package/src/app/social/user-event/user-event.service.d.ts +51 -79
- package/src/app/social/user-event/user-events.table.d.ts +6 -6
- package/src/assets/i18n/en-US.json +2 -15
- package/src/assets/i18n/en.json +2 -15
- package/src/assets/i18n/fr.json +1 -14
- package/src/theme/_ngx-components.scss +0 -7
- package/sumaris-net.ngx-components.d.ts +5 -7
- package/sumaris-net.ngx-components.metadata.json +1 -1
- package/esm2015/src/app/social/job/job.model.js +0 -24
- package/esm2015/src/app/social/job/job.module.js +0 -25
- package/esm2015/src/app/social/job/job.service.js +0 -53
- package/esm2015/src/app/social/job/progression/job-progression.component.js +0 -192
- package/esm2015/src/app/social/job/progression/job-progression.list.js +0 -20
- package/esm2015/src/app/social/message/message.module.js +0 -25
- package/esm2015/src/app/social/user-event/notification/user-event-notification.component.js +0 -92
- package/esm2015/src/app/social/user-event/notification/user-event-notification.list.js +0 -39
- package/esm2015/src/app/social/user-event/user-event.module.js +0 -28
- package/src/app/social/job/job.model.d.ts +0 -32
- package/src/app/social/job/job.module.d.ts +0 -2
- package/src/app/social/job/job.service.d.ts +0 -23
- package/src/app/social/job/progression/job-progression.component.d.ts +0 -43
- package/src/app/social/job/progression/job-progression.list.d.ts +0 -12
- package/src/app/social/message/message.module.d.ts +0 -2
- package/src/app/social/user-event/notification/user-event-notification.component.d.ts +0 -25
- package/src/app/social/user-event/notification/user-event-notification.list.d.ts +0 -20
- package/src/app/social/user-event/user-event.module.d.ts +0 -2
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
var SPACE_PLACEHOLDER_CHAR = '\u2000';
|
|
47
47
|
var KEYBOARD_HIDE_DELAY_MS = 250; // 1s
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
/*! *****************************************************************************
|
|
50
50
|
Copyright (c) Microsoft Corporation.
|
|
51
51
|
|
|
52
52
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -208,11 +208,7 @@
|
|
|
208
208
|
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
209
209
|
if (k2 === undefined)
|
|
210
210
|
k2 = k;
|
|
211
|
-
|
|
212
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
213
|
-
desc = { enumerable: true, get: function () { return m[k]; } };
|
|
214
|
-
}
|
|
215
|
-
Object.defineProperty(o, k2, desc);
|
|
211
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
216
212
|
}) : (function (o, m, k, k2) {
|
|
217
213
|
if (k2 === undefined)
|
|
218
214
|
k2 = k;
|
|
@@ -367,11 +363,6 @@
|
|
|
367
363
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
368
364
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
369
365
|
}
|
|
370
|
-
function __classPrivateFieldIn(state, receiver) {
|
|
371
|
-
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
372
|
-
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
373
|
-
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
374
|
-
}
|
|
375
366
|
|
|
376
367
|
function isNil(obj) {
|
|
377
368
|
return obj === undefined || obj === null;
|
|
@@ -509,67 +500,6 @@
|
|
|
509
500
|
function removeDiacritics(text) {
|
|
510
501
|
return text.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
511
502
|
}
|
|
512
|
-
function suggestFromArray(items, value, opts) {
|
|
513
|
-
var _this = this;
|
|
514
|
-
if (isNotNil(value) && typeof value === 'object')
|
|
515
|
-
return { data: [value] };
|
|
516
|
-
value = (typeof value === 'string' && value !== '*') && value.toUpperCase() || undefined;
|
|
517
|
-
var keys = opts && (opts.searchAttribute && [opts.searchAttribute] || opts.searchAttributes) || ['label'];
|
|
518
|
-
if (!items) {
|
|
519
|
-
return { data: [], total: 0 };
|
|
520
|
-
}
|
|
521
|
-
// Filter items
|
|
522
|
-
var filteredItems = items;
|
|
523
|
-
if (isNotNilOrBlank(value)) {
|
|
524
|
-
// If wildcard, search using regexp
|
|
525
|
-
if (value.indexOf('*') !== -1) {
|
|
526
|
-
value = value.replace(/[*]+/g, '.*');
|
|
527
|
-
filteredItems = filteredItems.filter(function (v) { return keys.findIndex(function (key) { return matchUpperCase(getPropertyByPathAsString(v, key), value); }) !== -1; });
|
|
528
|
-
}
|
|
529
|
-
// Else (no wildcard), search using startsWith
|
|
530
|
-
else {
|
|
531
|
-
filteredItems = filteredItems.filter(function (v) { return keys.findIndex(function (key) { return startsWithUpperCase(getPropertyByPathAsString(v, key), value); }) !== -1; });
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
// Exclude ids
|
|
535
|
-
if (isNotEmptyArray(opts === null || opts === void 0 ? void 0 : opts.excludedIds)) {
|
|
536
|
-
filteredItems = filteredItems.filter(function (v) { return !opts.excludedIds.includes(+v['id']); });
|
|
537
|
-
}
|
|
538
|
-
// Sort
|
|
539
|
-
if (!opts || opts.skipSort !== true) {
|
|
540
|
-
// Make to copy input items, before sorting (if not yet already done)
|
|
541
|
-
if (filteredItems === items)
|
|
542
|
-
filteredItems = filteredItems.slice();
|
|
543
|
-
// Sort by keys
|
|
544
|
-
filteredItems.sort(propertiesPathComparator(keys));
|
|
545
|
-
}
|
|
546
|
-
var total = filteredItems.length || 0;
|
|
547
|
-
// Pagination (truncate if need)
|
|
548
|
-
var pageData = filteredItems;
|
|
549
|
-
if (opts) {
|
|
550
|
-
if ((opts.offset || 0) > 0) {
|
|
551
|
-
pageData = pageData.slice(opts.offset);
|
|
552
|
-
}
|
|
553
|
-
if (isNotNil(opts.size) && pageData.length > opts.size) {
|
|
554
|
-
pageData = pageData.slice(0, opts.size);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
var result = {
|
|
558
|
-
data: pageData,
|
|
559
|
-
total: total
|
|
560
|
-
};
|
|
561
|
-
// Add fetch more capability, if total was fetched
|
|
562
|
-
var nextOffset = (opts && opts.offset || 0) + pageData.length;
|
|
563
|
-
if (nextOffset < total) {
|
|
564
|
-
result.fetchMore = function (_) { return __awaiter(_this, void 0, void 0, function () {
|
|
565
|
-
return __generator(this, function (_b) {
|
|
566
|
-
return [2 /*return*/, suggestFromArray(filteredItems, undefined /*OPTIMISATION: already applied*/, Object.assign(Object.assign({}, opts), { offset: nextOffset, skipSort: true, excludedIds: undefined // OPTIMISATION: already filtered
|
|
567
|
-
}))];
|
|
568
|
-
});
|
|
569
|
-
}); };
|
|
570
|
-
}
|
|
571
|
-
return result;
|
|
572
|
-
}
|
|
573
503
|
function suggestFromStringArray(values, value, options) {
|
|
574
504
|
value = (typeof value === 'string' && value !== '*') && value.toUpperCase() || undefined;
|
|
575
505
|
if (isNilOrBlank(value))
|
|
@@ -1117,11 +1047,11 @@
|
|
|
1117
1047
|
}, null);
|
|
1118
1048
|
}
|
|
1119
1049
|
function firstTrue(obs) {
|
|
1120
|
-
return obs.pipe(operators.first(function (
|
|
1050
|
+
return obs.pipe(operators.first(function (value) { return value === true; }), operators.map(function (_) { }) // Convert to void
|
|
1121
1051
|
);
|
|
1122
1052
|
}
|
|
1123
1053
|
function firstFalse(obs) {
|
|
1124
|
-
return obs.pipe(operators.first(function (
|
|
1054
|
+
return obs.pipe(operators.first(function (value) { return value === false; }), operators.map(function (_) { }) // Convert to void
|
|
1125
1055
|
);
|
|
1126
1056
|
}
|
|
1127
1057
|
/**
|
|
@@ -1162,14 +1092,13 @@
|
|
|
1162
1092
|
}
|
|
1163
1093
|
function waitForTrue(observable, opts) {
|
|
1164
1094
|
return __awaiter(this, void 0, void 0, function () {
|
|
1165
|
-
var
|
|
1095
|
+
var $timeout;
|
|
1166
1096
|
return __generator(this, function (_a) {
|
|
1167
|
-
firstTrueObservable = firstTrue(observable);
|
|
1168
1097
|
// Timeout (+ dueTime)
|
|
1169
1098
|
if (opts && opts.timeout > 0) {
|
|
1170
1099
|
$timeout = rxjs.timer(opts.timeout);
|
|
1171
1100
|
return [2 /*return*/, rxjs.merge(rxjs.timer(opts.dueTime || 0)
|
|
1172
|
-
.pipe(operators.switchMap(function () { return
|
|
1101
|
+
.pipe(operators.switchMap(function () { return firstTrue(observable); }), operators.takeUntil($timeout)), $timeout
|
|
1173
1102
|
.pipe(operators.map(function () {
|
|
1174
1103
|
throw new Error("Timeout ready() - after " + opts.timeout + "ms");
|
|
1175
1104
|
})))
|
|
@@ -1178,10 +1107,19 @@
|
|
|
1178
1107
|
// dueTime (without timeout)
|
|
1179
1108
|
if (opts && opts.dueTime > 0) {
|
|
1180
1109
|
return [2 /*return*/, rxjs.timer(opts.dueTime)
|
|
1181
|
-
.pipe(operators.switchMap(function () { return
|
|
1110
|
+
.pipe(operators.switchMap(function () { return firstTrue(observable); }))
|
|
1182
1111
|
.toPromise()];
|
|
1183
1112
|
}
|
|
1184
|
-
return [2 /*return*/,
|
|
1113
|
+
return [2 /*return*/, firstTrue(observable).toPromise()];
|
|
1114
|
+
});
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
function waitForFalse(observable, opts) {
|
|
1118
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1119
|
+
return __generator(this, function (_a) {
|
|
1120
|
+
return [2 /*return*/, waitForTrue(
|
|
1121
|
+
// Inverse the logic
|
|
1122
|
+
observable.pipe(operators.map(function (v) { return v === false; })), opts)];
|
|
1185
1123
|
});
|
|
1186
1124
|
});
|
|
1187
1125
|
}
|
|
@@ -1386,6 +1324,68 @@
|
|
|
1386
1324
|
return _cache.mobile;
|
|
1387
1325
|
};
|
|
1388
1326
|
|
|
1327
|
+
function suggestFromArray(items, value, opts) {
|
|
1328
|
+
var _this = this;
|
|
1329
|
+
if (isNotNil(value) && typeof value === 'object')
|
|
1330
|
+
return { data: [value] };
|
|
1331
|
+
value = (typeof value === 'string' && value !== '*') && value.toUpperCase() || undefined;
|
|
1332
|
+
var keys = opts && (opts.searchAttribute && [opts.searchAttribute] || opts.searchAttributes) || ['label'];
|
|
1333
|
+
if (!items) {
|
|
1334
|
+
return { data: [], total: 0 };
|
|
1335
|
+
}
|
|
1336
|
+
// Filter items
|
|
1337
|
+
var filteredItems = items;
|
|
1338
|
+
if (isNotNilOrBlank(value)) {
|
|
1339
|
+
// If wildcard, search using regexp
|
|
1340
|
+
if (value.indexOf('*') !== -1) {
|
|
1341
|
+
value = value.replace(/[*]+/g, '.*');
|
|
1342
|
+
filteredItems = filteredItems.filter(function (v) { return keys.findIndex(function (key) { return matchUpperCase(getPropertyByPathAsString(v, key), value); }) !== -1; });
|
|
1343
|
+
}
|
|
1344
|
+
// Else (no wildcard), search using startsWith
|
|
1345
|
+
else {
|
|
1346
|
+
filteredItems = filteredItems.filter(function (v) { return keys.findIndex(function (key) { return startsWithUpperCase(getPropertyByPathAsString(v, key), value); }) !== -1; });
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
// Exclude ids
|
|
1350
|
+
if (isNotEmptyArray(opts === null || opts === void 0 ? void 0 : opts.excludedIds)) {
|
|
1351
|
+
filteredItems = filteredItems.filter(function (v) { return !opts.excludedIds.includes(+v['id']); });
|
|
1352
|
+
}
|
|
1353
|
+
// Sort
|
|
1354
|
+
if (!opts || opts.skipSort !== true) {
|
|
1355
|
+
// Make to copy input items, before sorting (if not yet already done)
|
|
1356
|
+
if (filteredItems === items)
|
|
1357
|
+
filteredItems = filteredItems.slice();
|
|
1358
|
+
// Sort by keys
|
|
1359
|
+
filteredItems.sort(propertiesPathComparator(keys));
|
|
1360
|
+
}
|
|
1361
|
+
var total = filteredItems.length || 0;
|
|
1362
|
+
// Pagination (truncate if need)
|
|
1363
|
+
var pageData = filteredItems;
|
|
1364
|
+
if (opts) {
|
|
1365
|
+
if ((opts.offset || 0) > 0) {
|
|
1366
|
+
pageData = pageData.slice(opts.offset);
|
|
1367
|
+
}
|
|
1368
|
+
if (isNotNil(opts.size) && pageData.length > opts.size) {
|
|
1369
|
+
pageData = pageData.slice(0, opts.size);
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
var result = {
|
|
1373
|
+
data: pageData,
|
|
1374
|
+
total: total
|
|
1375
|
+
};
|
|
1376
|
+
// Add fetch more capability, if total was fetched
|
|
1377
|
+
var nextOffset = (opts && opts.offset || 0) + pageData.length;
|
|
1378
|
+
if (nextOffset < total) {
|
|
1379
|
+
result.fetchMore = function (_) { return __awaiter(_this, void 0, void 0, function () {
|
|
1380
|
+
return __generator(this, function (_a) {
|
|
1381
|
+
return [2 /*return*/, suggestFromArray(filteredItems, undefined /*OPTIMISATION: already applied*/, Object.assign(Object.assign({}, opts), { offset: nextOffset, skipSort: true, excludedIds: undefined // OPTIMISATION: already filtered
|
|
1382
|
+
}))];
|
|
1383
|
+
});
|
|
1384
|
+
}); };
|
|
1385
|
+
}
|
|
1386
|
+
return result;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
1389
|
var MatAutocompleteConfigHolder = /** @class */ (function () {
|
|
1390
1390
|
function MatAutocompleteConfigHolder(options) {
|
|
1391
1391
|
this.options = options;
|
|
@@ -1706,11 +1706,11 @@
|
|
|
1706
1706
|
// Search text (no distinctUntilChanged() because of the debounceTime() pipe)
|
|
1707
1707
|
this.formControl.valueChanges
|
|
1708
1708
|
.pipe(operators.filter(function (value) { return _this.enabled && isNotNilString(value); }),
|
|
1709
|
-
// Mark as loading (to show loading spinner) -
|
|
1709
|
+
// Mark as loading (to show loading spinner) - as soon as possible, and before debounceTime
|
|
1710
1710
|
operators.tap(function (_) { return _this.showLoadingSpinner && _this.markAsLoading(); }),
|
|
1711
1711
|
// Filter if not enough character
|
|
1712
1712
|
operators.filter(function (value) {
|
|
1713
|
-
if (value.length
|
|
1713
|
+
if (((value === null || value === void 0 ? void 0 : value.length) || 0) < _this.suggestLengthThreshold) {
|
|
1714
1714
|
// Update display value, to enable the message "not enough characters"
|
|
1715
1715
|
_this.displayValue = value;
|
|
1716
1716
|
return false;
|
|
@@ -2709,9 +2709,9 @@
|
|
|
2709
2709
|
var cleanedSearchText = removeDiacritics(searchRegexp).toUpperCase();
|
|
2710
2710
|
var index = removeDiacritics(value.toUpperCase()).indexOf(cleanedSearchText);
|
|
2711
2711
|
if (index !== -1) {
|
|
2712
|
-
return value.
|
|
2713
|
-
'<b>' + value.
|
|
2714
|
-
value.
|
|
2712
|
+
return value.substring(0, index - 1) +
|
|
2713
|
+
'<b>' + value.substring(index, cleanedSearchText.length) + '</b>' +
|
|
2714
|
+
value.substring(index + cleanedSearchText.length);
|
|
2715
2715
|
}
|
|
2716
2716
|
return value;
|
|
2717
2717
|
}
|
|
@@ -3159,12 +3159,10 @@
|
|
|
3159
3159
|
};
|
|
3160
3160
|
return IsNotNilOrBlankPipe;
|
|
3161
3161
|
}());
|
|
3162
|
-
IsNotNilOrBlankPipe.ɵprov = i0.ɵɵdefineInjectable({ factory: function IsNotNilOrBlankPipe_Factory() { return new IsNotNilOrBlankPipe(); }, token: IsNotNilOrBlankPipe, providedIn: "root" });
|
|
3163
3162
|
IsNotNilOrBlankPipe.decorators = [
|
|
3164
3163
|
{ type: i0.Pipe, args: [{
|
|
3165
3164
|
name: 'isNotNilOrBlank'
|
|
3166
|
-
},] }
|
|
3167
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
3165
|
+
},] }
|
|
3168
3166
|
];
|
|
3169
3167
|
var IsNilOrBlankPipe = /** @class */ (function () {
|
|
3170
3168
|
function IsNilOrBlankPipe() {
|
|
@@ -3174,12 +3172,10 @@
|
|
|
3174
3172
|
};
|
|
3175
3173
|
return IsNilOrBlankPipe;
|
|
3176
3174
|
}());
|
|
3177
|
-
IsNilOrBlankPipe.ɵprov = i0.ɵɵdefineInjectable({ factory: function IsNilOrBlankPipe_Factory() { return new IsNilOrBlankPipe(); }, token: IsNilOrBlankPipe, providedIn: "root" });
|
|
3178
3175
|
IsNilOrBlankPipe.decorators = [
|
|
3179
3176
|
{ type: i0.Pipe, args: [{
|
|
3180
3177
|
name: 'isNilOrBlank'
|
|
3181
|
-
},] }
|
|
3182
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
3178
|
+
},] }
|
|
3183
3179
|
];
|
|
3184
3180
|
var ToStringPipe = /** @class */ (function () {
|
|
3185
3181
|
function ToStringPipe() {
|
|
@@ -3189,12 +3185,10 @@
|
|
|
3189
3185
|
};
|
|
3190
3186
|
return ToStringPipe;
|
|
3191
3187
|
}());
|
|
3192
|
-
ToStringPipe.ɵprov = i0.ɵɵdefineInjectable({ factory: function ToStringPipe_Factory() { return new ToStringPipe(); }, token: ToStringPipe, providedIn: "root" });
|
|
3193
3188
|
ToStringPipe.decorators = [
|
|
3194
3189
|
{ type: i0.Pipe, args: [{
|
|
3195
3190
|
name: 'toString'
|
|
3196
|
-
},] }
|
|
3197
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
3191
|
+
},] }
|
|
3198
3192
|
];
|
|
3199
3193
|
var StrLengthPipe = /** @class */ (function () {
|
|
3200
3194
|
function StrLengthPipe() {
|
|
@@ -3204,12 +3198,10 @@
|
|
|
3204
3198
|
};
|
|
3205
3199
|
return StrLengthPipe;
|
|
3206
3200
|
}());
|
|
3207
|
-
StrLengthPipe.ɵprov = i0.ɵɵdefineInjectable({ factory: function StrLengthPipe_Factory() { return new StrLengthPipe(); }, token: StrLengthPipe, providedIn: "root" });
|
|
3208
3201
|
StrLengthPipe.decorators = [
|
|
3209
3202
|
{ type: i0.Pipe, args: [{
|
|
3210
3203
|
name: 'strLength'
|
|
3211
|
-
},] }
|
|
3212
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
3204
|
+
},] }
|
|
3213
3205
|
];
|
|
3214
3206
|
var StrIncludesPipe = /** @class */ (function () {
|
|
3215
3207
|
function StrIncludesPipe() {
|
|
@@ -3219,12 +3211,10 @@
|
|
|
3219
3211
|
};
|
|
3220
3212
|
return StrIncludesPipe;
|
|
3221
3213
|
}());
|
|
3222
|
-
StrIncludesPipe.ɵprov = i0.ɵɵdefineInjectable({ factory: function StrIncludesPipe_Factory() { return new StrIncludesPipe(); }, token: StrIncludesPipe, providedIn: "root" });
|
|
3223
3214
|
StrIncludesPipe.decorators = [
|
|
3224
3215
|
{ type: i0.Pipe, args: [{
|
|
3225
3216
|
name: 'strIncludes'
|
|
3226
|
-
},] }
|
|
3227
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
3217
|
+
},] }
|
|
3228
3218
|
];
|
|
3229
3219
|
|
|
3230
3220
|
var TranslateContextService = /** @class */ (function () {
|
|
@@ -4769,7 +4759,7 @@
|
|
|
4769
4759
|
function FormGetControlPipe() {
|
|
4770
4760
|
}
|
|
4771
4761
|
FormGetControlPipe.prototype.transform = function (form, path) {
|
|
4772
|
-
return (form && path && form.get(path) || form);
|
|
4762
|
+
return (form && isNotNil(path) && form.get(path) || form);
|
|
4773
4763
|
};
|
|
4774
4764
|
return FormGetControlPipe;
|
|
4775
4765
|
}());
|
|
@@ -4805,8 +4795,7 @@
|
|
|
4805
4795
|
},] }
|
|
4806
4796
|
];
|
|
4807
4797
|
var FormGetValuePipe = /** @class */ (function () {
|
|
4808
|
-
function FormGetValuePipe(
|
|
4809
|
-
this.adapter = adapter;
|
|
4798
|
+
function FormGetValuePipe(_ref) {
|
|
4810
4799
|
this._ref = _ref;
|
|
4811
4800
|
this.value = undefined;
|
|
4812
4801
|
this._lastControl = null;
|
|
@@ -4874,7 +4863,6 @@
|
|
|
4874
4863
|
},] }
|
|
4875
4864
|
];
|
|
4876
4865
|
FormGetValuePipe.ctorParameters = function () { return [
|
|
4877
|
-
{ type: FormErrorTranslator },
|
|
4878
4866
|
{ type: i0.ChangeDetectorRef }
|
|
4879
4867
|
]; };
|
|
4880
4868
|
|
|
@@ -5796,10 +5784,10 @@
|
|
|
5796
5784
|
return this._tabindex;
|
|
5797
5785
|
},
|
|
5798
5786
|
set: function (value) {
|
|
5799
|
-
var _this = this;
|
|
5800
5787
|
if (this._tabindex !== value) {
|
|
5801
5788
|
this._tabindex = value;
|
|
5802
|
-
|
|
5789
|
+
if (!this._writing)
|
|
5790
|
+
this.updateTabIndex();
|
|
5803
5791
|
}
|
|
5804
5792
|
},
|
|
5805
5793
|
enumerable: false,
|
|
@@ -6191,10 +6179,10 @@
|
|
|
6191
6179
|
return this._tabindex;
|
|
6192
6180
|
},
|
|
6193
6181
|
set: function (value) {
|
|
6194
|
-
var _this = this;
|
|
6195
6182
|
if (this._tabindex !== value) {
|
|
6196
6183
|
this._tabindex = value;
|
|
6197
|
-
|
|
6184
|
+
if (!this._writing)
|
|
6185
|
+
this.updateTabIndex();
|
|
6198
6186
|
}
|
|
6199
6187
|
},
|
|
6200
6188
|
enumerable: false,
|
|
@@ -12044,7 +12032,7 @@
|
|
|
12044
12032
|
Object.defineProperty(LocalSettingsService.prototype, "usageMode", {
|
|
12045
12033
|
get: function () {
|
|
12046
12034
|
var _a;
|
|
12047
|
-
if (isNil((_a = this._data) === null || _a === void 0 ? void 0 : _a.
|
|
12035
|
+
if (isNil((_a = this._data) === null || _a === void 0 ? void 0 : _a.usageMode)) {
|
|
12048
12036
|
console.warn("[settings] Accessing to property 'usageMode' BEFORE service started! Please use ready()");
|
|
12049
12037
|
return isCordova(window) ? 'FIELD' : 'DESK';
|
|
12050
12038
|
}
|
|
@@ -15234,7 +15222,8 @@
|
|
|
15234
15222
|
console.debug('[graphql] Apply token authentication to headers');
|
|
15235
15223
|
this.connectionParams.authToken = token;
|
|
15236
15224
|
}
|
|
15237
|
-
|
|
15225
|
+
// Clean auth token
|
|
15226
|
+
else if (this.connectionParams.authToken) {
|
|
15238
15227
|
console.debug('[graphql] Remove token authentication from headers');
|
|
15239
15228
|
delete this.connectionParams.authToken;
|
|
15240
15229
|
// Clear cache
|
|
@@ -15246,7 +15235,8 @@
|
|
|
15246
15235
|
console.debug('[graphql] Apply basic authentication to headers');
|
|
15247
15236
|
this.connectionParams.authBasic = basic;
|
|
15248
15237
|
}
|
|
15249
|
-
|
|
15238
|
+
// Clean auth basic
|
|
15239
|
+
else if (this.connectionParams.authBasic) {
|
|
15250
15240
|
console.debug('[graphql] Remove basic authentication from headers');
|
|
15251
15241
|
delete this.connectionParams.authBasic;
|
|
15252
15242
|
// Clear cache
|
|
@@ -19948,12 +19938,12 @@
|
|
|
19948
19938
|
var AppForm = /** @class */ (function () {
|
|
19949
19939
|
function AppForm(injector, form) {
|
|
19950
19940
|
var _this = this;
|
|
19951
|
-
this.
|
|
19941
|
+
this._subscription = new rxjs.Subscription();
|
|
19952
19942
|
this._enable = false;
|
|
19953
|
-
this._$ready = new rxjs.BehaviorSubject(false);
|
|
19954
|
-
this._$loading = new rxjs.BehaviorSubject(true);
|
|
19955
19943
|
this.i18nFieldPrefix = null;
|
|
19956
|
-
this.
|
|
19944
|
+
this.readySubject = new rxjs.BehaviorSubject(false);
|
|
19945
|
+
this.loadingSubject = new rxjs.BehaviorSubject(true);
|
|
19946
|
+
this.errorSubject = new rxjs.BehaviorSubject(undefined);
|
|
19957
19947
|
this.debug = false;
|
|
19958
19948
|
this.onCancel = new i0.EventEmitter();
|
|
19959
19949
|
this.onSubmit = new i0.EventEmitter();
|
|
@@ -19983,9 +19973,46 @@
|
|
|
19983
19973
|
enumerable: false,
|
|
19984
19974
|
configurable: true
|
|
19985
19975
|
});
|
|
19976
|
+
Object.defineProperty(AppForm.prototype, "_$ready", {
|
|
19977
|
+
/**
|
|
19978
|
+
* @deprecated
|
|
19979
|
+
*/
|
|
19980
|
+
get: function () {
|
|
19981
|
+
return this.readySubject;
|
|
19982
|
+
},
|
|
19983
|
+
enumerable: false,
|
|
19984
|
+
configurable: true
|
|
19985
|
+
});
|
|
19986
|
+
Object.defineProperty(AppForm.prototype, "_$loading", {
|
|
19987
|
+
/**
|
|
19988
|
+
* @deprecated
|
|
19989
|
+
*/
|
|
19990
|
+
get: function () {
|
|
19991
|
+
return this.loadingSubject;
|
|
19992
|
+
},
|
|
19993
|
+
enumerable: false,
|
|
19994
|
+
configurable: true
|
|
19995
|
+
});
|
|
19996
|
+
Object.defineProperty(AppForm.prototype, "error", {
|
|
19997
|
+
get: function () {
|
|
19998
|
+
return this.errorSubject.value;
|
|
19999
|
+
},
|
|
20000
|
+
set: function (error) {
|
|
20001
|
+
this.setError(error);
|
|
20002
|
+
},
|
|
20003
|
+
enumerable: false,
|
|
20004
|
+
configurable: true
|
|
20005
|
+
});
|
|
19986
20006
|
Object.defineProperty(AppForm.prototype, "loading", {
|
|
19987
20007
|
get: function () {
|
|
19988
|
-
return this.
|
|
20008
|
+
return this.loadingSubject.value;
|
|
20009
|
+
},
|
|
20010
|
+
enumerable: false,
|
|
20011
|
+
configurable: true
|
|
20012
|
+
});
|
|
20013
|
+
Object.defineProperty(AppForm.prototype, "loaded", {
|
|
20014
|
+
get: function () {
|
|
20015
|
+
return !this.loadingSubject.value;
|
|
19989
20016
|
},
|
|
19990
20017
|
enumerable: false,
|
|
19991
20018
|
configurable: true
|
|
@@ -20002,7 +20029,8 @@
|
|
|
20002
20029
|
});
|
|
20003
20030
|
Object.defineProperty(AppForm.prototype, "dirty", {
|
|
20004
20031
|
get: function () {
|
|
20005
|
-
|
|
20032
|
+
var _a;
|
|
20033
|
+
return ((_a = this.form) === null || _a === void 0 ? void 0 : _a.dirty) || false;
|
|
20006
20034
|
},
|
|
20007
20035
|
enumerable: false,
|
|
20008
20036
|
configurable: true
|
|
@@ -20023,7 +20051,8 @@
|
|
|
20023
20051
|
});
|
|
20024
20052
|
Object.defineProperty(AppForm.prototype, "valid", {
|
|
20025
20053
|
get: function () {
|
|
20026
|
-
|
|
20054
|
+
var _a;
|
|
20055
|
+
return ((_a = this.form) === null || _a === void 0 ? void 0 : _a.valid) || false;
|
|
20027
20056
|
},
|
|
20028
20057
|
enumerable: false,
|
|
20029
20058
|
configurable: true
|
|
@@ -20092,17 +20121,19 @@
|
|
|
20092
20121
|
};
|
|
20093
20122
|
AppForm.prototype.ngOnDestroy = function () {
|
|
20094
20123
|
this._subscription.unsubscribe();
|
|
20095
|
-
this.
|
|
20124
|
+
this.readySubject.unsubscribe();
|
|
20125
|
+
this.loadingSubject.unsubscribe();
|
|
20126
|
+
this.errorSubject.unsubscribe();
|
|
20096
20127
|
this.onCancel.unsubscribe();
|
|
20097
|
-
this.onSubmit.complete();
|
|
20098
20128
|
this.onSubmit.unsubscribe();
|
|
20099
|
-
this._$ready.complete();
|
|
20100
|
-
this._$ready.unsubscribe();
|
|
20101
|
-
this._$loading.complete();
|
|
20102
|
-
this._$loading.unsubscribe();
|
|
20103
20129
|
};
|
|
20104
20130
|
AppForm.prototype.cancel = function () {
|
|
20105
|
-
this
|
|
20131
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20132
|
+
return __generator(this, function (_b) {
|
|
20133
|
+
this.onCancel.emit();
|
|
20134
|
+
return [2 /*return*/];
|
|
20135
|
+
});
|
|
20136
|
+
});
|
|
20106
20137
|
};
|
|
20107
20138
|
/**
|
|
20108
20139
|
*
|
|
@@ -20207,22 +20238,14 @@
|
|
|
20207
20238
|
this.markForCheck();
|
|
20208
20239
|
};
|
|
20209
20240
|
AppForm.prototype.markAsLoading = function (opts) {
|
|
20210
|
-
|
|
20211
|
-
this._$loading.next(true);
|
|
20212
|
-
if (!opts || opts.emitEvent !== false)
|
|
20213
|
-
this.markForCheck();
|
|
20214
|
-
}
|
|
20241
|
+
this.setLoading(true, opts);
|
|
20215
20242
|
};
|
|
20216
20243
|
AppForm.prototype.markAsLoaded = function (opts) {
|
|
20217
|
-
|
|
20218
|
-
this._$loading.next(false);
|
|
20219
|
-
if (!opts || opts.emitEvent !== false)
|
|
20220
|
-
this.markForCheck();
|
|
20221
|
-
}
|
|
20244
|
+
this.setLoading(false, opts);
|
|
20222
20245
|
};
|
|
20223
20246
|
AppForm.prototype.markAsReady = function (opts) {
|
|
20224
|
-
if (this.
|
|
20225
|
-
this.
|
|
20247
|
+
if (this.readySubject.value !== true) {
|
|
20248
|
+
this.readySubject.next(true);
|
|
20226
20249
|
// If subclasses implements OnReady
|
|
20227
20250
|
if (typeof this['ngOnReady'] === 'function') {
|
|
20228
20251
|
this.ngOnReady();
|
|
@@ -20234,18 +20257,14 @@
|
|
|
20234
20257
|
* @param opts
|
|
20235
20258
|
*/
|
|
20236
20259
|
AppForm.prototype.ready = function (opts) {
|
|
20237
|
-
return waitForTrue(this.
|
|
20260
|
+
return waitForTrue(this.readySubject, opts);
|
|
20238
20261
|
};
|
|
20239
20262
|
/**
|
|
20240
|
-
* Wait form is
|
|
20263
|
+
* Wait form is not busy (=loaded)
|
|
20241
20264
|
* @param opts
|
|
20242
20265
|
*/
|
|
20243
20266
|
AppForm.prototype.waitIdle = function (opts) {
|
|
20244
|
-
return
|
|
20245
|
-
return __generator(this, function (_b) {
|
|
20246
|
-
return [2 /*return*/, AppFormUtils.waitIdle(this, opts)];
|
|
20247
|
-
});
|
|
20248
|
-
});
|
|
20267
|
+
return waitForFalse(this.loadingSubject, opts);
|
|
20249
20268
|
};
|
|
20250
20269
|
AppForm.prototype.updateValueAndValidity = function (opts) {
|
|
20251
20270
|
AppFormUtils.updateValueAndValidity(this.form, opts);
|
|
@@ -20275,10 +20294,27 @@
|
|
|
20275
20294
|
AppForm.prototype.registerAutocompleteField = function (fieldName, opts) {
|
|
20276
20295
|
return this.autocompleteHelper.add(fieldName, opts);
|
|
20277
20296
|
};
|
|
20297
|
+
AppForm.prototype.setError = function (value, opts) {
|
|
20298
|
+
if (this.errorSubject.value !== value) {
|
|
20299
|
+
this.errorSubject.next(value);
|
|
20300
|
+
if (!opts || opts.emitEvent !== false) {
|
|
20301
|
+
this.markForCheck();
|
|
20302
|
+
}
|
|
20303
|
+
}
|
|
20304
|
+
};
|
|
20278
20305
|
AppForm.prototype.markForCheck = function () {
|
|
20279
20306
|
// Should be overwritten by subclasses
|
|
20280
20307
|
console.warn('markForCheck() has been called, but is not overwritten by component ' + this.constructor.name);
|
|
20281
20308
|
};
|
|
20309
|
+
/* -- private function -- */
|
|
20310
|
+
AppForm.prototype.setLoading = function (value, opts) {
|
|
20311
|
+
if (this.loadingSubject.value !== value) {
|
|
20312
|
+
this.loadingSubject.next(value);
|
|
20313
|
+
if (!opts || opts.emitEvent !== false) {
|
|
20314
|
+
this.markForCheck();
|
|
20315
|
+
}
|
|
20316
|
+
}
|
|
20317
|
+
};
|
|
20282
20318
|
return AppForm;
|
|
20283
20319
|
}());
|
|
20284
20320
|
AppForm.decorators = [
|
|
@@ -20739,14 +20775,14 @@
|
|
|
20739
20775
|
}
|
|
20740
20776
|
return this._onChange
|
|
20741
20777
|
.pipe(operators.filter(isNotNil), operators.mergeMap(function (_) { return waitFor(function () { return !_this._saving; }); }), operators.mergeMap(function (_) { return __awaiter(_this, void 0, void 0, function () {
|
|
20742
|
-
var excludedDataByFilter, excludedDataByPagination, data, promiseOrData,
|
|
20743
|
-
return __generator(this, function (
|
|
20744
|
-
switch (
|
|
20778
|
+
var excludedDataByFilter, excludedDataByPagination, data, promiseOrData, _b, total;
|
|
20779
|
+
return __generator(this, function (_c) {
|
|
20780
|
+
switch (_c.label) {
|
|
20745
20781
|
case 0:
|
|
20746
20782
|
excludedDataByFilter = [];
|
|
20747
|
-
|
|
20783
|
+
_c.label = 1;
|
|
20748
20784
|
case 1:
|
|
20749
|
-
|
|
20785
|
+
_c.trys.push([1, , 6, 7]);
|
|
20750
20786
|
if (isEmptyArray(this.data)) {
|
|
20751
20787
|
return [2 /*return*/, { data: [], total: 0 }];
|
|
20752
20788
|
}
|
|
@@ -20756,14 +20792,14 @@
|
|
|
20756
20792
|
if (!((promiseOrData instanceof Promise))) return [3 /*break*/, 3];
|
|
20757
20793
|
return [4 /*yield*/, promiseOrData];
|
|
20758
20794
|
case 2:
|
|
20759
|
-
|
|
20795
|
+
_b = _c.sent();
|
|
20760
20796
|
return [3 /*break*/, 4];
|
|
20761
20797
|
case 3:
|
|
20762
|
-
|
|
20763
|
-
|
|
20798
|
+
_b = promiseOrData;
|
|
20799
|
+
_c.label = 4;
|
|
20764
20800
|
case 4:
|
|
20765
|
-
data =
|
|
20766
|
-
|
|
20801
|
+
data = _b;
|
|
20802
|
+
_c.label = 5;
|
|
20767
20803
|
case 5:
|
|
20768
20804
|
// Apply filter (will update hiddenData)
|
|
20769
20805
|
data = this.filter(data, filterData, excludedDataByFilter);
|
|
@@ -20819,16 +20855,16 @@
|
|
|
20819
20855
|
};
|
|
20820
20856
|
InMemoryEntitiesService.prototype.saveAll = function (data, options) {
|
|
20821
20857
|
return __awaiter(this, void 0, void 0, function () {
|
|
20822
|
-
var res,
|
|
20823
|
-
return __generator(this, function (
|
|
20824
|
-
switch (
|
|
20858
|
+
var res, _b;
|
|
20859
|
+
return __generator(this, function (_c) {
|
|
20860
|
+
switch (_c.label) {
|
|
20825
20861
|
case 0:
|
|
20826
20862
|
if (!this.data)
|
|
20827
20863
|
throw new Error('[memory-service] Could not save, because value not set');
|
|
20828
20864
|
this.markAsSaving();
|
|
20829
|
-
|
|
20865
|
+
_c.label = 1;
|
|
20830
20866
|
case 1:
|
|
20831
|
-
|
|
20867
|
+
_c.trys.push([1, , 6, 7]);
|
|
20832
20868
|
// Restore hidden data
|
|
20833
20869
|
if (isNotEmptyArray(this._hiddenData))
|
|
20834
20870
|
data = data.concat.apply(data, __spread(this._hiddenData));
|
|
@@ -20837,14 +20873,14 @@
|
|
|
20837
20873
|
if (!((res instanceof Promise))) return [3 /*break*/, 3];
|
|
20838
20874
|
return [4 /*yield*/, res];
|
|
20839
20875
|
case 2:
|
|
20840
|
-
|
|
20876
|
+
_b = _c.sent();
|
|
20841
20877
|
return [3 /*break*/, 4];
|
|
20842
20878
|
case 3:
|
|
20843
|
-
|
|
20844
|
-
|
|
20879
|
+
_b = res;
|
|
20880
|
+
_c.label = 4;
|
|
20845
20881
|
case 4:
|
|
20846
|
-
data =
|
|
20847
|
-
|
|
20882
|
+
data = _b;
|
|
20883
|
+
_c.label = 5;
|
|
20848
20884
|
case 5:
|
|
20849
20885
|
this.data = data;
|
|
20850
20886
|
this.dirty = true;
|
|
@@ -20861,7 +20897,7 @@
|
|
|
20861
20897
|
return __awaiter(this, void 0, void 0, function () {
|
|
20862
20898
|
var updatedData, deleteCount;
|
|
20863
20899
|
var _this = this;
|
|
20864
|
-
return __generator(this, function (
|
|
20900
|
+
return __generator(this, function (_b) {
|
|
20865
20901
|
if (!this.data)
|
|
20866
20902
|
throw new Error('[memory-service] Could not delete, because value not set');
|
|
20867
20903
|
updatedData = this.data.filter(function (entity) {
|
|
@@ -20895,6 +20931,26 @@
|
|
|
20895
20931
|
return this._equalsFn(d1, d2);
|
|
20896
20932
|
return d1 && d1.equals ? d1.equals(d2) : EntityUtils.equals(d1, d2, 'id');
|
|
20897
20933
|
};
|
|
20934
|
+
Object.defineProperty(InMemoryEntitiesService.prototype, "count", {
|
|
20935
|
+
/**
|
|
20936
|
+
* Count data stored by the service (without hidden data).
|
|
20937
|
+
* @param opts
|
|
20938
|
+
*/
|
|
20939
|
+
get: function () {
|
|
20940
|
+
var _a;
|
|
20941
|
+
return (((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) || 0);
|
|
20942
|
+
},
|
|
20943
|
+
enumerable: false,
|
|
20944
|
+
configurable: true
|
|
20945
|
+
});
|
|
20946
|
+
Object.defineProperty(InMemoryEntitiesService.prototype, "hiddenCount", {
|
|
20947
|
+
get: function () {
|
|
20948
|
+
var _a;
|
|
20949
|
+
return ((_a = this._hiddenData) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
20950
|
+
},
|
|
20951
|
+
enumerable: false,
|
|
20952
|
+
configurable: true
|
|
20953
|
+
});
|
|
20898
20954
|
/* -- protected methods -- */
|
|
20899
20955
|
InMemoryEntitiesService.prototype.filter = function (data, _filter, hiddenData) {
|
|
20900
20956
|
// if filter is DataFilter instance, use its test function
|
|
@@ -21522,7 +21578,12 @@
|
|
|
21522
21578
|
}
|
|
21523
21579
|
};
|
|
21524
21580
|
AuthForm.prototype.cancel = function () {
|
|
21525
|
-
this
|
|
21581
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
21582
|
+
return __generator(this, function (_a) {
|
|
21583
|
+
this.onCancel.emit();
|
|
21584
|
+
return [2 /*return*/];
|
|
21585
|
+
});
|
|
21586
|
+
});
|
|
21526
21587
|
};
|
|
21527
21588
|
AuthForm.prototype.doSubmit = function (event) {
|
|
21528
21589
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -22541,8 +22602,12 @@
|
|
|
22541
22602
|
});
|
|
22542
22603
|
return __awaiter(this, void 0, void 0, function () {
|
|
22543
22604
|
return __generator(this, function (_c) {
|
|
22544
|
-
|
|
22545
|
-
|
|
22605
|
+
switch (_c.label) {
|
|
22606
|
+
case 0: return [4 /*yield*/, _super.cancel.call(this)];
|
|
22607
|
+
case 1:
|
|
22608
|
+
_c.sent();
|
|
22609
|
+
return [2 /*return*/];
|
|
22610
|
+
}
|
|
22546
22611
|
});
|
|
22547
22612
|
});
|
|
22548
22613
|
};
|
|
@@ -24749,7 +24814,7 @@
|
|
|
24749
24814
|
MenuComponent.decorators = [
|
|
24750
24815
|
{ type: i0.Component, args: [{
|
|
24751
24816
|
selector: 'app-menu',
|
|
24752
|
-
template: "<ion-split-pane #splitPane [contentId]=\"contentId\" (swiperight)=\"onSwipeRight($event)\">\n\n <ion-menu [id]=\"id\" [menuId]=\"menuId\" contentId=\"menu-content\">\n <ion-header>\n\n <ion-toolbar @fadeInAnimation *ngIf=\"isLogin; else notLogin\" class=\"ion-toolbar-top\">\n <ion-grid>\n <ion-row>\n <ion-col size=\"4\">\n <button type=\"button\" mat-flat-button\n class=\"user-avatar\" [class.primary]=\"!accountAvatar\"\n [style.background-image]=\"'url('+(accountAvatar||'./assets/img/person.png')+')'\"\n [routerLink]=\"['/account']\"\n routerDirection=\"root\"\n routerLinkActive=\"ion-color-primary\"\n (click)=\"close()\">\n </button>\n </ion-col>\n <ion-col size=\"8\" class=\"user-logo\">\n <img *ngIf=\"logo\" src=\"{{logo}}\" [title]=\"'APP_NAME'|translate: {appName: appName}\" width=\"108px;\"/>\n <span *ngIf=\"!logo\" width=\"108px;\">{{appName}}</span>\n </ion-col>\n </ion-row>\n <ion-row class=\"ion-no-padding\">\n\n <button mat-button type=\"button\"\n [routerLink]=\"['/account']\"\n routerDirection=\"root\"\n routerLinkActive=\"ion-color-primary\"\n (click)=\"close()\">\n <ion-label color=\"primary\" class=\"ion-text-wrap ion-text-start\">\n <h3 class=\"no-margin username\">\n <b>{{accountName}}</b>\n </h3>\n <h4>{{accountEmail}}</h4>\n </ion-label>\n </button>\n\n
|
|
24817
|
+
template: "<ion-split-pane #splitPane [contentId]=\"contentId\" (swiperight)=\"onSwipeRight($event)\">\n\n <ion-menu [id]=\"id\" [menuId]=\"menuId\" contentId=\"menu-content\">\n <ion-header>\n\n <ion-toolbar @fadeInAnimation *ngIf=\"isLogin; else notLogin\" class=\"ion-toolbar-top\">\n <ion-grid>\n <ion-row>\n <ion-col size=\"4\">\n <button type=\"button\" mat-flat-button\n class=\"user-avatar\" [class.primary]=\"!accountAvatar\"\n [style.background-image]=\"'url('+(accountAvatar||'./assets/img/person.png')+')'\"\n [routerLink]=\"['/account']\"\n routerDirection=\"root\"\n routerLinkActive=\"ion-color-primary\"\n (click)=\"close()\">\n </button>\n </ion-col>\n <ion-col size=\"8\" class=\"user-logo\">\n <img *ngIf=\"logo\" src=\"{{logo}}\" [title]=\"'APP_NAME'|translate: {appName: appName}\" width=\"108px;\"/>\n <span *ngIf=\"!logo\" width=\"108px;\">{{appName}}</span>\n </ion-col>\n </ion-row>\n <ion-row class=\"ion-no-padding\">\n\n <button mat-button type=\"button\"\n [routerLink]=\"['/account']\"\n routerDirection=\"root\"\n routerLinkActive=\"ion-color-primary\"\n (click)=\"close()\">\n <ion-label color=\"primary\" class=\"ion-text-wrap ion-text-start\">\n <h3 class=\"no-margin username\">\n <b>{{accountName}}</b>\n </h3>\n <h4>{{accountEmail}}</h4>\n </ion-label>\n </button>\n\n </ion-row>\n </ion-grid>\n\n </ion-toolbar>\n\n <!-- User not logged -->\n <ng-template #notLogin>\n <mat-toolbar class=\"ion-padding\" @fadeInAnimation\n style=\"height: unset; display: block; margin: auto; text-align: center;\">\n <img *ngIf=\"logo\" src=\"{{logo}}\" [title]=\"'APP_NAME'|translate: {appName: appName}\" width=\"150px;\">\n <span *ngIf=\"!logo\" style=\"width: 150px\">{{appName}}</span>\n </mat-toolbar>\n </ng-template>\n </ion-header>\n\n <ion-content [class.has-user-header]=\"isLogin\">\n\n <ion-list lines=\"none\">\n <ion-menu-toggle auto-hide=\"false\"\n [class.flex-spacer]=\"item.cssClass == 'flex-spacer'\"\n *ngFor=\"let item of $items | async\">\n\n <!-- link -->\n <ion-item *ngIf=\"!loading && item.path\"\n @fadeInAnimation\n class=\"{{item.cssClass}} {{item.color}} text-1x\"\n tappable\n [routerLink]=\"item.path\"\n routerDirection=\"root\"\n routerLinkActive=\"selected\"\n [routerLinkActiveOptions]=\"{exact: (item.path === '/')}\">\n <ion-icon slot=\"start\" *ngIf=\"item.icon\" [name]=\"item.icon\"></ion-icon>\n <mat-icon slot=\"start\" *ngIf=\"item.matIcon\">{{item.matIcon}}</mat-icon>\n <ion-label translate>{{item.title}}</ion-label>\n </ion-item>\n\n <!-- action -->\n <ion-item *ngIf=\"!loading && item.action\"\n @fadeInAnimation\n class=\"{{item.cssClass}} {{item.color}} text-1x\"\n tappable\n (click)=\"doAction(item.action, $event)\">\n <ion-icon slot=\"start\" *ngIf=\"item.icon\" [name]=\"item.icon\"></ion-icon>\n <mat-icon slot=\"start\" *ngIf=\"item.matIcon\">{{item.matIcon}}</mat-icon>\n <ion-label translate>{{item.title}}</ion-label>\n </ion-item>\n\n <!-- divider -->\n <ion-item-divider @fadeInAnimation\n class=\"{{item.cssClass}} {{item.color}}\"\n *ngIf=\"!loading && !item.path && !item.action\">\n <ion-label translate>{{item.title}}</ion-label>\n </ion-item-divider>\n\n </ion-menu-toggle>\n </ion-list>\n </ion-content>\n\n <ion-footer class=\"hidden-xs hidden-sm\">\n <ion-toolbar>\n\n <ion-buttons slot=\"start\">\n <ion-button mat-icon-button color=\"accent\" (click)=\"openAboutModal($event)\">\n <mat-icon slot=\"icon-only\">help_outline</mat-icon>\n </ion-button>\n </ion-buttons>\n\n <ion-title (click)=\"openAboutModal($event)\" color=\"medium\">\n {{'MENU.FOOTER_VERSION_ABOUT'| translate: {version: appVersion} }}\n </ion-title>\n\n <ion-buttons slot=\"end\">\n <button mat-icon-button color=\"accent\" (click)=\"toggleSplitPaneShow($event)\"\n class=\"hidden-xs hidden-sm hidden-md\"\n [title]=\"(splitPane.when ? 'COMMON.BTN_HIDE_MENU' : 'COMMON.BTN_SHOW_MENU') |translate\">\n <mat-icon><span>{{splitPane.when ? '«' : '»'}}</span></mat-icon>\n </button>\n </ion-buttons>\n </ion-toolbar>\n </ion-footer>\n\n </ion-menu>\n\n <ng-content></ng-content>\n\n</ion-split-pane>\n",
|
|
24753
24818
|
animations: [fadeInAnimation],
|
|
24754
24819
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
24755
24820
|
styles: ["ion-menu{--ion-item-background:transparent;--ion-item-divider-background:transparent;--ion-item-icon-color:var(--ion-color-primary-tint);--ion-item-text-color:var(--ion-color-primary-tint);--ion-item-background-selected:var(--ion-color-secondary100);--ion-item-text-color-selected:var(--ion-color-primary);--ion-item-icon-color-selected:var(--ion-color-primary);--ion-item-text-color-disable:var(--ion-color-medium);--ion-item-icon-color-disable:var(--ion-color-medium)}ion-menu ion-header ion-text{color:var(--ion-color-primary)}ion-menu ion-header .user-avatar{background-size:cover;background-repeat:no-repeat;background-position:50%;background-color:var(--ion-color-secondary);border:1px solid var(--ion-color-primary);overflow:hidden!important;font-size:var(--avatar-size,60px)!important;line-height:var(--avatar-size,60px);height:var(--avatar-size,60px)!important;width:var(--avatar-size,60px)!important;border-radius:50%;display:inline-block}ion-menu ion-header .user-logo{text-align:right}ion-menu ion-header .user-logo img{max-width:120px;max-height:var(--avatar-size,60px);width:auto}ion-menu ion-header .username{padding-top:0;margin-top:0;margin-bottom:0;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}ion-menu ion-header button[mat-button]{padding:0;text-align:start!important;width:100%}ion-menu .scroll-content{margin-top:79px!important}ion-menu .has-user-header .scroll-content{margin-top:188px!important}ion-menu ion-content.has-profile-header{--offset-top:188px}ion-menu ion-content.no-profile-header{--offset-top:79px}ion-menu ion-content ion-list{min-height:100%;display:flex;flex-direction:column;justify-content:flex-start}ion-menu ion-content ion-list ion-menu-toggle.flex-spacer{flex:1 1 auto;display:flex;flex-direction:column;justify-content:flex-end}ion-menu ion-content ion-list ion-item.primary{--ion-item-icon-color:var(--ion-color-primary-tint);--ion-item-text-color:var(--ion-color-primary-tint)}ion-menu ion-content ion-list ion-item.secondary{--ion-item-icon-color:var(--ion-color-secondary-tint);--ion-item-text-color:var(--ion-color-secondary-tint)}ion-menu ion-content ion-list ion-item.tertiary{--ion-item-icon-color:var(--ion-color-tertiary-tint);--ion-item-text-color:var(--ion-color-tertiary-tint)}ion-menu ion-content ion-list ion-item.danger{--ion-item-icon-color:var(--ion-color-danger-tint);--ion-item-text-color:var(--ion-color-danger-tint)}ion-menu ion-content ion-list ion-item.medium{--ion-item-icon-color:var(--ion-color-medium-shade);--ion-item-text-color:var(--ion-color-medium-shade)}ion-menu ion-content ion-list ion-item.dark{--ion-item-icon-color:var(--ion-color-dark-tint);--ion-item-text-color:var(--ion-color-dark-tint)}ion-menu ion-content ion-list ion-item ion-icon,ion-menu ion-content ion-list ion-item mat-icon{color:var(--ion-item-icon-color)!important;fill:currentColor;stroke:currentColor}ion-menu ion-content ion-list ion-item ion-label,ion-menu ion-content ion-list ion-item ion-text{color:var(--ion-item-text-color)!important}ion-menu ion-content ion-list ion-item.selected{background-color:var(--ion-item-background-selected)!important;--color-hover:var(--ion-item-background-selected)!important}ion-menu ion-content ion-list ion-item.selected ion-icon,ion-menu ion-content ion-list ion-item.selected mat-icon{color:var(--ion-item-icon-color-selected)!important;fill:currentColor;stroke:currentColor}ion-menu ion-content ion-list ion-item.selected ion-label,ion-menu ion-content ion-list ion-item.selected ion-text{color:var(--ion-item-text-color-selected)!important}ion-menu ion-content ion-list ion-item.selected:hover{--color-hover:var(--ion-item-background-selected)!important;--ion-item-icon-color-selected:var(--ion-item-icon-color)!important;--ion-item-text-color-selected:var(--ion-item-text-color)!important}ion-menu ion-footer{display:block!important}ion-menu ion-footer ion-toolbar ion-title{cursor:pointer;font-size:12pt;font-weight:400;text-align:center;padding:0 8px}ion-menu ion-footer ion-toolbar ion-button{--width:40px}@media screen and (max-width:767px){ion-menu ion-footer{display:none!important;visibility:hidden!important}}@media screen and (min-width:768px){ion-menu ion-scroll{overflow-y:auto!important}ion-menu .user-avatar{font-size:var(--avatar-size,80px)!important;line-height:var(--avatar-size,80px);height:var(--avatar-size,80px)!important;width:var(--avatar-size,80px)!important}ion-menu .user-logo img{max-height:var(--avatar-size,80px)}}"]
|
|
@@ -24817,7 +24882,6 @@
|
|
|
24817
24882
|
this.icon = value.icon;
|
|
24818
24883
|
this.matIcon = value.matIcon;
|
|
24819
24884
|
this.matSvgIcon = value.matSvgIcon;
|
|
24820
|
-
this.color = value.color;
|
|
24821
24885
|
},
|
|
24822
24886
|
enumerable: false,
|
|
24823
24887
|
configurable: true
|
|
@@ -24828,7 +24892,7 @@
|
|
|
24828
24892
|
AppIconComponent.decorators = [
|
|
24829
24893
|
{ type: i0.Component, args: [{
|
|
24830
24894
|
selector: 'app-icon',
|
|
24831
|
-
template: "<ion-icon *ngIf=\"icon; else matIconTemplate\" slot=\"icon-only\"\n [color]=\"color\"\n [name]=\"icon\"\n
|
|
24895
|
+
template: "<ion-icon *ngIf=\"icon; else matIconTemplate\" slot=\"icon-only\"\n [color]=\"color\"\n [name]=\"icon\"\n></ion-icon>\n<ng-template #matIconTemplate>\n <mat-icon [svgIcon]=\"matSvgIcon\"\n [style.color]=\"'var(--ion-color-'+color+')'\">{{matIcon}}</mat-icon>\n</ng-template>\n\n"
|
|
24832
24896
|
},] }
|
|
24833
24897
|
];
|
|
24834
24898
|
AppIconComponent.propDecorators = {
|
|
@@ -24836,8 +24900,6 @@
|
|
|
24836
24900
|
matIcon: [{ type: i0.Input }],
|
|
24837
24901
|
matSvgIcon: [{ type: i0.Input }],
|
|
24838
24902
|
color: [{ type: i0.Input }],
|
|
24839
|
-
height: [{ type: i0.Input }],
|
|
24840
|
-
width: [{ type: i0.Input }],
|
|
24841
24903
|
ref: [{ type: i0.Input }]
|
|
24842
24904
|
};
|
|
24843
24905
|
|
|
@@ -26074,10 +26136,6 @@
|
|
|
26074
26136
|
get: function () {
|
|
26075
26137
|
return this.errorSubject.value;
|
|
26076
26138
|
},
|
|
26077
|
-
/**
|
|
26078
|
-
* @deprecated
|
|
26079
|
-
* @param error
|
|
26080
|
-
*/
|
|
26081
26139
|
set: function (error) {
|
|
26082
26140
|
this.setError(error);
|
|
26083
26141
|
},
|
|
@@ -26085,6 +26143,9 @@
|
|
|
26085
26143
|
configurable: true
|
|
26086
26144
|
});
|
|
26087
26145
|
Object.defineProperty(AppTable.prototype, "error$", {
|
|
26146
|
+
/**
|
|
26147
|
+
* @deprecated
|
|
26148
|
+
*/
|
|
26088
26149
|
get: function () {
|
|
26089
26150
|
return this.errorSubject.asObservable();
|
|
26090
26151
|
},
|
|
@@ -26603,7 +26664,7 @@
|
|
|
26603
26664
|
.then(function () { return _this.editRowById(event, row.id, { focusColumn: _this.lastUserColumn }); });
|
|
26604
26665
|
return true;
|
|
26605
26666
|
}
|
|
26606
|
-
// Edit
|
|
26667
|
+
// Edit previous row
|
|
26607
26668
|
this.editRow(event, row, { focusColumn: this.lastUserColumn });
|
|
26608
26669
|
return true;
|
|
26609
26670
|
};
|
|
@@ -26631,8 +26692,7 @@
|
|
|
26631
26692
|
if (id < 0)
|
|
26632
26693
|
return [2 /*return*/];
|
|
26633
26694
|
if (!(id >= this.visibleRowCount)) return [3 /*break*/, 1];
|
|
26634
|
-
this.
|
|
26635
|
-
this.addRow(event);
|
|
26695
|
+
this.addRow(event, undefined, opts);
|
|
26636
26696
|
return [3 /*break*/, 3];
|
|
26637
26697
|
case 1: return [4 /*yield*/, this.dataSource.getRow(id)];
|
|
26638
26698
|
case 2:
|
|
@@ -26710,7 +26770,7 @@
|
|
|
26710
26770
|
this.cancelExistingRow(event, row, opts);
|
|
26711
26771
|
}
|
|
26712
26772
|
};
|
|
26713
|
-
AppTable.prototype.addRow = function (event, insertAt) {
|
|
26773
|
+
AppTable.prototype.addRow = function (event, insertAt, opts) {
|
|
26714
26774
|
if (this.debug)
|
|
26715
26775
|
console.debug('[table] Asking for new row...');
|
|
26716
26776
|
if (!this._enabled)
|
|
@@ -26725,7 +26785,7 @@
|
|
|
26725
26785
|
return false;
|
|
26726
26786
|
}
|
|
26727
26787
|
// Add new row
|
|
26728
|
-
this.addRowToTable(insertAt);
|
|
26788
|
+
this.addRowToTable(insertAt, opts);
|
|
26729
26789
|
return true;
|
|
26730
26790
|
};
|
|
26731
26791
|
AppTable.prototype.save = function (opts) {
|
|
@@ -26870,7 +26930,7 @@
|
|
|
26870
26930
|
* @param event
|
|
26871
26931
|
* @param row
|
|
26872
26932
|
* @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
|
|
26873
|
-
*
|
|
26933
|
+
* And to force deletion even if table is busy
|
|
26874
26934
|
*/
|
|
26875
26935
|
AppTable.prototype.deleteRow = function (event, row, opts) {
|
|
26876
26936
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -26890,7 +26950,7 @@
|
|
|
26890
26950
|
* @param event
|
|
26891
26951
|
* @param rows
|
|
26892
26952
|
* @param opts Use interactive=false to avoid user interaction (e.g. user confirmation)
|
|
26893
|
-
*
|
|
26953
|
+
* And to force deletion even if table is busy
|
|
26894
26954
|
*/
|
|
26895
26955
|
AppTable.prototype.deleteRows = function (event, rows, opts) {
|
|
26896
26956
|
var _a;
|
|
@@ -26908,8 +26968,8 @@
|
|
|
26908
26968
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
26909
26969
|
if (!this._enabled || isEmptyArray(rows))
|
|
26910
26970
|
return [2 /*return*/, 0]; // Skip is disabled, or no rows to delete
|
|
26911
|
-
if (this.loading && (!opts || opts.
|
|
26912
|
-
console.warn('[app-table] Skip deleteRows() because table is busy (loading). Use opts.
|
|
26971
|
+
if (this.loading && (!opts || opts.interactive !== false)) {
|
|
26972
|
+
console.warn('[app-table] Skip deleteRows() because table is busy (loading). Use opts.interactive = false to force deletion');
|
|
26913
26973
|
return [2 /*return*/, 0]; // Skip if loading
|
|
26914
26974
|
}
|
|
26915
26975
|
// Make sure to keep newly created row
|
|
@@ -27068,29 +27128,11 @@
|
|
|
27068
27128
|
AppTable.prototype.moveRow = function (id, direction) {
|
|
27069
27129
|
this.dataSource.move(id, direction);
|
|
27070
27130
|
};
|
|
27071
|
-
AppTable.prototype.ready = function () {
|
|
27072
|
-
return
|
|
27073
|
-
return __generator(this, function (_e) {
|
|
27074
|
-
switch (_e.label) {
|
|
27075
|
-
case 0: return [4 /*yield*/, firstTruePromise(this.readySubject)];
|
|
27076
|
-
case 1:
|
|
27077
|
-
_e.sent();
|
|
27078
|
-
return [2 /*return*/];
|
|
27079
|
-
}
|
|
27080
|
-
});
|
|
27081
|
-
});
|
|
27131
|
+
AppTable.prototype.ready = function (opts) {
|
|
27132
|
+
return waitForTrue(this.readySubject, opts);
|
|
27082
27133
|
};
|
|
27083
27134
|
AppTable.prototype.waitIdle = function (opts) {
|
|
27084
|
-
return
|
|
27085
|
-
return __generator(this, function (_e) {
|
|
27086
|
-
switch (_e.label) {
|
|
27087
|
-
case 0: return [4 /*yield*/, firstFalsePromise(this.loadingSubject)];
|
|
27088
|
-
case 1:
|
|
27089
|
-
_e.sent();
|
|
27090
|
-
return [2 /*return*/];
|
|
27091
|
-
}
|
|
27092
|
-
});
|
|
27093
|
-
});
|
|
27135
|
+
return waitForFalse(this.loadingSubject, opts);
|
|
27094
27136
|
};
|
|
27095
27137
|
AppTable.prototype.openSelectColumnsModal = function (event) {
|
|
27096
27138
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -27548,12 +27590,13 @@
|
|
|
27548
27590
|
//if (this.debug) console.debug("[table] id = " + id);
|
|
27549
27591
|
return id;
|
|
27550
27592
|
};
|
|
27551
|
-
AppTable.prototype.addRowToTable = function (insertAt) {
|
|
27593
|
+
AppTable.prototype.addRowToTable = function (insertAt, opts) {
|
|
27552
27594
|
return __awaiter(this, void 0, void 0, function () {
|
|
27553
27595
|
return __generator(this, function (_e) {
|
|
27554
27596
|
switch (_e.label) {
|
|
27555
27597
|
case 0:
|
|
27556
27598
|
this.focusFirstColumn = true;
|
|
27599
|
+
this.focusColumn = (opts === null || opts === void 0 ? void 0 : opts.focusColumn) || this.firstUserColumn;
|
|
27557
27600
|
return [4 /*yield*/, this._dataSource.asyncCreateNew(insertAt)];
|
|
27558
27601
|
case 1:
|
|
27559
27602
|
_e.sent();
|
|
@@ -28154,6 +28197,8 @@
|
|
|
28154
28197
|
AppEditor.prototype.ready = function (opts) {
|
|
28155
28198
|
return __awaiter(this, void 0, void 0, function () {
|
|
28156
28199
|
return __generator(this, function (_b) {
|
|
28200
|
+
if (this._$ready.value)
|
|
28201
|
+
return [2 /*return*/];
|
|
28157
28202
|
return [2 /*return*/, waitForTrue(this._$ready, opts)];
|
|
28158
28203
|
});
|
|
28159
28204
|
});
|
|
@@ -28510,6 +28555,10 @@
|
|
|
28510
28555
|
this.markForCheck();
|
|
28511
28556
|
}
|
|
28512
28557
|
};
|
|
28558
|
+
AppTabEditor.prototype.realignInkBar = function () {
|
|
28559
|
+
var _a;
|
|
28560
|
+
(_a = this.tabGroup) === null || _a === void 0 ? void 0 : _a.realignInkBar();
|
|
28561
|
+
};
|
|
28513
28562
|
AppTabEditor.prototype.onTabChange = function (event, queryTabIndexParamName) {
|
|
28514
28563
|
queryTabIndexParamName = queryTabIndexParamName || this.queryTabIndexParamName;
|
|
28515
28564
|
if (!queryTabIndexParamName || !this.route)
|
|
@@ -29757,18 +29806,22 @@
|
|
|
29757
29806
|
console.debug(this._logPrefix + 'Saving data...');
|
|
29758
29807
|
_c.label = 2;
|
|
29759
29808
|
case 2:
|
|
29760
|
-
_c.trys.push([2,
|
|
29761
|
-
|
|
29762
|
-
|
|
29763
|
-
|
|
29764
|
-
|
|
29809
|
+
_c.trys.push([2, 5, 6, 7]);
|
|
29810
|
+
return [4 /*yield*/, this.saveDirtyTables()];
|
|
29811
|
+
case 3:
|
|
29812
|
+
saved = _c.sent();
|
|
29813
|
+
if (!saved)
|
|
29814
|
+
return [2 /*return*/, false];
|
|
29815
|
+
// Fill data
|
|
29765
29816
|
_b = this;
|
|
29766
29817
|
return [4 /*yield*/, this.getValue()];
|
|
29767
|
-
case
|
|
29818
|
+
case 4:
|
|
29819
|
+
// Fill data
|
|
29768
29820
|
_b.data = _c.sent();
|
|
29821
|
+
// Mark as submitted
|
|
29769
29822
|
this.submitted = true;
|
|
29770
|
-
return [2 /*return*/,
|
|
29771
|
-
case
|
|
29823
|
+
return [2 /*return*/, true];
|
|
29824
|
+
case 5:
|
|
29772
29825
|
err_2 = _c.sent();
|
|
29773
29826
|
this.submitted = true;
|
|
29774
29827
|
this.setError(err_2);
|
|
@@ -29777,10 +29830,10 @@
|
|
|
29777
29830
|
this.markAsDirty();
|
|
29778
29831
|
this.enable();
|
|
29779
29832
|
return [2 /*return*/, false];
|
|
29780
|
-
case
|
|
29833
|
+
case 6:
|
|
29781
29834
|
this.markAsSaved();
|
|
29782
29835
|
return [7 /*endfinally*/];
|
|
29783
|
-
case
|
|
29836
|
+
case 7: return [2 /*return*/];
|
|
29784
29837
|
}
|
|
29785
29838
|
});
|
|
29786
29839
|
});
|
|
@@ -29904,6 +29957,22 @@
|
|
|
29904
29957
|
this.markForCheck();
|
|
29905
29958
|
};
|
|
29906
29959
|
/* -- protected methods -- */
|
|
29960
|
+
AppEntityEditorModal.prototype.saveDirtyTables = function () {
|
|
29961
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
29962
|
+
var results, saved;
|
|
29963
|
+
return __generator(this, function (_b) {
|
|
29964
|
+
switch (_b.label) {
|
|
29965
|
+
case 0: return [4 /*yield*/, Promise.all((this.tables || [])
|
|
29966
|
+
.filter(function (c) { return c.dirty; })
|
|
29967
|
+
.map(function (c) { return c.save(); }))];
|
|
29968
|
+
case 1:
|
|
29969
|
+
results = _b.sent();
|
|
29970
|
+
saved = results.findIndex(function (result) { return result !== true; }) === -1;
|
|
29971
|
+
return [2 /*return*/, saved];
|
|
29972
|
+
}
|
|
29973
|
+
});
|
|
29974
|
+
});
|
|
29975
|
+
};
|
|
29907
29976
|
AppEntityEditorModal.prototype.waitWhilePending = function (opts) {
|
|
29908
29977
|
return AppFormUtils.waitWhilePending(this, opts);
|
|
29909
29978
|
};
|
|
@@ -30056,10 +30125,7 @@
|
|
|
30056
30125
|
var SocialErrorCodes = {
|
|
30057
30126
|
LOAD_USER_EVENTS_ERROR: 50000,
|
|
30058
30127
|
SAVE_USER_EVENT_ERROR: 50001,
|
|
30059
|
-
|
|
30060
|
-
SEND_MESSAGE_ERROR: 50003,
|
|
30061
|
-
SUBSCRIBE_USER_EVENTS_ERROR: 50005,
|
|
30062
|
-
SUBSCRIBE_JOB_PROGRESSION_ERROR: 50010
|
|
30128
|
+
SEND_MESSAGE_ERROR: 50003
|
|
30063
30129
|
};
|
|
30064
30130
|
|
|
30065
30131
|
var UserEvent_1;
|
|
@@ -30075,23 +30141,16 @@
|
|
|
30075
30141
|
}
|
|
30076
30142
|
UserEvent.prototype.asObject = function (opts) {
|
|
30077
30143
|
var target = _super.prototype.asObject.call(this, opts);
|
|
30078
|
-
target.creationDate = toDateISOString(this.creationDate);
|
|
30079
|
-
target.readDate = toDateISOString(this.readDate);
|
|
30080
30144
|
// Serialize content
|
|
30081
30145
|
if (typeof target.content === 'object') {
|
|
30082
30146
|
target.content = JSON.stringify(target.content);
|
|
30083
30147
|
}
|
|
30084
|
-
delete target.avatar;
|
|
30085
|
-
delete target.avatarIcon;
|
|
30086
|
-
delete target.icon;
|
|
30087
|
-
delete target.actions;
|
|
30088
30148
|
return target;
|
|
30089
30149
|
};
|
|
30090
30150
|
UserEvent.prototype.fromObject = function (source) {
|
|
30091
30151
|
Object.assign(this, source); // Copy all properties
|
|
30092
30152
|
_super.prototype.fromObject.call(this, source);
|
|
30093
30153
|
this.creationDate = fromDateISOString(source.creationDate);
|
|
30094
|
-
this.readDate = fromDateISOString(source.readDate);
|
|
30095
30154
|
try {
|
|
30096
30155
|
// Deserialize content
|
|
30097
30156
|
if (typeof source.content === 'string' && source.content.startsWith('{')) {
|
|
@@ -30111,48 +30170,36 @@
|
|
|
30111
30170
|
exports.UserEvent = UserEvent_1 = __decorate([
|
|
30112
30171
|
EntityClass({ typename: 'UserEventVO' })
|
|
30113
30172
|
], exports.UserEvent);
|
|
30173
|
+
|
|
30174
|
+
var UserEventFragments = {
|
|
30175
|
+
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 }"]))),
|
|
30176
|
+
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 }"])))
|
|
30177
|
+
};
|
|
30178
|
+
var templateObject_1$2, templateObject_2$2;
|
|
30179
|
+
|
|
30114
30180
|
// @dynamic
|
|
30115
30181
|
exports.UserEventFilter = /** @class */ (function (_super) {
|
|
30116
30182
|
__extends(UserEventFilter, _super);
|
|
30117
30183
|
function UserEventFilter() {
|
|
30118
30184
|
var _this = _super.apply(this, __spread(arguments)) || this;
|
|
30119
|
-
_this.
|
|
30120
|
-
_this.
|
|
30121
|
-
_this.issuers = [];
|
|
30122
|
-
_this.recipients = [];
|
|
30123
|
-
_this.startDate = null;
|
|
30124
|
-
_this.excludeRead = false;
|
|
30185
|
+
_this.issuer = null;
|
|
30186
|
+
_this.recipient = null;
|
|
30125
30187
|
return _this;
|
|
30126
30188
|
}
|
|
30127
30189
|
UserEventFilter.prototype.fromObject = function (source, opts) {
|
|
30128
30190
|
_super.prototype.fromObject.call(this, source, opts);
|
|
30129
|
-
this.
|
|
30130
|
-
this.
|
|
30131
|
-
this.issuers = source.issuers || [];
|
|
30132
|
-
this.recipients = source.recipients || [];
|
|
30133
|
-
this.startDate = fromDateISOString(source.startDate);
|
|
30134
|
-
this.excludeRead = source.excludeRead || false;
|
|
30191
|
+
this.issuer = source.issuer;
|
|
30192
|
+
this.recipient = source.recipient;
|
|
30135
30193
|
};
|
|
30136
30194
|
UserEventFilter.prototype.buildFilter = function () {
|
|
30137
30195
|
var _this = this;
|
|
30138
30196
|
var filterFns = _super.prototype.buildFilter.call(this);
|
|
30139
|
-
|
|
30140
|
-
|
|
30141
|
-
|
|
30142
|
-
if (isNotEmptyArray(this.levels)) {
|
|
30143
|
-
filterFns.push(function (t) { return _this.levels.includes(t.level); });
|
|
30144
|
-
}
|
|
30145
|
-
if (isNotEmptyArray(this.issuers)) {
|
|
30146
|
-
filterFns.push(function (t) { return _this.issuers.includes(t.issuer); });
|
|
30147
|
-
}
|
|
30148
|
-
if (isNotEmptyArray(this.recipients)) {
|
|
30149
|
-
filterFns.push(function (t) { return _this.recipients.includes(t.recipient); });
|
|
30197
|
+
// issuer
|
|
30198
|
+
if (this.issuer) {
|
|
30199
|
+
filterFns.push(function (t) { return (t.issuer === _this.issuer); });
|
|
30150
30200
|
}
|
|
30151
|
-
if (
|
|
30152
|
-
filterFns.push(function (t) { return
|
|
30153
|
-
}
|
|
30154
|
-
if (this.excludeRead === true) {
|
|
30155
|
-
filterFns.push(function (t) { return isNil(t.readSignature); }); // todo or t.signature ?
|
|
30201
|
+
if (this.recipient) {
|
|
30202
|
+
filterFns.push(function (t) { return (t.recipient === _this.recipient); });
|
|
30156
30203
|
}
|
|
30157
30204
|
return filterFns;
|
|
30158
30205
|
};
|
|
@@ -30161,276 +30208,120 @@
|
|
|
30161
30208
|
exports.UserEventFilter = __decorate([
|
|
30162
30209
|
EntityClass({ typename: 'UserEventFilterVO' })
|
|
30163
30210
|
], exports.UserEventFilter);
|
|
30164
|
-
|
|
30165
|
-
var
|
|
30166
|
-
|
|
30167
|
-
|
|
30168
|
-
|
|
30169
|
-
|
|
30170
|
-
|
|
30171
|
-
var moment$6 = momentImported__namespace;
|
|
30172
|
-
var UserEventServiceToken = new i0.InjectionToken('UserEventService');
|
|
30173
|
-
var AbstractUserEventService = /** @class */ (function (_super) {
|
|
30174
|
-
__extends(AbstractUserEventService, _super);
|
|
30175
|
-
function AbstractUserEventService(graphql, accountService, network, translate, queries, mutations, subscriptions, environment) {
|
|
30211
|
+
var SaveQuery = core.gql(templateObject_1$3 || (templateObject_1$3 = __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);
|
|
30212
|
+
var LoadAllQuery = core.gql(templateObject_2$3 || (templateObject_2$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);
|
|
30213
|
+
var DeleteByIdsMutation = 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"])));
|
|
30214
|
+
var LoadAllWithContentQuery = core.gql(templateObject_4$2 || (templateObject_4$2 = __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);
|
|
30215
|
+
var UserEventService = /** @class */ (function (_super) {
|
|
30216
|
+
__extends(UserEventService, _super);
|
|
30217
|
+
function UserEventService(graphql, accountService, network, translate, toastController, environment) {
|
|
30176
30218
|
var _this = _super.call(this, graphql, environment) || this;
|
|
30177
30219
|
_this.graphql = graphql;
|
|
30178
30220
|
_this.accountService = accountService;
|
|
30179
30221
|
_this.network = network;
|
|
30180
30222
|
_this.translate = translate;
|
|
30181
|
-
_this.
|
|
30182
|
-
_this.mutations = mutations;
|
|
30183
|
-
_this.subscriptions = subscriptions;
|
|
30223
|
+
_this.toastController = toastController;
|
|
30184
30224
|
_this.environment = environment;
|
|
30185
|
-
_this.
|
|
30186
|
-
_this._subscriptions = new rxjs.Subscription();
|
|
30187
|
-
_this.listeners = [];
|
|
30188
|
-
_this._logPrefix = '[user-event-service] ';
|
|
30225
|
+
_this._userEventActions = [];
|
|
30189
30226
|
// For DEV only
|
|
30190
|
-
_this._debug =
|
|
30191
|
-
// listen login/logout
|
|
30192
|
-
_this._subscriptions.add(accountService.onLogin.subscribe(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
30193
|
-
var count;
|
|
30194
|
-
return __generator(this, function (_b) {
|
|
30195
|
-
switch (_b.label) {
|
|
30196
|
-
case 0: return [4 /*yield*/, this.count(this.defaultFilter())];
|
|
30197
|
-
case 1:
|
|
30198
|
-
count = _b.sent();
|
|
30199
|
-
if (count && this._debug) {
|
|
30200
|
-
console.debug(this._logPrefix + "Received " + count + " unread notifications");
|
|
30201
|
-
}
|
|
30202
|
-
this._count$.next(count);
|
|
30203
|
-
return [2 /*return*/];
|
|
30204
|
-
}
|
|
30205
|
-
});
|
|
30206
|
-
}); }));
|
|
30227
|
+
_this._debug = environment && !environment.production;
|
|
30207
30228
|
return _this;
|
|
30208
30229
|
}
|
|
30209
|
-
|
|
30210
|
-
|
|
30211
|
-
|
|
30212
|
-
|
|
30213
|
-
|
|
30214
|
-
|
|
30215
|
-
|
|
30216
|
-
|
|
30217
|
-
|
|
30218
|
-
|
|
30219
|
-
|
|
30230
|
+
/**
|
|
30231
|
+
*
|
|
30232
|
+
* @param offset
|
|
30233
|
+
* @param size
|
|
30234
|
+
* @param sortBy
|
|
30235
|
+
* @param sortDirection
|
|
30236
|
+
* @param filter
|
|
30237
|
+
* @param options
|
|
30238
|
+
* @deprecated use watchPage() instead
|
|
30239
|
+
*/
|
|
30240
|
+
UserEventService.prototype.watchAll = function (offset, size, sortBy, sortDirection, filter, options) {
|
|
30220
30241
|
return this.watchPage({ offset: offset, size: size, sortBy: sortBy, sortDirection: sortDirection }, filter, options);
|
|
30221
30242
|
};
|
|
30222
|
-
|
|
30223
|
-
var _this = this;
|
|
30224
|
-
var _a;
|
|
30243
|
+
UserEventService.prototype.watchPage = function (page, filter, options) {
|
|
30225
30244
|
var now = this._debug && Date.now();
|
|
30226
30245
|
//if (this._debug)
|
|
30227
|
-
console.debug(
|
|
30246
|
+
console.debug('[user-event-service] Loading user events...', filter);
|
|
30228
30247
|
filter = this.asFilter(filter);
|
|
30229
30248
|
// Force recipient to current issuer, if not admin and not specified
|
|
30230
|
-
if (
|
|
30231
|
-
var recipient = this.
|
|
30232
|
-
if (
|
|
30249
|
+
if (isNilOrBlank(filter.recipient) || !this.accountService.isAdmin()) {
|
|
30250
|
+
var recipient = this.accountService.account.pubkey;
|
|
30251
|
+
if (recipient !== filter.recipient) {
|
|
30233
30252
|
console.warn('[user-events-service] Force user event filter.recipient=' + recipient);
|
|
30234
|
-
filter.
|
|
30253
|
+
filter.recipient = recipient;
|
|
30235
30254
|
}
|
|
30236
30255
|
}
|
|
30237
|
-
var withContent =
|
|
30256
|
+
var withContent = options && options.withContent === true;
|
|
30238
30257
|
return this.mutableWatchQuery({
|
|
30239
30258
|
queryName: withContent ? 'LoadAllWithContent' : 'LoadAll',
|
|
30240
|
-
query: withContent ?
|
|
30259
|
+
query: withContent ? LoadAllWithContentQuery : LoadAllQuery,
|
|
30241
30260
|
variables: {
|
|
30242
|
-
page: Object.assign(Object.assign({ sortBy: '
|
|
30243
|
-
// @ts-ignore
|
|
30244
|
-
sortDirection: (page.sortDirection || 'desc').toUpperCase()
|
|
30245
|
-
}),
|
|
30261
|
+
page: Object.assign(Object.assign({ sortBy: 'updateDate' }, page), { sortDirection: (page.sortDirection || 'DESC').toUpperCase() }),
|
|
30246
30262
|
filter: filter && filter.asPodObject()
|
|
30247
30263
|
},
|
|
30248
30264
|
arrayFieldName: 'data',
|
|
30249
30265
|
error: { code: SocialErrorCodes.LOAD_USER_EVENTS_ERROR, message: 'SOCIAL.ERROR.LOAD_USER_EVENTS_ERROR' },
|
|
30250
|
-
fetchPolicy:
|
|
30266
|
+
fetchPolicy: options && options.fetchPolicy || undefined
|
|
30251
30267
|
})
|
|
30252
30268
|
.pipe(operators.map(function (res) {
|
|
30253
|
-
var data =
|
|
30269
|
+
var data = res && (res.data || []).map(exports.UserEvent.fromObject);
|
|
30254
30270
|
if (now) {
|
|
30255
|
-
console.debug("" +
|
|
30271
|
+
console.debug("[user-event-service] " + data.length + " user events loaded in " + (Date.now() - now) + "ms");
|
|
30256
30272
|
now = null;
|
|
30257
30273
|
}
|
|
30258
|
-
var unreadCount = _this.unreadEvents(data);
|
|
30259
30274
|
return {
|
|
30260
30275
|
data: data,
|
|
30261
|
-
total:
|
|
30276
|
+
total: res && toNumber(res.total, data.length)
|
|
30262
30277
|
};
|
|
30263
30278
|
}));
|
|
30264
30279
|
};
|
|
30265
|
-
|
|
30266
|
-
// TODO set an id !!!!!!!!!!!!!!!!!!!!!!!!!
|
|
30267
|
-
entity = this.processUserEvent(entity);
|
|
30268
|
-
var withContent = !!entity.content;
|
|
30269
|
-
// Add user event locally
|
|
30270
|
-
this.insertIntoMutableCachedQueries(this.graphql.cache, {
|
|
30271
|
-
query: withContent ? this.queries.loadAllWithContent : this.queries.loadAll,
|
|
30272
|
-
data: entity
|
|
30273
|
-
});
|
|
30274
|
-
// Update count
|
|
30275
|
-
this._count$.next(this._count$.value + 1);
|
|
30276
|
-
};
|
|
30277
|
-
AbstractUserEventService.prototype.count = function (filter, options) {
|
|
30278
|
-
var _a;
|
|
30279
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
30280
|
-
var res;
|
|
30281
|
-
return __generator(this, function (_b) {
|
|
30282
|
-
switch (_b.label) {
|
|
30283
|
-
case 0:
|
|
30284
|
-
if (!((_a = this.queries) === null || _a === void 0 ? void 0 : _a.count)) {
|
|
30285
|
-
console.warn(this._logPrefix + "Query 'count' not provided, skip.");
|
|
30286
|
-
return [2 /*return*/, undefined];
|
|
30287
|
-
}
|
|
30288
|
-
if (!filter)
|
|
30289
|
-
throw new Error("Missing argument 'filter'");
|
|
30290
|
-
filter = this.asFilter(filter);
|
|
30291
|
-
if (this._debug)
|
|
30292
|
-
console.debug(this._logPrefix + "Counting user events with filter:", filter);
|
|
30293
|
-
return [4 /*yield*/, this.graphql.query({
|
|
30294
|
-
query: this.queries.count,
|
|
30295
|
-
variables: {
|
|
30296
|
-
filter: filter.asPodObject()
|
|
30297
|
-
},
|
|
30298
|
-
error: { code: SocialErrorCodes.COUNT_USER_EVENT_ERROR, message: 'SOCIAL.ERROR.COUNT_USER_EVENT_ERROR' },
|
|
30299
|
-
fetchPolicy: (options === null || options === void 0 ? void 0 : options.fetchPolicy) || 'network-only'
|
|
30300
|
-
})];
|
|
30301
|
-
case 1:
|
|
30302
|
-
res = _b.sent();
|
|
30303
|
-
return [2 /*return*/, res.total];
|
|
30304
|
-
}
|
|
30305
|
-
});
|
|
30306
|
-
});
|
|
30307
|
-
};
|
|
30308
|
-
AbstractUserEventService.prototype.listenChanges = function (filter, options) {
|
|
30280
|
+
UserEventService.prototype.saveAll = function (data, options) {
|
|
30309
30281
|
var _this = this;
|
|
30310
|
-
|
|
30311
|
-
|
|
30312
|
-
console.warn(this._logPrefix + "Subscription query 'listenChanges' not provided, skip.");
|
|
30313
|
-
return rxjs.of();
|
|
30314
|
-
}
|
|
30315
|
-
if (!filter)
|
|
30316
|
-
throw new Error("Missing argument 'filter'");
|
|
30317
|
-
filter = this.asFilter(filter);
|
|
30318
|
-
var withContent = (options === null || options === void 0 ? void 0 : options.withContent) === true;
|
|
30319
|
-
if (this._debug)
|
|
30320
|
-
console.debug(this._logPrefix + "[WS] Listening changes for user events with filter:", filter);
|
|
30321
|
-
return this.graphql.subscribe({
|
|
30322
|
-
query: this.subscriptions.listenChanges,
|
|
30323
|
-
fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
|
|
30324
|
-
variables: { filter: filter.asPodObject(), interval: toNumber(options === null || options === void 0 ? void 0 : options.interval, 10) },
|
|
30325
|
-
error: {
|
|
30326
|
-
code: SocialErrorCodes.SUBSCRIBE_USER_EVENTS_ERROR,
|
|
30327
|
-
message: 'SOCIAL.ERROR.SUBSCRIBE_USER_EVENTS_ERROR'
|
|
30328
|
-
}
|
|
30329
|
-
}).pipe(operators.map(function (_b) {
|
|
30330
|
-
var data = _b.data;
|
|
30331
|
-
if (data && _this._debug)
|
|
30332
|
-
console.debug(_this._logPrefix + "Received new user events:", data);
|
|
30333
|
-
var updatedData = data === null || data === void 0 ? void 0 : data.map(_this.processUserEvent);
|
|
30334
|
-
// Update cache
|
|
30335
|
-
_this.insertIntoMutableCachedQueries(_this.graphql.cache, {
|
|
30336
|
-
query: withContent ? _this.queries.loadAllWithContent : _this.queries.loadAll,
|
|
30337
|
-
data: updatedData
|
|
30338
|
-
});
|
|
30339
|
-
// update count
|
|
30340
|
-
_this._count$.next(_this.unreadEvents(updatedData));
|
|
30341
|
-
return updatedData;
|
|
30342
|
-
}));
|
|
30343
|
-
};
|
|
30344
|
-
AbstractUserEventService.prototype.delete = function (entity) {
|
|
30345
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
30346
|
-
return __generator(this, function (_b) {
|
|
30347
|
-
switch (_b.label) {
|
|
30348
|
-
case 0:
|
|
30349
|
-
if (!entity)
|
|
30350
|
-
return [2 /*return*/]; // skip
|
|
30351
|
-
return [4 /*yield*/, this.deleteAll([entity])];
|
|
30352
|
-
case 1:
|
|
30353
|
-
_b.sent();
|
|
30354
|
-
return [2 /*return*/];
|
|
30355
|
-
}
|
|
30356
|
-
});
|
|
30357
|
-
});
|
|
30358
|
-
};
|
|
30359
|
-
AbstractUserEventService.prototype.deleteAll = function (entities, opts) {
|
|
30360
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
30361
|
-
var ids, now;
|
|
30362
|
-
var _this = this;
|
|
30363
|
-
return __generator(this, function (_b) {
|
|
30364
|
-
switch (_b.label) {
|
|
30365
|
-
case 0:
|
|
30366
|
-
ids = entities && entities
|
|
30367
|
-
.map(function (t) { return t.id; });
|
|
30368
|
-
if (isEmptyArray(ids))
|
|
30369
|
-
return [2 /*return*/]; // stop, if nothing else to do
|
|
30370
|
-
now = Date.now();
|
|
30371
|
-
if (this._debug)
|
|
30372
|
-
console.debug(this._logPrefix + "Deleting events... ids:", ids);
|
|
30373
|
-
return [4 /*yield*/, this.graphql.mutate({
|
|
30374
|
-
mutation: this.mutations.deleteByIds,
|
|
30375
|
-
variables: {
|
|
30376
|
-
ids: ids
|
|
30377
|
-
},
|
|
30378
|
-
update: function (proxy) {
|
|
30379
|
-
// Remove from caches
|
|
30380
|
-
_this.removeFromMutableCachedQueriesByIds(proxy, {
|
|
30381
|
-
query: _this.queries.loadAll,
|
|
30382
|
-
ids: ids
|
|
30383
|
-
});
|
|
30384
|
-
_this.removeFromMutableCachedQueriesByIds(proxy, {
|
|
30385
|
-
query: _this.queries.loadAllWithContent,
|
|
30386
|
-
ids: ids
|
|
30387
|
-
});
|
|
30388
|
-
if (_this._debug)
|
|
30389
|
-
console.debug(_this._logPrefix + "Events deleted in " + (Date.now() - now) + "ms");
|
|
30390
|
-
}
|
|
30391
|
-
})];
|
|
30392
|
-
case 1:
|
|
30393
|
-
_b.sent();
|
|
30394
|
-
return [2 /*return*/];
|
|
30395
|
-
}
|
|
30396
|
-
});
|
|
30397
|
-
});
|
|
30282
|
+
return Promise.all(data
|
|
30283
|
+
.map(function (entity) { return _this.save(entity, options); }));
|
|
30398
30284
|
};
|
|
30399
|
-
|
|
30285
|
+
/**
|
|
30286
|
+
* Save a userEvent entity
|
|
30287
|
+
*
|
|
30288
|
+
* @param entity
|
|
30289
|
+
*/
|
|
30290
|
+
UserEventService.prototype.save = function (entity, options) {
|
|
30400
30291
|
return __awaiter(this, void 0, void 0, function () {
|
|
30401
30292
|
var isNew, json, now;
|
|
30402
30293
|
var _this = this;
|
|
30403
|
-
return __generator(this, function (
|
|
30404
|
-
switch (
|
|
30294
|
+
return __generator(this, function (_a) {
|
|
30295
|
+
switch (_a.label) {
|
|
30405
30296
|
case 0:
|
|
30406
30297
|
this.fillDefaultProperties(entity);
|
|
30407
30298
|
isNew = isNil(entity.id);
|
|
30408
30299
|
json = entity.asObject();
|
|
30409
30300
|
now = Date.now();
|
|
30410
30301
|
if (this._debug)
|
|
30411
|
-
console.debug(
|
|
30302
|
+
console.debug("[user-event-service] Saving user event...", json);
|
|
30412
30303
|
return [4 /*yield*/, this.graphql.mutate({
|
|
30413
|
-
mutation:
|
|
30304
|
+
mutation: SaveQuery,
|
|
30414
30305
|
variables: {
|
|
30415
30306
|
data: json
|
|
30416
30307
|
},
|
|
30417
30308
|
error: { code: SocialErrorCodes.SAVE_USER_EVENT_ERROR, message: 'SOCIAL.ERROR.SAVE_USER_EVENT_ERROR' },
|
|
30418
|
-
update: function (proxy,
|
|
30419
|
-
var data =
|
|
30309
|
+
update: function (proxy, _a) {
|
|
30310
|
+
var data = _a.data;
|
|
30420
30311
|
// Update entity
|
|
30421
30312
|
var savedEntity = data && data.data;
|
|
30422
30313
|
if (savedEntity) {
|
|
30423
30314
|
if (_this._debug)
|
|
30424
|
-
console.debug(
|
|
30315
|
+
console.debug("[user-event-service] User event saved in " + (Date.now() - now) + "ms", entity);
|
|
30425
30316
|
_this.copyIdAndUpdateDate(savedEntity, entity);
|
|
30426
30317
|
// Add to cache
|
|
30427
30318
|
if (isNew) {
|
|
30428
30319
|
_this.insertIntoMutableCachedQueries(proxy, {
|
|
30429
|
-
query:
|
|
30320
|
+
query: LoadAllQuery,
|
|
30430
30321
|
data: Object.assign(Object.assign({}, savedEntity), { content: null })
|
|
30431
30322
|
});
|
|
30432
30323
|
_this.insertIntoMutableCachedQueries(proxy, {
|
|
30433
|
-
query:
|
|
30324
|
+
query: LoadAllWithContentQuery,
|
|
30434
30325
|
data: savedEntity
|
|
30435
30326
|
});
|
|
30436
30327
|
}
|
|
@@ -30438,185 +30329,93 @@
|
|
|
30438
30329
|
}
|
|
30439
30330
|
})];
|
|
30440
30331
|
case 1:
|
|
30441
|
-
|
|
30332
|
+
_a.sent();
|
|
30442
30333
|
return [2 /*return*/, entity];
|
|
30443
30334
|
}
|
|
30444
30335
|
});
|
|
30445
30336
|
});
|
|
30446
30337
|
};
|
|
30447
|
-
|
|
30448
|
-
|
|
30449
|
-
|
|
30450
|
-
|
|
30451
|
-
|
|
30452
|
-
|
|
30338
|
+
/**
|
|
30339
|
+
* Save many trips
|
|
30340
|
+
*
|
|
30341
|
+
* @param entities
|
|
30342
|
+
* @param opts
|
|
30343
|
+
*/
|
|
30344
|
+
UserEventService.prototype.deleteAll = function (entities, opts) {
|
|
30453
30345
|
return __awaiter(this, void 0, void 0, function () {
|
|
30454
|
-
var
|
|
30455
|
-
var
|
|
30456
|
-
return __generator(this, function (
|
|
30457
|
-
switch (
|
|
30346
|
+
var ids, now;
|
|
30347
|
+
var _this = this;
|
|
30348
|
+
return __generator(this, function (_a) {
|
|
30349
|
+
switch (_a.label) {
|
|
30458
30350
|
case 0:
|
|
30459
|
-
|
|
30460
|
-
|
|
30461
|
-
|
|
30351
|
+
ids = entities && entities
|
|
30352
|
+
.map(function (t) { return t.id; });
|
|
30353
|
+
if (isEmptyArray(ids))
|
|
30354
|
+
return [2 /*return*/]; // stop, if nothing else to do
|
|
30355
|
+
now = Date.now();
|
|
30356
|
+
if (this._debug)
|
|
30357
|
+
console.debug('[user-event-service] Deleting events... ids:', ids);
|
|
30358
|
+
return [4 /*yield*/, this.graphql.mutate({
|
|
30359
|
+
mutation: DeleteByIdsMutation,
|
|
30360
|
+
variables: {
|
|
30361
|
+
ids: ids
|
|
30362
|
+
},
|
|
30363
|
+
update: function (proxy) {
|
|
30364
|
+
// Remove from caches
|
|
30365
|
+
_this.removeFromMutableCachedQueriesByIds(proxy, {
|
|
30366
|
+
query: LoadAllQuery,
|
|
30367
|
+
ids: ids
|
|
30368
|
+
});
|
|
30369
|
+
_this.removeFromMutableCachedQueriesByIds(proxy, {
|
|
30370
|
+
query: LoadAllWithContentQuery,
|
|
30371
|
+
ids: ids
|
|
30372
|
+
});
|
|
30373
|
+
if (_this._debug)
|
|
30374
|
+
console.debug("[user-event-service] Events deleted in " + (Date.now() - now) + "ms");
|
|
30375
|
+
}
|
|
30376
|
+
})];
|
|
30462
30377
|
case 1:
|
|
30463
|
-
|
|
30464
|
-
|
|
30465
|
-
_c.label = 2;
|
|
30466
|
-
case 2:
|
|
30467
|
-
if (!!onReadListeners_1_1.done) return [3 /*break*/, 5];
|
|
30468
|
-
listener = onReadListeners_1_1.value;
|
|
30469
|
-
return [4 /*yield*/, listener.onRead(entity)];
|
|
30470
|
-
case 3:
|
|
30471
|
-
_c.sent();
|
|
30472
|
-
_c.label = 4;
|
|
30473
|
-
case 4:
|
|
30474
|
-
onReadListeners_1_1 = onReadListeners_1.next();
|
|
30475
|
-
return [3 /*break*/, 2];
|
|
30476
|
-
case 5: return [3 /*break*/, 8];
|
|
30477
|
-
case 6:
|
|
30478
|
-
e_1_1 = _c.sent();
|
|
30479
|
-
e_1 = { error: e_1_1 };
|
|
30480
|
-
return [3 /*break*/, 8];
|
|
30481
|
-
case 7:
|
|
30482
|
-
try {
|
|
30483
|
-
if (onReadListeners_1_1 && !onReadListeners_1_1.done && (_b = onReadListeners_1.return)) _b.call(onReadListeners_1);
|
|
30484
|
-
}
|
|
30485
|
-
finally { if (e_1) throw e_1.error; }
|
|
30486
|
-
return [7 /*endfinally*/];
|
|
30487
|
-
case 8: return [3 /*break*/, 11];
|
|
30488
|
-
case 9:
|
|
30489
|
-
// Use default
|
|
30490
|
-
return [4 /*yield*/, this.defaultMarkAsRead(entity)];
|
|
30491
|
-
case 10:
|
|
30492
|
-
// Use default
|
|
30493
|
-
_c.sent();
|
|
30494
|
-
_c.label = 11;
|
|
30495
|
-
case 11: return [2 /*return*/];
|
|
30378
|
+
_a.sent();
|
|
30379
|
+
return [2 /*return*/];
|
|
30496
30380
|
}
|
|
30497
30381
|
});
|
|
30498
30382
|
});
|
|
30499
30383
|
};
|
|
30500
|
-
|
|
30501
|
-
|
|
30502
|
-
|
|
30503
|
-
|
|
30504
|
-
};
|
|
30505
|
-
/* -- protected methods -- */
|
|
30506
|
-
AbstractUserEventService.prototype.processUserEvent = function (source) {
|
|
30507
|
-
var e_2, _b;
|
|
30508
|
-
// Convert json source to IUserEvent
|
|
30509
|
-
var target = this.fromObject(source);
|
|
30510
|
-
// Get listeners
|
|
30511
|
-
var listeners = (this.listeners || []).filter(function (listener) { return listener.onReceived; }).filter(function (listener) { return listener.accept(target); });
|
|
30512
|
-
try {
|
|
30513
|
-
for (var listeners_1 = __values(listeners), listeners_1_1 = listeners_1.next(); !listeners_1_1.done; listeners_1_1 = listeners_1.next()) {
|
|
30514
|
-
var listener = listeners_1_1.value;
|
|
30515
|
-
if (target) {
|
|
30516
|
-
target = listener.onReceived(target);
|
|
30517
|
-
}
|
|
30518
|
-
else {
|
|
30519
|
-
if (this._debug)
|
|
30520
|
-
console.debug(this._logPrefix + "Event has been rejected by a listener", source);
|
|
30521
|
-
break;
|
|
30522
|
-
}
|
|
30523
|
-
}
|
|
30524
|
-
}
|
|
30525
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
30526
|
-
finally {
|
|
30527
|
-
try {
|
|
30528
|
-
if (listeners_1_1 && !listeners_1_1.done && (_b = listeners_1.return)) _b.call(listeners_1);
|
|
30529
|
-
}
|
|
30530
|
-
finally { if (e_2) throw e_2.error; }
|
|
30531
|
-
}
|
|
30532
|
-
return target;
|
|
30533
|
-
};
|
|
30534
|
-
AbstractUserEventService.prototype.defaultMarkAsRead = function (userEvent) {
|
|
30384
|
+
/**
|
|
30385
|
+
* Delete userEvent entities
|
|
30386
|
+
*/
|
|
30387
|
+
UserEventService.prototype.delete = function (data) {
|
|
30535
30388
|
return __awaiter(this, void 0, void 0, function () {
|
|
30536
|
-
return __generator(this, function (
|
|
30537
|
-
switch (
|
|
30389
|
+
return __generator(this, function (_a) {
|
|
30390
|
+
switch (_a.label) {
|
|
30538
30391
|
case 0:
|
|
30539
|
-
if (!
|
|
30540
|
-
|
|
30541
|
-
|
|
30542
|
-
|
|
30543
|
-
|
|
30544
|
-
|
|
30545
|
-
console.debug(this._logPrefix + "Save local user event");
|
|
30546
|
-
return [3 /*break*/, 3];
|
|
30547
|
-
case 1: return [4 /*yield*/, this.save(userEvent)];
|
|
30548
|
-
case 2:
|
|
30549
|
-
_b.sent();
|
|
30550
|
-
_b.label = 3;
|
|
30551
|
-
case 3: return [2 /*return*/];
|
|
30392
|
+
if (!data)
|
|
30393
|
+
return [2 /*return*/]; // skip
|
|
30394
|
+
return [4 /*yield*/, this.deleteAll([data])];
|
|
30395
|
+
case 1:
|
|
30396
|
+
_a.sent();
|
|
30397
|
+
return [2 /*return*/];
|
|
30552
30398
|
}
|
|
30553
30399
|
});
|
|
30554
30400
|
});
|
|
30555
30401
|
};
|
|
30556
|
-
|
|
30557
|
-
//
|
|
30558
|
-
|
|
30559
|
-
|
|
30560
|
-
};
|
|
30402
|
+
UserEventService.prototype.listenChanges = function (id, options) {
|
|
30403
|
+
// TODO
|
|
30404
|
+
console.warn('TODO: implement listen changes on user events');
|
|
30405
|
+
return rxjs.of();
|
|
30561
30406
|
};
|
|
30562
|
-
|
|
30563
|
-
|
|
30407
|
+
UserEventService.prototype.registerAction = function (definition) {
|
|
30408
|
+
console.info("[user-event-service] Registering action " + definition.name + " for " + definition.__typename);
|
|
30409
|
+
this._userEventActions.push(definition);
|
|
30564
30410
|
};
|
|
30565
|
-
|
|
30566
|
-
|
|
30567
|
-
AbstractUserEventService.prototype.unreadEvents = function (events) {
|
|
30568
|
-
// default calculation on unread events from a list
|
|
30569
|
-
if (isEmptyArray(events))
|
|
30570
|
-
return undefined;
|
|
30571
|
-
var lastReadDate = events
|
|
30572
|
-
.filter(function (event) { return isNotNil(event.readDate); })
|
|
30573
|
-
.reduce(function (lastDate, event) { return DateUtils.max(lastDate, event.readDate); }, undefined);
|
|
30574
|
-
return events
|
|
30575
|
-
.filter(function (event) { return event.creationDate.isSameOrAfter(lastReadDate); }).length;
|
|
30411
|
+
UserEventService.prototype.getActionsByTypename = function (typename) {
|
|
30412
|
+
return this._userEventActions.filter(function (def) { return def.__typename === typename; });
|
|
30576
30413
|
};
|
|
30577
|
-
AbstractUserEventService.prototype.copyIdAndUpdateDate = function (source, target) {
|
|
30578
|
-
EntityUtils.copyIdAndUpdateDate(source, target);
|
|
30579
|
-
};
|
|
30580
|
-
return AbstractUserEventService;
|
|
30581
|
-
}(BaseGraphqlService));
|
|
30582
|
-
AbstractUserEventService.decorators = [
|
|
30583
|
-
{ type: i0.Directive }
|
|
30584
|
-
];
|
|
30585
|
-
AbstractUserEventService.ctorParameters = function () { return [
|
|
30586
|
-
{ type: GraphqlService },
|
|
30587
|
-
{ type: AccountService },
|
|
30588
|
-
{ type: NetworkService },
|
|
30589
|
-
{ type: i1$2.TranslateService },
|
|
30590
|
-
{ type: undefined },
|
|
30591
|
-
{ type: undefined },
|
|
30592
|
-
{ type: undefined },
|
|
30593
|
-
{ type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
30594
|
-
]; };
|
|
30595
|
-
var userEventQueries = {
|
|
30596
|
-
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),
|
|
30597
|
-
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)
|
|
30598
|
-
};
|
|
30599
|
-
var userEventMutations = {
|
|
30600
|
-
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 "]))),
|
|
30601
|
-
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)
|
|
30602
|
-
};
|
|
30603
|
-
var UserEventService = /** @class */ (function (_super) {
|
|
30604
|
-
__extends(UserEventService, _super);
|
|
30605
|
-
function UserEventService(graphql, accountService, network, translate, toastController, environment) {
|
|
30606
|
-
var _this = _super.call(this, graphql, accountService, network, translate, userEventQueries, userEventMutations, undefined, environment) || this;
|
|
30607
|
-
_this.graphql = graphql;
|
|
30608
|
-
_this.accountService = accountService;
|
|
30609
|
-
_this.network = network;
|
|
30610
|
-
_this.translate = translate;
|
|
30611
|
-
_this.toastController = toastController;
|
|
30612
|
-
_this.environment = environment;
|
|
30613
|
-
return _this;
|
|
30614
|
-
}
|
|
30615
30414
|
UserEventService.prototype.showToastErrorWithContext = function (opts) {
|
|
30616
30415
|
return __awaiter(this, void 0, void 0, function () {
|
|
30617
30416
|
var message, res, context, userEvent, err_1;
|
|
30618
|
-
return __generator(this, function (
|
|
30619
|
-
switch (
|
|
30417
|
+
return __generator(this, function (_a) {
|
|
30418
|
+
switch (_a.label) {
|
|
30620
30419
|
case 0:
|
|
30621
30420
|
message = opts.message || (opts.error && opts.error.message || opts.error);
|
|
30622
30421
|
// Make sure message a string
|
|
@@ -30645,12 +30444,12 @@
|
|
|
30645
30444
|
}]
|
|
30646
30445
|
})];
|
|
30647
30446
|
case 1:
|
|
30648
|
-
res =
|
|
30447
|
+
res = _a.sent();
|
|
30649
30448
|
if (!res || res.role !== 'send')
|
|
30650
30449
|
return [2 /*return*/];
|
|
30651
|
-
|
|
30450
|
+
_a.label = 2;
|
|
30652
30451
|
case 2:
|
|
30653
|
-
|
|
30452
|
+
_a.trys.push([2, 6, , 7]);
|
|
30654
30453
|
if (this._debug)
|
|
30655
30454
|
console.debug('Sending debug data...');
|
|
30656
30455
|
context = opts && opts.context;
|
|
@@ -30660,15 +30459,15 @@
|
|
|
30660
30459
|
if (!(context instanceof Promise)) return [3 /*break*/, 4];
|
|
30661
30460
|
return [4 /*yield*/, context];
|
|
30662
30461
|
case 3:
|
|
30663
|
-
context =
|
|
30664
|
-
|
|
30462
|
+
context = _a.sent();
|
|
30463
|
+
_a.label = 4;
|
|
30665
30464
|
case 4: return [4 /*yield*/, this.sendDataForDebug({
|
|
30666
30465
|
message: message,
|
|
30667
30466
|
error: opts.error || undefined,
|
|
30668
30467
|
context: this.convertObjectToString(context)
|
|
30669
30468
|
})];
|
|
30670
30469
|
case 5:
|
|
30671
|
-
userEvent =
|
|
30470
|
+
userEvent = _a.sent();
|
|
30672
30471
|
console.info('Debug data successfully sent to admin', userEvent);
|
|
30673
30472
|
this.showToast({
|
|
30674
30473
|
type: 'info',
|
|
@@ -30677,7 +30476,7 @@
|
|
|
30677
30476
|
});
|
|
30678
30477
|
return [3 /*break*/, 7];
|
|
30679
30478
|
case 6:
|
|
30680
|
-
err_1 =
|
|
30479
|
+
err_1 = _a.sent();
|
|
30681
30480
|
console.error('Error while sending debug data:', err_1);
|
|
30682
30481
|
return [3 /*break*/, 7];
|
|
30683
30482
|
case 7: return [2 /*return*/];
|
|
@@ -30687,16 +30486,13 @@
|
|
|
30687
30486
|
};
|
|
30688
30487
|
UserEventService.prototype.sendDataForDebug = function (data) {
|
|
30689
30488
|
var userEvent = new exports.UserEvent();
|
|
30690
|
-
userEvent.
|
|
30489
|
+
userEvent.eventType = UserEventTypes.DEBUG_DATA;
|
|
30691
30490
|
userEvent.content = this.convertObjectToString(data);
|
|
30692
30491
|
return this.save(userEvent);
|
|
30693
30492
|
};
|
|
30694
30493
|
UserEventService.prototype.asFilter = function (filter) {
|
|
30695
30494
|
return exports.UserEventFilter.fromObject(filter);
|
|
30696
30495
|
};
|
|
30697
|
-
UserEventService.prototype.fromObject = function (source) {
|
|
30698
|
-
return exports.UserEvent.fromObject(source);
|
|
30699
|
-
};
|
|
30700
30496
|
/* -- protected methods -- */
|
|
30701
30497
|
UserEventService.prototype.convertObjectToString = function (data) {
|
|
30702
30498
|
if (typeof data === 'string') {
|
|
@@ -30714,13 +30510,13 @@
|
|
|
30714
30510
|
};
|
|
30715
30511
|
UserEventService.prototype.showToast = function (opts) {
|
|
30716
30512
|
return __awaiter(this, void 0, void 0, function () {
|
|
30717
|
-
return __generator(this, function (
|
|
30718
|
-
switch (
|
|
30513
|
+
return __generator(this, function (_a) {
|
|
30514
|
+
switch (_a.label) {
|
|
30719
30515
|
case 0:
|
|
30720
30516
|
if (!this.toastController)
|
|
30721
30517
|
throw new Error('Missing toastController in component\'s constructor');
|
|
30722
30518
|
return [4 /*yield*/, Toasts.show(this.toastController, this.translate, opts)];
|
|
30723
|
-
case 1: return [2 /*return*/,
|
|
30519
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
30724
30520
|
}
|
|
30725
30521
|
});
|
|
30726
30522
|
});
|
|
@@ -30731,10 +30527,14 @@
|
|
|
30731
30527
|
// TODO: compute sign
|
|
30732
30528
|
console.warn('TODO: sign user event before sending');
|
|
30733
30529
|
};
|
|
30530
|
+
UserEventService.prototype.copyIdAndUpdateDate = function (source, target) {
|
|
30531
|
+
EntityUtils.copyIdAndUpdateDate(source, target);
|
|
30532
|
+
};
|
|
30734
30533
|
return UserEventService;
|
|
30735
|
-
}(
|
|
30534
|
+
}(BaseGraphqlService));
|
|
30535
|
+
UserEventService.ɵprov = i0.ɵɵdefineInjectable({ factory: function UserEventService_Factory() { return new UserEventService(i0.ɵɵinject(GraphqlService), i0.ɵɵinject(AccountService), i0.ɵɵinject(NetworkService), i0.ɵɵinject(i1$2.TranslateService), i0.ɵɵinject(i1$5.ToastController), i0.ɵɵinject(ENVIRONMENT, 8)); }, token: UserEventService, providedIn: "root" });
|
|
30736
30536
|
UserEventService.decorators = [
|
|
30737
|
-
{ type: i0.Injectable }
|
|
30537
|
+
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
30738
30538
|
];
|
|
30739
30539
|
UserEventService.ctorParameters = function () { return [
|
|
30740
30540
|
{ type: GraphqlService },
|
|
@@ -30748,7 +30548,7 @@
|
|
|
30748
30548
|
|
|
30749
30549
|
var ICONS_MAP = {
|
|
30750
30550
|
DEBUG_DATA: { matIcon: 'bug_report' },
|
|
30751
|
-
INBOX_MESSAGE: { matIcon: 'mail' }
|
|
30551
|
+
INBOX_MESSAGE: { matIcon: 'mail' },
|
|
30752
30552
|
};
|
|
30753
30553
|
// TODO: refactor with a registration done by data service:
|
|
30754
30554
|
// - userEventService.registerEventAction({__typename: 'TripVO', ...})
|
|
@@ -30816,7 +30616,7 @@
|
|
|
30816
30616
|
}
|
|
30817
30617
|
}));
|
|
30818
30618
|
var filter = this.filter || new exports.UserEventFilter();
|
|
30819
|
-
filter.
|
|
30619
|
+
filter.recipient = this.recipient;
|
|
30820
30620
|
this.setFilter(filter, { emitEvent: true });
|
|
30821
30621
|
};
|
|
30822
30622
|
UserEventsTable.prototype.start = function () {
|
|
@@ -30838,17 +30638,17 @@
|
|
|
30838
30638
|
});
|
|
30839
30639
|
};
|
|
30840
30640
|
UserEventsTable.prototype.getIcon = function (source) {
|
|
30841
|
-
return ICONS_MAP[source.
|
|
30641
|
+
return ICONS_MAP[source.eventType];
|
|
30842
30642
|
};
|
|
30843
30643
|
UserEventsTable.prototype.getDetail = function (source) {
|
|
30844
30644
|
if (!source)
|
|
30845
30645
|
return undefined;
|
|
30846
|
-
if (source.content && source.
|
|
30646
|
+
if (source.content && source.eventType === UserEventTypes.DEBUG_DATA) {
|
|
30847
30647
|
var context = source.content.context;
|
|
30848
30648
|
if (context && context.__typename) {
|
|
30849
|
-
|
|
30649
|
+
var actions = this.service.getActionsByTypename(context.__typename);
|
|
30850
30650
|
return {
|
|
30851
|
-
|
|
30651
|
+
actions: actions,
|
|
30852
30652
|
title: source.content.error && source.content.error.message || source.content.message,
|
|
30853
30653
|
description: source.content.error && source.content.error.details || undefined
|
|
30854
30654
|
};
|
|
@@ -30859,18 +30659,18 @@
|
|
|
30859
30659
|
};
|
|
30860
30660
|
UserEventsTable.prototype.doAction = function (action, row) {
|
|
30861
30661
|
return __awaiter(this, void 0, void 0, function () {
|
|
30862
|
-
var event, res, _a, err_1;
|
|
30662
|
+
var event, context, res, _a, err_1;
|
|
30863
30663
|
return __generator(this, function (_b) {
|
|
30864
30664
|
switch (_b.label) {
|
|
30865
30665
|
case 0:
|
|
30866
30666
|
event = row.currentData;
|
|
30867
|
-
|
|
30667
|
+
context = event.content && event.content.context;
|
|
30868
30668
|
this.markAsLoading();
|
|
30869
30669
|
if (!(action && typeof action.executeAction === 'function')) return [3 /*break*/, 7];
|
|
30870
30670
|
_b.label = 1;
|
|
30871
30671
|
case 1:
|
|
30872
30672
|
_b.trys.push([1, 5, 6, 7]);
|
|
30873
|
-
res = action.executeAction(event
|
|
30673
|
+
res = action.executeAction(event, context);
|
|
30874
30674
|
if (!(res instanceof Promise)) return [3 /*break*/, 3];
|
|
30875
30675
|
return [4 /*yield*/, res];
|
|
30876
30676
|
case 2:
|
|
@@ -30902,18 +30702,13 @@
|
|
|
30902
30702
|
selector: 'app-user-events-table',
|
|
30903
30703
|
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 <ion-icon slot=\"start\" *ngIf=\"action.icon\" [name]=\"action.icon\"></ion-icon>\n <mat-icon slot=\"start\" *ngIf=\"action.matIcon\">{{action.matIcon}}</mat-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",
|
|
30904
30704
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
30905
|
-
providers: [
|
|
30906
|
-
{
|
|
30907
|
-
provide: UserEventServiceToken, useClass: UserEventService
|
|
30908
|
-
}
|
|
30909
|
-
],
|
|
30910
30705
|
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}"]
|
|
30911
30706
|
},] }
|
|
30912
30707
|
];
|
|
30913
30708
|
UserEventsTable.ctorParameters = function () { return [
|
|
30914
30709
|
{ type: i0.Injector },
|
|
30915
30710
|
{ type: AccountService },
|
|
30916
|
-
{ type:
|
|
30711
|
+
{ type: UserEventService },
|
|
30917
30712
|
{ type: EntitiesStorage },
|
|
30918
30713
|
{ type: i0.ChangeDetectorRef },
|
|
30919
30714
|
{ type: undefined, decorators: [{ type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
@@ -30925,167 +30720,6 @@
|
|
|
30925
30720
|
defaultSortDirection: [{ type: i0.Input }]
|
|
30926
30721
|
};
|
|
30927
30722
|
|
|
30928
|
-
var UserEventNotificationList = /** @class */ (function () {
|
|
30929
|
-
function UserEventNotificationList(popoverController) {
|
|
30930
|
-
this.popoverController = popoverController;
|
|
30931
|
-
}
|
|
30932
|
-
UserEventNotificationList.prototype.ngOnInit = function () {
|
|
30933
|
-
};
|
|
30934
|
-
UserEventNotificationList.prototype.read = function ($event, userEvent) {
|
|
30935
|
-
var _a;
|
|
30936
|
-
if (userEvent === null || userEvent === void 0 ? void 0 : userEvent.readDate)
|
|
30937
|
-
return;
|
|
30938
|
-
(_a = this.readEvent) === null || _a === void 0 ? void 0 : _a.emit(userEvent);
|
|
30939
|
-
};
|
|
30940
|
-
UserEventNotificationList.prototype.executeAction = function (action, userEvent) {
|
|
30941
|
-
// Execute then close popover
|
|
30942
|
-
action.executeAction(userEvent);
|
|
30943
|
-
this.dismiss();
|
|
30944
|
-
};
|
|
30945
|
-
UserEventNotificationList.prototype.dismiss = function () {
|
|
30946
|
-
this.popoverController.dismiss();
|
|
30947
|
-
};
|
|
30948
|
-
return UserEventNotificationList;
|
|
30949
|
-
}());
|
|
30950
|
-
UserEventNotificationList.decorators = [
|
|
30951
|
-
{ type: i0.Component, args: [{
|
|
30952
|
-
selector: 'app-user-event-notification-list',
|
|
30953
|
-
template: "\n<ion-list class=\"ion-list-popover\">\n\n <ion-row class=\"ion-list-header column\">\n <ion-col>\n <ion-label>{{titleI18n | translate}}</ion-label>\n </ion-col>\n </ion-row>\n\n <ion-item *ngIf=\"!(userEvents | async)?.length\">\n {{'SOCIAL.USER_EVENT.NOTIFICATION.EMPTY' | translate}}\n </ion-item>\n <ion-item\n *ngFor=\"let userEvent of userEvents | async\"\n (click)=\"read($event, userEvent)\"\n >\n\n <ion-avatar slot=\"start\">\n\n <img *ngIf=\"userEvent.avatar; else avatarIcon\" src=\"{{ userEvent.avatar }}\">\n\n <ng-template #avatarIcon>\n <app-icon\n *ngIf=\"userEvent.avatarIcon\"\n [ref]=\"userEvent.avatarIcon\"\n height=\"40\"\n width=\"40\"\n ></app-icon>\n </ng-template>\n\n </ion-avatar>\n\n <ion-grid class=\"ion-no-margin ion-no-padding\">\n <ion-row>\n <ion-col>\n <p [class.unread]=\"!userEvent.readDate\">\n {{userEvent.message}}\n </p>\n </ion-col>\n </ion-row>\n <ion-row *ngIf=\"userEvent.actions?.length\">\n <ion-col>\n <p>\n <span *ngFor=\"let action of userEvent.actions\">\n <a\n [style.margin-right.px]=\"8\"\n [style.cursor]=\"'pointer'\"\n (click)=\"executeAction(action, userEvent)\"\n >\n {{ '➞ ' + action.name}}\n </a>\n </span>\n </p>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col>\n <app-icon\n *ngIf=\"userEvent.icon\"\n [ref]=\"userEvent.icon\"\n height=\"16\"\n width=\"16\"\n [style.vertical-align]=\"'sub'\"\n ></app-icon>\n <small>\n <span>{{userEvent.creationDate|dateFromNow}}</span>\n <span [style.color]=\"'gray'\">{{ ' | ' + (userEvent.creationDate|dateFormat:{time:true}) }}</span>\n </small>\n </ion-col>\n </ion-row>\n </ion-grid>\n </ion-item>\n\n</ion-list>\n",
|
|
30954
|
-
styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.unread{font-weight:700}"]
|
|
30955
|
-
},] }
|
|
30956
|
-
];
|
|
30957
|
-
UserEventNotificationList.ctorParameters = function () { return [
|
|
30958
|
-
{ type: i1$5.PopoverController }
|
|
30959
|
-
]; };
|
|
30960
|
-
UserEventNotificationList.propDecorators = {
|
|
30961
|
-
titleI18n: [{ type: i0.Input }],
|
|
30962
|
-
userEvents: [{ type: i0.Input }],
|
|
30963
|
-
readEvent: [{ type: i0.Output }]
|
|
30964
|
-
};
|
|
30965
|
-
|
|
30966
|
-
var UserEventNotificationComponent = /** @class */ (function () {
|
|
30967
|
-
function UserEventNotificationComponent(userEventService, accountService, popoverController, cd) {
|
|
30968
|
-
this.userEventService = userEventService;
|
|
30969
|
-
this.accountService = accountService;
|
|
30970
|
-
this.popoverController = popoverController;
|
|
30971
|
-
this.cd = cd;
|
|
30972
|
-
this.debug = false;
|
|
30973
|
-
this.titleI18n = 'SOCIAL.USER_EVENT.NOTIFICATION.TITLE';
|
|
30974
|
-
this.disabled = false;
|
|
30975
|
-
this.userEventsSubject = new rxjs.BehaviorSubject(undefined);
|
|
30976
|
-
this._subscriptions = new rxjs.Subscription();
|
|
30977
|
-
this._logPrefix = '[user-event-notification] ';
|
|
30978
|
-
this._readEvent = new i0.EventEmitter();
|
|
30979
|
-
}
|
|
30980
|
-
Object.defineProperty(UserEventNotificationComponent.prototype, "count", {
|
|
30981
|
-
get: function () {
|
|
30982
|
-
var _a;
|
|
30983
|
-
return (_a = this.userEventService) === null || _a === void 0 ? void 0 : _a.userEventCount.pipe(operators.map(function (value) { return value === 0 ? undefined : value; }));
|
|
30984
|
-
},
|
|
30985
|
-
enumerable: false,
|
|
30986
|
-
configurable: true
|
|
30987
|
-
});
|
|
30988
|
-
UserEventNotificationComponent.prototype.ngOnInit = function () {
|
|
30989
|
-
var _this = this;
|
|
30990
|
-
if (isNil(this.userEventService)) {
|
|
30991
|
-
console.warn(this._logPrefix + "No service injected");
|
|
30992
|
-
this.disabled = true;
|
|
30993
|
-
return;
|
|
30994
|
-
}
|
|
30995
|
-
this._subscriptions.add(this.userEventService.watchAll(0, 10, 'creationDate', "desc").subscribe(function (value) {
|
|
30996
|
-
var data = value.data;
|
|
30997
|
-
if (_this.debug) {
|
|
30998
|
-
console.debug(_this._logPrefix + "Receiving user events", data);
|
|
30999
|
-
}
|
|
31000
|
-
_this.userEventsSubject.next(data);
|
|
31001
|
-
}));
|
|
31002
|
-
this._readEvent.subscribe(function (value) {
|
|
31003
|
-
_this.userEventService.markAsRead(value);
|
|
31004
|
-
});
|
|
31005
|
-
};
|
|
31006
|
-
UserEventNotificationComponent.prototype.showList = function (event) {
|
|
31007
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
31008
|
-
var popover;
|
|
31009
|
-
return __generator(this, function (_b) {
|
|
31010
|
-
switch (_b.label) {
|
|
31011
|
-
case 0: return [4 /*yield*/, this.popoverController.create({
|
|
31012
|
-
component: UserEventNotificationList,
|
|
31013
|
-
componentProps: {
|
|
31014
|
-
titleI18n: this.titleI18n,
|
|
31015
|
-
userEvents: this.userEventsSubject,
|
|
31016
|
-
readEvent: this._readEvent
|
|
31017
|
-
},
|
|
31018
|
-
backdropDismiss: true,
|
|
31019
|
-
keyboardClose: true,
|
|
31020
|
-
event: event,
|
|
31021
|
-
translucent: true,
|
|
31022
|
-
cssClass: 'popover-large'
|
|
31023
|
-
})];
|
|
31024
|
-
case 1:
|
|
31025
|
-
popover = _b.sent();
|
|
31026
|
-
return [4 /*yield*/, popover.present()];
|
|
31027
|
-
case 2:
|
|
31028
|
-
_b.sent();
|
|
31029
|
-
return [2 /*return*/];
|
|
31030
|
-
}
|
|
31031
|
-
});
|
|
31032
|
-
});
|
|
31033
|
-
};
|
|
31034
|
-
UserEventNotificationComponent.prototype.markForCheck = function () {
|
|
31035
|
-
this.cd.markForCheck();
|
|
31036
|
-
};
|
|
31037
|
-
UserEventNotificationComponent.prototype.ngOnDestroy = function () {
|
|
31038
|
-
if (this.debug) {
|
|
31039
|
-
console.debug(this._logPrefix + "Destroying");
|
|
31040
|
-
}
|
|
31041
|
-
this._subscriptions.unsubscribe();
|
|
31042
|
-
};
|
|
31043
|
-
return UserEventNotificationComponent;
|
|
31044
|
-
}());
|
|
31045
|
-
UserEventNotificationComponent.decorators = [
|
|
31046
|
-
{ type: i0.Component, args: [{
|
|
31047
|
-
selector: 'app-user-event-notification-component',
|
|
31048
|
-
template: "<button\n #button\n mat-icon-button\n [title]=\"titleI18n | translate\"\n [disabled]=\"disabled\"\n (click)=\"showList($event)\"\n>\n <mat-icon\n [matBadge]=\"count | async\"\n matBadgeColor=\"accent\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >notifications\n </mat-icon>\n</button>\n\n",
|
|
31049
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
31050
|
-
styles: [""]
|
|
31051
|
-
},] }
|
|
31052
|
-
];
|
|
31053
|
-
UserEventNotificationComponent.ctorParameters = function () { return [
|
|
31054
|
-
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [UserEventServiceToken,] }] },
|
|
31055
|
-
{ type: AccountService },
|
|
31056
|
-
{ type: i1$5.PopoverController },
|
|
31057
|
-
{ type: i0.ChangeDetectorRef }
|
|
31058
|
-
]; };
|
|
31059
|
-
UserEventNotificationComponent.propDecorators = {
|
|
31060
|
-
debug: [{ type: i0.Input }],
|
|
31061
|
-
titleI18n: [{ type: i0.Input }],
|
|
31062
|
-
disabled: [{ type: i0.Input }]
|
|
31063
|
-
};
|
|
31064
|
-
|
|
31065
|
-
var UserEventModule = /** @class */ (function () {
|
|
31066
|
-
function UserEventModule() {
|
|
31067
|
-
}
|
|
31068
|
-
return UserEventModule;
|
|
31069
|
-
}());
|
|
31070
|
-
UserEventModule.decorators = [
|
|
31071
|
-
{ type: i0.NgModule, args: [{
|
|
31072
|
-
imports: [
|
|
31073
|
-
i1$4.CommonModule,
|
|
31074
|
-
CoreModule,
|
|
31075
|
-
SharedModule
|
|
31076
|
-
],
|
|
31077
|
-
declarations: [
|
|
31078
|
-
UserEventsTable,
|
|
31079
|
-
UserEventNotificationComponent,
|
|
31080
|
-
UserEventNotificationList,
|
|
31081
|
-
],
|
|
31082
|
-
exports: [
|
|
31083
|
-
UserEventsTable,
|
|
31084
|
-
UserEventNotificationComponent
|
|
31085
|
-
]
|
|
31086
|
-
},] }
|
|
31087
|
-
];
|
|
31088
|
-
|
|
31089
30723
|
var MessageTypes = {
|
|
31090
30724
|
INBOX_MESSAGE: 'INBOX_MESSAGE',
|
|
31091
30725
|
EMAIL: 'EMAIL',
|
|
@@ -31319,12 +30953,12 @@
|
|
|
31319
30953
|
canSelectType: [{ type: i0.Input }]
|
|
31320
30954
|
};
|
|
31321
30955
|
|
|
31322
|
-
var
|
|
31323
|
-
function
|
|
30956
|
+
var SocialModule = /** @class */ (function () {
|
|
30957
|
+
function SocialModule() {
|
|
31324
30958
|
}
|
|
31325
|
-
return
|
|
30959
|
+
return SocialModule;
|
|
31326
30960
|
}());
|
|
31327
|
-
|
|
30961
|
+
SocialModule.decorators = [
|
|
31328
30962
|
{ type: i0.NgModule, args: [{
|
|
31329
30963
|
imports: [
|
|
31330
30964
|
i1$4.CommonModule,
|
|
@@ -31332,342 +30966,19 @@
|
|
|
31332
30966
|
SharedModule
|
|
31333
30967
|
],
|
|
31334
30968
|
declarations: [
|
|
30969
|
+
UserEventsTable,
|
|
31335
30970
|
MessageModal,
|
|
31336
30971
|
MessageForm
|
|
31337
30972
|
],
|
|
31338
30973
|
exports: [
|
|
30974
|
+
UserEventsTable,
|
|
31339
30975
|
MessageModal
|
|
31340
30976
|
]
|
|
31341
30977
|
},] }
|
|
31342
30978
|
];
|
|
31343
30979
|
|
|
31344
|
-
var JobProgression_1;
|
|
31345
|
-
// todo use entity
|
|
31346
|
-
var Job = /** @class */ (function () {
|
|
31347
|
-
function Job() {
|
|
31348
|
-
}
|
|
31349
|
-
return Job;
|
|
31350
|
-
}());
|
|
31351
|
-
// @dynamic
|
|
31352
|
-
exports.JobProgression = JobProgression_1 = /** @class */ (function (_super) {
|
|
31353
|
-
__extends(JobProgression, _super);
|
|
31354
|
-
function JobProgression() {
|
|
31355
|
-
return _super.call(this, JobProgression_1.TYPENAME) || this;
|
|
31356
|
-
}
|
|
31357
|
-
JobProgression.prototype.fromObject = function (source) {
|
|
31358
|
-
_super.prototype.fromObject.call(this, source);
|
|
31359
|
-
this.message = source.message;
|
|
31360
|
-
this.current = source.current;
|
|
31361
|
-
this.total = source.total;
|
|
31362
|
-
};
|
|
31363
|
-
return JobProgression;
|
|
31364
|
-
}(Entity));
|
|
31365
|
-
exports.JobProgression = JobProgression_1 = __decorate([
|
|
31366
|
-
EntityClass({ typename: 'JobProgressionVO' })
|
|
31367
|
-
], exports.JobProgression);
|
|
31368
|
-
|
|
31369
|
-
var JobProgressionServiceToken = new i0.InjectionToken('JobProgressionService');
|
|
31370
|
-
var jobProgressionSubscription = core.gql(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["subscription UpdateJobProgression($id: Int!, $interval: Int){\n data: updateJobProgression(id: $id, interval: $interval) {\n id\n message\n current\n total\n }\n}"], ["subscription UpdateJobProgression($id: Int!, $interval: Int){\n data: updateJobProgression(id: $id, interval: $interval) {\n id\n message\n current\n total\n }\n}"])));
|
|
31371
|
-
var JobProgressionService = /** @class */ (function (_super) {
|
|
31372
|
-
__extends(JobProgressionService, _super);
|
|
31373
|
-
function JobProgressionService(graphql, environment) {
|
|
31374
|
-
var _this = _super.call(this, graphql, environment) || this;
|
|
31375
|
-
_this.graphql = graphql;
|
|
31376
|
-
_this.environment = environment;
|
|
31377
|
-
_this._logPrefix = '[job-progression-service] ';
|
|
31378
|
-
// For DEV only
|
|
31379
|
-
_this._debug = !(environment === null || environment === void 0 ? void 0 : environment.production);
|
|
31380
|
-
return _this;
|
|
31381
|
-
}
|
|
31382
|
-
JobProgressionService.prototype.listenChanges = function (id, options) {
|
|
31383
|
-
var _this = this;
|
|
31384
|
-
if (isNil(id))
|
|
31385
|
-
throw new Error(this._logPrefix + "Missing argument 'id'");
|
|
31386
|
-
if (this._debug)
|
|
31387
|
-
console.debug(this._logPrefix + "[WS] Listening changes for job progression {" + id + "}...");
|
|
31388
|
-
return this.graphql.subscribe({
|
|
31389
|
-
query: jobProgressionSubscription,
|
|
31390
|
-
fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
|
|
31391
|
-
variables: { id: id, interval: toNumber(options === null || options === void 0 ? void 0 : options.interval, 10) },
|
|
31392
|
-
error: { code: SocialErrorCodes.SUBSCRIBE_JOB_PROGRESSION_ERROR, message: 'SOCIAL.ERROR.SUBSCRIBE_JOB_PROGRESSION_ERROR' }
|
|
31393
|
-
}).pipe(operators.map(function (_a) {
|
|
31394
|
-
var data = _a.data;
|
|
31395
|
-
var progression = data && exports.JobProgression.fromObject(data);
|
|
31396
|
-
if (progression && _this._debug)
|
|
31397
|
-
console.debug(_this._logPrefix + "Job progression " + id + " updated on server", progression);
|
|
31398
|
-
return progression;
|
|
31399
|
-
}));
|
|
31400
|
-
};
|
|
31401
|
-
return JobProgressionService;
|
|
31402
|
-
}(BaseGraphqlService));
|
|
31403
|
-
JobProgressionService.decorators = [
|
|
31404
|
-
{ type: i0.Injectable }
|
|
31405
|
-
];
|
|
31406
|
-
JobProgressionService.ctorParameters = function () { return [
|
|
31407
|
-
{ type: GraphqlService },
|
|
31408
|
-
{ type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
31409
|
-
]; };
|
|
31410
|
-
var templateObject_1$4;
|
|
31411
|
-
|
|
31412
|
-
var JobProgressionList = /** @class */ (function () {
|
|
31413
|
-
function JobProgressionList() {
|
|
31414
|
-
}
|
|
31415
|
-
JobProgressionList.prototype.ngOnInit = function () {
|
|
31416
|
-
};
|
|
31417
|
-
return JobProgressionList;
|
|
31418
|
-
}());
|
|
31419
|
-
JobProgressionList.decorators = [
|
|
31420
|
-
{ type: i0.Component, args: [{
|
|
31421
|
-
selector: 'app-job-progression-list',
|
|
31422
|
-
template: "<ion-list class=\"ion-list-popover\">\n\n <ion-row class=\"ion-list-header column\">\n <ion-col>\n <ion-label>{{titleI18n | translate}}</ion-label>\n </ion-col>\n </ion-row>\n\n <ion-item *ngIf=\"!jobProgressions?.length\">\n {{'SOCIAL.JOB.PROGRESSION.EMPTY' | translate}}\n </ion-item>\n <ion-item *ngFor=\"let jobProgression of jobProgressions\">\n <ion-grid class=\"ion-no-margin\">\n <ion-row>\n <ion-col>\n {{jobProgression.message}}\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col>\n <ion-progress-bar\n [value]=\"jobProgression.total > 0 ? jobProgression.current / jobProgression.total : undefined\"\n [type]=\"jobProgression.total > 0 ? 'determinate' : 'indeterminate'\">\n </ion-progress-bar>\n </ion-col>\n </ion-row>\n </ion-grid>\n </ion-item>\n\n</ion-list>\n",
|
|
31423
|
-
styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}"]
|
|
31424
|
-
},] }
|
|
31425
|
-
];
|
|
31426
|
-
JobProgressionList.ctorParameters = function () { return []; };
|
|
31427
|
-
JobProgressionList.propDecorators = {
|
|
31428
|
-
titleI18n: [{ type: i0.Input }],
|
|
31429
|
-
jobProgressions: [{ type: i0.Input }]
|
|
31430
|
-
};
|
|
31431
|
-
|
|
31432
|
-
var JobProgressionComponent = /** @class */ (function () {
|
|
31433
|
-
function JobProgressionComponent(jobProgressionService, popoverController, cd) {
|
|
31434
|
-
this.jobProgressionService = jobProgressionService;
|
|
31435
|
-
this.popoverController = popoverController;
|
|
31436
|
-
this.cd = cd;
|
|
31437
|
-
this.debug = false;
|
|
31438
|
-
this.titleI18n = 'SOCIAL.JOB.PROGRESSION.TITLE';
|
|
31439
|
-
this.jobFinished = new i0.EventEmitter();
|
|
31440
|
-
this.disabled = true;
|
|
31441
|
-
this.color = 'accent';
|
|
31442
|
-
this.mode = 'determinate';
|
|
31443
|
-
this.value = 0;
|
|
31444
|
-
this.jobProgressions = [];
|
|
31445
|
-
this._subscriptions = new rxjs.Subscription();
|
|
31446
|
-
this._subscriptionsById = {};
|
|
31447
|
-
this._logPrefix = '[job-progression] ';
|
|
31448
|
-
}
|
|
31449
|
-
JobProgressionComponent.prototype.ngOnInit = function () {
|
|
31450
|
-
var _a, _b, _c, _d;
|
|
31451
|
-
if (isNil(this.jobProgressionService)) {
|
|
31452
|
-
console.warn(this._logPrefix + "No service injected");
|
|
31453
|
-
}
|
|
31454
|
-
// parse options
|
|
31455
|
-
this.autoHide = toBoolean((_a = this.options) === null || _a === void 0 ? void 0 : _a.autoHide, false);
|
|
31456
|
-
this.visible = !this.autoHide;
|
|
31457
|
-
this.autoHideDelay = toNumber((_b = this.options) === null || _b === void 0 ? void 0 : _b.autoHideDelay, 1000);
|
|
31458
|
-
this.autoRemove = toBoolean((_c = this.options) === null || _c === void 0 ? void 0 : _c.autoRemove, true);
|
|
31459
|
-
this.autoRemoveDelay = toNumber((_d = this.options) === null || _d === void 0 ? void 0 : _d.autoRemoveDelay, 1000);
|
|
31460
|
-
};
|
|
31461
|
-
JobProgressionComponent.prototype.addJob = function (id) {
|
|
31462
|
-
var _this = this;
|
|
31463
|
-
if (isNil(this.jobProgressionService)) {
|
|
31464
|
-
console.warn(this._logPrefix + "No service injected. Can't add a job");
|
|
31465
|
-
return;
|
|
31466
|
-
}
|
|
31467
|
-
if (this.debug) {
|
|
31468
|
-
console.debug(this._logPrefix + "Add job id=" + id);
|
|
31469
|
-
}
|
|
31470
|
-
if (!!this.getProgression(id)) {
|
|
31471
|
-
console.warn(this._logPrefix + "Job (id=" + id + ") already present");
|
|
31472
|
-
return;
|
|
31473
|
-
}
|
|
31474
|
-
this.disabled = false;
|
|
31475
|
-
var sub = this.jobProgressionService.listenChanges(id)
|
|
31476
|
-
.pipe(operators.filter(function (progression) {
|
|
31477
|
-
if (id !== progression.id) {
|
|
31478
|
-
console.error(_this._logPrefix + "Job progression (id=" + progression.id + ") doesn't match expected job (id=" + id + ")");
|
|
31479
|
-
return false;
|
|
31480
|
-
}
|
|
31481
|
-
return true;
|
|
31482
|
-
}), operators.map(function (progression) {
|
|
31483
|
-
// Ensure visible
|
|
31484
|
-
_this.visible = true;
|
|
31485
|
-
// Get current progression object
|
|
31486
|
-
var currentProgression = _this.getProgression(id);
|
|
31487
|
-
if (!currentProgression) {
|
|
31488
|
-
// add it
|
|
31489
|
-
_this.jobProgressions.push(progression);
|
|
31490
|
-
if (_this.debug) {
|
|
31491
|
-
console.debug(_this._logPrefix + "Progression added id=" + id, progression);
|
|
31492
|
-
}
|
|
31493
|
-
}
|
|
31494
|
-
else {
|
|
31495
|
-
// update current
|
|
31496
|
-
Object.assign(currentProgression, progression);
|
|
31497
|
-
if (_this.debug) {
|
|
31498
|
-
console.debug(_this._logPrefix + "Progression updated id=" + id, progression);
|
|
31499
|
-
}
|
|
31500
|
-
}
|
|
31501
|
-
return progression;
|
|
31502
|
-
}))
|
|
31503
|
-
.subscribe(function (progression) {
|
|
31504
|
-
// update value
|
|
31505
|
-
_this.updateValue();
|
|
31506
|
-
// job finished
|
|
31507
|
-
if (progression.total > 0 && progression.current == progression.total) {
|
|
31508
|
-
if (_this.debug) {
|
|
31509
|
-
console.debug(_this._logPrefix + "Finished job id=" + progression.id);
|
|
31510
|
-
}
|
|
31511
|
-
// emit event
|
|
31512
|
-
_this.jobFinished.emit(progression.id);
|
|
31513
|
-
if (_this.autoRemove) {
|
|
31514
|
-
setTimeout(function () {
|
|
31515
|
-
var _a;
|
|
31516
|
-
_this.removeJob(progression.id);
|
|
31517
|
-
// If last job
|
|
31518
|
-
if (_this.autoHide && !((_a = _this.jobProgressions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
31519
|
-
setTimeout(function () {
|
|
31520
|
-
_this.visible = false;
|
|
31521
|
-
_this.markForCheck();
|
|
31522
|
-
}, _this.autoHideDelay);
|
|
31523
|
-
}
|
|
31524
|
-
}, _this.autoRemoveDelay);
|
|
31525
|
-
}
|
|
31526
|
-
}
|
|
31527
|
-
});
|
|
31528
|
-
this._subscriptionsById[id] = sub;
|
|
31529
|
-
this._subscriptions.add(sub);
|
|
31530
|
-
};
|
|
31531
|
-
JobProgressionComponent.prototype.removeJob = function (id) {
|
|
31532
|
-
if (this.debug) {
|
|
31533
|
-
console.debug(this._logPrefix + "Remove job id=" + id);
|
|
31534
|
-
}
|
|
31535
|
-
var sub = this._subscriptionsById[id];
|
|
31536
|
-
if (sub) {
|
|
31537
|
-
this._subscriptions.remove(sub);
|
|
31538
|
-
sub.unsubscribe();
|
|
31539
|
-
}
|
|
31540
|
-
var progression = this.getProgression(id);
|
|
31541
|
-
if (progression) {
|
|
31542
|
-
this.jobProgressions.splice(this.jobProgressions.indexOf(progression), 1);
|
|
31543
|
-
}
|
|
31544
|
-
this.updateValue();
|
|
31545
|
-
};
|
|
31546
|
-
JobProgressionComponent.prototype.getProgression = function (id) {
|
|
31547
|
-
return this.jobProgressions.find(function (progression) { return progression.id === id; });
|
|
31548
|
-
};
|
|
31549
|
-
JobProgressionComponent.prototype.updateValue = function () {
|
|
31550
|
-
if (this.debug) {
|
|
31551
|
-
console.debug(this._logPrefix + "Updating value");
|
|
31552
|
-
}
|
|
31553
|
-
var value = 0;
|
|
31554
|
-
var nbProgression = arraySize(this.jobProgressions);
|
|
31555
|
-
var allIndeterminate = nbProgression > 0;
|
|
31556
|
-
this.jobProgressions.forEach(function (progression) {
|
|
31557
|
-
var indeterminate = progression.total === 0;
|
|
31558
|
-
allIndeterminate = allIndeterminate && indeterminate;
|
|
31559
|
-
if (!indeterminate) {
|
|
31560
|
-
value = value + progression.current * 100 / progression.total;
|
|
31561
|
-
}
|
|
31562
|
-
});
|
|
31563
|
-
this.value = nbProgression > 0 ? value / nbProgression : 0;
|
|
31564
|
-
this.mode = allIndeterminate ? 'indeterminate' : 'determinate';
|
|
31565
|
-
if (this.debug) {
|
|
31566
|
-
console.debug(this._logPrefix + "Setting value=" + this.value + ", mode=" + this.mode);
|
|
31567
|
-
}
|
|
31568
|
-
this.markForCheck();
|
|
31569
|
-
};
|
|
31570
|
-
JobProgressionComponent.prototype.showList = function (event) {
|
|
31571
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
31572
|
-
var popover;
|
|
31573
|
-
return __generator(this, function (_e) {
|
|
31574
|
-
switch (_e.label) {
|
|
31575
|
-
case 0: return [4 /*yield*/, this.popoverController.create({
|
|
31576
|
-
component: JobProgressionList,
|
|
31577
|
-
componentProps: {
|
|
31578
|
-
titleI18n: this.titleI18n,
|
|
31579
|
-
jobProgressions: this.jobProgressions
|
|
31580
|
-
},
|
|
31581
|
-
backdropDismiss: true,
|
|
31582
|
-
keyboardClose: true,
|
|
31583
|
-
event: event,
|
|
31584
|
-
translucent: true,
|
|
31585
|
-
cssClass: 'popover-large'
|
|
31586
|
-
})];
|
|
31587
|
-
case 1:
|
|
31588
|
-
popover = _e.sent();
|
|
31589
|
-
return [4 /*yield*/, popover.present()];
|
|
31590
|
-
case 2:
|
|
31591
|
-
_e.sent();
|
|
31592
|
-
return [2 /*return*/];
|
|
31593
|
-
}
|
|
31594
|
-
});
|
|
31595
|
-
});
|
|
31596
|
-
};
|
|
31597
|
-
JobProgressionComponent.prototype.markForCheck = function () {
|
|
31598
|
-
this.cd.markForCheck();
|
|
31599
|
-
};
|
|
31600
|
-
JobProgressionComponent.prototype.ngOnDestroy = function () {
|
|
31601
|
-
if (this.debug) {
|
|
31602
|
-
console.debug(this._logPrefix + "Destroying");
|
|
31603
|
-
}
|
|
31604
|
-
this._subscriptions.unsubscribe();
|
|
31605
|
-
};
|
|
31606
|
-
return JobProgressionComponent;
|
|
31607
|
-
}());
|
|
31608
|
-
JobProgressionComponent.decorators = [
|
|
31609
|
-
{ type: i0.Component, args: [{
|
|
31610
|
-
selector: 'app-job-progression',
|
|
31611
|
-
template: "<button\n #button\n mat-icon-button\n [title]=\"titleI18n | translate\"\n [disabled]=\"disabled\"\n *ngIf=\"visible\"\n (click)=\"showList($event)\"\n>\n <mat-icon\n [matBadge]=\"jobProgressions?.length\"\n [matBadgeHidden]=\"!jobProgressions?.length\"\n matBadgeColor=\"accent\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >{{ disabled || jobProgressions?.length ? 'schedule' : 'task_alt' }}\n </mat-icon>\n <mat-spinner\n #spinner\n *ngIf=\"jobProgressions?.length\"\n class=\"floating-spinner\"\n [color]=\"color\"\n [mode]=\"mode\"\n [value]=\"value\"\n diameter=\"30\"\n strokeWidth=\"3\"\n ></mat-spinner>\n</button>\n\n",
|
|
31612
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
31613
|
-
styles: [".floating-spinner{position:absolute;top:6px;left:5px}"]
|
|
31614
|
-
},] }
|
|
31615
|
-
];
|
|
31616
|
-
JobProgressionComponent.ctorParameters = function () { return [
|
|
31617
|
-
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [JobProgressionServiceToken,] }] },
|
|
31618
|
-
{ type: i1$5.PopoverController },
|
|
31619
|
-
{ type: i0.ChangeDetectorRef }
|
|
31620
|
-
]; };
|
|
31621
|
-
JobProgressionComponent.propDecorators = {
|
|
31622
|
-
debug: [{ type: i0.Input }],
|
|
31623
|
-
titleI18n: [{ type: i0.Input }],
|
|
31624
|
-
options: [{ type: i0.Input }],
|
|
31625
|
-
jobFinished: [{ type: i0.Output }]
|
|
31626
|
-
};
|
|
31627
|
-
|
|
31628
|
-
var JobModule = /** @class */ (function () {
|
|
31629
|
-
function JobModule() {
|
|
31630
|
-
}
|
|
31631
|
-
return JobModule;
|
|
31632
|
-
}());
|
|
31633
|
-
JobModule.decorators = [
|
|
31634
|
-
{ type: i0.NgModule, args: [{
|
|
31635
|
-
imports: [
|
|
31636
|
-
i1$4.CommonModule,
|
|
31637
|
-
SharedModule,
|
|
31638
|
-
i1$2.TranslateModule.forChild(),
|
|
31639
|
-
],
|
|
31640
|
-
declarations: [
|
|
31641
|
-
JobProgressionComponent,
|
|
31642
|
-
JobProgressionList
|
|
31643
|
-
],
|
|
31644
|
-
exports: [
|
|
31645
|
-
JobProgressionComponent
|
|
31646
|
-
]
|
|
31647
|
-
},] }
|
|
31648
|
-
];
|
|
31649
|
-
|
|
31650
|
-
var SocialModuleOptionsToken = new i0.InjectionToken("SocialModuleOptions");
|
|
31651
|
-
var SocialModule = /** @class */ (function () {
|
|
31652
|
-
function SocialModule() {
|
|
31653
|
-
}
|
|
31654
|
-
return SocialModule;
|
|
31655
|
-
}());
|
|
31656
|
-
SocialModule.decorators = [
|
|
31657
|
-
{ type: i0.NgModule, args: [{
|
|
31658
|
-
imports: [
|
|
31659
|
-
i1$4.CommonModule,
|
|
31660
|
-
CoreModule,
|
|
31661
|
-
SharedModule,
|
|
31662
|
-
UserEventModule,
|
|
31663
|
-
JobModule,
|
|
31664
|
-
MessageModule,
|
|
31665
|
-
],
|
|
31666
|
-
},] }
|
|
31667
|
-
];
|
|
31668
|
-
|
|
31669
30980
|
var Mutations = {
|
|
31670
|
-
send: core.gql(templateObject_1$
|
|
30981
|
+
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 }"])))
|
|
31671
30982
|
};
|
|
31672
30983
|
var MessageService = /** @class */ (function (_super) {
|
|
31673
30984
|
__extends(MessageService, _super);
|
|
@@ -31751,7 +31062,7 @@
|
|
|
31751
31062
|
{ type: i1$5.ToastController },
|
|
31752
31063
|
{ type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
31753
31064
|
]; };
|
|
31754
|
-
var templateObject_1$
|
|
31065
|
+
var templateObject_1$4;
|
|
31755
31066
|
|
|
31756
31067
|
var PersonFilter_1;
|
|
31757
31068
|
// @dynamic
|
|
@@ -31810,7 +31121,7 @@
|
|
|
31810
31121
|
], exports.PersonFilter);
|
|
31811
31122
|
|
|
31812
31123
|
var PersonFragments = {
|
|
31813
|
-
person: core.gql(templateObject_1$
|
|
31124
|
+
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 }"])))
|
|
31814
31125
|
};
|
|
31815
31126
|
// Load persons query
|
|
31816
31127
|
var PersonQueries = {
|
|
@@ -31950,7 +31261,7 @@
|
|
|
31950
31261
|
{ type: NetworkService },
|
|
31951
31262
|
{ type: EntitiesStorage }
|
|
31952
31263
|
]; };
|
|
31953
|
-
var templateObject_1$
|
|
31264
|
+
var templateObject_1$5, templateObject_2$4, templateObject_3$3, templateObject_4$3, templateObject_5$2;
|
|
31954
31265
|
|
|
31955
31266
|
var PersonValidatorService = /** @class */ (function () {
|
|
31956
31267
|
function PersonValidatorService(formBuilder, accountValidatorService) {
|
|
@@ -32360,10 +31671,12 @@
|
|
|
32360
31671
|
};
|
|
32361
31672
|
AutocompleteTestPage.prototype.ngAfterViewInit = function () {
|
|
32362
31673
|
var _this = this;
|
|
32363
|
-
|
|
32364
|
-
|
|
32365
|
-
|
|
32366
|
-
|
|
31674
|
+
if (this.farEntityField) {
|
|
31675
|
+
setTimeout(function () {
|
|
31676
|
+
_this.farEntityField.suggestLengthThreshold = 2;
|
|
31677
|
+
_this.farEntityField.reloadItems();
|
|
31678
|
+
}, 2000);
|
|
31679
|
+
}
|
|
32367
31680
|
setTimeout(function () { return _this.loadData(); }, 1000);
|
|
32368
31681
|
};
|
|
32369
31682
|
// Load the form with data
|
|
@@ -32470,7 +31783,7 @@
|
|
|
32470
31783
|
AutocompleteTestPage.decorators = [
|
|
32471
31784
|
{ type: i0.Component, args: [{
|
|
32472
31785
|
selector: 'app-autocomplete-test',
|
|
32473
|
-
template: "<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Autocomplete field test page</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n\n <!-- Tab nav - mobile/desktop mode -->\n <nav mat-tab-nav-bar>\n <a mat-tab-link\n [active]=\"mode==='mobile'\"\n (click)=\"toggleMode('mobile')\">\n <mat-label>Mobile</mat-label>\n </a>\n <a mat-tab-link [active]=\"mode==='desktop'\"\n (click)=\"toggleMode('desktop')\">\n <mat-label>Desktop</mat-label>\n </a>\n <a mat-tab-link [active]=\"mode==='memory'\"\n (click)=\"toggleMode('memory')\">\n <mat-label>Memory leak debug</mat-label>\n </a>\n <a mat-tab-link\n [active]=\"mode==='temp'\"\n (click)=\"toggleMode('temp')\">\n <mat-label>Temporary</mat-label>\n </a>\n </nav>\n\n <form class=\"form-container\" [formGroup]=\"form\" (ngSubmit)=\"doSubmit($event)\">\n\n <!--<ion-grid *ngIf=\"mode === 'temp'\">\n <ion-row>\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Items is an Observable\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>items: Observable<any[]></pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [logPrefix]=\"'[combo-desktop-2]'\"\n [compareWith]=\"compareWithFn\"\n [mobile]=\"false\"\n ></mat-autocomplete-field>\n </ion-card-content>\n\n </ion-card>\n </ion-col>\n </ion-row>\n\n\n </ion-grid>-->\n\n\n <ion-grid *ngIf=\"mode === 'memory'\">\n\n <!-- debugging memory leak -->\n <ion-row>\n <ion-col>\n <ion-text><h4>Debug memory leak</h4></ion-text>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col size=\"2\">\n <mat-form-field floatLabel=\"always\">\n <input matInput type=\"text\" hidden placeholder=\"Items type\">\n <mat-select (selectionChange)=\"memoryAutocompleteFieldName=$event.value\" [value]=\"memoryAutocompleteFieldName\">\n <mat-option value=\"entity-$items\">Observable</mat-option>\n <mat-option value=\"entity-suggestFn\">Suggest function</mat-option>\n </mat-select>\n </mat-form-field>\n </ion-col>\n <ion-col size=\"1\" class=\"ion-no-padding\">\n <mat-form-field floatLabel=\"always\">\n <input matInput type=\"text\" hidden placeholder=\"Mobile ?\">\n <mat-checkbox (change)=\"memoryMobile=$event.checked\" [checked]=\"memoryMobile\">\n </mat-checkbox>\n </mat-form-field>\n </ion-col>\n\n <ion-col size=\"2\">\n <ion-button *ngIf=\"!memoryTimer\" (click)=\"startMemoryTimer()\" color=\"tertiary\">Start</ion-button>\n <ion-button *ngIf=\"memoryTimer\" (click)=\"stopMemoryTimer()\" color=\"tertiary\">Stop</ion-button>\n </ion-col>\n </ion-row>\n\n <ion-row>\n <ion-col>\n <mat-autocomplete-field formControlName=\"entity\"\n *ngIf=\"!memoryHide && memoryAutocompleteFieldName\"\n [config]=\"autocompleteFields.get(memoryAutocompleteFieldName)\"\n [mobile]=\"memoryMobile\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-memory-leak]'\">\n </mat-autocomplete-field>\n </ion-col>\n </ion-row>\n\n </ion-grid>\n\n <!-- Mobile mode -->\n <ion-grid *ngIf=\"mode === 'mobile'\">\n\n <ion-row>\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Entity far in the list (not in first page)\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre style=\"white-space: normal !important;\">value: {{stringify(form.controls.farEntity.value)}}</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"farEntity\" #farEntityField\n [config]=\"autocompleteFields.get('entity-far')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-far]'\"\n [debug]=\"true\"\n [required]=\"true\"\n [clearable]=\"true\"\n placeholder=\"Far entity (in the list)\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Suggest() function\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>mobile: true, suggestFn: (searchText, filter) => any[]</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-suggestFn')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-1]'\"\n [required]=\"true\"\n placeholder=\"Suggest field\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Items is an Observable\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>mobile: true, items: Observable<any[]></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-observable]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Control value if missing in items\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>mobile: true, items: Observable<any[]></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"missingEntity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [clearable]=\"true\"\n [logPrefix]=\"'[combo-mobile-2]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n search with a suggestLengthThreshold\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>suggest: (value, filter) => LoadResult<any>\nsuggestLengthThreshold: '3'</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-filter')\"\n [placeholder]=\"'Entity'\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n suggestLengthThreshold=\"3\"\n [logPrefix]=\"'[combo-mobile-suggestLengthThreshold]'\"\n required\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Multiple value\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>multiple: true</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entities\"\n [config]=\"autocompleteFields.get('entities-items-filter')\"\n [placeholder]=\"'Multiple'\"\n mobile=\"true\"\n multiple=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-multiple]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Disabled control\n </ion-label>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"disableEntity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-2]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n </ion-row>\n\n <ion-row>\n <ion-col size=\"9\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Change filter\n </ion-label>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <ion-grid class=\"ion-no-padding\">\n <ion-row>\n <ion-col>\n <ion-button (click)=\"updateFilter(filterChangeField, 'entity-items-filter')\">Filter on: {{autocompleteFields.get('entity-items-filter').filter?.searchAttribute }}</ion-button>\n </ion-col>\n <ion-col>\n <mat-autocomplete-field formControlName=\"entity\" #filterChangeField\n [config]=\"autocompleteFields.get('entity-items-filter')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-filter]'\"\n ></mat-autocomplete-field>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col size=\"3\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Large combo\n </ion-label>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>class=\"min-width-large\"</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-large')\"\n [mobile]=\"true\"\n class=\"min-width-large\"\n panelWidth=\"400px\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-large]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col size=\"6\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Readonly toggle\n </ion-text>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <ion-grid>\n <ion-row>\n <ion-col size=\"3\">\n <mat-checkbox (change)=\"readonlyField.readonly=$event.checked\" [checked]=\"readonlyField.readonly\">\n Readonly ?\n </mat-checkbox>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col>\n <mat-autocomplete-field #readonlyField formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items')\"\n [placeholder]=\"'Entity'\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-readonly]'\"\n [readonly]=\"true\"\n [clearable]=\"!readonlyField.readonly\">\n </mat-autocomplete-field>\n </ion-col>\n </ion-row>\n </ion-grid>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Fullscreen\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>class: 'mat-autocomplete-panel-full-size'</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"true\"\n [class]=\"'mat-autocomplete-panel-full-size'\"\n [matAutocompletePosition]=\"'above'\"\n [logPrefix]=\"'[combo-mobile-full-size]'\"\n [debug]=\"true\"\n [showAllOnFocus]=\"true\"\n [showPanelOnFocus]=\"true\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n <!-- Desktop mode -->\n <ion-grid *ngIf=\"mode === 'desktop'\">\n <ion-row>\n <ion-col>\n <ion-text><h4>Desktop mode</h4></ion-text>\n </ion-col>\n </ion-row>\n <ion-row>\n\n\n <ion-col size=\"6\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n items from suggest function\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>suggest: (value, filter) => LoadResult<any></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-filter')\"\n [placeholder]=\"'Entity'\"\n [mobile]=\"false\"\n [equals]=\"equals\"\n [clearable]=\"true\"\n [logPrefix]=\"'[combo-desktop-suggest]'\">\n </mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col size=\"6\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n search with a suggestLengthThreshold\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>suggest: (value, filter) => LoadResult<any>\nsuggestLengthThreshold: '3'</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-filter')\"\n [placeholder]=\"'Entity'\"\n [mobile]=\"false\"\n [equals]=\"equals\"\n suggestLengthThreshold=\"3\"\n [logPrefix]=\"'[combo-desktop-suggestLengthThreshold]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col size=\"6\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Items is an array\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>items: [], value: {{stringify(form.controls.entity.value)}}</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items')\"\n [logPrefix]=\"'[combo-desktop-array-1]'\"\n [equals]=\"equals\"\n [mobile]=\"false\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Items is an Observable\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>items: Observable<any[]></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [logPrefix]=\"'[combo-desktop-2]'\"\n [equals]=\"equals\"\n [mobile]=\"false\"\n ></mat-autocomplete-field>\n </ion-card-content>\n\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Multiple value\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>multiple: true</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entities\"\n [config]=\"autocompleteFields.get('entities-items-filter')\"\n [placeholder]=\"'Multiple'\"\n mobile=\"false\"\n multiple=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-multiple]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Control value if missing in items\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>items: Observable<any[]></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"missingEntity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-missing]'\"\n [mobile]=\"false\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Full size panel\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>class: 'mat-autocomplete-panel-full-size'</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"false\"\n [class]=\"'mat-autocomplete-panel-full-size'\"\n [matAutocompletePosition]=\"'above'\"\n [logPrefix]=\"'[combo-desktop-full-size]'\"\n [debug]=\"true\"\n [showAllOnFocus]=\"true\"\n [showPanelOnFocus]=\"true\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Disabled control\n </ion-label>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"disableEntity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"false\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-disable]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Readonly control\n </ion-label>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"false\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-readonly]'\"\n [readonly]=\"true\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n\n <ion-row>\n <ion-col size=\"9\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Full size combo\n </ion-label>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>class=\"mat-autocomplete-panel-full-size\"</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-large')\"\n [mobile]=\"false\"\n class=\"mat-autocomplete-panel-full-size\"\n panelWidth=\"100vw\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-full-size]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col size=\"3\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Large combo\n </ion-label>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>panelWidth: string</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-large')\"\n [mobile]=\"false\"\n panelWidth=\"400px\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-large]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col size=\"6\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Readonly toggle\n </ion-text>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <ion-grid>\n <ion-row>\n <ion-col size=\"3\">\n <mat-checkbox (change)=\"readonlyField.readonly=$event.checked\" [checked]=\"readonlyField.readonly\">\n Readonly ?\n </mat-checkbox>\n </ion-col>\n <ion-col size=\"3\">\n <mat-checkbox #showIcons [checked]=\"false\">\n Icons ?\n </mat-checkbox>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col>\n <mat-autocomplete-field #readonlyField formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-filter')\"\n [placeholder]=\"'Entity'\"\n [mobile]=\"false\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-readonly]'\"\n [readonly]=\"true\"\n [clearable]=\"!readonlyField.readonly\">\n <mat-icon matPrefix *ngIf=\"showIcons.checked\">keyboard_arrow_right</mat-icon>\n <mat-icon matSuffix *ngIf=\"showIcons.checked\">keyboard_arrow_left</mat-icon>\n </mat-autocomplete-field>\n </ion-col>\n </ion-row>\n </ion-grid>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n\n </ion-grid>\n\n </form>\n\n</ion-content>\n"
|
|
31786
|
+
template: "<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Autocomplete field test page</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n\n <!-- Tab nav - mobile/desktop mode -->\n <nav mat-tab-nav-bar>\n <a mat-tab-link\n [active]=\"mode==='mobile'\"\n (click)=\"toggleMode('mobile')\">\n <mat-label>Mobile</mat-label>\n </a>\n <a mat-tab-link [active]=\"mode==='desktop'\"\n (click)=\"toggleMode('desktop')\">\n <mat-label>Desktop</mat-label>\n </a>\n <a mat-tab-link [active]=\"mode==='memory'\"\n (click)=\"toggleMode('memory')\">\n <mat-label>Memory leak debug</mat-label>\n </a>\n <a mat-tab-link\n [active]=\"mode==='temp'\"\n (click)=\"toggleMode('temp')\">\n <mat-label>Temporary</mat-label>\n </a>\n </nav>\n\n <form class=\"form-container\" [formGroup]=\"form\" (ngSubmit)=\"doSubmit($event)\">\n\n <!--<ion-grid *ngIf=\"mode === 'temp'\">\n <ion-row>\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Items is an Observable\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>items: Observable<any[]></pre></small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [logPrefix]=\"'[combo-desktop-2]'\"\n [compareWith]=\"compareWithFn\"\n [mobile]=\"false\"\n ></mat-autocomplete-field>\n </ion-card-content>\n\n </ion-card>\n </ion-col>\n </ion-row>\n\n\n </ion-grid>-->\n\n\n <ion-grid *ngIf=\"mode === 'memory'\">\n\n <!-- debugging memory leak -->\n <ion-row>\n <ion-col>\n <ion-text><h4>Debug memory leak</h4></ion-text>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col size=\"2\">\n <mat-form-field floatLabel=\"always\">\n <input matInput type=\"text\" hidden placeholder=\"Items type\">\n <mat-select (selectionChange)=\"memoryAutocompleteFieldName=$event.value\" [value]=\"memoryAutocompleteFieldName\">\n <mat-option value=\"entity-$items\">Observable</mat-option>\n <mat-option value=\"entity-suggestFn\">Suggest function</mat-option>\n </mat-select>\n </mat-form-field>\n </ion-col>\n <ion-col size=\"1\" class=\"ion-no-padding\">\n <mat-form-field floatLabel=\"always\">\n <input matInput type=\"text\" hidden placeholder=\"Mobile ?\">\n <mat-checkbox (change)=\"memoryMobile=$event.checked\" [checked]=\"memoryMobile\">\n </mat-checkbox>\n </mat-form-field>\n </ion-col>\n\n <ion-col size=\"2\">\n <ion-button *ngIf=\"!memoryTimer\" (click)=\"startMemoryTimer()\" color=\"tertiary\">Start</ion-button>\n <ion-button *ngIf=\"memoryTimer\" (click)=\"stopMemoryTimer()\" color=\"tertiary\">Stop</ion-button>\n </ion-col>\n </ion-row>\n\n <ion-row>\n <ion-col>\n <mat-autocomplete-field formControlName=\"entity\"\n *ngIf=\"!memoryHide && memoryAutocompleteFieldName\"\n [config]=\"autocompleteFields.get(memoryAutocompleteFieldName)\"\n [mobile]=\"memoryMobile\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-memory-leak]'\">\n </mat-autocomplete-field>\n </ion-col>\n </ion-row>\n\n </ion-grid>\n\n <!-- Mobile mode -->\n <ion-grid *ngIf=\"mode === 'mobile'\">\n\n <ion-row>\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Entity far in the list (not in first page)\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre style=\"white-space: normal !important;\">value: {{stringify(form.controls.farEntity.value)}}</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"farEntity\" #farEntityField\n [config]=\"autocompleteFields.get('entity-far')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-far]'\"\n [debug]=\"true\"\n [required]=\"true\"\n [clearable]=\"true\"\n placeholder=\"Far entity (in the list)\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Suggest() function\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>mobile: true, suggestFn: (searchText, filter) => any[]</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-suggestFn')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-1]'\"\n [required]=\"true\"\n placeholder=\"Suggest field\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Items is an Observable\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>mobile: true, items: Observable<any[]></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-observable]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Control value if missing in items\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>mobile: true, items: Observable<any[]></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"missingEntity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [clearable]=\"true\"\n [logPrefix]=\"'[combo-mobile-2]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n search with a suggestLengthThreshold\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>suggest: (value, filter) => LoadResult<any>\nsuggestLengthThreshold: '3'</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-filter')\"\n [placeholder]=\"'Entity'\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n suggestLengthThreshold=\"3\"\n [logPrefix]=\"'[combo-mobile-suggestLengthThreshold]'\"\n required\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Multiple value\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>multiple: true</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entities\"\n [config]=\"autocompleteFields.get('entities-items-filter')\"\n [placeholder]=\"'Multiple'\"\n mobile=\"true\"\n multiple=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-multiple]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Disabled control\n </ion-label>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"disableEntity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-2]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n </ion-row>\n\n <ion-row>\n <ion-col size=\"9\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Change filter\n </ion-label>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <ion-grid class=\"ion-no-padding\">\n <ion-row>\n <ion-col>\n <ion-button (click)=\"updateFilter(filterChangeField, 'entity-items-filter')\">Filter on: {{autocompleteFields.get('entity-items-filter').filter?.searchAttribute }}</ion-button>\n </ion-col>\n <ion-col>\n <mat-autocomplete-field formControlName=\"entity\" #filterChangeField\n [config]=\"autocompleteFields.get('entity-items-filter')\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-filter]'\"\n ></mat-autocomplete-field>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col size=\"3\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Large combo\n </ion-label>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>class=\"min-width-large\"</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-large')\"\n [mobile]=\"true\"\n class=\"min-width-large\"\n panelWidth=\"400px\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-large]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col size=\"6\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Readonly toggle\n </ion-text>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <ion-grid>\n <ion-row>\n <ion-col size=\"3\">\n <mat-checkbox (change)=\"readonlyField.readonly=$event.checked\" [checked]=\"readonlyField.readonly\">\n Readonly ?\n </mat-checkbox>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col>\n <mat-autocomplete-field #readonlyField formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items')\"\n [placeholder]=\"'Entity'\"\n [mobile]=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-mobile-readonly]'\"\n [readonly]=\"true\"\n [clearable]=\"!readonlyField.readonly\">\n </mat-autocomplete-field>\n </ion-col>\n </ion-row>\n </ion-grid>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Fullscreen\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>class: 'mat-autocomplete-panel-full-size'</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"true\"\n [class]=\"'mat-autocomplete-panel-full-size'\"\n [matAutocompletePosition]=\"'above'\"\n [logPrefix]=\"'[combo-mobile-full-size]'\"\n [debug]=\"true\"\n [showAllOnFocus]=\"true\"\n [showPanelOnFocus]=\"true\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n\n <!-- Desktop mode -->\n <ion-grid *ngIf=\"mode === 'desktop'\">\n <ion-row>\n <ion-col>\n <ion-text><h4>Desktop mode</h4></ion-text>\n </ion-col>\n </ion-row>\n <ion-row>\n\n\n <ion-col size=\"6\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n items from suggest function\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>suggest: (value, filter) => LoadResult<any></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-filter')\"\n [placeholder]=\"'Entity'\"\n [mobile]=\"false\"\n [equals]=\"equals\"\n [clearable]=\"true\"\n [logPrefix]=\"'[combo-desktop-suggest]'\"\n [debug]=\"true\">\n </mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col size=\"6\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n search with a suggestLengthThreshold\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>suggest: (value, filter) => LoadResult<any>\nsuggestLengthThreshold: '3'</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-filter')\"\n [placeholder]=\"'Entity'\"\n [mobile]=\"false\"\n [equals]=\"equals\"\n suggestLengthThreshold=\"3\"\n [logPrefix]=\"'[combo-desktop-suggestLengthThreshold]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col size=\"6\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Items is an array\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>items: [], value: {{stringify(form.controls.entity.value)}}</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items')\"\n [logPrefix]=\"'[combo-desktop-array-1]'\"\n [equals]=\"equals\"\n [mobile]=\"false\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Items is an Observable\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>items: Observable<any[]></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [logPrefix]=\"'[combo-desktop-2]'\"\n [equals]=\"equals\"\n [mobile]=\"false\"\n ></mat-autocomplete-field>\n </ion-card-content>\n\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Multiple value\n </ion-text>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small><pre>multiple: true</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entities\"\n [config]=\"autocompleteFields.get('entities-items-filter')\"\n [placeholder]=\"'Multiple'\"\n mobile=\"false\"\n multiple=\"true\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-multiple]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Control value if missing in items\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>items: Observable<any[]></pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"missingEntity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-missing]'\"\n [mobile]=\"false\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Full size panel\n </ion-label>\n </ion-card-title>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>class: 'mat-autocomplete-panel-full-size'</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"false\"\n [class]=\"'mat-autocomplete-panel-full-size'\"\n [matAutocompletePosition]=\"'above'\"\n [logPrefix]=\"'[combo-desktop-full-size]'\"\n [debug]=\"true\"\n [showAllOnFocus]=\"true\"\n [showPanelOnFocus]=\"true\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Disabled control\n </ion-label>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"disableEntity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"false\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-disable]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col>\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Readonly control\n </ion-label>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-$items')\"\n [mobile]=\"false\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-readonly]'\"\n [readonly]=\"true\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n\n <ion-row>\n <ion-col size=\"9\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Full size combo\n </ion-label>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>class=\"mat-autocomplete-panel-full-size\"</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-large')\"\n [mobile]=\"false\"\n class=\"mat-autocomplete-panel-full-size\"\n panelWidth=\"100vw\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-full-size]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col size=\"3\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-label color=\"primary\">\n Large combo\n </ion-label>\n <ion-card-subtitle>\n <ion-text color=\"medium\">\n <small>\n <pre>panelWidth: string</pre>\n </small>\n </ion-text>\n </ion-card-subtitle>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <mat-autocomplete-field formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-large')\"\n [mobile]=\"false\"\n panelWidth=\"400px\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-large]'\"\n ></mat-autocomplete-field>\n </ion-card-content>\n </ion-card>\n </ion-col>\n\n <ion-col size=\"6\">\n <ion-card>\n <ion-card-header>\n <ion-card-title>\n <ion-text color=\"primary\">\n Readonly toggle\n </ion-text>\n </ion-card-title>\n </ion-card-header>\n <ion-card-content>\n <ion-grid>\n <ion-row>\n <ion-col size=\"3\">\n <mat-checkbox (change)=\"readonlyField.readonly=$event.checked\" [checked]=\"readonlyField.readonly\">\n Readonly ?\n </mat-checkbox>\n </ion-col>\n <ion-col size=\"3\">\n <mat-checkbox #showIcons [checked]=\"false\">\n Icons ?\n </mat-checkbox>\n </ion-col>\n </ion-row>\n <ion-row>\n <ion-col>\n <mat-autocomplete-field #readonlyField formControlName=\"entity\"\n [config]=\"autocompleteFields.get('entity-items-filter')\"\n [placeholder]=\"'Entity'\"\n [mobile]=\"false\"\n [equals]=\"equals\"\n [logPrefix]=\"'[combo-desktop-readonly]'\"\n [readonly]=\"true\"\n [clearable]=\"!readonlyField.readonly\">\n <mat-icon matPrefix *ngIf=\"showIcons.checked\">keyboard_arrow_right</mat-icon>\n <mat-icon matSuffix *ngIf=\"showIcons.checked\">keyboard_arrow_left</mat-icon>\n </mat-autocomplete-field>\n </ion-col>\n </ion-row>\n </ion-grid>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n\n </ion-grid>\n\n </form>\n\n</ion-content>\n"
|
|
32474
31787
|
},] }
|
|
32475
31788
|
];
|
|
32476
31789
|
AutocompleteTestPage.ctorParameters = function () { return [
|
|
@@ -32552,13 +31865,13 @@
|
|
|
32552
31865
|
{ type: i1.FormBuilder }
|
|
32553
31866
|
]; };
|
|
32554
31867
|
|
|
32555
|
-
var moment$
|
|
31868
|
+
var moment$6 = momentImported__namespace;
|
|
32556
31869
|
var SwipeTestPage = /** @class */ (function () {
|
|
32557
31870
|
function SwipeTestPage(formBuilder, dateFormatPipe) {
|
|
32558
31871
|
this.formBuilder = formBuilder;
|
|
32559
31872
|
this.dateFormatPipe = dateFormatPipe;
|
|
32560
31873
|
this.$dates = new rxjs.BehaviorSubject(undefined);
|
|
32561
|
-
this._today = moment$
|
|
31874
|
+
this._today = moment$6().startOf('day');
|
|
32562
31875
|
this.form = formBuilder.group({
|
|
32563
31876
|
empty: [null, i1.Validators.required],
|
|
32564
31877
|
date: [null, i1.Validators.compose([i1.Validators.required, SharedValidators.validDate])],
|
|
@@ -32572,7 +31885,7 @@
|
|
|
32572
31885
|
var _this = this;
|
|
32573
31886
|
var dates = [];
|
|
32574
31887
|
for (var d = 0; d < 7; d++) {
|
|
32575
|
-
dates[d] = moment$
|
|
31888
|
+
dates[d] = moment$6(this._today).add(d - 3, 'day');
|
|
32576
31889
|
}
|
|
32577
31890
|
this.$dates.next(dates);
|
|
32578
31891
|
this.loadData();
|
|
@@ -32619,7 +31932,7 @@
|
|
|
32619
31932
|
{ type: DateFormatPipe }
|
|
32620
31933
|
]; };
|
|
32621
31934
|
|
|
32622
|
-
var moment$
|
|
31935
|
+
var moment$7 = momentImported__namespace;
|
|
32623
31936
|
var DateTimeTestPage = /** @class */ (function () {
|
|
32624
31937
|
function DateTimeTestPage(platform, formBuilder, cd) {
|
|
32625
31938
|
this.platform = platform;
|
|
@@ -32655,7 +31968,7 @@
|
|
|
32655
31968
|
var now, data;
|
|
32656
31969
|
var _this = this;
|
|
32657
31970
|
return __generator(this, function (_a) {
|
|
32658
|
-
now = moment$
|
|
31971
|
+
now = moment$7();
|
|
32659
31972
|
data = {
|
|
32660
31973
|
empty: null,
|
|
32661
31974
|
emptyRequired: null,
|
|
@@ -32933,7 +32246,7 @@
|
|
|
32933
32246
|
{ type: i1.FormBuilder }
|
|
32934
32247
|
]; };
|
|
32935
32248
|
|
|
32936
|
-
var moment$
|
|
32249
|
+
var moment$8 = momentImported__namespace;
|
|
32937
32250
|
var DateTestPage = /** @class */ (function () {
|
|
32938
32251
|
function DateTestPage(formBuilder, cd) {
|
|
32939
32252
|
this.formBuilder = formBuilder;
|
|
@@ -32970,7 +32283,7 @@
|
|
|
32970
32283
|
var now, nowAtMahe, data;
|
|
32971
32284
|
var _this = this;
|
|
32972
32285
|
return __generator(this, function (_a) {
|
|
32973
|
-
now = moment$
|
|
32286
|
+
now = moment$8();
|
|
32974
32287
|
nowAtMahe = now.clone().tz(this.timezone).startOf('day');
|
|
32975
32288
|
data = {
|
|
32976
32289
|
empty: null,
|
|
@@ -33809,7 +33122,6 @@
|
|
|
33809
33122
|
exports.APP_MENU_ITEMS = APP_MENU_ITEMS;
|
|
33810
33123
|
exports.APP_TESTING_PAGES = APP_TESTING_PAGES;
|
|
33811
33124
|
exports.AboutModal = AboutModal;
|
|
33812
|
-
exports.AbstractUserEventService = AbstractUserEventService;
|
|
33813
33125
|
exports.AccountPage = AccountPage;
|
|
33814
33126
|
exports.AccountService = AccountService;
|
|
33815
33127
|
exports.AccountToStringPipe = AccountToStringPipe;
|
|
@@ -33936,11 +33248,6 @@
|
|
|
33936
33248
|
exports.IsNotNilOrBlankPipe = IsNotNilOrBlankPipe;
|
|
33937
33249
|
exports.IsNotOnFieldModePipe = IsNotOnFieldModePipe;
|
|
33938
33250
|
exports.IsOnFieldModePipe = IsOnFieldModePipe;
|
|
33939
|
-
exports.Job = Job;
|
|
33940
|
-
exports.JobModule = JobModule;
|
|
33941
|
-
exports.JobProgressionComponent = JobProgressionComponent;
|
|
33942
|
-
exports.JobProgressionService = JobProgressionService;
|
|
33943
|
-
exports.JobProgressionServiceToken = JobProgressionServiceToken;
|
|
33944
33251
|
exports.JobUtils = JobUtils;
|
|
33945
33252
|
exports.KEYBOARD_HIDE_DELAY_MS = KEYBOARD_HIDE_DELAY_MS;
|
|
33946
33253
|
exports.LAT_LONG_DEFAULT_MAX_DECIMALS = LAT_LONG_DEFAULT_MAX_DECIMALS;
|
|
@@ -33978,7 +33285,6 @@
|
|
|
33978
33285
|
exports.MenuService = MenuService;
|
|
33979
33286
|
exports.MessageForm = MessageForm;
|
|
33980
33287
|
exports.MessageModal = MessageModal;
|
|
33981
|
-
exports.MessageModule = MessageModule;
|
|
33982
33288
|
exports.MessageService = MessageService;
|
|
33983
33289
|
exports.MessageTypeList = MessageTypeList;
|
|
33984
33290
|
exports.MessageTypes = MessageTypes;
|
|
@@ -34046,7 +33352,6 @@
|
|
|
34046
33352
|
exports.SharedValidators = SharedValidators;
|
|
34047
33353
|
exports.SocialErrorCodes = SocialErrorCodes;
|
|
34048
33354
|
exports.SocialModule = SocialModule;
|
|
34049
|
-
exports.SocialModuleOptionsToken = SocialModuleOptionsToken;
|
|
34050
33355
|
exports.StartableService = StartableService;
|
|
34051
33356
|
exports.StatusById = StatusById;
|
|
34052
33357
|
exports.StatusIds = StatusIds;
|
|
@@ -34075,10 +33380,7 @@
|
|
|
34075
33380
|
exports.UploadFileTestingPage = UploadFileTestingPage;
|
|
34076
33381
|
exports.UriUtils = UriUtils;
|
|
34077
33382
|
exports.UserEventFragments = UserEventFragments;
|
|
34078
|
-
exports.UserEventModule = UserEventModule;
|
|
34079
|
-
exports.UserEventNotificationComponent = UserEventNotificationComponent;
|
|
34080
33383
|
exports.UserEventService = UserEventService;
|
|
34081
|
-
exports.UserEventServiceToken = UserEventServiceToken;
|
|
34082
33384
|
exports.UserEventTypes = UserEventTypes;
|
|
34083
33385
|
exports.UserEventsTable = UserEventsTable;
|
|
34084
33386
|
exports.UsersPage = UsersPage;
|
|
@@ -34229,6 +33531,7 @@
|
|
|
34229
33531
|
exports.uncapitalizeFirstLetter = uncapitalizeFirstLetter;
|
|
34230
33532
|
exports.updateValueAndValidity = updateValueAndValidity;
|
|
34231
33533
|
exports.waitFor = waitFor;
|
|
33534
|
+
exports.waitForFalse = waitForFalse;
|
|
34232
33535
|
exports.waitForTrue = waitForTrue;
|
|
34233
33536
|
exports.waitIdle = waitIdle;
|
|
34234
33537
|
exports.waitWhilePending = waitWhilePending;
|
|
@@ -34243,13 +33546,11 @@
|
|
|
34243
33546
|
exports.ɵh = LocalSettingsValidatorService;
|
|
34244
33547
|
exports.ɵi = AppUpdateOfflineModeCard;
|
|
34245
33548
|
exports.ɵj = AppIconComponent;
|
|
34246
|
-
exports.ɵk =
|
|
34247
|
-
exports.ɵl =
|
|
34248
|
-
exports.ɵm =
|
|
34249
|
-
exports.ɵn =
|
|
34250
|
-
exports.ɵo =
|
|
34251
|
-
exports.ɵp = ToastTestingModule;
|
|
34252
|
-
exports.ɵq = ToastTestingPage;
|
|
33549
|
+
exports.ɵk = DateTestPage;
|
|
33550
|
+
exports.ɵl = NumpadTestPage;
|
|
33551
|
+
exports.ɵm = MatBadgeIconTestPage;
|
|
33552
|
+
exports.ɵn = ToastTestingModule;
|
|
33553
|
+
exports.ɵo = ToastTestingPage;
|
|
34253
33554
|
|
|
34254
33555
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
34255
33556
|
|