@sumaris-net/ngx-components 1.21.0-beta7 → 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 -1171
- 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 -293
- 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 -970
- 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,273 +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({ sortBy: 'updateDate', sortDirection: '
|
|
30261
|
+
page: Object.assign(Object.assign({ sortBy: 'updateDate' }, page), { sortDirection: (page.sortDirection || 'DESC').toUpperCase() }),
|
|
30243
30262
|
filter: filter && filter.asPodObject()
|
|
30244
30263
|
},
|
|
30245
30264
|
arrayFieldName: 'data',
|
|
30246
30265
|
error: { code: SocialErrorCodes.LOAD_USER_EVENTS_ERROR, message: 'SOCIAL.ERROR.LOAD_USER_EVENTS_ERROR' },
|
|
30247
|
-
fetchPolicy:
|
|
30266
|
+
fetchPolicy: options && options.fetchPolicy || undefined
|
|
30248
30267
|
})
|
|
30249
30268
|
.pipe(operators.map(function (res) {
|
|
30250
|
-
var data =
|
|
30269
|
+
var data = res && (res.data || []).map(exports.UserEvent.fromObject);
|
|
30251
30270
|
if (now) {
|
|
30252
|
-
console.debug("" +
|
|
30271
|
+
console.debug("[user-event-service] " + data.length + " user events loaded in " + (Date.now() - now) + "ms");
|
|
30253
30272
|
now = null;
|
|
30254
30273
|
}
|
|
30255
|
-
var unreadCount = _this.unreadEvents(data);
|
|
30256
30274
|
return {
|
|
30257
30275
|
data: data,
|
|
30258
|
-
total:
|
|
30276
|
+
total: res && toNumber(res.total, data.length)
|
|
30259
30277
|
};
|
|
30260
30278
|
}));
|
|
30261
30279
|
};
|
|
30262
|
-
|
|
30263
|
-
// TODO set an id !!!!!!!!!!!!!!!!!!!!!!!!!
|
|
30264
|
-
entity = this.processUserEvent(entity);
|
|
30265
|
-
var withContent = !!entity.content;
|
|
30266
|
-
// Add user event locally
|
|
30267
|
-
this.insertIntoMutableCachedQueries(this.graphql.cache, {
|
|
30268
|
-
query: withContent ? this.queries.loadAllWithContent : this.queries.loadAll,
|
|
30269
|
-
data: entity
|
|
30270
|
-
});
|
|
30271
|
-
// Update count
|
|
30272
|
-
this._count$.next(this._count$.value + 1);
|
|
30273
|
-
};
|
|
30274
|
-
AbstractUserEventService.prototype.count = function (filter, options) {
|
|
30275
|
-
var _a;
|
|
30276
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
30277
|
-
var res;
|
|
30278
|
-
return __generator(this, function (_b) {
|
|
30279
|
-
switch (_b.label) {
|
|
30280
|
-
case 0:
|
|
30281
|
-
if (!((_a = this.queries) === null || _a === void 0 ? void 0 : _a.count)) {
|
|
30282
|
-
console.warn(this._logPrefix + "Query 'count' not provided, skip.");
|
|
30283
|
-
return [2 /*return*/, undefined];
|
|
30284
|
-
}
|
|
30285
|
-
if (!filter)
|
|
30286
|
-
throw new Error("Missing argument 'filter'");
|
|
30287
|
-
filter = this.asFilter(filter);
|
|
30288
|
-
if (this._debug)
|
|
30289
|
-
console.debug(this._logPrefix + "Counting user events with filter:", filter);
|
|
30290
|
-
return [4 /*yield*/, this.graphql.query({
|
|
30291
|
-
query: this.queries.count,
|
|
30292
|
-
variables: {
|
|
30293
|
-
filter: filter.asPodObject()
|
|
30294
|
-
},
|
|
30295
|
-
error: { code: SocialErrorCodes.COUNT_USER_EVENT_ERROR, message: 'SOCIAL.ERROR.COUNT_USER_EVENT_ERROR' },
|
|
30296
|
-
fetchPolicy: (options === null || options === void 0 ? void 0 : options.fetchPolicy) || 'network-only'
|
|
30297
|
-
})];
|
|
30298
|
-
case 1:
|
|
30299
|
-
res = _b.sent();
|
|
30300
|
-
return [2 /*return*/, res.total];
|
|
30301
|
-
}
|
|
30302
|
-
});
|
|
30303
|
-
});
|
|
30304
|
-
};
|
|
30305
|
-
AbstractUserEventService.prototype.listenChanges = function (filter, options) {
|
|
30280
|
+
UserEventService.prototype.saveAll = function (data, options) {
|
|
30306
30281
|
var _this = this;
|
|
30307
|
-
|
|
30308
|
-
|
|
30309
|
-
console.warn(this._logPrefix + "Subscription query 'listenChanges' not provided, skip.");
|
|
30310
|
-
return rxjs.of();
|
|
30311
|
-
}
|
|
30312
|
-
if (!filter)
|
|
30313
|
-
throw new Error("Missing argument 'filter'");
|
|
30314
|
-
filter = this.asFilter(filter);
|
|
30315
|
-
var withContent = (options === null || options === void 0 ? void 0 : options.withContent) === true;
|
|
30316
|
-
if (this._debug)
|
|
30317
|
-
console.debug(this._logPrefix + "[WS] Listening changes for user events with filter:", filter);
|
|
30318
|
-
return this.graphql.subscribe({
|
|
30319
|
-
query: this.subscriptions.listenChanges,
|
|
30320
|
-
fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
|
|
30321
|
-
variables: { filter: filter.asPodObject(), interval: toNumber(options === null || options === void 0 ? void 0 : options.interval, 10) },
|
|
30322
|
-
error: {
|
|
30323
|
-
code: SocialErrorCodes.SUBSCRIBE_USER_EVENTS_ERROR,
|
|
30324
|
-
message: 'SOCIAL.ERROR.SUBSCRIBE_USER_EVENTS_ERROR'
|
|
30325
|
-
}
|
|
30326
|
-
}).pipe(operators.map(function (_b) {
|
|
30327
|
-
var data = _b.data;
|
|
30328
|
-
if (data && _this._debug)
|
|
30329
|
-
console.debug(_this._logPrefix + "Received new user events:", data);
|
|
30330
|
-
var updatedData = data === null || data === void 0 ? void 0 : data.map(_this.processUserEvent);
|
|
30331
|
-
// Update cache
|
|
30332
|
-
_this.insertIntoMutableCachedQueries(_this.graphql.cache, {
|
|
30333
|
-
query: withContent ? _this.queries.loadAllWithContent : _this.queries.loadAll,
|
|
30334
|
-
data: updatedData
|
|
30335
|
-
});
|
|
30336
|
-
// update count
|
|
30337
|
-
_this._count$.next(_this.unreadEvents(updatedData));
|
|
30338
|
-
return updatedData;
|
|
30339
|
-
}));
|
|
30340
|
-
};
|
|
30341
|
-
AbstractUserEventService.prototype.delete = function (entity) {
|
|
30342
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
30343
|
-
return __generator(this, function (_b) {
|
|
30344
|
-
switch (_b.label) {
|
|
30345
|
-
case 0:
|
|
30346
|
-
if (!entity)
|
|
30347
|
-
return [2 /*return*/]; // skip
|
|
30348
|
-
return [4 /*yield*/, this.deleteAll([entity])];
|
|
30349
|
-
case 1:
|
|
30350
|
-
_b.sent();
|
|
30351
|
-
return [2 /*return*/];
|
|
30352
|
-
}
|
|
30353
|
-
});
|
|
30354
|
-
});
|
|
30355
|
-
};
|
|
30356
|
-
AbstractUserEventService.prototype.deleteAll = function (entities, opts) {
|
|
30357
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
30358
|
-
var ids, now;
|
|
30359
|
-
var _this = this;
|
|
30360
|
-
return __generator(this, function (_b) {
|
|
30361
|
-
switch (_b.label) {
|
|
30362
|
-
case 0:
|
|
30363
|
-
ids = entities && entities
|
|
30364
|
-
.map(function (t) { return t.id; });
|
|
30365
|
-
if (isEmptyArray(ids))
|
|
30366
|
-
return [2 /*return*/]; // stop, if nothing else to do
|
|
30367
|
-
now = Date.now();
|
|
30368
|
-
if (this._debug)
|
|
30369
|
-
console.debug(this._logPrefix + "Deleting events... ids:", ids);
|
|
30370
|
-
return [4 /*yield*/, this.graphql.mutate({
|
|
30371
|
-
mutation: this.mutations.deleteByIds,
|
|
30372
|
-
variables: {
|
|
30373
|
-
ids: ids
|
|
30374
|
-
},
|
|
30375
|
-
update: function (proxy) {
|
|
30376
|
-
// Remove from caches
|
|
30377
|
-
_this.removeFromMutableCachedQueriesByIds(proxy, {
|
|
30378
|
-
query: _this.queries.loadAll,
|
|
30379
|
-
ids: ids
|
|
30380
|
-
});
|
|
30381
|
-
_this.removeFromMutableCachedQueriesByIds(proxy, {
|
|
30382
|
-
query: _this.queries.loadAllWithContent,
|
|
30383
|
-
ids: ids
|
|
30384
|
-
});
|
|
30385
|
-
if (_this._debug)
|
|
30386
|
-
console.debug(_this._logPrefix + "Events deleted in " + (Date.now() - now) + "ms");
|
|
30387
|
-
}
|
|
30388
|
-
})];
|
|
30389
|
-
case 1:
|
|
30390
|
-
_b.sent();
|
|
30391
|
-
return [2 /*return*/];
|
|
30392
|
-
}
|
|
30393
|
-
});
|
|
30394
|
-
});
|
|
30282
|
+
return Promise.all(data
|
|
30283
|
+
.map(function (entity) { return _this.save(entity, options); }));
|
|
30395
30284
|
};
|
|
30396
|
-
|
|
30285
|
+
/**
|
|
30286
|
+
* Save a userEvent entity
|
|
30287
|
+
*
|
|
30288
|
+
* @param entity
|
|
30289
|
+
*/
|
|
30290
|
+
UserEventService.prototype.save = function (entity, options) {
|
|
30397
30291
|
return __awaiter(this, void 0, void 0, function () {
|
|
30398
30292
|
var isNew, json, now;
|
|
30399
30293
|
var _this = this;
|
|
30400
|
-
return __generator(this, function (
|
|
30401
|
-
switch (
|
|
30294
|
+
return __generator(this, function (_a) {
|
|
30295
|
+
switch (_a.label) {
|
|
30402
30296
|
case 0:
|
|
30403
30297
|
this.fillDefaultProperties(entity);
|
|
30404
30298
|
isNew = isNil(entity.id);
|
|
30405
30299
|
json = entity.asObject();
|
|
30406
30300
|
now = Date.now();
|
|
30407
30301
|
if (this._debug)
|
|
30408
|
-
console.debug(
|
|
30302
|
+
console.debug("[user-event-service] Saving user event...", json);
|
|
30409
30303
|
return [4 /*yield*/, this.graphql.mutate({
|
|
30410
|
-
mutation:
|
|
30304
|
+
mutation: SaveQuery,
|
|
30411
30305
|
variables: {
|
|
30412
30306
|
data: json
|
|
30413
30307
|
},
|
|
30414
30308
|
error: { code: SocialErrorCodes.SAVE_USER_EVENT_ERROR, message: 'SOCIAL.ERROR.SAVE_USER_EVENT_ERROR' },
|
|
30415
|
-
update: function (proxy,
|
|
30416
|
-
var data =
|
|
30309
|
+
update: function (proxy, _a) {
|
|
30310
|
+
var data = _a.data;
|
|
30417
30311
|
// Update entity
|
|
30418
30312
|
var savedEntity = data && data.data;
|
|
30419
30313
|
if (savedEntity) {
|
|
30420
30314
|
if (_this._debug)
|
|
30421
|
-
console.debug(
|
|
30315
|
+
console.debug("[user-event-service] User event saved in " + (Date.now() - now) + "ms", entity);
|
|
30422
30316
|
_this.copyIdAndUpdateDate(savedEntity, entity);
|
|
30423
30317
|
// Add to cache
|
|
30424
30318
|
if (isNew) {
|
|
30425
30319
|
_this.insertIntoMutableCachedQueries(proxy, {
|
|
30426
|
-
query:
|
|
30320
|
+
query: LoadAllQuery,
|
|
30427
30321
|
data: Object.assign(Object.assign({}, savedEntity), { content: null })
|
|
30428
30322
|
});
|
|
30429
30323
|
_this.insertIntoMutableCachedQueries(proxy, {
|
|
30430
|
-
query:
|
|
30324
|
+
query: LoadAllWithContentQuery,
|
|
30431
30325
|
data: savedEntity
|
|
30432
30326
|
});
|
|
30433
30327
|
}
|
|
@@ -30435,185 +30329,93 @@
|
|
|
30435
30329
|
}
|
|
30436
30330
|
})];
|
|
30437
30331
|
case 1:
|
|
30438
|
-
|
|
30332
|
+
_a.sent();
|
|
30439
30333
|
return [2 /*return*/, entity];
|
|
30440
30334
|
}
|
|
30441
30335
|
});
|
|
30442
30336
|
});
|
|
30443
30337
|
};
|
|
30444
|
-
|
|
30445
|
-
|
|
30446
|
-
|
|
30447
|
-
|
|
30448
|
-
|
|
30449
|
-
|
|
30338
|
+
/**
|
|
30339
|
+
* Save many trips
|
|
30340
|
+
*
|
|
30341
|
+
* @param entities
|
|
30342
|
+
* @param opts
|
|
30343
|
+
*/
|
|
30344
|
+
UserEventService.prototype.deleteAll = function (entities, opts) {
|
|
30450
30345
|
return __awaiter(this, void 0, void 0, function () {
|
|
30451
|
-
var
|
|
30452
|
-
var
|
|
30453
|
-
return __generator(this, function (
|
|
30454
|
-
switch (
|
|
30346
|
+
var ids, now;
|
|
30347
|
+
var _this = this;
|
|
30348
|
+
return __generator(this, function (_a) {
|
|
30349
|
+
switch (_a.label) {
|
|
30455
30350
|
case 0:
|
|
30456
|
-
|
|
30457
|
-
|
|
30458
|
-
|
|
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
|
+
})];
|
|
30459
30377
|
case 1:
|
|
30460
|
-
|
|
30461
|
-
|
|
30462
|
-
_c.label = 2;
|
|
30463
|
-
case 2:
|
|
30464
|
-
if (!!onReadListeners_1_1.done) return [3 /*break*/, 5];
|
|
30465
|
-
listener = onReadListeners_1_1.value;
|
|
30466
|
-
return [4 /*yield*/, listener.onRead(entity)];
|
|
30467
|
-
case 3:
|
|
30468
|
-
_c.sent();
|
|
30469
|
-
_c.label = 4;
|
|
30470
|
-
case 4:
|
|
30471
|
-
onReadListeners_1_1 = onReadListeners_1.next();
|
|
30472
|
-
return [3 /*break*/, 2];
|
|
30473
|
-
case 5: return [3 /*break*/, 8];
|
|
30474
|
-
case 6:
|
|
30475
|
-
e_1_1 = _c.sent();
|
|
30476
|
-
e_1 = { error: e_1_1 };
|
|
30477
|
-
return [3 /*break*/, 8];
|
|
30478
|
-
case 7:
|
|
30479
|
-
try {
|
|
30480
|
-
if (onReadListeners_1_1 && !onReadListeners_1_1.done && (_b = onReadListeners_1.return)) _b.call(onReadListeners_1);
|
|
30481
|
-
}
|
|
30482
|
-
finally { if (e_1) throw e_1.error; }
|
|
30483
|
-
return [7 /*endfinally*/];
|
|
30484
|
-
case 8: return [3 /*break*/, 11];
|
|
30485
|
-
case 9:
|
|
30486
|
-
// Use default
|
|
30487
|
-
return [4 /*yield*/, this.defaultMarkAsRead(entity)];
|
|
30488
|
-
case 10:
|
|
30489
|
-
// Use default
|
|
30490
|
-
_c.sent();
|
|
30491
|
-
_c.label = 11;
|
|
30492
|
-
case 11: return [2 /*return*/];
|
|
30378
|
+
_a.sent();
|
|
30379
|
+
return [2 /*return*/];
|
|
30493
30380
|
}
|
|
30494
30381
|
});
|
|
30495
30382
|
});
|
|
30496
30383
|
};
|
|
30497
|
-
|
|
30498
|
-
|
|
30499
|
-
|
|
30500
|
-
|
|
30501
|
-
};
|
|
30502
|
-
/* -- protected methods -- */
|
|
30503
|
-
AbstractUserEventService.prototype.processUserEvent = function (source) {
|
|
30504
|
-
var e_2, _b;
|
|
30505
|
-
// Convert json source to IUserEvent
|
|
30506
|
-
var target = this.fromObject(source);
|
|
30507
|
-
// Get listeners
|
|
30508
|
-
var listeners = (this.listeners || []).filter(function (listener) { return listener.onReceived; }).filter(function (listener) { return listener.accept(target); });
|
|
30509
|
-
try {
|
|
30510
|
-
for (var listeners_1 = __values(listeners), listeners_1_1 = listeners_1.next(); !listeners_1_1.done; listeners_1_1 = listeners_1.next()) {
|
|
30511
|
-
var listener = listeners_1_1.value;
|
|
30512
|
-
if (target) {
|
|
30513
|
-
target = listener.onReceived(target);
|
|
30514
|
-
}
|
|
30515
|
-
else {
|
|
30516
|
-
if (this._debug)
|
|
30517
|
-
console.debug(this._logPrefix + "Event has been rejected by a listener", source);
|
|
30518
|
-
break;
|
|
30519
|
-
}
|
|
30520
|
-
}
|
|
30521
|
-
}
|
|
30522
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
30523
|
-
finally {
|
|
30524
|
-
try {
|
|
30525
|
-
if (listeners_1_1 && !listeners_1_1.done && (_b = listeners_1.return)) _b.call(listeners_1);
|
|
30526
|
-
}
|
|
30527
|
-
finally { if (e_2) throw e_2.error; }
|
|
30528
|
-
}
|
|
30529
|
-
return target;
|
|
30530
|
-
};
|
|
30531
|
-
AbstractUserEventService.prototype.defaultMarkAsRead = function (userEvent) {
|
|
30384
|
+
/**
|
|
30385
|
+
* Delete userEvent entities
|
|
30386
|
+
*/
|
|
30387
|
+
UserEventService.prototype.delete = function (data) {
|
|
30532
30388
|
return __awaiter(this, void 0, void 0, function () {
|
|
30533
|
-
return __generator(this, function (
|
|
30534
|
-
switch (
|
|
30389
|
+
return __generator(this, function (_a) {
|
|
30390
|
+
switch (_a.label) {
|
|
30535
30391
|
case 0:
|
|
30536
|
-
if (!
|
|
30537
|
-
|
|
30538
|
-
|
|
30539
|
-
|
|
30540
|
-
|
|
30541
|
-
|
|
30542
|
-
console.debug(this._logPrefix + "Save local user event");
|
|
30543
|
-
return [3 /*break*/, 3];
|
|
30544
|
-
case 1: return [4 /*yield*/, this.save(userEvent)];
|
|
30545
|
-
case 2:
|
|
30546
|
-
_b.sent();
|
|
30547
|
-
_b.label = 3;
|
|
30548
|
-
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*/];
|
|
30549
30398
|
}
|
|
30550
30399
|
});
|
|
30551
30400
|
});
|
|
30552
30401
|
};
|
|
30553
|
-
|
|
30554
|
-
//
|
|
30555
|
-
|
|
30556
|
-
|
|
30557
|
-
};
|
|
30402
|
+
UserEventService.prototype.listenChanges = function (id, options) {
|
|
30403
|
+
// TODO
|
|
30404
|
+
console.warn('TODO: implement listen changes on user events');
|
|
30405
|
+
return rxjs.of();
|
|
30558
30406
|
};
|
|
30559
|
-
|
|
30560
|
-
|
|
30407
|
+
UserEventService.prototype.registerAction = function (definition) {
|
|
30408
|
+
console.info("[user-event-service] Registering action " + definition.name + " for " + definition.__typename);
|
|
30409
|
+
this._userEventActions.push(definition);
|
|
30561
30410
|
};
|
|
30562
|
-
|
|
30563
|
-
|
|
30564
|
-
AbstractUserEventService.prototype.unreadEvents = function (events) {
|
|
30565
|
-
// default calculation on unread events from a list
|
|
30566
|
-
if (isEmptyArray(events))
|
|
30567
|
-
return undefined;
|
|
30568
|
-
var lastReadDate = events
|
|
30569
|
-
.filter(function (event) { return isNotNil(event.readDate); })
|
|
30570
|
-
.reduce(function (lastDate, event) { return DateUtils.max(lastDate, event.readDate); }, undefined);
|
|
30571
|
-
return events
|
|
30572
|
-
.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; });
|
|
30573
30413
|
};
|
|
30574
|
-
AbstractUserEventService.prototype.copyIdAndUpdateDate = function (source, target) {
|
|
30575
|
-
EntityUtils.copyIdAndUpdateDate(source, target);
|
|
30576
|
-
};
|
|
30577
|
-
return AbstractUserEventService;
|
|
30578
|
-
}(BaseGraphqlService));
|
|
30579
|
-
AbstractUserEventService.decorators = [
|
|
30580
|
-
{ type: i0.Directive }
|
|
30581
|
-
];
|
|
30582
|
-
AbstractUserEventService.ctorParameters = function () { return [
|
|
30583
|
-
{ type: GraphqlService },
|
|
30584
|
-
{ type: AccountService },
|
|
30585
|
-
{ type: NetworkService },
|
|
30586
|
-
{ type: i1$2.TranslateService },
|
|
30587
|
-
{ type: undefined },
|
|
30588
|
-
{ type: undefined },
|
|
30589
|
-
{ type: undefined },
|
|
30590
|
-
{ type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
30591
|
-
]; };
|
|
30592
|
-
var userEventQueries = {
|
|
30593
|
-
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),
|
|
30594
|
-
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)
|
|
30595
|
-
};
|
|
30596
|
-
var userEventMutations = {
|
|
30597
|
-
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 "]))),
|
|
30598
|
-
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)
|
|
30599
|
-
};
|
|
30600
|
-
var UserEventService = /** @class */ (function (_super) {
|
|
30601
|
-
__extends(UserEventService, _super);
|
|
30602
|
-
function UserEventService(graphql, accountService, network, translate, toastController, environment) {
|
|
30603
|
-
var _this = _super.call(this, graphql, accountService, network, translate, userEventQueries, userEventMutations, undefined, environment) || this;
|
|
30604
|
-
_this.graphql = graphql;
|
|
30605
|
-
_this.accountService = accountService;
|
|
30606
|
-
_this.network = network;
|
|
30607
|
-
_this.translate = translate;
|
|
30608
|
-
_this.toastController = toastController;
|
|
30609
|
-
_this.environment = environment;
|
|
30610
|
-
return _this;
|
|
30611
|
-
}
|
|
30612
30414
|
UserEventService.prototype.showToastErrorWithContext = function (opts) {
|
|
30613
30415
|
return __awaiter(this, void 0, void 0, function () {
|
|
30614
30416
|
var message, res, context, userEvent, err_1;
|
|
30615
|
-
return __generator(this, function (
|
|
30616
|
-
switch (
|
|
30417
|
+
return __generator(this, function (_a) {
|
|
30418
|
+
switch (_a.label) {
|
|
30617
30419
|
case 0:
|
|
30618
30420
|
message = opts.message || (opts.error && opts.error.message || opts.error);
|
|
30619
30421
|
// Make sure message a string
|
|
@@ -30642,12 +30444,12 @@
|
|
|
30642
30444
|
}]
|
|
30643
30445
|
})];
|
|
30644
30446
|
case 1:
|
|
30645
|
-
res =
|
|
30447
|
+
res = _a.sent();
|
|
30646
30448
|
if (!res || res.role !== 'send')
|
|
30647
30449
|
return [2 /*return*/];
|
|
30648
|
-
|
|
30450
|
+
_a.label = 2;
|
|
30649
30451
|
case 2:
|
|
30650
|
-
|
|
30452
|
+
_a.trys.push([2, 6, , 7]);
|
|
30651
30453
|
if (this._debug)
|
|
30652
30454
|
console.debug('Sending debug data...');
|
|
30653
30455
|
context = opts && opts.context;
|
|
@@ -30657,15 +30459,15 @@
|
|
|
30657
30459
|
if (!(context instanceof Promise)) return [3 /*break*/, 4];
|
|
30658
30460
|
return [4 /*yield*/, context];
|
|
30659
30461
|
case 3:
|
|
30660
|
-
context =
|
|
30661
|
-
|
|
30462
|
+
context = _a.sent();
|
|
30463
|
+
_a.label = 4;
|
|
30662
30464
|
case 4: return [4 /*yield*/, this.sendDataForDebug({
|
|
30663
30465
|
message: message,
|
|
30664
30466
|
error: opts.error || undefined,
|
|
30665
30467
|
context: this.convertObjectToString(context)
|
|
30666
30468
|
})];
|
|
30667
30469
|
case 5:
|
|
30668
|
-
userEvent =
|
|
30470
|
+
userEvent = _a.sent();
|
|
30669
30471
|
console.info('Debug data successfully sent to admin', userEvent);
|
|
30670
30472
|
this.showToast({
|
|
30671
30473
|
type: 'info',
|
|
@@ -30674,7 +30476,7 @@
|
|
|
30674
30476
|
});
|
|
30675
30477
|
return [3 /*break*/, 7];
|
|
30676
30478
|
case 6:
|
|
30677
|
-
err_1 =
|
|
30479
|
+
err_1 = _a.sent();
|
|
30678
30480
|
console.error('Error while sending debug data:', err_1);
|
|
30679
30481
|
return [3 /*break*/, 7];
|
|
30680
30482
|
case 7: return [2 /*return*/];
|
|
@@ -30684,16 +30486,13 @@
|
|
|
30684
30486
|
};
|
|
30685
30487
|
UserEventService.prototype.sendDataForDebug = function (data) {
|
|
30686
30488
|
var userEvent = new exports.UserEvent();
|
|
30687
|
-
userEvent.
|
|
30489
|
+
userEvent.eventType = UserEventTypes.DEBUG_DATA;
|
|
30688
30490
|
userEvent.content = this.convertObjectToString(data);
|
|
30689
30491
|
return this.save(userEvent);
|
|
30690
30492
|
};
|
|
30691
30493
|
UserEventService.prototype.asFilter = function (filter) {
|
|
30692
30494
|
return exports.UserEventFilter.fromObject(filter);
|
|
30693
30495
|
};
|
|
30694
|
-
UserEventService.prototype.fromObject = function (source) {
|
|
30695
|
-
return exports.UserEvent.fromObject(source);
|
|
30696
|
-
};
|
|
30697
30496
|
/* -- protected methods -- */
|
|
30698
30497
|
UserEventService.prototype.convertObjectToString = function (data) {
|
|
30699
30498
|
if (typeof data === 'string') {
|
|
@@ -30711,13 +30510,13 @@
|
|
|
30711
30510
|
};
|
|
30712
30511
|
UserEventService.prototype.showToast = function (opts) {
|
|
30713
30512
|
return __awaiter(this, void 0, void 0, function () {
|
|
30714
|
-
return __generator(this, function (
|
|
30715
|
-
switch (
|
|
30513
|
+
return __generator(this, function (_a) {
|
|
30514
|
+
switch (_a.label) {
|
|
30716
30515
|
case 0:
|
|
30717
30516
|
if (!this.toastController)
|
|
30718
30517
|
throw new Error('Missing toastController in component\'s constructor');
|
|
30719
30518
|
return [4 /*yield*/, Toasts.show(this.toastController, this.translate, opts)];
|
|
30720
|
-
case 1: return [2 /*return*/,
|
|
30519
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
30721
30520
|
}
|
|
30722
30521
|
});
|
|
30723
30522
|
});
|
|
@@ -30728,10 +30527,14 @@
|
|
|
30728
30527
|
// TODO: compute sign
|
|
30729
30528
|
console.warn('TODO: sign user event before sending');
|
|
30730
30529
|
};
|
|
30530
|
+
UserEventService.prototype.copyIdAndUpdateDate = function (source, target) {
|
|
30531
|
+
EntityUtils.copyIdAndUpdateDate(source, target);
|
|
30532
|
+
};
|
|
30731
30533
|
return UserEventService;
|
|
30732
|
-
}(
|
|
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" });
|
|
30733
30536
|
UserEventService.decorators = [
|
|
30734
|
-
{ type: i0.Injectable }
|
|
30537
|
+
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
30735
30538
|
];
|
|
30736
30539
|
UserEventService.ctorParameters = function () { return [
|
|
30737
30540
|
{ type: GraphqlService },
|
|
@@ -30745,7 +30548,7 @@
|
|
|
30745
30548
|
|
|
30746
30549
|
var ICONS_MAP = {
|
|
30747
30550
|
DEBUG_DATA: { matIcon: 'bug_report' },
|
|
30748
|
-
INBOX_MESSAGE: { matIcon: 'mail' }
|
|
30551
|
+
INBOX_MESSAGE: { matIcon: 'mail' },
|
|
30749
30552
|
};
|
|
30750
30553
|
// TODO: refactor with a registration done by data service:
|
|
30751
30554
|
// - userEventService.registerEventAction({__typename: 'TripVO', ...})
|
|
@@ -30813,7 +30616,7 @@
|
|
|
30813
30616
|
}
|
|
30814
30617
|
}));
|
|
30815
30618
|
var filter = this.filter || new exports.UserEventFilter();
|
|
30816
|
-
filter.
|
|
30619
|
+
filter.recipient = this.recipient;
|
|
30817
30620
|
this.setFilter(filter, { emitEvent: true });
|
|
30818
30621
|
};
|
|
30819
30622
|
UserEventsTable.prototype.start = function () {
|
|
@@ -30835,17 +30638,17 @@
|
|
|
30835
30638
|
});
|
|
30836
30639
|
};
|
|
30837
30640
|
UserEventsTable.prototype.getIcon = function (source) {
|
|
30838
|
-
return ICONS_MAP[source.
|
|
30641
|
+
return ICONS_MAP[source.eventType];
|
|
30839
30642
|
};
|
|
30840
30643
|
UserEventsTable.prototype.getDetail = function (source) {
|
|
30841
30644
|
if (!source)
|
|
30842
30645
|
return undefined;
|
|
30843
|
-
if (source.content && source.
|
|
30646
|
+
if (source.content && source.eventType === UserEventTypes.DEBUG_DATA) {
|
|
30844
30647
|
var context = source.content.context;
|
|
30845
30648
|
if (context && context.__typename) {
|
|
30846
|
-
|
|
30649
|
+
var actions = this.service.getActionsByTypename(context.__typename);
|
|
30847
30650
|
return {
|
|
30848
|
-
|
|
30651
|
+
actions: actions,
|
|
30849
30652
|
title: source.content.error && source.content.error.message || source.content.message,
|
|
30850
30653
|
description: source.content.error && source.content.error.details || undefined
|
|
30851
30654
|
};
|
|
@@ -30856,18 +30659,18 @@
|
|
|
30856
30659
|
};
|
|
30857
30660
|
UserEventsTable.prototype.doAction = function (action, row) {
|
|
30858
30661
|
return __awaiter(this, void 0, void 0, function () {
|
|
30859
|
-
var event, res, _a, err_1;
|
|
30662
|
+
var event, context, res, _a, err_1;
|
|
30860
30663
|
return __generator(this, function (_b) {
|
|
30861
30664
|
switch (_b.label) {
|
|
30862
30665
|
case 0:
|
|
30863
30666
|
event = row.currentData;
|
|
30864
|
-
|
|
30667
|
+
context = event.content && event.content.context;
|
|
30865
30668
|
this.markAsLoading();
|
|
30866
30669
|
if (!(action && typeof action.executeAction === 'function')) return [3 /*break*/, 7];
|
|
30867
30670
|
_b.label = 1;
|
|
30868
30671
|
case 1:
|
|
30869
30672
|
_b.trys.push([1, 5, 6, 7]);
|
|
30870
|
-
res = action.executeAction(event
|
|
30673
|
+
res = action.executeAction(event, context);
|
|
30871
30674
|
if (!(res instanceof Promise)) return [3 /*break*/, 3];
|
|
30872
30675
|
return [4 /*yield*/, res];
|
|
30873
30676
|
case 2:
|
|
@@ -30899,18 +30702,13 @@
|
|
|
30899
30702
|
selector: 'app-user-events-table',
|
|
30900
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",
|
|
30901
30704
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
30902
|
-
providers: [
|
|
30903
|
-
{
|
|
30904
|
-
provide: UserEventServiceToken, useClass: UserEventService
|
|
30905
|
-
}
|
|
30906
|
-
],
|
|
30907
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}"]
|
|
30908
30706
|
},] }
|
|
30909
30707
|
];
|
|
30910
30708
|
UserEventsTable.ctorParameters = function () { return [
|
|
30911
30709
|
{ type: i0.Injector },
|
|
30912
30710
|
{ type: AccountService },
|
|
30913
|
-
{ type:
|
|
30711
|
+
{ type: UserEventService },
|
|
30914
30712
|
{ type: EntitiesStorage },
|
|
30915
30713
|
{ type: i0.ChangeDetectorRef },
|
|
30916
30714
|
{ type: undefined, decorators: [{ type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
@@ -30922,167 +30720,6 @@
|
|
|
30922
30720
|
defaultSortDirection: [{ type: i0.Input }]
|
|
30923
30721
|
};
|
|
30924
30722
|
|
|
30925
|
-
var UserEventNotificationList = /** @class */ (function () {
|
|
30926
|
-
function UserEventNotificationList(popoverController) {
|
|
30927
|
-
this.popoverController = popoverController;
|
|
30928
|
-
}
|
|
30929
|
-
UserEventNotificationList.prototype.ngOnInit = function () {
|
|
30930
|
-
};
|
|
30931
|
-
UserEventNotificationList.prototype.read = function ($event, userEvent) {
|
|
30932
|
-
var _a;
|
|
30933
|
-
if (userEvent === null || userEvent === void 0 ? void 0 : userEvent.readDate)
|
|
30934
|
-
return;
|
|
30935
|
-
(_a = this.readEvent) === null || _a === void 0 ? void 0 : _a.emit(userEvent);
|
|
30936
|
-
};
|
|
30937
|
-
UserEventNotificationList.prototype.executeAction = function (action, userEvent) {
|
|
30938
|
-
// Execute then close popover
|
|
30939
|
-
action.executeAction(userEvent);
|
|
30940
|
-
this.dismiss();
|
|
30941
|
-
};
|
|
30942
|
-
UserEventNotificationList.prototype.dismiss = function () {
|
|
30943
|
-
this.popoverController.dismiss();
|
|
30944
|
-
};
|
|
30945
|
-
return UserEventNotificationList;
|
|
30946
|
-
}());
|
|
30947
|
-
UserEventNotificationList.decorators = [
|
|
30948
|
-
{ type: i0.Component, args: [{
|
|
30949
|
-
selector: 'app-user-event-notification-list',
|
|
30950
|
-
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",
|
|
30951
|
-
styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.unread{font-weight:700}"]
|
|
30952
|
-
},] }
|
|
30953
|
-
];
|
|
30954
|
-
UserEventNotificationList.ctorParameters = function () { return [
|
|
30955
|
-
{ type: i1$5.PopoverController }
|
|
30956
|
-
]; };
|
|
30957
|
-
UserEventNotificationList.propDecorators = {
|
|
30958
|
-
titleI18n: [{ type: i0.Input }],
|
|
30959
|
-
userEvents: [{ type: i0.Input }],
|
|
30960
|
-
readEvent: [{ type: i0.Output }]
|
|
30961
|
-
};
|
|
30962
|
-
|
|
30963
|
-
var UserEventNotificationComponent = /** @class */ (function () {
|
|
30964
|
-
function UserEventNotificationComponent(userEventService, accountService, popoverController, cd) {
|
|
30965
|
-
this.userEventService = userEventService;
|
|
30966
|
-
this.accountService = accountService;
|
|
30967
|
-
this.popoverController = popoverController;
|
|
30968
|
-
this.cd = cd;
|
|
30969
|
-
this.debug = false;
|
|
30970
|
-
this.titleI18n = 'SOCIAL.USER_EVENT.NOTIFICATION.TITLE';
|
|
30971
|
-
this.disabled = false;
|
|
30972
|
-
this.userEventsSubject = new rxjs.BehaviorSubject(undefined);
|
|
30973
|
-
this._subscriptions = new rxjs.Subscription();
|
|
30974
|
-
this._logPrefix = '[user-event-notification] ';
|
|
30975
|
-
this._readEvent = new i0.EventEmitter();
|
|
30976
|
-
}
|
|
30977
|
-
Object.defineProperty(UserEventNotificationComponent.prototype, "count", {
|
|
30978
|
-
get: function () {
|
|
30979
|
-
var _a;
|
|
30980
|
-
return (_a = this.userEventService) === null || _a === void 0 ? void 0 : _a.userEventCount.pipe(operators.map(function (value) { return value === 0 ? undefined : value; }));
|
|
30981
|
-
},
|
|
30982
|
-
enumerable: false,
|
|
30983
|
-
configurable: true
|
|
30984
|
-
});
|
|
30985
|
-
UserEventNotificationComponent.prototype.ngOnInit = function () {
|
|
30986
|
-
var _this = this;
|
|
30987
|
-
if (isNil(this.userEventService)) {
|
|
30988
|
-
console.warn(this._logPrefix + "No service injected");
|
|
30989
|
-
this.disabled = true;
|
|
30990
|
-
return;
|
|
30991
|
-
}
|
|
30992
|
-
this._subscriptions.add(this.userEventService.watchAll(0, 10, 'creationDate', "desc").subscribe(function (value) {
|
|
30993
|
-
var data = value.data;
|
|
30994
|
-
if (_this.debug) {
|
|
30995
|
-
console.debug(_this._logPrefix + "Receiving user events", data);
|
|
30996
|
-
}
|
|
30997
|
-
_this.userEventsSubject.next(data);
|
|
30998
|
-
}));
|
|
30999
|
-
this._readEvent.subscribe(function (value) {
|
|
31000
|
-
_this.userEventService.markAsRead(value);
|
|
31001
|
-
});
|
|
31002
|
-
};
|
|
31003
|
-
UserEventNotificationComponent.prototype.showList = function (event) {
|
|
31004
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
31005
|
-
var popover;
|
|
31006
|
-
return __generator(this, function (_b) {
|
|
31007
|
-
switch (_b.label) {
|
|
31008
|
-
case 0: return [4 /*yield*/, this.popoverController.create({
|
|
31009
|
-
component: UserEventNotificationList,
|
|
31010
|
-
componentProps: {
|
|
31011
|
-
titleI18n: this.titleI18n,
|
|
31012
|
-
userEvents: this.userEventsSubject,
|
|
31013
|
-
readEvent: this._readEvent
|
|
31014
|
-
},
|
|
31015
|
-
backdropDismiss: true,
|
|
31016
|
-
keyboardClose: true,
|
|
31017
|
-
event: event,
|
|
31018
|
-
translucent: true,
|
|
31019
|
-
cssClass: 'popover-large'
|
|
31020
|
-
})];
|
|
31021
|
-
case 1:
|
|
31022
|
-
popover = _b.sent();
|
|
31023
|
-
return [4 /*yield*/, popover.present()];
|
|
31024
|
-
case 2:
|
|
31025
|
-
_b.sent();
|
|
31026
|
-
return [2 /*return*/];
|
|
31027
|
-
}
|
|
31028
|
-
});
|
|
31029
|
-
});
|
|
31030
|
-
};
|
|
31031
|
-
UserEventNotificationComponent.prototype.markForCheck = function () {
|
|
31032
|
-
this.cd.markForCheck();
|
|
31033
|
-
};
|
|
31034
|
-
UserEventNotificationComponent.prototype.ngOnDestroy = function () {
|
|
31035
|
-
if (this.debug) {
|
|
31036
|
-
console.debug(this._logPrefix + "Destroying");
|
|
31037
|
-
}
|
|
31038
|
-
this._subscriptions.unsubscribe();
|
|
31039
|
-
};
|
|
31040
|
-
return UserEventNotificationComponent;
|
|
31041
|
-
}());
|
|
31042
|
-
UserEventNotificationComponent.decorators = [
|
|
31043
|
-
{ type: i0.Component, args: [{
|
|
31044
|
-
selector: 'app-user-event-notification-component',
|
|
31045
|
-
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",
|
|
31046
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
31047
|
-
styles: [""]
|
|
31048
|
-
},] }
|
|
31049
|
-
];
|
|
31050
|
-
UserEventNotificationComponent.ctorParameters = function () { return [
|
|
31051
|
-
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [UserEventServiceToken,] }] },
|
|
31052
|
-
{ type: AccountService },
|
|
31053
|
-
{ type: i1$5.PopoverController },
|
|
31054
|
-
{ type: i0.ChangeDetectorRef }
|
|
31055
|
-
]; };
|
|
31056
|
-
UserEventNotificationComponent.propDecorators = {
|
|
31057
|
-
debug: [{ type: i0.Input }],
|
|
31058
|
-
titleI18n: [{ type: i0.Input }],
|
|
31059
|
-
disabled: [{ type: i0.Input }]
|
|
31060
|
-
};
|
|
31061
|
-
|
|
31062
|
-
var UserEventModule = /** @class */ (function () {
|
|
31063
|
-
function UserEventModule() {
|
|
31064
|
-
}
|
|
31065
|
-
return UserEventModule;
|
|
31066
|
-
}());
|
|
31067
|
-
UserEventModule.decorators = [
|
|
31068
|
-
{ type: i0.NgModule, args: [{
|
|
31069
|
-
imports: [
|
|
31070
|
-
i1$4.CommonModule,
|
|
31071
|
-
CoreModule,
|
|
31072
|
-
SharedModule
|
|
31073
|
-
],
|
|
31074
|
-
declarations: [
|
|
31075
|
-
UserEventsTable,
|
|
31076
|
-
UserEventNotificationComponent,
|
|
31077
|
-
UserEventNotificationList,
|
|
31078
|
-
],
|
|
31079
|
-
exports: [
|
|
31080
|
-
UserEventsTable,
|
|
31081
|
-
UserEventNotificationComponent
|
|
31082
|
-
]
|
|
31083
|
-
},] }
|
|
31084
|
-
];
|
|
31085
|
-
|
|
31086
30723
|
var MessageTypes = {
|
|
31087
30724
|
INBOX_MESSAGE: 'INBOX_MESSAGE',
|
|
31088
30725
|
EMAIL: 'EMAIL',
|
|
@@ -31316,12 +30953,12 @@
|
|
|
31316
30953
|
canSelectType: [{ type: i0.Input }]
|
|
31317
30954
|
};
|
|
31318
30955
|
|
|
31319
|
-
var
|
|
31320
|
-
function
|
|
30956
|
+
var SocialModule = /** @class */ (function () {
|
|
30957
|
+
function SocialModule() {
|
|
31321
30958
|
}
|
|
31322
|
-
return
|
|
30959
|
+
return SocialModule;
|
|
31323
30960
|
}());
|
|
31324
|
-
|
|
30961
|
+
SocialModule.decorators = [
|
|
31325
30962
|
{ type: i0.NgModule, args: [{
|
|
31326
30963
|
imports: [
|
|
31327
30964
|
i1$4.CommonModule,
|
|
@@ -31329,342 +30966,19 @@
|
|
|
31329
30966
|
SharedModule
|
|
31330
30967
|
],
|
|
31331
30968
|
declarations: [
|
|
30969
|
+
UserEventsTable,
|
|
31332
30970
|
MessageModal,
|
|
31333
30971
|
MessageForm
|
|
31334
30972
|
],
|
|
31335
30973
|
exports: [
|
|
30974
|
+
UserEventsTable,
|
|
31336
30975
|
MessageModal
|
|
31337
30976
|
]
|
|
31338
30977
|
},] }
|
|
31339
30978
|
];
|
|
31340
30979
|
|
|
31341
|
-
var JobProgression_1;
|
|
31342
|
-
// todo use entity
|
|
31343
|
-
var Job = /** @class */ (function () {
|
|
31344
|
-
function Job() {
|
|
31345
|
-
}
|
|
31346
|
-
return Job;
|
|
31347
|
-
}());
|
|
31348
|
-
// @dynamic
|
|
31349
|
-
exports.JobProgression = JobProgression_1 = /** @class */ (function (_super) {
|
|
31350
|
-
__extends(JobProgression, _super);
|
|
31351
|
-
function JobProgression() {
|
|
31352
|
-
return _super.call(this, JobProgression_1.TYPENAME) || this;
|
|
31353
|
-
}
|
|
31354
|
-
JobProgression.prototype.fromObject = function (source) {
|
|
31355
|
-
_super.prototype.fromObject.call(this, source);
|
|
31356
|
-
this.message = source.message;
|
|
31357
|
-
this.current = source.current;
|
|
31358
|
-
this.total = source.total;
|
|
31359
|
-
};
|
|
31360
|
-
return JobProgression;
|
|
31361
|
-
}(Entity));
|
|
31362
|
-
exports.JobProgression = JobProgression_1 = __decorate([
|
|
31363
|
-
EntityClass({ typename: 'JobProgressionVO' })
|
|
31364
|
-
], exports.JobProgression);
|
|
31365
|
-
|
|
31366
|
-
var JobProgressionServiceToken = new i0.InjectionToken('JobProgressionService');
|
|
31367
|
-
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}"])));
|
|
31368
|
-
var JobProgressionService = /** @class */ (function (_super) {
|
|
31369
|
-
__extends(JobProgressionService, _super);
|
|
31370
|
-
function JobProgressionService(graphql, environment) {
|
|
31371
|
-
var _this = _super.call(this, graphql, environment) || this;
|
|
31372
|
-
_this.graphql = graphql;
|
|
31373
|
-
_this.environment = environment;
|
|
31374
|
-
_this._logPrefix = '[job-progression-service] ';
|
|
31375
|
-
// For DEV only
|
|
31376
|
-
_this._debug = !(environment === null || environment === void 0 ? void 0 : environment.production);
|
|
31377
|
-
return _this;
|
|
31378
|
-
}
|
|
31379
|
-
JobProgressionService.prototype.listenChanges = function (id, options) {
|
|
31380
|
-
var _this = this;
|
|
31381
|
-
if (isNil(id))
|
|
31382
|
-
throw new Error(this._logPrefix + "Missing argument 'id'");
|
|
31383
|
-
if (this._debug)
|
|
31384
|
-
console.debug(this._logPrefix + "[WS] Listening changes for job progression {" + id + "}...");
|
|
31385
|
-
return this.graphql.subscribe({
|
|
31386
|
-
query: jobProgressionSubscription,
|
|
31387
|
-
fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
|
|
31388
|
-
variables: { id: id, interval: toNumber(options === null || options === void 0 ? void 0 : options.interval, 10) },
|
|
31389
|
-
error: { code: SocialErrorCodes.SUBSCRIBE_JOB_PROGRESSION_ERROR, message: 'SOCIAL.ERROR.SUBSCRIBE_JOB_PROGRESSION_ERROR' }
|
|
31390
|
-
}).pipe(operators.map(function (_a) {
|
|
31391
|
-
var data = _a.data;
|
|
31392
|
-
var progression = data && exports.JobProgression.fromObject(data);
|
|
31393
|
-
if (progression && _this._debug)
|
|
31394
|
-
console.debug(_this._logPrefix + "Job progression " + id + " updated on server", progression);
|
|
31395
|
-
return progression;
|
|
31396
|
-
}));
|
|
31397
|
-
};
|
|
31398
|
-
return JobProgressionService;
|
|
31399
|
-
}(BaseGraphqlService));
|
|
31400
|
-
JobProgressionService.decorators = [
|
|
31401
|
-
{ type: i0.Injectable }
|
|
31402
|
-
];
|
|
31403
|
-
JobProgressionService.ctorParameters = function () { return [
|
|
31404
|
-
{ type: GraphqlService },
|
|
31405
|
-
{ type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
31406
|
-
]; };
|
|
31407
|
-
var templateObject_1$4;
|
|
31408
|
-
|
|
31409
|
-
var JobProgressionList = /** @class */ (function () {
|
|
31410
|
-
function JobProgressionList() {
|
|
31411
|
-
}
|
|
31412
|
-
JobProgressionList.prototype.ngOnInit = function () {
|
|
31413
|
-
};
|
|
31414
|
-
return JobProgressionList;
|
|
31415
|
-
}());
|
|
31416
|
-
JobProgressionList.decorators = [
|
|
31417
|
-
{ type: i0.Component, args: [{
|
|
31418
|
-
selector: 'app-job-progression-list',
|
|
31419
|
-
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",
|
|
31420
|
-
styles: [":host(.popover-viewport){overflow-y:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}"]
|
|
31421
|
-
},] }
|
|
31422
|
-
];
|
|
31423
|
-
JobProgressionList.ctorParameters = function () { return []; };
|
|
31424
|
-
JobProgressionList.propDecorators = {
|
|
31425
|
-
titleI18n: [{ type: i0.Input }],
|
|
31426
|
-
jobProgressions: [{ type: i0.Input }]
|
|
31427
|
-
};
|
|
31428
|
-
|
|
31429
|
-
var JobProgressionComponent = /** @class */ (function () {
|
|
31430
|
-
function JobProgressionComponent(jobProgressionService, popoverController, cd) {
|
|
31431
|
-
this.jobProgressionService = jobProgressionService;
|
|
31432
|
-
this.popoverController = popoverController;
|
|
31433
|
-
this.cd = cd;
|
|
31434
|
-
this.debug = false;
|
|
31435
|
-
this.titleI18n = 'SOCIAL.JOB.PROGRESSION.TITLE';
|
|
31436
|
-
this.jobFinished = new i0.EventEmitter();
|
|
31437
|
-
this.disabled = true;
|
|
31438
|
-
this.color = 'accent';
|
|
31439
|
-
this.mode = 'determinate';
|
|
31440
|
-
this.value = 0;
|
|
31441
|
-
this.jobProgressions = [];
|
|
31442
|
-
this._subscriptions = new rxjs.Subscription();
|
|
31443
|
-
this._subscriptionsById = {};
|
|
31444
|
-
this._logPrefix = '[job-progression] ';
|
|
31445
|
-
}
|
|
31446
|
-
JobProgressionComponent.prototype.ngOnInit = function () {
|
|
31447
|
-
var _a, _b, _c, _d;
|
|
31448
|
-
if (isNil(this.jobProgressionService)) {
|
|
31449
|
-
console.warn(this._logPrefix + "No service injected");
|
|
31450
|
-
}
|
|
31451
|
-
// parse options
|
|
31452
|
-
this.autoHide = toBoolean((_a = this.options) === null || _a === void 0 ? void 0 : _a.autoHide, false);
|
|
31453
|
-
this.visible = !this.autoHide;
|
|
31454
|
-
this.autoHideDelay = toNumber((_b = this.options) === null || _b === void 0 ? void 0 : _b.autoHideDelay, 1000);
|
|
31455
|
-
this.autoRemove = toBoolean((_c = this.options) === null || _c === void 0 ? void 0 : _c.autoRemove, true);
|
|
31456
|
-
this.autoRemoveDelay = toNumber((_d = this.options) === null || _d === void 0 ? void 0 : _d.autoRemoveDelay, 1000);
|
|
31457
|
-
};
|
|
31458
|
-
JobProgressionComponent.prototype.addJob = function (id) {
|
|
31459
|
-
var _this = this;
|
|
31460
|
-
if (isNil(this.jobProgressionService)) {
|
|
31461
|
-
console.warn(this._logPrefix + "No service injected. Can't add a job");
|
|
31462
|
-
return;
|
|
31463
|
-
}
|
|
31464
|
-
if (this.debug) {
|
|
31465
|
-
console.debug(this._logPrefix + "Add job id=" + id);
|
|
31466
|
-
}
|
|
31467
|
-
if (!!this.getProgression(id)) {
|
|
31468
|
-
console.warn(this._logPrefix + "Job (id=" + id + ") already present");
|
|
31469
|
-
return;
|
|
31470
|
-
}
|
|
31471
|
-
this.disabled = false;
|
|
31472
|
-
var sub = this.jobProgressionService.listenChanges(id)
|
|
31473
|
-
.pipe(operators.filter(function (progression) {
|
|
31474
|
-
if (id !== progression.id) {
|
|
31475
|
-
console.error(_this._logPrefix + "Job progression (id=" + progression.id + ") doesn't match expected job (id=" + id + ")");
|
|
31476
|
-
return false;
|
|
31477
|
-
}
|
|
31478
|
-
return true;
|
|
31479
|
-
}), operators.map(function (progression) {
|
|
31480
|
-
// Ensure visible
|
|
31481
|
-
_this.visible = true;
|
|
31482
|
-
// Get current progression object
|
|
31483
|
-
var currentProgression = _this.getProgression(id);
|
|
31484
|
-
if (!currentProgression) {
|
|
31485
|
-
// add it
|
|
31486
|
-
_this.jobProgressions.push(progression);
|
|
31487
|
-
if (_this.debug) {
|
|
31488
|
-
console.debug(_this._logPrefix + "Progression added id=" + id, progression);
|
|
31489
|
-
}
|
|
31490
|
-
}
|
|
31491
|
-
else {
|
|
31492
|
-
// update current
|
|
31493
|
-
Object.assign(currentProgression, progression);
|
|
31494
|
-
if (_this.debug) {
|
|
31495
|
-
console.debug(_this._logPrefix + "Progression updated id=" + id, progression);
|
|
31496
|
-
}
|
|
31497
|
-
}
|
|
31498
|
-
return progression;
|
|
31499
|
-
}))
|
|
31500
|
-
.subscribe(function (progression) {
|
|
31501
|
-
// update value
|
|
31502
|
-
_this.updateValue();
|
|
31503
|
-
// job finished
|
|
31504
|
-
if (progression.total > 0 && progression.current == progression.total) {
|
|
31505
|
-
if (_this.debug) {
|
|
31506
|
-
console.debug(_this._logPrefix + "Finished job id=" + progression.id);
|
|
31507
|
-
}
|
|
31508
|
-
// emit event
|
|
31509
|
-
_this.jobFinished.emit(progression.id);
|
|
31510
|
-
if (_this.autoRemove) {
|
|
31511
|
-
setTimeout(function () {
|
|
31512
|
-
var _a;
|
|
31513
|
-
_this.removeJob(progression.id);
|
|
31514
|
-
// If last job
|
|
31515
|
-
if (_this.autoHide && !((_a = _this.jobProgressions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
31516
|
-
setTimeout(function () {
|
|
31517
|
-
_this.visible = false;
|
|
31518
|
-
_this.markForCheck();
|
|
31519
|
-
}, _this.autoHideDelay);
|
|
31520
|
-
}
|
|
31521
|
-
}, _this.autoRemoveDelay);
|
|
31522
|
-
}
|
|
31523
|
-
}
|
|
31524
|
-
});
|
|
31525
|
-
this._subscriptionsById[id] = sub;
|
|
31526
|
-
this._subscriptions.add(sub);
|
|
31527
|
-
};
|
|
31528
|
-
JobProgressionComponent.prototype.removeJob = function (id) {
|
|
31529
|
-
if (this.debug) {
|
|
31530
|
-
console.debug(this._logPrefix + "Remove job id=" + id);
|
|
31531
|
-
}
|
|
31532
|
-
var sub = this._subscriptionsById[id];
|
|
31533
|
-
if (sub) {
|
|
31534
|
-
this._subscriptions.remove(sub);
|
|
31535
|
-
sub.unsubscribe();
|
|
31536
|
-
}
|
|
31537
|
-
var progression = this.getProgression(id);
|
|
31538
|
-
if (progression) {
|
|
31539
|
-
this.jobProgressions.splice(this.jobProgressions.indexOf(progression), 1);
|
|
31540
|
-
}
|
|
31541
|
-
this.updateValue();
|
|
31542
|
-
};
|
|
31543
|
-
JobProgressionComponent.prototype.getProgression = function (id) {
|
|
31544
|
-
return this.jobProgressions.find(function (progression) { return progression.id === id; });
|
|
31545
|
-
};
|
|
31546
|
-
JobProgressionComponent.prototype.updateValue = function () {
|
|
31547
|
-
if (this.debug) {
|
|
31548
|
-
console.debug(this._logPrefix + "Updating value");
|
|
31549
|
-
}
|
|
31550
|
-
var value = 0;
|
|
31551
|
-
var nbProgression = arraySize(this.jobProgressions);
|
|
31552
|
-
var allIndeterminate = nbProgression > 0;
|
|
31553
|
-
this.jobProgressions.forEach(function (progression) {
|
|
31554
|
-
var indeterminate = progression.total === 0;
|
|
31555
|
-
allIndeterminate = allIndeterminate && indeterminate;
|
|
31556
|
-
if (!indeterminate) {
|
|
31557
|
-
value = value + progression.current * 100 / progression.total;
|
|
31558
|
-
}
|
|
31559
|
-
});
|
|
31560
|
-
this.value = nbProgression > 0 ? value / nbProgression : 0;
|
|
31561
|
-
this.mode = allIndeterminate ? 'indeterminate' : 'determinate';
|
|
31562
|
-
if (this.debug) {
|
|
31563
|
-
console.debug(this._logPrefix + "Setting value=" + this.value + ", mode=" + this.mode);
|
|
31564
|
-
}
|
|
31565
|
-
this.markForCheck();
|
|
31566
|
-
};
|
|
31567
|
-
JobProgressionComponent.prototype.showList = function (event) {
|
|
31568
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
31569
|
-
var popover;
|
|
31570
|
-
return __generator(this, function (_e) {
|
|
31571
|
-
switch (_e.label) {
|
|
31572
|
-
case 0: return [4 /*yield*/, this.popoverController.create({
|
|
31573
|
-
component: JobProgressionList,
|
|
31574
|
-
componentProps: {
|
|
31575
|
-
titleI18n: this.titleI18n,
|
|
31576
|
-
jobProgressions: this.jobProgressions
|
|
31577
|
-
},
|
|
31578
|
-
backdropDismiss: true,
|
|
31579
|
-
keyboardClose: true,
|
|
31580
|
-
event: event,
|
|
31581
|
-
translucent: true,
|
|
31582
|
-
cssClass: 'popover-large'
|
|
31583
|
-
})];
|
|
31584
|
-
case 1:
|
|
31585
|
-
popover = _e.sent();
|
|
31586
|
-
return [4 /*yield*/, popover.present()];
|
|
31587
|
-
case 2:
|
|
31588
|
-
_e.sent();
|
|
31589
|
-
return [2 /*return*/];
|
|
31590
|
-
}
|
|
31591
|
-
});
|
|
31592
|
-
});
|
|
31593
|
-
};
|
|
31594
|
-
JobProgressionComponent.prototype.markForCheck = function () {
|
|
31595
|
-
this.cd.markForCheck();
|
|
31596
|
-
};
|
|
31597
|
-
JobProgressionComponent.prototype.ngOnDestroy = function () {
|
|
31598
|
-
if (this.debug) {
|
|
31599
|
-
console.debug(this._logPrefix + "Destroying");
|
|
31600
|
-
}
|
|
31601
|
-
this._subscriptions.unsubscribe();
|
|
31602
|
-
};
|
|
31603
|
-
return JobProgressionComponent;
|
|
31604
|
-
}());
|
|
31605
|
-
JobProgressionComponent.decorators = [
|
|
31606
|
-
{ type: i0.Component, args: [{
|
|
31607
|
-
selector: 'app-job-progression',
|
|
31608
|
-
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",
|
|
31609
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
31610
|
-
styles: [".floating-spinner{position:absolute;top:6px;left:5px}"]
|
|
31611
|
-
},] }
|
|
31612
|
-
];
|
|
31613
|
-
JobProgressionComponent.ctorParameters = function () { return [
|
|
31614
|
-
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [JobProgressionServiceToken,] }] },
|
|
31615
|
-
{ type: i1$5.PopoverController },
|
|
31616
|
-
{ type: i0.ChangeDetectorRef }
|
|
31617
|
-
]; };
|
|
31618
|
-
JobProgressionComponent.propDecorators = {
|
|
31619
|
-
debug: [{ type: i0.Input }],
|
|
31620
|
-
titleI18n: [{ type: i0.Input }],
|
|
31621
|
-
options: [{ type: i0.Input }],
|
|
31622
|
-
jobFinished: [{ type: i0.Output }]
|
|
31623
|
-
};
|
|
31624
|
-
|
|
31625
|
-
var JobModule = /** @class */ (function () {
|
|
31626
|
-
function JobModule() {
|
|
31627
|
-
}
|
|
31628
|
-
return JobModule;
|
|
31629
|
-
}());
|
|
31630
|
-
JobModule.decorators = [
|
|
31631
|
-
{ type: i0.NgModule, args: [{
|
|
31632
|
-
imports: [
|
|
31633
|
-
i1$4.CommonModule,
|
|
31634
|
-
SharedModule,
|
|
31635
|
-
i1$2.TranslateModule.forChild(),
|
|
31636
|
-
],
|
|
31637
|
-
declarations: [
|
|
31638
|
-
JobProgressionComponent,
|
|
31639
|
-
JobProgressionList
|
|
31640
|
-
],
|
|
31641
|
-
exports: [
|
|
31642
|
-
JobProgressionComponent
|
|
31643
|
-
]
|
|
31644
|
-
},] }
|
|
31645
|
-
];
|
|
31646
|
-
|
|
31647
|
-
var SocialModuleOptionsToken = new i0.InjectionToken("SocialModuleOptions");
|
|
31648
|
-
var SocialModule = /** @class */ (function () {
|
|
31649
|
-
function SocialModule() {
|
|
31650
|
-
}
|
|
31651
|
-
return SocialModule;
|
|
31652
|
-
}());
|
|
31653
|
-
SocialModule.decorators = [
|
|
31654
|
-
{ type: i0.NgModule, args: [{
|
|
31655
|
-
imports: [
|
|
31656
|
-
i1$4.CommonModule,
|
|
31657
|
-
CoreModule,
|
|
31658
|
-
SharedModule,
|
|
31659
|
-
UserEventModule,
|
|
31660
|
-
JobModule,
|
|
31661
|
-
MessageModule,
|
|
31662
|
-
],
|
|
31663
|
-
},] }
|
|
31664
|
-
];
|
|
31665
|
-
|
|
31666
30980
|
var Mutations = {
|
|
31667
|
-
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 }"])))
|
|
31668
30982
|
};
|
|
31669
30983
|
var MessageService = /** @class */ (function (_super) {
|
|
31670
30984
|
__extends(MessageService, _super);
|
|
@@ -31748,7 +31062,7 @@
|
|
|
31748
31062
|
{ type: i1$5.ToastController },
|
|
31749
31063
|
{ type: Environment, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [ENVIRONMENT,] }] }
|
|
31750
31064
|
]; };
|
|
31751
|
-
var templateObject_1$
|
|
31065
|
+
var templateObject_1$4;
|
|
31752
31066
|
|
|
31753
31067
|
var PersonFilter_1;
|
|
31754
31068
|
// @dynamic
|
|
@@ -31807,7 +31121,7 @@
|
|
|
31807
31121
|
], exports.PersonFilter);
|
|
31808
31122
|
|
|
31809
31123
|
var PersonFragments = {
|
|
31810
|
-
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 }"])))
|
|
31811
31125
|
};
|
|
31812
31126
|
// Load persons query
|
|
31813
31127
|
var PersonQueries = {
|
|
@@ -31947,7 +31261,7 @@
|
|
|
31947
31261
|
{ type: NetworkService },
|
|
31948
31262
|
{ type: EntitiesStorage }
|
|
31949
31263
|
]; };
|
|
31950
|
-
var templateObject_1$
|
|
31264
|
+
var templateObject_1$5, templateObject_2$4, templateObject_3$3, templateObject_4$3, templateObject_5$2;
|
|
31951
31265
|
|
|
31952
31266
|
var PersonValidatorService = /** @class */ (function () {
|
|
31953
31267
|
function PersonValidatorService(formBuilder, accountValidatorService) {
|
|
@@ -32357,10 +31671,12 @@
|
|
|
32357
31671
|
};
|
|
32358
31672
|
AutocompleteTestPage.prototype.ngAfterViewInit = function () {
|
|
32359
31673
|
var _this = this;
|
|
32360
|
-
|
|
32361
|
-
|
|
32362
|
-
|
|
32363
|
-
|
|
31674
|
+
if (this.farEntityField) {
|
|
31675
|
+
setTimeout(function () {
|
|
31676
|
+
_this.farEntityField.suggestLengthThreshold = 2;
|
|
31677
|
+
_this.farEntityField.reloadItems();
|
|
31678
|
+
}, 2000);
|
|
31679
|
+
}
|
|
32364
31680
|
setTimeout(function () { return _this.loadData(); }, 1000);
|
|
32365
31681
|
};
|
|
32366
31682
|
// Load the form with data
|
|
@@ -32467,7 +31783,7 @@
|
|
|
32467
31783
|
AutocompleteTestPage.decorators = [
|
|
32468
31784
|
{ type: i0.Component, args: [{
|
|
32469
31785
|
selector: 'app-autocomplete-test',
|
|
32470
|
-
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"
|
|
32471
31787
|
},] }
|
|
32472
31788
|
];
|
|
32473
31789
|
AutocompleteTestPage.ctorParameters = function () { return [
|
|
@@ -32549,13 +31865,13 @@
|
|
|
32549
31865
|
{ type: i1.FormBuilder }
|
|
32550
31866
|
]; };
|
|
32551
31867
|
|
|
32552
|
-
var moment$
|
|
31868
|
+
var moment$6 = momentImported__namespace;
|
|
32553
31869
|
var SwipeTestPage = /** @class */ (function () {
|
|
32554
31870
|
function SwipeTestPage(formBuilder, dateFormatPipe) {
|
|
32555
31871
|
this.formBuilder = formBuilder;
|
|
32556
31872
|
this.dateFormatPipe = dateFormatPipe;
|
|
32557
31873
|
this.$dates = new rxjs.BehaviorSubject(undefined);
|
|
32558
|
-
this._today = moment$
|
|
31874
|
+
this._today = moment$6().startOf('day');
|
|
32559
31875
|
this.form = formBuilder.group({
|
|
32560
31876
|
empty: [null, i1.Validators.required],
|
|
32561
31877
|
date: [null, i1.Validators.compose([i1.Validators.required, SharedValidators.validDate])],
|
|
@@ -32569,7 +31885,7 @@
|
|
|
32569
31885
|
var _this = this;
|
|
32570
31886
|
var dates = [];
|
|
32571
31887
|
for (var d = 0; d < 7; d++) {
|
|
32572
|
-
dates[d] = moment$
|
|
31888
|
+
dates[d] = moment$6(this._today).add(d - 3, 'day');
|
|
32573
31889
|
}
|
|
32574
31890
|
this.$dates.next(dates);
|
|
32575
31891
|
this.loadData();
|
|
@@ -32616,7 +31932,7 @@
|
|
|
32616
31932
|
{ type: DateFormatPipe }
|
|
32617
31933
|
]; };
|
|
32618
31934
|
|
|
32619
|
-
var moment$
|
|
31935
|
+
var moment$7 = momentImported__namespace;
|
|
32620
31936
|
var DateTimeTestPage = /** @class */ (function () {
|
|
32621
31937
|
function DateTimeTestPage(platform, formBuilder, cd) {
|
|
32622
31938
|
this.platform = platform;
|
|
@@ -32652,7 +31968,7 @@
|
|
|
32652
31968
|
var now, data;
|
|
32653
31969
|
var _this = this;
|
|
32654
31970
|
return __generator(this, function (_a) {
|
|
32655
|
-
now = moment$
|
|
31971
|
+
now = moment$7();
|
|
32656
31972
|
data = {
|
|
32657
31973
|
empty: null,
|
|
32658
31974
|
emptyRequired: null,
|
|
@@ -32930,7 +32246,7 @@
|
|
|
32930
32246
|
{ type: i1.FormBuilder }
|
|
32931
32247
|
]; };
|
|
32932
32248
|
|
|
32933
|
-
var moment$
|
|
32249
|
+
var moment$8 = momentImported__namespace;
|
|
32934
32250
|
var DateTestPage = /** @class */ (function () {
|
|
32935
32251
|
function DateTestPage(formBuilder, cd) {
|
|
32936
32252
|
this.formBuilder = formBuilder;
|
|
@@ -32967,7 +32283,7 @@
|
|
|
32967
32283
|
var now, nowAtMahe, data;
|
|
32968
32284
|
var _this = this;
|
|
32969
32285
|
return __generator(this, function (_a) {
|
|
32970
|
-
now = moment$
|
|
32286
|
+
now = moment$8();
|
|
32971
32287
|
nowAtMahe = now.clone().tz(this.timezone).startOf('day');
|
|
32972
32288
|
data = {
|
|
32973
32289
|
empty: null,
|
|
@@ -33806,7 +33122,6 @@
|
|
|
33806
33122
|
exports.APP_MENU_ITEMS = APP_MENU_ITEMS;
|
|
33807
33123
|
exports.APP_TESTING_PAGES = APP_TESTING_PAGES;
|
|
33808
33124
|
exports.AboutModal = AboutModal;
|
|
33809
|
-
exports.AbstractUserEventService = AbstractUserEventService;
|
|
33810
33125
|
exports.AccountPage = AccountPage;
|
|
33811
33126
|
exports.AccountService = AccountService;
|
|
33812
33127
|
exports.AccountToStringPipe = AccountToStringPipe;
|
|
@@ -33933,11 +33248,6 @@
|
|
|
33933
33248
|
exports.IsNotNilOrBlankPipe = IsNotNilOrBlankPipe;
|
|
33934
33249
|
exports.IsNotOnFieldModePipe = IsNotOnFieldModePipe;
|
|
33935
33250
|
exports.IsOnFieldModePipe = IsOnFieldModePipe;
|
|
33936
|
-
exports.Job = Job;
|
|
33937
|
-
exports.JobModule = JobModule;
|
|
33938
|
-
exports.JobProgressionComponent = JobProgressionComponent;
|
|
33939
|
-
exports.JobProgressionService = JobProgressionService;
|
|
33940
|
-
exports.JobProgressionServiceToken = JobProgressionServiceToken;
|
|
33941
33251
|
exports.JobUtils = JobUtils;
|
|
33942
33252
|
exports.KEYBOARD_HIDE_DELAY_MS = KEYBOARD_HIDE_DELAY_MS;
|
|
33943
33253
|
exports.LAT_LONG_DEFAULT_MAX_DECIMALS = LAT_LONG_DEFAULT_MAX_DECIMALS;
|
|
@@ -33975,7 +33285,6 @@
|
|
|
33975
33285
|
exports.MenuService = MenuService;
|
|
33976
33286
|
exports.MessageForm = MessageForm;
|
|
33977
33287
|
exports.MessageModal = MessageModal;
|
|
33978
|
-
exports.MessageModule = MessageModule;
|
|
33979
33288
|
exports.MessageService = MessageService;
|
|
33980
33289
|
exports.MessageTypeList = MessageTypeList;
|
|
33981
33290
|
exports.MessageTypes = MessageTypes;
|
|
@@ -34043,7 +33352,6 @@
|
|
|
34043
33352
|
exports.SharedValidators = SharedValidators;
|
|
34044
33353
|
exports.SocialErrorCodes = SocialErrorCodes;
|
|
34045
33354
|
exports.SocialModule = SocialModule;
|
|
34046
|
-
exports.SocialModuleOptionsToken = SocialModuleOptionsToken;
|
|
34047
33355
|
exports.StartableService = StartableService;
|
|
34048
33356
|
exports.StatusById = StatusById;
|
|
34049
33357
|
exports.StatusIds = StatusIds;
|
|
@@ -34072,10 +33380,7 @@
|
|
|
34072
33380
|
exports.UploadFileTestingPage = UploadFileTestingPage;
|
|
34073
33381
|
exports.UriUtils = UriUtils;
|
|
34074
33382
|
exports.UserEventFragments = UserEventFragments;
|
|
34075
|
-
exports.UserEventModule = UserEventModule;
|
|
34076
|
-
exports.UserEventNotificationComponent = UserEventNotificationComponent;
|
|
34077
33383
|
exports.UserEventService = UserEventService;
|
|
34078
|
-
exports.UserEventServiceToken = UserEventServiceToken;
|
|
34079
33384
|
exports.UserEventTypes = UserEventTypes;
|
|
34080
33385
|
exports.UserEventsTable = UserEventsTable;
|
|
34081
33386
|
exports.UsersPage = UsersPage;
|
|
@@ -34226,6 +33531,7 @@
|
|
|
34226
33531
|
exports.uncapitalizeFirstLetter = uncapitalizeFirstLetter;
|
|
34227
33532
|
exports.updateValueAndValidity = updateValueAndValidity;
|
|
34228
33533
|
exports.waitFor = waitFor;
|
|
33534
|
+
exports.waitForFalse = waitForFalse;
|
|
34229
33535
|
exports.waitForTrue = waitForTrue;
|
|
34230
33536
|
exports.waitIdle = waitIdle;
|
|
34231
33537
|
exports.waitWhilePending = waitWhilePending;
|
|
@@ -34240,13 +33546,11 @@
|
|
|
34240
33546
|
exports.ɵh = LocalSettingsValidatorService;
|
|
34241
33547
|
exports.ɵi = AppUpdateOfflineModeCard;
|
|
34242
33548
|
exports.ɵj = AppIconComponent;
|
|
34243
|
-
exports.ɵk =
|
|
34244
|
-
exports.ɵl =
|
|
34245
|
-
exports.ɵm =
|
|
34246
|
-
exports.ɵn =
|
|
34247
|
-
exports.ɵo =
|
|
34248
|
-
exports.ɵp = ToastTestingModule;
|
|
34249
|
-
exports.ɵq = ToastTestingPage;
|
|
33549
|
+
exports.ɵk = DateTestPage;
|
|
33550
|
+
exports.ɵl = NumpadTestPage;
|
|
33551
|
+
exports.ɵm = MatBadgeIconTestPage;
|
|
33552
|
+
exports.ɵn = ToastTestingModule;
|
|
33553
|
+
exports.ɵo = ToastTestingPage;
|
|
34250
33554
|
|
|
34251
33555
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
34252
33556
|
|