diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationQuery.java index eabc676b5..53bd80673 100644 --- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationQuery.java +++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationQuery.java @@ -35,6 +35,8 @@ public class NotificationQuery extends QueryBase { private List trackingState; private List trackingProgress; + + private Collection userIds; private EnumSet authorize = EnumSet.of(AuthorizationFlags.None); public NotificationQuery ids(UUID value) { @@ -172,6 +174,21 @@ public class NotificationQuery extends QueryBase { return this; } + public NotificationQuery userIds(UUID value) { + this.userIds = List.of(value); + return this; + } + + public NotificationQuery userIds(UUID... value) { + this.userIds = Arrays.asList(value); + return this; + } + + public NotificationQuery userIds(Collection values) { + this.userIds = values; + return this; + } + public NotificationQuery ordering(Ordering ordering) { this.setOrder(ordering); return this; @@ -246,6 +263,10 @@ public class NotificationQuery extends QueryBase { predicates.add(queryContext.Root.get(NotificationEntity.Field._trackingProcess).in(trackingProgress)); } + if (this.userIds != null) { + predicates.add(queryContext.Root.get(NotificationEntity.Field._userId).in(userIds)); + } + if (predicates.size() > 0) { Predicate[] predicatesArray = predicates.toArray(new Predicate[0]); return queryContext.CriteriaBuilder.and(predicatesArray); diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/lookup/NotificationLookup.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/lookup/NotificationLookup.java index 70938b9b0..ca27d07f7 100644 --- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/lookup/NotificationLookup.java +++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/lookup/NotificationLookup.java @@ -24,6 +24,7 @@ public class NotificationLookup extends Lookup { private Instant createdAfter; private List trackingState; private List trackingProcess; + private List userIds; public List getIsActive() { @@ -122,6 +123,14 @@ public class NotificationLookup extends Lookup { this.trackingProcess = trackingProcess; } + public List getUserIds() { + return userIds; + } + + public void setUserIds(List userIds) { + this.userIds = userIds; + } + public NotificationQuery enrich(QueryFactory queryFactory) { NotificationQuery query = queryFactory.query(NotificationQuery.class); if (this.isActive != null) query.isActive(this.isActive); @@ -136,6 +145,7 @@ public class NotificationLookup extends Lookup { if (this.type != null) query.type(this.type); if (this.trackingProcess != null) query.trackingProgress(this.trackingProcess); if (this.trackingState != null) query.trackingState(this.trackingState); + if (this.userIds != null) query.userIds(this.userIds); this.enrichCommon(query); diff --git a/dmp-frontend/src/app/core/query/notification.lookup.ts b/dmp-frontend/src/app/core/query/notification.lookup.ts index 7c4d3ac71..3ac6f12cc 100644 --- a/dmp-frontend/src/app/core/query/notification.lookup.ts +++ b/dmp-frontend/src/app/core/query/notification.lookup.ts @@ -17,6 +17,7 @@ export class NotificationLookup extends Lookup implements NotificationFilter { contactType: NotificationContactType[]; trackingState: NotificationTrackingState[]; trackingProcess: NotificationTrackingProcess[]; + userIds: Guid[]; constructor() { super(); @@ -33,4 +34,5 @@ export interface NotificationFilter { contactType: NotificationContactType[]; trackingState: NotificationTrackingState[]; trackingProcess: NotificationTrackingProcess[]; + userIds: Guid[]; } \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/language/listing/language-listing.component.html b/dmp-frontend/src/app/ui/admin/language/listing/language-listing.component.html index 55be97c8b..94d9f035b 100644 --- a/dmp-frontend/src/app/ui/admin/language/listing/language-listing.component.html +++ b/dmp-frontend/src/app/ui/admin/language/listing/language-listing.component.html @@ -39,9 +39,9 @@
- + {{item?.name | nullifyValue}} + (click)="$event.stopPropagation()">{{item?.code | nullifyValue}}
diff --git a/dmp-frontend/src/app/ui/admin/notification-template/listing/notification-template-listing.component.html b/dmp-frontend/src/app/ui/admin/notification-template/listing/notification-template-listing.component.html index 70c326c4d..616f548b7 100644 --- a/dmp-frontend/src/app/ui/admin/notification-template/listing/notification-template-listing.component.html +++ b/dmp-frontend/src/app/ui/admin/notification-template/listing/notification-template-listing.component.html @@ -71,6 +71,14 @@
+ + + {{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-LISTING.FIELDS.CREATED-AT' | translate}}: + + {{item?.createdAt | dateTimeFormatter : 'short' | nullifyValue}} + + + {{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-LISTING.FIELDS.UPDATED-AT' | translate}}: diff --git a/dmp-frontend/src/app/ui/admin/notification/filters/notification-listing-filters.component.html b/dmp-frontend/src/app/ui/admin/notification/filters/notification-listing-filters.component.html index b06b4cd12..36441e232 100644 --- a/dmp-frontend/src/app/ui/admin/notification/filters/notification-listing-filters.component.html +++ b/dmp-frontend/src/app/ui/admin/notification/filters/notification-listing-filters.component.html @@ -20,6 +20,14 @@ {{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FILTER.IS-ACTIVE' | translate}} +
+ + {{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FILTER.USERS' | translate}} + + + +
+
{{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FILTER.NOTIFICATION-TYPE' | translate}} diff --git a/dmp-frontend/src/app/ui/admin/notification/filters/notification-listing-filters.component.ts b/dmp-frontend/src/app/ui/admin/notification/filters/notification-listing-filters.component.ts index 088945fb2..402dad24b 100644 --- a/dmp-frontend/src/app/ui/admin/notification/filters/notification-listing-filters.component.ts +++ b/dmp-frontend/src/app/ui/admin/notification/filters/notification-listing-filters.component.ts @@ -1,3 +1,4 @@ +import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; import { IsActive } from '@app/core/common/enum/is-active.enum'; import { NotificationContactType } from '@app/core/common/enum/notification-contact-type'; @@ -6,8 +7,11 @@ import { NotificationTrackingProcess } from '@app/core/common/enum/notification- import { NotificationTrackingState } from '@app/core/common/enum/notification-tracking-state'; import { NotificationType } from '@app/core/common/enum/notification-type'; import { NotificationFilter } from '@app/core/query/notification.lookup'; +import { UserService } from '@app/core/services/user/user.service'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; +import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; import { BaseComponent } from '@common/base/base.component'; +import { Guid } from '@common/types/guid'; import { nameof } from 'ts-simple-nameof'; @Component({ @@ -24,6 +28,9 @@ export class NotificationListingFiltersComponent extends BaseComponent implement notificationTrackingStateEnumValues = this.enumUtils.getEnumValues(NotificationTrackingState); notificationTrackingProcessEnumValues = this.enumUtils.getEnumValues(NotificationTrackingProcess); notificationTypeEnumValues = this.enumUtils.getEnumValues(NotificationType); + userAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; + + readonly separatorKeysCodes: number[] = [ENTER, COMMA]; // * State internalFilters: NotificationListingFilters = this._getEmptyFilters(); @@ -31,9 +38,11 @@ export class NotificationListingFiltersComponent extends BaseComponent implement protected appliedFilterCount: number = 0; constructor( public enumUtils: EnumUtils, + private userService: UserService, ) { super(); } ngOnInit() { + this.userAutoCompleteConfiguration = this.userService.multipleAutocompleteConfiguration; } ngOnChanges(changes: SimpleChanges): void { @@ -55,7 +64,7 @@ export class NotificationListingFiltersComponent extends BaseComponent implement } protected applyFilters(): void { - const { isActive, type, notifyState, notifiedWith, contactType, trackingState, trackingProcess } = this.internalFilters ?? {} + const { isActive, type, notifyState, notifiedWith, contactType, trackingState, trackingProcess, userIds } = this.internalFilters ?? {} this.filterChange.emit({ ...this.filter, isActive: isActive ? [IsActive.Active] : [IsActive.Inactive], @@ -64,7 +73,8 @@ export class NotificationListingFiltersComponent extends BaseComponent implement notifiedWith, contactType, trackingState, - trackingProcess + trackingProcess, + userIds }) } @@ -74,7 +84,7 @@ export class NotificationListingFiltersComponent extends BaseComponent implement return this._getEmptyFilters(); } - let { isActive, type, notifyState, notifiedWith, contactType, trackingState, trackingProcess } = inputFilter; + let { isActive, type, notifyState, notifiedWith, contactType, trackingState, trackingProcess, userIds } = inputFilter; return { isActive: (isActive ?? [])?.includes(IsActive.Active) || !isActive?.length, @@ -83,7 +93,8 @@ export class NotificationListingFiltersComponent extends BaseComponent implement notifiedWith: notifiedWith, contactType: contactType, trackingState: trackingState, - trackingProcess: trackingProcess + trackingProcess: trackingProcess, + userIds: userIds } } @@ -96,7 +107,8 @@ export class NotificationListingFiltersComponent extends BaseComponent implement notifiedWith: null, contactType: null, trackingState: null, - trackingProcess: null + trackingProcess: null, + userIds: null } } @@ -121,4 +133,5 @@ interface NotificationListingFilters { contactType: NotificationContactType[]; trackingState: NotificationTrackingState[]; trackingProcess: NotificationTrackingProcess[]; + userIds: Guid[]; } diff --git a/dmp-frontend/src/app/ui/admin/notification/notification-listing.component.html b/dmp-frontend/src/app/ui/admin/notification/notification-listing.component.html index bdd4865f8..5d78108ad 100644 --- a/dmp-frontend/src/app/ui/admin/notification/notification-listing.component.html +++ b/dmp-frontend/src/app/ui/admin/notification/notification-listing.component.html @@ -11,7 +11,7 @@ @@ -31,43 +31,47 @@
- - {{item?.name | nullifyValue}} -
-
- + {{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FIELDS.NOTIFICATION-TYPE' | translate}}: - {{enumUtils.toNotificationTypeString(item.notificationType) | nullifyValue}} + {{enumUtils.toNotificationTypeString(item.type) | nullifyValue}}
- + - {{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FIELDS.KIND' | translate}}: + {{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FIELDS.CONTACT-TYPE' | translate}}: - {{enumUtils.toNotificationTemplateKindString(item.kind) | nullifyValue}} + {{enumUtils.toNotificationContactTypeString(item.contactTypeHint) | nullifyValue}}
- + - {{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FIELDS.CHANNEL' | translate}}: + {{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FIELDS.NOTIFY-STATE' | translate}}: - {{enumUtils.toNotificationTemplateChannelString(item.channel) | nullifyValue}} + {{enumUtils.toNotificationNotifyStateString(item.notifyState) | nullifyValue}}
- + - {{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FIELDS.UPDATED-AT' | translate}}: + {{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FIELDS.NOTIFIED-AT' | translate}}: - {{item?.updatedAt | dateTimeFormatter : 'short' | nullifyValue}} + {{item?.notifiedAt | dateTimeFormatter : 'short' | nullifyValue}} + + +
+
+ + + {{'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FIELDS.CREATED-AT' | translate}}: + + {{item?.createdAt | dateTimeFormatter : 'short' | nullifyValue}} diff --git a/dmp-frontend/src/app/ui/admin/notification/notification-listing.component.ts b/dmp-frontend/src/app/ui/admin/notification/notification-listing.component.ts index 7d23dccda..e47455f95 100644 --- a/dmp-frontend/src/app/ui/admin/notification/notification-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/notification/notification-listing.component.ts @@ -50,6 +50,8 @@ export class NotificationListingComponent extends BaseListingComponent(x => x.notifyState), nameof(x => x.notifiedWith), nameof(x => x.notifiedAt), + nameof(x => x.user.id), + nameof(x => x.user.name), nameof(x => x.createdAt), nameof(x => x.updatedAt), nameof(x => x.hash), @@ -125,7 +127,7 @@ export class NotificationListingComponent extends BaseListingComponent(x => x.notifiedAt), sortable: true, languageName: 'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FIELDS.NOTIFIED-AT', - // pipe: this.pipeService.getPipe(NotificationContactTypePipe) + pipe: this.pipeService.getPipe(DataTableDateTimeFormatPipe).withFormat('short') }, { prop: nameof(x => x.trackingState), @@ -133,6 +135,11 @@ export class NotificationListingComponent extends BaseListingComponent(NotificationTrackingStatePipe) }, + { + prop: nameof(x => x.user.name), + sortable: true, + languageName: 'NOTIFICATION-SERVICE.NOTIFICATION-LISTING.FIELDS.USER', + }, { prop: nameof(x => x.trackingProcess), sortable: true, diff --git a/dmp-frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.html b/dmp-frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.html index 26530010e..32e3296e4 100644 --- a/dmp-frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.html +++ b/dmp-frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.html @@ -1,4 +1,4 @@ -
+
@@ -49,12 +49,13 @@ -
-
- {{enumUtils.toDescriptionTemplateTypeStatusString(item.status) | nullifyValue}} -
-
+ + {{'REFERENCE-TYPE-LISTING.FIELDS.CODE' | translate}}: + + {{item?.code | nullifyValue}} + + +
diff --git a/dmp-frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.scss b/dmp-frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.scss index 6e1b48814..cd02faad1 100644 --- a/dmp-frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.scss +++ b/dmp-frontend/src/app/ui/admin/reference-type/listing/reference-type-listing.component.scss @@ -1,4 +1,4 @@ -.description-template-type-listing { +.reference-type-listing { margin-top: 1.3rem; margin-left: 1rem; margin-right: 2rem; diff --git a/dmp-frontend/src/app/ui/admin/reference/listing/reference-listing.component.html b/dmp-frontend/src/app/ui/admin/reference/listing/reference-listing.component.html index c1a42cc4b..6f349fd72 100644 --- a/dmp-frontend/src/app/ui/admin/reference/listing/reference-listing.component.html +++ b/dmp-frontend/src/app/ui/admin/reference/listing/reference-listing.component.html @@ -39,12 +39,42 @@
- + {{item?.name | nullifyValue}} + (click)="$event.stopPropagation()">{{item?.label | nullifyValue}}
+ + + {{'REFERENCE-LISTING.FIELDS.SOURCE' | translate}}: + + {{item.source}} + + +
+
+ + + + {{'REFERENCE-LISTING.FIELDS.SOURCE-TYPE' | translate}}: + + {{enumUtils.toReferenceTypeSourceTypeString(item.sourceType) | nullifyValue}} + + +
+
+ + + + {{'REFERENCE-LISTING.FIELDS.TYPE' | translate}}: + + {{enumUtils.toReferenceTypeString(item.type) | nullifyValue}} + + +
+
+ {{'REFERENCE-LISTING.FIELDS.CREATED-AT' | translate}}: diff --git a/dmp-frontend/src/app/ui/admin/tenant/listing/tenant-listing.component.html b/dmp-frontend/src/app/ui/admin/tenant/listing/tenant-listing.component.html index 93669a2f5..7e147010a 100644 --- a/dmp-frontend/src/app/ui/admin/tenant/listing/tenant-listing.component.html +++ b/dmp-frontend/src/app/ui/admin/tenant/listing/tenant-listing.component.html @@ -45,13 +45,14 @@
- -
-
- {{enumUtils.toDescriptionTemplateTypeStatusString(item.status) | nullifyValue}} -
-
+ + + {{'TENANT-LISTING.FIELDS.CODE' | translate}}: + + {{item?.code | nullifyValue}} + + +
diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index b6e029b5e..21c6af833 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1421,6 +1421,7 @@ "TRACKING-PROCESS": "Tracking Process", "RETRY-COUNT": "Retry Count", "NOTIFIED-AT": "Notified At", + "USER": "User", "UPDATED-AT": "Updated", "CREATED-AT": "Created", "IS-ACTIVE": "Is Active" @@ -1433,6 +1434,7 @@ "CONTACT-TYPE": "Contact Type", "TRACKING-STATE": "Tracking State", "TRACKING-PROCESS": "Tracking Process", + "USERS": "Users", "CANCEL": "Cancel", "APPLY-FILTERS": "Apply filters" },