@sumaris-net/ngx-components 1.22.7 → 1.22.10
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 +143 -485
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +3 -0
- package/esm2015/public_api.js +1 -2
- package/esm2015/src/app/core/menu/menu.component.js +2 -2
- package/esm2015/src/app/social/social.module.js +2 -2
- package/esm2015/src/app/social/user-event/user-event.model.js +5 -1
- package/esm2015/src/app/social/user-event/user-event.module.js +2 -10
- package/esm2015/src/app/social/user-event/user-event.service.js +4 -82
- package/esm2015/sumaris-net.ngx-components.js +7 -8
- package/fesm2015/sumaris-net.ngx-components.js +130 -423
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +0 -1
- package/src/app/social/user-event/user-event.model.d.ts +2 -0
- package/src/app/social/user-event/user-event.service.d.ts +1 -13
- package/sumaris-net.ngx-components.d.ts +6 -7
- package/sumaris-net.ngx-components.metadata.json +1 -1
- package/esm2015/src/app/social/user-event/user-events.table.js +0 -159
- package/src/app/social/user-event/user-events.table.d.ts +0 -58
|
@@ -21485,7 +21485,7 @@ class MenuComponent {
|
|
|
21485
21485
|
MenuComponent.decorators = [
|
|
21486
21486
|
{ type: Component, args: [{
|
|
21487
21487
|
selector: 'app-menu',
|
|
21488
|
-
template: "<ion-split-pane #splitPane [contentId]=\"contentId\" (swiperight)=\"onSwipeRight($event)\">\n\n <ion-menu [id]=\"id\" [menuId]=\"menuId\" [contentId]=\"contentId\">\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 [title]=\"'MENU.BTN_MY_ACCOUNT'|translate\">\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\" style=\"width: 108px;\">{{appName}}</span>\n </ion-col>\n </ion-row>\n <ion-row class=\"ion-no-padding\">\n <ion-col>\n <button mat-button type=\"button\"\n [routerLink]=\"['/account']\"\n routerDirection=\"root\"\n routerLinkActive=\"ion-color-primary\"\n (click)=\"close()\"\n [title]=\"'MENU.BTN_MY_ACCOUNT'|translate\">\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 </ion-col>\n\n <!-- Insertion
|
|
21488
|
+
template: "<ion-split-pane #splitPane [contentId]=\"contentId\" (swiperight)=\"onSwipeRight($event)\">\n\n <ion-menu [id]=\"id\" [menuId]=\"menuId\" [contentId]=\"contentId\">\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 [title]=\"'MENU.BTN_MY_ACCOUNT'|translate\">\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\" style=\"width: 108px;\">{{appName}}</span>\n </ion-col>\n </ion-row>\n <ion-row class=\"ion-no-padding\">\n <ion-col>\n <button mat-button type=\"button\"\n [routerLink]=\"['/account']\"\n routerDirection=\"root\"\n routerLinkActive=\"ion-color-primary\"\n (click)=\"close()\"\n [title]=\"'MENU.BTN_MY_ACCOUNT'|translate\">\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 </ion-col>\n\n <!-- Insertion headerBottomRight -->\n <ion-col size=\"auto\">\n <ng-container *ngTemplateOutlet=\"headerBottomRight\"></ng-container>\n </ion-col>\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 select=\"ion-router-outlet\"></ng-content>\n\n</ion-split-pane>\n\n<ng-template #headerBottomRight>\n <ng-content select=\"[headerBottomRight]\"></ng-content>\n</ng-template>\n",
|
|
21489
21489
|
animations: [fadeInAnimation],
|
|
21490
21490
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21491
21491
|
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-avatar:hover{background-color:var(--ion-color-secondary-shade);border:2px solid var(--ion-color-primary-shade)}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)}}"]
|
|
@@ -25958,126 +25958,6 @@ const SocialErrorCodes = {
|
|
|
25958
25958
|
SUBSCRIBE_JOB_PROGRESSION_ERROR: 50010
|
|
25959
25959
|
};
|
|
25960
25960
|
|
|
25961
|
-
var UserEvent_1;
|
|
25962
|
-
const UserEventTypes = {
|
|
25963
|
-
DEBUG_DATA: 'DEBUG_DATA',
|
|
25964
|
-
INBOX_MESSAGE: 'INBOX_MESSAGE'
|
|
25965
|
-
};
|
|
25966
|
-
// @dynamic
|
|
25967
|
-
let UserEvent = UserEvent_1 = class UserEvent extends Entity {
|
|
25968
|
-
constructor() {
|
|
25969
|
-
super(UserEvent_1.TYPENAME);
|
|
25970
|
-
}
|
|
25971
|
-
asObject(opts) {
|
|
25972
|
-
const target = super.asObject(opts);
|
|
25973
|
-
target.creationDate = toDateISOString(this.creationDate);
|
|
25974
|
-
target.readDate = toDateISOString(this.readDate);
|
|
25975
|
-
// Serialize content
|
|
25976
|
-
if (typeof target.content === 'object') {
|
|
25977
|
-
target.content = JSON.stringify(target.content);
|
|
25978
|
-
}
|
|
25979
|
-
delete target.avatar;
|
|
25980
|
-
delete target.avatarIcon;
|
|
25981
|
-
delete target.icon;
|
|
25982
|
-
delete target.actions;
|
|
25983
|
-
return target;
|
|
25984
|
-
}
|
|
25985
|
-
fromObject(source) {
|
|
25986
|
-
Object.assign(this, source); // Copy all properties
|
|
25987
|
-
super.fromObject(source);
|
|
25988
|
-
this.creationDate = fromDateISOString(source.creationDate);
|
|
25989
|
-
this.readDate = fromDateISOString(source.readDate);
|
|
25990
|
-
try {
|
|
25991
|
-
// Deserialize content
|
|
25992
|
-
if (typeof source.content === 'string' && source.content.startsWith('{')) {
|
|
25993
|
-
this.content = JSON.parse(source.content);
|
|
25994
|
-
}
|
|
25995
|
-
// Deserialize content.context
|
|
25996
|
-
if (this.content && typeof this.content.context === 'string' && this.content.context.startsWith('{')) {
|
|
25997
|
-
this.content.context = JSON.parse(this.content.context);
|
|
25998
|
-
}
|
|
25999
|
-
}
|
|
26000
|
-
catch (err) {
|
|
26001
|
-
console.error('Error during UserEvent deserialization', err);
|
|
26002
|
-
}
|
|
26003
|
-
}
|
|
26004
|
-
};
|
|
26005
|
-
UserEvent = UserEvent_1 = __decorate([
|
|
26006
|
-
EntityClass({ typename: 'UserEventVO' })
|
|
26007
|
-
], UserEvent);
|
|
26008
|
-
// @dynamic
|
|
26009
|
-
let UserEventFilter = class UserEventFilter extends EntityFilter {
|
|
26010
|
-
constructor() {
|
|
26011
|
-
super(...arguments);
|
|
26012
|
-
this.types = [];
|
|
26013
|
-
this.levels = [];
|
|
26014
|
-
this.issuers = [];
|
|
26015
|
-
this.recipients = [];
|
|
26016
|
-
this.startDate = null;
|
|
26017
|
-
this.excludeRead = false;
|
|
26018
|
-
}
|
|
26019
|
-
fromObject(source, opts) {
|
|
26020
|
-
super.fromObject(source, opts);
|
|
26021
|
-
this.types = source.types || [];
|
|
26022
|
-
this.levels = source.levels || [];
|
|
26023
|
-
this.issuers = source.issuers || [];
|
|
26024
|
-
this.recipients = source.recipients || [];
|
|
26025
|
-
this.startDate = fromDateISOString(source.startDate);
|
|
26026
|
-
this.excludeRead = source.excludeRead || false;
|
|
26027
|
-
}
|
|
26028
|
-
buildFilter() {
|
|
26029
|
-
const filterFns = super.buildFilter();
|
|
26030
|
-
if (isNotEmptyArray(this.types)) {
|
|
26031
|
-
filterFns.push(t => this.types.includes(t.type));
|
|
26032
|
-
}
|
|
26033
|
-
if (isNotEmptyArray(this.levels)) {
|
|
26034
|
-
filterFns.push(t => this.levels.includes(t.level));
|
|
26035
|
-
}
|
|
26036
|
-
if (isNotEmptyArray(this.issuers)) {
|
|
26037
|
-
filterFns.push(t => this.issuers.includes(t.issuer));
|
|
26038
|
-
}
|
|
26039
|
-
if (isNotEmptyArray(this.recipients)) {
|
|
26040
|
-
filterFns.push(t => this.recipients.includes(t.recipient));
|
|
26041
|
-
}
|
|
26042
|
-
if (isNotNil(this.startDate)) {
|
|
26043
|
-
filterFns.push(t => this.startDate.isSameOrBefore(t.creationDate));
|
|
26044
|
-
}
|
|
26045
|
-
if (this.excludeRead === true) {
|
|
26046
|
-
filterFns.push(t => isNil(t.readSignature)); // todo or t.signature ?
|
|
26047
|
-
}
|
|
26048
|
-
return filterFns;
|
|
26049
|
-
}
|
|
26050
|
-
};
|
|
26051
|
-
UserEventFilter = __decorate([
|
|
26052
|
-
EntityClass({ typename: 'UserEventFilterVO' })
|
|
26053
|
-
], UserEventFilter);
|
|
26054
|
-
|
|
26055
|
-
const UserEventFragments = {
|
|
26056
|
-
userEvent: gql `fragment UserEventFragment on UserEventVO {
|
|
26057
|
-
id
|
|
26058
|
-
issuer
|
|
26059
|
-
updateDate
|
|
26060
|
-
creationDate
|
|
26061
|
-
eventType
|
|
26062
|
-
recipient
|
|
26063
|
-
content
|
|
26064
|
-
hash
|
|
26065
|
-
signature
|
|
26066
|
-
readSignature
|
|
26067
|
-
__typename
|
|
26068
|
-
}`,
|
|
26069
|
-
lightUserEvent: gql `fragment LightUserEventFragment on UserEventVO {
|
|
26070
|
-
id
|
|
26071
|
-
issuer
|
|
26072
|
-
recipient
|
|
26073
|
-
updateDate
|
|
26074
|
-
creationDate
|
|
26075
|
-
eventType
|
|
26076
|
-
readSignature
|
|
26077
|
-
__typename
|
|
26078
|
-
}`
|
|
26079
|
-
};
|
|
26080
|
-
|
|
26081
25961
|
const moment$6 = momentImported;
|
|
26082
25962
|
const USER_EVENT_SERVICE = new InjectionToken('UserEventService');
|
|
26083
25963
|
class AbstractUserEventService extends BaseGraphqlService {
|
|
@@ -26102,7 +25982,8 @@ class AbstractUserEventService extends BaseGraphqlService {
|
|
|
26102
25982
|
ngOnStart() {
|
|
26103
25983
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26104
25984
|
// Update component when refresh is need (=login events)
|
|
26105
|
-
this._subscriptions.add(merge(this.accountService.onLogin, this.accountService.onLogout)
|
|
25985
|
+
this._subscriptions.add(merge(this.accountService.onLogin, this.accountService.onLogout, of() // Starts with - first attempt if account is ready
|
|
25986
|
+
)
|
|
26106
25987
|
.pipe(
|
|
26107
25988
|
// Wait account service ready (can be restarted)
|
|
26108
25989
|
mergeMap(() => this.accountService.ready()), map(() => this.accountService.isLogin()), distinctUntilChanged())
|
|
@@ -26114,11 +25995,6 @@ class AbstractUserEventService extends BaseGraphqlService {
|
|
|
26114
25995
|
this.onLogout();
|
|
26115
25996
|
}
|
|
26116
25997
|
}));
|
|
26117
|
-
// First attempt if account is ready
|
|
26118
|
-
yield this.accountService.ready();
|
|
26119
|
-
if (this.accountService.isLogin()) {
|
|
26120
|
-
setTimeout(() => this.onLogin());
|
|
26121
|
-
}
|
|
26122
25998
|
});
|
|
26123
25999
|
}
|
|
26124
26000
|
ngOnDestroy() {
|
|
@@ -26503,225 +26379,6 @@ AbstractUserEventService.ctorParameters = () => [
|
|
|
26503
26379
|
{ type: TranslateService },
|
|
26504
26380
|
{ type: undefined }
|
|
26505
26381
|
];
|
|
26506
|
-
const userEventQueries = {
|
|
26507
|
-
loadAll: gql `
|
|
26508
|
-
query UserEvents($filter: UserEventFilterVOInput, $page: PageInput){
|
|
26509
|
-
data: userEvents(filter: $filter, page: $page){
|
|
26510
|
-
...LightUserEventFragment
|
|
26511
|
-
}
|
|
26512
|
-
}
|
|
26513
|
-
${UserEventFragments.lightUserEvent}
|
|
26514
|
-
`,
|
|
26515
|
-
loadAllWithContent: gql `
|
|
26516
|
-
query UserEventsWithContent($filter: UserEventFilterVOInput, $page: PageInput){
|
|
26517
|
-
data: userEvents(filter: $filter, page: $page){
|
|
26518
|
-
...UserEventFragment
|
|
26519
|
-
}
|
|
26520
|
-
}
|
|
26521
|
-
${UserEventFragments.userEvent}
|
|
26522
|
-
`
|
|
26523
|
-
};
|
|
26524
|
-
const userEventMutations = {
|
|
26525
|
-
deleteByIds: gql `
|
|
26526
|
-
mutation DeleteUserEvents($ids:[Int]){
|
|
26527
|
-
deleteUserEvents(ids: $ids)
|
|
26528
|
-
}
|
|
26529
|
-
`,
|
|
26530
|
-
save: gql `
|
|
26531
|
-
mutation SaveUserEvent($data: UserEventVOInput){
|
|
26532
|
-
data: saveUserEvent(userEvent: $data){
|
|
26533
|
-
...UserEventFragment
|
|
26534
|
-
}
|
|
26535
|
-
}
|
|
26536
|
-
${UserEventFragments.userEvent}
|
|
26537
|
-
`
|
|
26538
|
-
};
|
|
26539
|
-
class UserEventService extends AbstractUserEventService {
|
|
26540
|
-
constructor(graphql, accountService, network, translate, environment) {
|
|
26541
|
-
super(graphql, accountService, network, translate, {
|
|
26542
|
-
queries: userEventQueries,
|
|
26543
|
-
mutations: userEventMutations,
|
|
26544
|
-
production: environment === null || environment === void 0 ? void 0 : environment.production
|
|
26545
|
-
});
|
|
26546
|
-
this.graphql = graphql;
|
|
26547
|
-
this.accountService = accountService;
|
|
26548
|
-
this.network = network;
|
|
26549
|
-
this.translate = translate;
|
|
26550
|
-
this.environment = environment;
|
|
26551
|
-
}
|
|
26552
|
-
asFilter(filter) {
|
|
26553
|
-
return UserEventFilter.fromObject(filter);
|
|
26554
|
-
}
|
|
26555
|
-
fromObject(source) {
|
|
26556
|
-
return UserEvent.fromObject(source);
|
|
26557
|
-
}
|
|
26558
|
-
/* -- protected methods -- */
|
|
26559
|
-
fillDefaultProperties(entity) {
|
|
26560
|
-
entity.issuer = this.accountService.account.pubkey;
|
|
26561
|
-
// TODO: compute hash (using cryptoService)
|
|
26562
|
-
// TODO: compute sign
|
|
26563
|
-
console.warn('TODO: sign user event before sending');
|
|
26564
|
-
}
|
|
26565
|
-
}
|
|
26566
|
-
UserEventService.decorators = [
|
|
26567
|
-
{ type: Injectable }
|
|
26568
|
-
];
|
|
26569
|
-
UserEventService.ctorParameters = () => [
|
|
26570
|
-
{ type: GraphqlService },
|
|
26571
|
-
{ type: AccountService },
|
|
26572
|
-
{ type: NetworkService },
|
|
26573
|
-
{ type: TranslateService },
|
|
26574
|
-
{ type: Environment, decorators: [{ type: Optional }, { type: Inject, args: [ENVIRONMENT,] }] }
|
|
26575
|
-
];
|
|
26576
|
-
|
|
26577
|
-
const ICONS_MAP = {
|
|
26578
|
-
DEBUG_DATA: { matIcon: 'bug_report' },
|
|
26579
|
-
INBOX_MESSAGE: { matIcon: 'mail' }
|
|
26580
|
-
};
|
|
26581
|
-
// TODO: refactor with a registration done by data service:
|
|
26582
|
-
// - userEventService.registerEventAction({__typename: 'TripVO', ...})
|
|
26583
|
-
// - userEventService.getActionsFor(__typename): UserEventDetailAction
|
|
26584
|
-
/*const DETAILS_MAP: {[key: string]: UserEventAction<RootDataEntity<any>>} = {
|
|
26585
|
-
"TripVO": {
|
|
26586
|
-
icon: null,
|
|
26587
|
-
matIcon: "content_copy",
|
|
26588
|
-
action: 'copyToLocal',
|
|
26589
|
-
actionTitle: 'SOCIAL.USER_EVENT.BTN_COPY_TO_LOCAL',
|
|
26590
|
-
actionColor: 'primary',
|
|
26591
|
-
fromObject: Trip.fromObject,
|
|
26592
|
-
childrenFields: ['operation', 'landing']
|
|
26593
|
-
},
|
|
26594
|
-
"ObservedLocationVO": {
|
|
26595
|
-
icon: null,
|
|
26596
|
-
matIcon: "content_copy",
|
|
26597
|
-
action: 'copyToLocal',
|
|
26598
|
-
actionTitle: 'SOCIAL.USER_EVENT.BTN_COPY_TO_LOCAL',
|
|
26599
|
-
actionColor: 'primary',
|
|
26600
|
-
fromObject: ObservedLocation.fromObject,
|
|
26601
|
-
childrenFields: ['landings']
|
|
26602
|
-
}
|
|
26603
|
-
}*/
|
|
26604
|
-
class UserEventsTable extends AppTable {
|
|
26605
|
-
constructor(injector, accountService, service, entities, cd, environment) {
|
|
26606
|
-
super(injector,
|
|
26607
|
-
// columns
|
|
26608
|
-
RESERVED_START_COLUMNS
|
|
26609
|
-
.concat([
|
|
26610
|
-
'creationDate',
|
|
26611
|
-
'icon',
|
|
26612
|
-
'eventType',
|
|
26613
|
-
'message'
|
|
26614
|
-
])
|
|
26615
|
-
.concat(RESERVED_END_COLUMNS), null, null);
|
|
26616
|
-
this.accountService = accountService;
|
|
26617
|
-
this.service = service;
|
|
26618
|
-
this.entities = entities;
|
|
26619
|
-
this.cd = cd;
|
|
26620
|
-
this.environment = environment;
|
|
26621
|
-
this.i18nColumnPrefix = 'SOCIAL.USER_EVENT.';
|
|
26622
|
-
this.autoLoad = false; // this.start()
|
|
26623
|
-
this.inlineEdition = false;
|
|
26624
|
-
this.defaultSortBy = 'creationDate';
|
|
26625
|
-
this.defaultSortDirection = 'desc';
|
|
26626
|
-
}
|
|
26627
|
-
ngOnInit() {
|
|
26628
|
-
super.ngOnInit();
|
|
26629
|
-
// Load date/time pattern
|
|
26630
|
-
this.dateTimePattern = this.translate.instant('COMMON.DATE_TIME_PATTERN');
|
|
26631
|
-
this.withContent = toBoolean(this.withContent, false);
|
|
26632
|
-
const account = this.accountService.account;
|
|
26633
|
-
const pubkey = account && account.pubkey;
|
|
26634
|
-
this.isAdmin = this.accountService.isAdmin();
|
|
26635
|
-
this.canEdit = this.isAdmin || pubkey === this.recipient;
|
|
26636
|
-
this.canDelete = this.canEdit;
|
|
26637
|
-
this.setDatasource(new EntitiesTableDataSource(UserEvent, this.service, null, {
|
|
26638
|
-
prependNewElements: false,
|
|
26639
|
-
suppressErrors: true,
|
|
26640
|
-
dataServiceOptions: {
|
|
26641
|
-
withContent: this.withContent
|
|
26642
|
-
}
|
|
26643
|
-
}));
|
|
26644
|
-
const filter = this.filter || new UserEventFilter();
|
|
26645
|
-
filter.recipients = [this.recipient];
|
|
26646
|
-
this.setFilter(filter, { emitEvent: true });
|
|
26647
|
-
}
|
|
26648
|
-
start() {
|
|
26649
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26650
|
-
console.debug('[user-event] Starting...');
|
|
26651
|
-
// Waiting account to be ready
|
|
26652
|
-
yield this.accountService.ready();
|
|
26653
|
-
// Load data
|
|
26654
|
-
this.onRefresh.emit();
|
|
26655
|
-
});
|
|
26656
|
-
}
|
|
26657
|
-
getIcon(source) {
|
|
26658
|
-
return ICONS_MAP[source.type];
|
|
26659
|
-
}
|
|
26660
|
-
getDetail(source) {
|
|
26661
|
-
if (!source)
|
|
26662
|
-
return undefined;
|
|
26663
|
-
if (source.content && source.type === UserEventTypes.DEBUG_DATA) {
|
|
26664
|
-
const context = source.content.context;
|
|
26665
|
-
if (context && context.__typename) {
|
|
26666
|
-
// const actions = this.service.getActionsByTypename(context.__typename);
|
|
26667
|
-
return {
|
|
26668
|
-
// actions,
|
|
26669
|
-
title: source.content.error && source.content.error.message || source.content.message,
|
|
26670
|
-
description: source.content.error && source.content.error.details || undefined
|
|
26671
|
-
};
|
|
26672
|
-
}
|
|
26673
|
-
}
|
|
26674
|
-
console.debug('TODO: implement getDetail() for event: ', source);
|
|
26675
|
-
return {};
|
|
26676
|
-
}
|
|
26677
|
-
doAction(action, row) {
|
|
26678
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26679
|
-
const event = row.currentData;
|
|
26680
|
-
// const context = event.content && event.content.context;
|
|
26681
|
-
this.markAsLoading();
|
|
26682
|
-
if (action && typeof action.executeAction === 'function') {
|
|
26683
|
-
try {
|
|
26684
|
-
let res = action.executeAction(event /*, context*/);
|
|
26685
|
-
res = (res instanceof Promise) ? yield res : res;
|
|
26686
|
-
}
|
|
26687
|
-
catch (err) {
|
|
26688
|
-
this.setError(err && err.message || err);
|
|
26689
|
-
console.error(`[user-event] Failed to execute action ${action.name}: ${err && err.message || err}`, err);
|
|
26690
|
-
}
|
|
26691
|
-
finally {
|
|
26692
|
-
this.markAsLoaded();
|
|
26693
|
-
}
|
|
26694
|
-
}
|
|
26695
|
-
});
|
|
26696
|
-
}
|
|
26697
|
-
}
|
|
26698
|
-
UserEventsTable.decorators = [
|
|
26699
|
-
{ type: Component, args: [{
|
|
26700
|
-
selector: 'app-user-events-table',
|
|
26701
|
-
template: "\n<!-- Type = options menu -->\n<mat-menu #optionsMenu=\"matMenu\" xPosition=\"after\">\n\n <!-- display columns -->\n <button mat-menu-item\n (click)=\"openSelectColumnsModal($event)\">\n <mat-icon>view_column</mat-icon>\n <ion-label translate>COMMON.DISPLAYED_COLUMNS_DOTS</ion-label>\n </button>\n\n</mat-menu>\n\n<!-- top header -->\n<mat-toolbar>\n\n <ng-container *ngIf=\"!selection.hasValue(); else hasSelection\">\n\n <button mat-icon-button [title]=\"'COMMON.BTN_REFRESH'|translate\" (click)=\"onRefresh.emit()\">\n <mat-icon>refresh</mat-icon>\n </button>\n\n </ng-container>\n\n <!-- if row selection -->\n <ng-template #hasSelection>\n\n <!-- delete -->\n <button mat-icon-button class=\"hidden-xs hidden-sm\" *ngIf=\"canDelete\"\n [title]=\"'COMMON.BTN_DELETE'|translate\" (click)=\"deleteSelection($event)\">\n <mat-icon>delete</mat-icon>\n </button>\n </ng-template>\n\n <!-- error -->\n <ion-item *ngIf=\"error\" hidden-xs hidden-sm hidden-mobile lines=\"none\">\n <ion-icon color=\"danger\" slot=\"start\" name=\"alert-circle\"></ion-icon>\n <ion-label color=\"danger\" class=\"error\" [innerHTML]=\"error|translate\"></ion-label>\n </ion-item>\n\n <div class=\"toolbar-spacer\"></div>\n\n <button mat-icon-button\n [title]=\"'COMMON.BTN_OPTIONS'|translate\"\n [matMenuTriggerFor]=\"optionsMenu\">\n <mat-icon>more_vert</mat-icon>\n </button>\n</mat-toolbar>\n\n\n<mat-table [dataSource]=\"dataSource\" matSort\n [matSortActive]=\"defaultSortBy\"\n [matSortDirection]=\"defaultSortDirection\"\n matSortDisableClear [trackBy]=\"trackByFn\">\n\n <!-- select -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef [class.cdk-visually-hidden]=\"!canEdit\">\n <mat-checkbox (change)=\"$event ? masterToggle() : null\" [checked]=\"selection.hasValue() && isAllSelected()\"\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\" [class.cdk-visually-hidden]=\"!canEdit\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(row) : null\" [checked]=\"selection.isSelected(row)\">\n </mat-checkbox>\n </mat-cell>\n </ng-container>\n\n <!-- id -->\n <ng-container matColumnDef=\"id\">\n <mat-header-cell *matHeaderCellDef mat-sort-header [class.cdk-visually-hidden]=\"!isAdmin\">\n <app-loading-spinner [loading]=\"loadingSubject|async\"><ion-label>#</ion-label></app-loading-spinner>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\" [class.cdk-visually-hidden]=\"!isAdmin\">{{ row.currentData.id | mathAbs }}</mat-cell>\n </ng-container>\n\n <!-- creationDate -->\n <ng-container matColumnDef=\"creationDate\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n <ion-label translate>SOCIAL.USER_EVENT.CREATION_DATE</ion-label>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <ion-text>\n {{row.currentData.creationDate | dateFromNow }}<br/>\n <ion-text color=\"medium\"><small>{{row.currentData.creationDate | dateFormat: {time: true} }}</small></ion-text>\n </ion-text>\n </mat-cell>\n </ng-container>\n\n <!-- icon -->\n <ng-container matColumnDef=\"icon\">\n <mat-header-cell *matHeaderCellDef>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row;\">\n <ng-container *ngIf=\"getIcon(row.currentData); let details\">\n <ion-icon slot=\"start\" *ngIf=\"details.icon\" [name]=\"details.icon\"></ion-icon>\n <mat-icon slot=\"start\" *ngIf=\"details.matIcon\">{{details.matIcon}}</mat-icon>\n </ng-container>\n </mat-cell>\n </ng-container>\n\n <!-- event type -->\n <ng-container matColumnDef=\"eventType\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n <ion-label translate>SOCIAL.USER_EVENT.EVENT_TYPE</ion-label>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row;\">\n <span>{{'SOCIAL.USER_EVENT.TYPE_ENUM.' + row.currentData.eventType | translate}}</span>\n </mat-cell>\n </ng-container>\n\n <!-- message -->\n <ng-container matColumnDef=\"message\">\n <mat-header-cell *matHeaderCellDef>\n <ion-label translate>SOCIAL.USER_EVENT.MESSAGE</ion-label>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row;\">\n <ng-container *ngIf=\"getDetail(row.currentData); let details\">\n <ion-text [innerHTML]=\"details.title|translate\">\n </ion-text>\n </ng-container>\n </mat-cell>\n </ng-container>\n\n <!-- Actions buttons column -->\n <ng-container matColumnDef=\"actions\">\n <mat-header-cell *matHeaderCellDef>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let row\">\n <ng-container *ngIf=\"getDetail(row.currentData); let details\">\n <button mat-icon-button color=\"light\"\n *ngFor=\"let action of details.actions\"\n [title]=\"action.title |translate\"\n [color]=\"action.color\"\n (click)=\"doAction(action, row)\">\n <app-icon slot=\"start\" *ngIf=\"action.iconRef\" [ref]=\"action.iconRef\"></app-icon>\n </button>\n </ng-container>\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns;\"\n class=\"mat-row-disabled\"\n (click)=\"clickRow($event, row)\"></mat-row>\n\n</mat-table>\n\n<ion-row class=\"ion-no-padding\">\n <ion-col></ion-col>\n <ion-col class=\"ion-no-padding\" size=\"auto\">\n <mat-paginator [length]=\"totalRowCount\" [pageSize]=\"defaultPageSize\" [pageSizeOptions]=\"defaultPageSizeOptions\" showFirstLastButtons>\n </mat-paginator>\n </ion-col>\n</ion-row>\n",
|
|
26702
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26703
|
-
providers: [
|
|
26704
|
-
{
|
|
26705
|
-
provide: USER_EVENT_SERVICE, useClass: UserEventService
|
|
26706
|
-
}
|
|
26707
|
-
],
|
|
26708
|
-
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}"]
|
|
26709
|
-
},] }
|
|
26710
|
-
];
|
|
26711
|
-
UserEventsTable.ctorParameters = () => [
|
|
26712
|
-
{ type: Injector },
|
|
26713
|
-
{ type: AccountService },
|
|
26714
|
-
{ type: undefined, decorators: [{ type: Inject, args: [USER_EVENT_SERVICE,] }] },
|
|
26715
|
-
{ type: EntitiesStorage },
|
|
26716
|
-
{ type: ChangeDetectorRef },
|
|
26717
|
-
{ type: undefined, decorators: [{ type: Inject, args: [ENVIRONMENT,] }] }
|
|
26718
|
-
];
|
|
26719
|
-
UserEventsTable.propDecorators = {
|
|
26720
|
-
recipient: [{ type: Input }],
|
|
26721
|
-
withContent: [{ type: Input }],
|
|
26722
|
-
defaultSortBy: [{ type: Input }],
|
|
26723
|
-
defaultSortDirection: [{ type: Input }]
|
|
26724
|
-
};
|
|
26725
26382
|
|
|
26726
26383
|
class UserEventNotificationList {
|
|
26727
26384
|
constructor(cd, popoverController, userEventService) {
|
|
@@ -26878,75 +26535,6 @@ UserEventNotificationComponent.propDecorators = {
|
|
|
26878
26535
|
disabled: [{ type: Input }]
|
|
26879
26536
|
};
|
|
26880
26537
|
|
|
26881
|
-
class UserEventTestService extends AbstractUserEventService {
|
|
26882
|
-
constructor(graphql, accountService, network, translate, environment) {
|
|
26883
|
-
super(graphql, accountService, network, translate, {
|
|
26884
|
-
queries: {
|
|
26885
|
-
loadAll: null,
|
|
26886
|
-
loadAllWithContent: null
|
|
26887
|
-
},
|
|
26888
|
-
production: environment === null || environment === void 0 ? void 0 : environment.production
|
|
26889
|
-
});
|
|
26890
|
-
this.graphql = graphql;
|
|
26891
|
-
this.accountService = accountService;
|
|
26892
|
-
this.network = network;
|
|
26893
|
-
this.translate = translate;
|
|
26894
|
-
this.environment = environment;
|
|
26895
|
-
this.userEvents = [];
|
|
26896
|
-
}
|
|
26897
|
-
fromObject(source) {
|
|
26898
|
-
return UserEvent.fromObject(source);
|
|
26899
|
-
}
|
|
26900
|
-
add(entity) {
|
|
26901
|
-
entity = this.processUserEvent(entity);
|
|
26902
|
-
entity.id = this.userEvents.length + 1;
|
|
26903
|
-
this.userEvents.push(entity);
|
|
26904
|
-
this.count$.next(this.userEvents.length);
|
|
26905
|
-
}
|
|
26906
|
-
asFilter(filter) {
|
|
26907
|
-
return filter;
|
|
26908
|
-
}
|
|
26909
|
-
count(filter, options) {
|
|
26910
|
-
return Promise.resolve(this.userEvents.length);
|
|
26911
|
-
}
|
|
26912
|
-
delete(entity) {
|
|
26913
|
-
return Promise.resolve(undefined);
|
|
26914
|
-
}
|
|
26915
|
-
deleteAll(data, opts) {
|
|
26916
|
-
return Promise.resolve(undefined);
|
|
26917
|
-
}
|
|
26918
|
-
listenChanges(filter, options) {
|
|
26919
|
-
return of();
|
|
26920
|
-
}
|
|
26921
|
-
save(entity, options) {
|
|
26922
|
-
var _a;
|
|
26923
|
-
const toSave = (_a = this.userEvents) === null || _a === void 0 ? void 0 : _a.find(value => value.id == (entity === null || entity === void 0 ? void 0 : entity.id));
|
|
26924
|
-
Object.assign(toSave, entity);
|
|
26925
|
-
return entity;
|
|
26926
|
-
}
|
|
26927
|
-
saveAll(data, opts) {
|
|
26928
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26929
|
-
for (const entity of (data || [])) {
|
|
26930
|
-
yield this.save(entity);
|
|
26931
|
-
}
|
|
26932
|
-
return Promise.resolve(this.userEvents);
|
|
26933
|
-
});
|
|
26934
|
-
}
|
|
26935
|
-
watchAll(offset, size, sortBy, sortDirection, filter, options) {
|
|
26936
|
-
return of({ data: this.userEvents });
|
|
26937
|
-
}
|
|
26938
|
-
}
|
|
26939
|
-
UserEventTestService.decorators = [
|
|
26940
|
-
{ type: Injectable }
|
|
26941
|
-
];
|
|
26942
|
-
UserEventTestService.ctorParameters = () => [
|
|
26943
|
-
{ type: GraphqlService },
|
|
26944
|
-
{ type: AccountService },
|
|
26945
|
-
{ type: NetworkService },
|
|
26946
|
-
{ type: TranslateService },
|
|
26947
|
-
{ type: Environment, decorators: [{ type: Optional }, { type: Inject, args: [ENVIRONMENT,] }] }
|
|
26948
|
-
];
|
|
26949
|
-
|
|
26950
26538
|
class UserEventModule {
|
|
26951
26539
|
}
|
|
26952
26540
|
UserEventModule.decorators = [
|
|
@@ -26957,16 +26545,11 @@ UserEventModule.decorators = [
|
|
|
26957
26545
|
AppIconModule
|
|
26958
26546
|
],
|
|
26959
26547
|
declarations: [
|
|
26960
|
-
UserEventsTable,
|
|
26961
26548
|
UserEventNotificationComponent,
|
|
26962
|
-
UserEventNotificationList
|
|
26549
|
+
UserEventNotificationList
|
|
26963
26550
|
],
|
|
26964
26551
|
exports: [
|
|
26965
|
-
UserEventsTable,
|
|
26966
26552
|
UserEventNotificationComponent
|
|
26967
|
-
],
|
|
26968
|
-
providers: [
|
|
26969
|
-
{ provide: USER_EVENT_SERVICE, useClass: UserEventTestService }
|
|
26970
26553
|
]
|
|
26971
26554
|
},] }
|
|
26972
26555
|
];
|
|
@@ -27508,11 +27091,135 @@ SocialModule.decorators = [
|
|
|
27508
27091
|
SharedModule,
|
|
27509
27092
|
UserEventModule,
|
|
27510
27093
|
JobModule,
|
|
27511
|
-
MessageModule
|
|
27094
|
+
MessageModule
|
|
27512
27095
|
],
|
|
27513
27096
|
},] }
|
|
27514
27097
|
];
|
|
27515
27098
|
|
|
27099
|
+
var UserEvent_1;
|
|
27100
|
+
const UserEventTypes = {
|
|
27101
|
+
DEBUG_DATA: 'DEBUG_DATA',
|
|
27102
|
+
INBOX_MESSAGE: 'INBOX_MESSAGE'
|
|
27103
|
+
};
|
|
27104
|
+
// @dynamic
|
|
27105
|
+
let UserEvent = UserEvent_1 = class UserEvent extends Entity {
|
|
27106
|
+
constructor() {
|
|
27107
|
+
super(UserEvent_1.TYPENAME);
|
|
27108
|
+
}
|
|
27109
|
+
asObject(opts) {
|
|
27110
|
+
const target = super.asObject(opts);
|
|
27111
|
+
target.creationDate = toDateISOString(this.creationDate);
|
|
27112
|
+
target.readDate = toDateISOString(this.readDate);
|
|
27113
|
+
// Serialize content
|
|
27114
|
+
if (typeof target.content === 'object') {
|
|
27115
|
+
target.content = JSON.stringify(target.content);
|
|
27116
|
+
}
|
|
27117
|
+
delete target.avatar;
|
|
27118
|
+
delete target.avatarIcon;
|
|
27119
|
+
delete target.icon;
|
|
27120
|
+
delete target.actions;
|
|
27121
|
+
return target;
|
|
27122
|
+
}
|
|
27123
|
+
fromObject(source) {
|
|
27124
|
+
Object.assign(this, source); // Copy all properties
|
|
27125
|
+
super.fromObject(source);
|
|
27126
|
+
this.creationDate = fromDateISOString(source.creationDate);
|
|
27127
|
+
this.readDate = fromDateISOString(source.readDate);
|
|
27128
|
+
try {
|
|
27129
|
+
// Deserialize content
|
|
27130
|
+
if (typeof source.content === 'string' && source.content.startsWith('{')) {
|
|
27131
|
+
this.content = JSON.parse(source.content);
|
|
27132
|
+
}
|
|
27133
|
+
// Deserialize content.context
|
|
27134
|
+
if (this.content && typeof this.content.context === 'string' && this.content.context.startsWith('{')) {
|
|
27135
|
+
this.content.context = JSON.parse(this.content.context);
|
|
27136
|
+
}
|
|
27137
|
+
}
|
|
27138
|
+
catch (err) {
|
|
27139
|
+
console.error('Error during UserEvent deserialization', err);
|
|
27140
|
+
}
|
|
27141
|
+
}
|
|
27142
|
+
};
|
|
27143
|
+
UserEvent = UserEvent_1 = __decorate([
|
|
27144
|
+
EntityClass({ typename: 'UserEventVO' })
|
|
27145
|
+
], UserEvent);
|
|
27146
|
+
// @dynamic
|
|
27147
|
+
let UserEventFilter = class UserEventFilter extends EntityFilter {
|
|
27148
|
+
constructor() {
|
|
27149
|
+
super(...arguments);
|
|
27150
|
+
this.types = [];
|
|
27151
|
+
this.levels = [];
|
|
27152
|
+
this.issuers = [];
|
|
27153
|
+
this.recipients = [];
|
|
27154
|
+
this.startDate = null;
|
|
27155
|
+
this.excludeRead = false;
|
|
27156
|
+
}
|
|
27157
|
+
fromObject(source, opts) {
|
|
27158
|
+
super.fromObject(source, opts);
|
|
27159
|
+
this.types = source.types || [];
|
|
27160
|
+
this.levels = source.levels || [];
|
|
27161
|
+
this.issuers = source.issuers || [];
|
|
27162
|
+
this.recipients = source.recipients || [];
|
|
27163
|
+
this.startDate = fromDateISOString(source.startDate);
|
|
27164
|
+
this.excludeRead = source.excludeRead || false;
|
|
27165
|
+
}
|
|
27166
|
+
buildFilter() {
|
|
27167
|
+
const filterFns = super.buildFilter();
|
|
27168
|
+
if (isNotEmptyArray(this.types)) {
|
|
27169
|
+
filterFns.push(t => this.types.includes(t.type));
|
|
27170
|
+
}
|
|
27171
|
+
if (isNotEmptyArray(this.levels)) {
|
|
27172
|
+
filterFns.push(t => this.levels.includes(t.level));
|
|
27173
|
+
}
|
|
27174
|
+
if (isNotEmptyArray(this.issuers)) {
|
|
27175
|
+
filterFns.push(t => this.issuers.includes(t.issuer));
|
|
27176
|
+
}
|
|
27177
|
+
if (isNotEmptyArray(this.recipients)) {
|
|
27178
|
+
filterFns.push(t => this.recipients.includes(t.recipient));
|
|
27179
|
+
}
|
|
27180
|
+
if (isNotNil(this.startDate)) {
|
|
27181
|
+
filterFns.push(t => this.startDate.isSameOrBefore(t.creationDate));
|
|
27182
|
+
}
|
|
27183
|
+
if (this.excludeRead === true) {
|
|
27184
|
+
filterFns.push(t => isNil(t.readSignature)); // todo or t.signature ?
|
|
27185
|
+
}
|
|
27186
|
+
return filterFns;
|
|
27187
|
+
}
|
|
27188
|
+
asObject(opts) {
|
|
27189
|
+
const target = super.asObject(opts);
|
|
27190
|
+
return target;
|
|
27191
|
+
}
|
|
27192
|
+
};
|
|
27193
|
+
UserEventFilter = __decorate([
|
|
27194
|
+
EntityClass({ typename: 'UserEventFilterVO' })
|
|
27195
|
+
], UserEventFilter);
|
|
27196
|
+
|
|
27197
|
+
const UserEventFragments = {
|
|
27198
|
+
userEvent: gql `fragment UserEventFragment on UserEventVO {
|
|
27199
|
+
id
|
|
27200
|
+
issuer
|
|
27201
|
+
updateDate
|
|
27202
|
+
creationDate
|
|
27203
|
+
eventType
|
|
27204
|
+
recipient
|
|
27205
|
+
content
|
|
27206
|
+
hash
|
|
27207
|
+
signature
|
|
27208
|
+
readSignature
|
|
27209
|
+
__typename
|
|
27210
|
+
}`,
|
|
27211
|
+
lightUserEvent: gql `fragment LightUserEventFragment on UserEventVO {
|
|
27212
|
+
id
|
|
27213
|
+
issuer
|
|
27214
|
+
recipient
|
|
27215
|
+
updateDate
|
|
27216
|
+
creationDate
|
|
27217
|
+
eventType
|
|
27218
|
+
readSignature
|
|
27219
|
+
__typename
|
|
27220
|
+
}`
|
|
27221
|
+
};
|
|
27222
|
+
|
|
27516
27223
|
const Mutations = {
|
|
27517
27224
|
send: gql `mutation SendMessage($data: MessageVOInput){
|
|
27518
27225
|
done: sendMessage(message: $data)
|
|
@@ -29444,5 +29151,5 @@ CoreTestingModule.decorators = [
|
|
|
29444
29151
|
* Generated bundle index. Do not edit.
|
|
29445
29152
|
*/
|
|
29446
29153
|
|
|
29447
|
-
export { APP_ABOUT_DEVELOPERS, APP_ABOUT_PARTNERS, APP_CONFIG_OPTIONS, APP_FORM_ERROR_I18N_KEYS, APP_GRAPHQL_TYPE_POLICIES, APP_HOME_BUTTONS, APP_LOCALES, APP_LOCAL_SETTINGS, APP_LOCAL_SETTINGS_OPTIONS, APP_LOCAL_STORAGE_TYPE_POLICIES, APP_MENU_ITEMS, APP_MENU_OPTIONS, APP_TESTING_PAGES, AboutModal, AbstractUserEventService, Account, AccountPage, AccountService, AccountToStringPipe, ActionsColumnComponent, AdminModule, AdminRoutingModule, Alerts, AndroidOsEnvironment, AnimationState, AppEditor, AppEditorOptions, AppEntityEditor, AppEntityEditorModal, AppEntityEditorModalOptions, AppForm, AppFormField, AppFormProvider, AppFormUtils, AppGestureConfig, AppGraphQLModule, AppHelpModal, AppIconComponent, AppIconModule, AppInMemoryTable, AppInstallUpgradeCard, AppListForm, AppLoadingSpinner, AppMenuModule, AppNullForm, AppPropertiesForm, AppTabEditor, AppTabEditorOptions, AppTable, AppTableDataSourceOptions, AppTableUtils, AppValidatorService, AppendToInputDirective, ArrayFilterPipe, ArrayFirstPipe, ArrayIncludesPipe, ArrayLengthPipe, ArrayPluckPipe, AudioProvider, AuthForm, AuthGuardService, AuthModal, AutoTitleDirective, AutocompleteTestPage, AutofocusDirective, Base58, BaseEntityService, BaseGraphqlService, BaseGraphqlServiceOptions, BaseReferential, Beans, CORE_CONFIG_OPTIONS, CORE_TESTING_PAGES, CellValueChangeListener, ChipsTestPage, Color, ColorScale, ComponentDirtyGuard, ConfigService, Configuration, CoreModule, CoreTestingModule, CryptoService, CsvUtils, DATE_ISO_PATTERN, DATE_UNIX_MS_TIMESTAMP, DATE_UNIX_TIMESTAMP, DEFAULT_MENU_SHOW_WHEN, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PLACEHOLDER_CHAR, DEFAULT_REQUIRED_COLUMNS, DateDiffDurationPipe, DateFormatPipe, DateFromNowPipe, DateTimeTestPage, DateUtils, Department, DepartmentToStringPipe, DragAndDropDirective, DurationPipe, ENTITIES_STORAGE_KEY_PREFIX, ENVIRONMENT, EmptyArrayPipe, EntitiesService, EntitiesStorage, EntitiesTableDataSource, Entity, EntityClass, EntityClasses, EntityFilter, EntityFilterUtils, EntityMetadataComponent, EntityStore, EntityUtils, Environment, ErrorCodes, EvenPipe, FileResponse, FileService, FileSizePipe, FilesUtils, FormArrayHelper, FormButtonsBarComponent, FormButtonsBarToken, FormErrorTranslatePipe, FormErrorTranslator, FormFieldValuesHolder, FormGetArrayPipe, FormGetControlPipe, FormGetGroupPipe, FormGetPipe, FormGetValuePipe, Fragments$1 as Fragments, GraphqlService, HAMMER_PRESS_TIME, HAMMER_TAP_TIME, HighlightPipe, HomePage, Hotkeys, HotkeysDialogComponent, InMemoryEntitiesService, IsLoginAccountPipe, IsNilOrBlankPipe, IsNotNilOrBlankPipe, IsNotOnFieldModePipe, IsOnFieldModePipe, Job, JobModule, JobProgression, JobProgressionComponent, JobProgressionService, JobProgressionServiceToken, JobUtils, KEYBOARD_HIDE_DELAY_MS, LAT_LONG_DEFAULT_MAX_DECIMALS, LAT_LONG_PATTERNS, LatLongFormatPipe, LatLongTestPage, LatitudeFormatPipe, LocalSettingsService, LongitudeFormatPipe, MINIFY_ENTITY_FOR_LOCAL_STORAGE, MINIFY_ENTITY_FOR_POD, MapGetPipe, MapKeysPipe, MapValuesPipe, MatAutocompleteConfigHolder, MatAutocompleteField, MatBadgeIconDirective, MatBooleanField, MatChipsField, MatDate, MatDateShort, MatDateTime, MatDuration, MatLatLongField, MatNumpadComponent, MatNumpadContainerComponent, MatNumpadContent, MatPaginatorI18n, MatStepperI18n, MatSwipeField, MaterialTestingModule, MathAbsPipe, MenuComponent, MenuItems, MenuOptions, MenuService, Message, MessageFilter, MessageForm, MessageModal, MessageModule, MessageService, MessageTypeList, MessageTypes, MimeTypes, ModalToolbarComponent, NetworkService, NgInitDirective, NgVarDirective, NotEmptyArrayPipe, NumberFormatPipe, NumpadDirective, OddPipe, PRIORITIZED_AUTHORITIES, PUBKEY_REGEXP, Peer, Person, PersonFilter, PersonFragments, PersonService, PersonToStringPipe, PersonUtils, PersonValidatorService, PlatformService, ProgressBarService, ProgressInterceptor, PropertyFormatPipe, PropertyGetPipe, RESERVED_END_COLUMNS, RESERVED_START_COLUMNS, Referential, ReferentialFilter, ReferentialRef, ReferentialUtils, ReferentialValidatorService, RegisterConfirmPage, ResizableComponent, ResizableDirective, ResizableModule, SETTINGS_DISPLAY_COLUMNS, SETTINGS_FILTER, SETTINGS_PAGE_SIZE, SETTINGS_SORTED_COLUMN, SETTINGS_STORAGE_KEY, SETTINGS_TRANSIENT_PROPERTIES, SHARED_MATERIAL_TESTING_PAGES, SHARED_TESTING_PAGES, SPACE_PLACEHOLDER_CHAR, SelectPeerModal, ServerErrorCodes, SettingsPage, SharedAsyncValidators, SharedDirectivesModule, SharedFormArrayValidators, SharedFormGroupValidators, SharedHotkeysModule, SharedMatAutocompleteModule, SharedMatBadgeIconModule, SharedMatBooleanModule, SharedMatChipsModule, SharedMatDateTimeModule, SharedMatDurationModule, SharedMatLatLongModule, SharedMatNumpadModule, SharedMatSwipeModule, SharedMaterialModule, SharedModule, SharedPipesModule, SharedRoutingModule, SharedTestingModule, SharedTestsPage, SharedValidators, SocialErrorCodes, SocialModule, SocialModuleOptionsToken, Software, StartableService, StatusById, StatusIds, StatusList, StrIncludesPipe, StrLengthPipe, SwipeTestPage, TableSelectColumnsComponent, TableTestPage, TableTestingModule, TextForm, TextPopover, TextPopoverTestingModule, TextPopoverTestingPage, ToStringPipe, Toasts, ToolbarComponent, ToolbarToken, TranslatablePipe, TranslateContextPipe, TranslateContextService, USER_EVENT_SERVICE, UploadFile, UploadFileComponent, UploadFilePopover, UploadFileTestingModule, UploadFileTestingPage, UriUtils, UserEvent, UserEventFilter, UserEventFragments, UserEventModule, UserEventNotificationComponent,
|
|
29154
|
+
export { APP_ABOUT_DEVELOPERS, APP_ABOUT_PARTNERS, APP_CONFIG_OPTIONS, APP_FORM_ERROR_I18N_KEYS, APP_GRAPHQL_TYPE_POLICIES, APP_HOME_BUTTONS, APP_LOCALES, APP_LOCAL_SETTINGS, APP_LOCAL_SETTINGS_OPTIONS, APP_LOCAL_STORAGE_TYPE_POLICIES, APP_MENU_ITEMS, APP_MENU_OPTIONS, APP_TESTING_PAGES, AboutModal, AbstractUserEventService, Account, AccountPage, AccountService, AccountToStringPipe, ActionsColumnComponent, AdminModule, AdminRoutingModule, Alerts, AndroidOsEnvironment, AnimationState, AppEditor, AppEditorOptions, AppEntityEditor, AppEntityEditorModal, AppEntityEditorModalOptions, AppForm, AppFormField, AppFormProvider, AppFormUtils, AppGestureConfig, AppGraphQLModule, AppHelpModal, AppIconComponent, AppIconModule, AppInMemoryTable, AppInstallUpgradeCard, AppListForm, AppLoadingSpinner, AppMenuModule, AppNullForm, AppPropertiesForm, AppTabEditor, AppTabEditorOptions, AppTable, AppTableDataSourceOptions, AppTableUtils, AppValidatorService, AppendToInputDirective, ArrayFilterPipe, ArrayFirstPipe, ArrayIncludesPipe, ArrayLengthPipe, ArrayPluckPipe, AudioProvider, AuthForm, AuthGuardService, AuthModal, AutoTitleDirective, AutocompleteTestPage, AutofocusDirective, Base58, BaseEntityService, BaseGraphqlService, BaseGraphqlServiceOptions, BaseReferential, Beans, CORE_CONFIG_OPTIONS, CORE_TESTING_PAGES, CellValueChangeListener, ChipsTestPage, Color, ColorScale, ComponentDirtyGuard, ConfigService, Configuration, CoreModule, CoreTestingModule, CryptoService, CsvUtils, DATE_ISO_PATTERN, DATE_UNIX_MS_TIMESTAMP, DATE_UNIX_TIMESTAMP, DEFAULT_MENU_SHOW_WHEN, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PLACEHOLDER_CHAR, DEFAULT_REQUIRED_COLUMNS, DateDiffDurationPipe, DateFormatPipe, DateFromNowPipe, DateTimeTestPage, DateUtils, Department, DepartmentToStringPipe, DragAndDropDirective, DurationPipe, ENTITIES_STORAGE_KEY_PREFIX, ENVIRONMENT, EmptyArrayPipe, EntitiesService, EntitiesStorage, EntitiesTableDataSource, Entity, EntityClass, EntityClasses, EntityFilter, EntityFilterUtils, EntityMetadataComponent, EntityStore, EntityUtils, Environment, ErrorCodes, EvenPipe, FileResponse, FileService, FileSizePipe, FilesUtils, FormArrayHelper, FormButtonsBarComponent, FormButtonsBarToken, FormErrorTranslatePipe, FormErrorTranslator, FormFieldValuesHolder, FormGetArrayPipe, FormGetControlPipe, FormGetGroupPipe, FormGetPipe, FormGetValuePipe, Fragments$1 as Fragments, GraphqlService, HAMMER_PRESS_TIME, HAMMER_TAP_TIME, HighlightPipe, HomePage, Hotkeys, HotkeysDialogComponent, InMemoryEntitiesService, IsLoginAccountPipe, IsNilOrBlankPipe, IsNotNilOrBlankPipe, IsNotOnFieldModePipe, IsOnFieldModePipe, Job, JobModule, JobProgression, JobProgressionComponent, JobProgressionService, JobProgressionServiceToken, JobUtils, KEYBOARD_HIDE_DELAY_MS, LAT_LONG_DEFAULT_MAX_DECIMALS, LAT_LONG_PATTERNS, LatLongFormatPipe, LatLongTestPage, LatitudeFormatPipe, LocalSettingsService, LongitudeFormatPipe, MINIFY_ENTITY_FOR_LOCAL_STORAGE, MINIFY_ENTITY_FOR_POD, MapGetPipe, MapKeysPipe, MapValuesPipe, MatAutocompleteConfigHolder, MatAutocompleteField, MatBadgeIconDirective, MatBooleanField, MatChipsField, MatDate, MatDateShort, MatDateTime, MatDuration, MatLatLongField, MatNumpadComponent, MatNumpadContainerComponent, MatNumpadContent, MatPaginatorI18n, MatStepperI18n, MatSwipeField, MaterialTestingModule, MathAbsPipe, MenuComponent, MenuItems, MenuOptions, MenuService, Message, MessageFilter, MessageForm, MessageModal, MessageModule, MessageService, MessageTypeList, MessageTypes, MimeTypes, ModalToolbarComponent, NetworkService, NgInitDirective, NgVarDirective, NotEmptyArrayPipe, NumberFormatPipe, NumpadDirective, OddPipe, PRIORITIZED_AUTHORITIES, PUBKEY_REGEXP, Peer, Person, PersonFilter, PersonFragments, PersonService, PersonToStringPipe, PersonUtils, PersonValidatorService, PlatformService, ProgressBarService, ProgressInterceptor, PropertyFormatPipe, PropertyGetPipe, RESERVED_END_COLUMNS, RESERVED_START_COLUMNS, Referential, ReferentialFilter, ReferentialRef, ReferentialUtils, ReferentialValidatorService, RegisterConfirmPage, ResizableComponent, ResizableDirective, ResizableModule, SETTINGS_DISPLAY_COLUMNS, SETTINGS_FILTER, SETTINGS_PAGE_SIZE, SETTINGS_SORTED_COLUMN, SETTINGS_STORAGE_KEY, SETTINGS_TRANSIENT_PROPERTIES, SHARED_MATERIAL_TESTING_PAGES, SHARED_TESTING_PAGES, SPACE_PLACEHOLDER_CHAR, SelectPeerModal, ServerErrorCodes, SettingsPage, SharedAsyncValidators, SharedDirectivesModule, SharedFormArrayValidators, SharedFormGroupValidators, SharedHotkeysModule, SharedMatAutocompleteModule, SharedMatBadgeIconModule, SharedMatBooleanModule, SharedMatChipsModule, SharedMatDateTimeModule, SharedMatDurationModule, SharedMatLatLongModule, SharedMatNumpadModule, SharedMatSwipeModule, SharedMaterialModule, SharedModule, SharedPipesModule, SharedRoutingModule, SharedTestingModule, SharedTestsPage, SharedValidators, SocialErrorCodes, SocialModule, SocialModuleOptionsToken, Software, StartableService, StatusById, StatusIds, StatusList, StrIncludesPipe, StrLengthPipe, SwipeTestPage, TableSelectColumnsComponent, TableTestPage, TableTestingModule, TextForm, TextPopover, TextPopoverTestingModule, TextPopoverTestingPage, ToStringPipe, Toasts, ToolbarComponent, ToolbarToken, TranslatablePipe, TranslateContextPipe, TranslateContextService, USER_EVENT_SERVICE, UploadFile, UploadFileComponent, UploadFilePopover, UploadFileTestingModule, UploadFileTestingPage, UriUtils, UserEvent, UserEventFilter, UserEventFragments, UserEventModule, UserEventNotificationComponent, UserEventTypes, UserSettings, UsersPage, accountToString, adaptValueToControl, addValueInArray, arrayDistinct, arrayGroupBy, arraySize, asInputElement, canHaveFocus, capitalizeFirstLetter, chainPromises, changeCaseToUnderscore, clearValueInArray, copyEntity2Form, createPromiseEvent, createPromiseEventEmitter, departmentToString, departmentsToString, disableControls, emitPromiseEvent, entityToString, equals, equalsOrNil, escapeRegExp, fadeInAnimation, fadeInOutAnimation, filterFalse, filterNotNil, filterNumberInput, filterTrue, firstArrayValue, firstFalse, firstFalsePromise, firstNotNil, firstNotNilPromise, firstTrue, firstTruePromise, focusInput, focusNextInput, focusPreviousInput, formatLatitude, formatLongitude, fromDateISOString, fromScrollEndEvent, fromUnixMsTimestamp, fromUnixTimestamp, getCaretPosition, getColorContrast, getColorShade, getColorTint, getConnectionType, getControlFromPath, getFocusableInputElements, getFormErrors, getFormValueFromEntity, getProperty, getPropertyByPath, getPropertyByPathAsString, getRandomImage, hexToRgb, hexToRgbArray, isAndroid, isBlankString, isControlHasInput, isCordova, isEmptyArray, isIOS, isInputElement, isInstanceOf, isInt, isMobile, isNil, isNilOrBlank, isNilOrNaN, isNotEmptyArray, isNotNil, isNotNilBoolean, isNotNilOrBlank, isNotNilOrNaN, isNotNilString, isNumber, isNumberRange, isProgressEvent, isResponseEvent, isTouchUi, isWindows, joinProperties, joinPropertiesPath, logFormErrors, markAllAsTouched, markAsUntouched, markControlAsTouched, markFormGroupAsTouched, matchMedia, matchUpperCase, mergeLoadResult, mixHex, moment$5 as moment, moveInputCaretToSeparator, noTrailingSlash, notNilOrDefault, nullIfUndefined, parseLatitudeOrLongitude, propertiesPathComparator, propertyComparator, propertyPathComparator, referentialToString, referentialsToString, remove, removeAll, removeDiacritics, removeDuplicatesFromArray, removeEnd, removeValueInArray, replaceAll, resetCalculatedValue, resizeArray, rgbArrayToHex, rgbToHex, round, scrollFactory, selectInputContent, selectInputRange, setCalculatedValue, setTabIndex, sleep, slideInOutAnimation, slideUpDownAnimation, sort, splitById, splitByProperty, startsWithUpperCase, suggestFromArray, suggestFromStringArray, tabindexComparator, testUserAgent, toBoolean, toDateISOString, toDuration, toFloat, toInt, toNotNil, toNumber, trimEmptyToNull, tz, uncapitalizeFirstLetter, updateValueAndValidity, waitFor, waitForFalse, waitForTrue, waitIdle, waitWhilePending, ɵ0, CustomReuseStrategy as ɵa, MatNumpadDomService as ɵb, isFocusableElement as ɵc, RegisterForm as ɵd, AccountValidatorService as ɵe, RegisterModal as ɵf, UserSettingsValidatorService as ɵg, LocalSettingsValidatorService as ɵh, AppUpdateOfflineModeCard as ɵi, UserEventNotificationList as ɵj, JobProgressionList as ɵk, DateTestPage as ɵl, NumpadTestPage as ɵm, MatBadgeIconTestPage as ɵn, ToastTestingModule as ɵo, ToastTestingPage as ɵp };
|
|
29448
29155
|
//# sourceMappingURL=sumaris-net.ngx-components.js.map
|