Skip to content

Commit

Permalink
Merge pull request #821 from catenax-ng/main
Browse files Browse the repository at this point in the history
upward sync
  • Loading branch information
ds-mwesener authored Apr 3, 2024
2 parents d8deab9 + 972f02b commit 06f17d2
Show file tree
Hide file tree
Showing 57 changed files with 471 additions and 1,610 deletions.
4 changes: 2 additions & 2 deletions DEPENDENCIES_BACKEND
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ maven/mavencentral/org.jboss.logging/jboss-logging/3.5.3.Final, Apache-2.0, appr
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-common/1.9.0, Apache-2.0, approved, #14186
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-common/1.9.23, Apache-2.0, approved, #14186
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.6.10, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.9.23, None, restricted, #14188
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.9.23, Apache-2.0, approved, #14188
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.6.10, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.9.23, None, restricted, #14185
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.9.23, Apache-2.0, approved, #14185
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib/1.6.20, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib/1.9.23, Apache-2.0, approved, #11827
maven/mavencentral/org.jetbrains/annotations/24.1.0, Apache-2.0, approved, clearlydefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@ skinparam defaultFontName "Architects daughter"

title Sequence diagram: Policy handling on asset provisioning flow
participant "Trace-X" as TraceX
participant "EDC Consumer" as EdcConsumer
participant "EDC Provider (other)" as EdcProvider

activate TraceX
TraceX -> TraceX: Publish asset to core services
TraceX -> EdcConsumer: Register policy
activate EdcConsumer
EdcConsumer -> EdcProvider: Register policy
activate EdcProvider
EdcProvider --> EdcConsumer: Ok
deactivate EdcProvider
EdcConsumer --> TraceX: Ok
deactivate EdcConsumer
TraceX -> EdcProvider: Register policy
EdcProvider --> TraceX: Ok
TraceX -> TraceX: Reuse policy for contract definition creation
@enduml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
********************************************************************************/

import { Injectable } from '@angular/core';
import { NotificationChannel } from '@shared/components/multi-select-autocomplete/table-type.model';
import { Notifications } from '@shared/model/notification.model';
import { View } from '@shared/model/view.model';
import { NotificationService } from '@shared/service/notification.service';
Expand Down Expand Up @@ -97,23 +98,23 @@ export class DashboardFacade {

private setReceivedInvestigations(): void {
this.investigationsReceivedSubscription?.unsubscribe();
this.investigationsReceivedSubscription = this.notificationService.getReceived(0, 5, [ [ 'createdDate', 'desc' ] ], null, null, true).subscribe({
this.investigationsReceivedSubscription = this.notificationService.getNotifications(0, 5, [ [ 'createdDate', 'desc' ] ], NotificationChannel.RECEIVER, null, null).subscribe({
next: data => this.dashboardState.setRecentReceivedInvestigations({ data }),
error: (error: Error) => this.dashboardState.setRecentReceivedInvestigations({ error }),
});
}

private setCreatedInvestigations(): void {
this.investigationsCreatedSubscription?.unsubscribe();
this.investigationsCreatedSubscription = this.notificationService.getCreated(0, 5, [ [ 'createdDate', 'desc' ] ], null, null, true).subscribe({
this.investigationsCreatedSubscription = this.notificationService.getNotifications(0, 5, [ [ 'createdDate', 'desc' ] ], NotificationChannel.SENDER, null, null).subscribe({
next: data => this.dashboardState.setRecentCreatedInvestigations({ data }),
error: (error: Error) => this.dashboardState.setRecentCreatedInvestigations({ error }),
});
}

private setReceivedAlerts(): void {
this.alertsReceivedSubscription?.unsubscribe();
this.alertsReceivedSubscription = this.notificationService.getReceived(0, 5, [ [ 'createdDate', 'desc' ] ], null, null, false).subscribe({
this.alertsReceivedSubscription = this.notificationService.getNotifications(0, 5, [ [ 'createdDate', 'desc' ] ], NotificationChannel.RECEIVER, null, null).subscribe({
next: data => this.dashboardState.setRecentReceivedAlerts({ data }),
error: (error: Error) => this.dashboardState.setRecentReceivedAlerts({ error }),
});
Expand All @@ -122,7 +123,7 @@ export class DashboardFacade {

private setCreatedAlerts(): void {
this.alertsCreatedSubscription?.unsubscribe();
this.alertsCreatedSubscription = this.notificationService.getCreated(0, 5, [ [ 'createdDate', 'desc' ] ], null, null, false).subscribe({
this.alertsCreatedSubscription = this.notificationService.getNotifications(0, 5, [ [ 'createdDate', 'desc' ] ], NotificationChannel.SENDER, null, null).subscribe({
next: data => this.dashboardState.setRecentCreatedAlerts({ data }),
error: (error: Error) => this.dashboardState.setRecentCreatedAlerts({ error }),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,9 @@ <h3 class="flex items-center">

<mat-card-content>
<app-notifications-tab
[notificationType]="NotificationType.ALERT"
[notificationsView$]="alertsCreated$"
[translationContext]="'commonAlert'"
[tableType]="TableType.RECEIVED_ALERT"
[tableType]="TableType.RECEIVED_NOTIFICATION"
[labelId]="'dashboard-alerts-created'"
[hasPagination]="false"
[optionalColumns]="['targetDate', 'severity', 'createdBy', 'type']"
Expand Down Expand Up @@ -155,13 +154,12 @@ <h3 class="flex items-center">

<mat-card-content>
<app-notifications-tab
[notificationType]="NotificationType.ALERT"
[notificationsView$]="alertsReceived$"
[translationContext]="'commonAlert'"
[labelId]="'dashboard-alerts-received'"
[hasPagination]="false"
[optionalColumns]="['targetDate', 'severity', 'createdBy', 'type']"
[tableType]="TableType.RECEIVED_ALERT"
[tableType]="TableType.RECEIVED_NOTIFICATION"
(selected)="onAlertSelected($event)"
></app-notifications-tab>
</mat-card-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,11 @@

import { Component, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { NOTIFICATION_BASE_ROUTE, getRoute } from '@core/known-route';
import { getRoute, NOTIFICATION_BASE_ROUTE } from '@core/known-route';
import { DashboardStats } from '@page/dashboard/model/dashboard.model';
import { MetricData } from '@page/dashboard/presentation/dashboard.model';
import { TableType } from '@shared/components/multi-select-autocomplete/table-type.model';
import {
Notification,
Notifications,
NotificationStatusGroup,
NotificationType,
} from '@shared/model/notification.model';
import { Notification, Notifications, NotificationStatusGroup } from '@shared/model/notification.model';
import { View } from '@shared/model/view.model';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
Expand Down Expand Up @@ -134,6 +129,5 @@ export class DashboardComponent implements OnInit, OnDestroy {
this.router.navigate([ `/${ link }/${ notification.id }` ]).then();
}

protected readonly NotificationType = NotificationType;
protected readonly TableType = TableType;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import { Injectable } from '@angular/core';
import { NotificationsFacade } from '@page/notifications/core/notifications.facade';
import { NotificationStatus } from '@shared/model/notification.model';
import { Observable } from 'rxjs';

@Injectable({
Expand Down Expand Up @@ -52,4 +53,24 @@ export class NotificationHelperService {
return this.notificationsFacade.declineNotification(id, reason);
}

modalCallback(status: NotificationStatus, id: string, reason?: string): Observable<void> {
switch (status) {
case NotificationStatus.ACKNOWLEDGED:
return this.notificationsFacade.acknowledgeNotification(id);
case NotificationStatus.APPROVED:
return this.notificationsFacade.approveNotification(id);
case NotificationStatus.CANCELED:
return this.notificationsFacade.cancelNotification(id);
case NotificationStatus.CLOSED:
return this.notificationsFacade.closeNotification(id, reason);
case NotificationStatus.ACCEPTED:
return this.notificationsFacade.acceptNotification(id, reason);
case NotificationStatus.DECLINED:
return this.notificationsFacade.declineNotification(id, reason);
default:
return null;
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import { Injectable } from '@angular/core';
import { NotificationsState } from '@page/notifications/core/notifications.state';
import { provideDataObject } from '@page/parts/core/parts.helper';
import { NotificationChannel } from '@shared/components/multi-select-autocomplete/table-type.model';
import { TableHeaderSort } from '@shared/components/table/table.model';
import {
Notification,
Expand Down Expand Up @@ -51,13 +52,13 @@ export class NotificationsFacade {
}

public getNotification(id: string): Observable<Notification> {
return this.notificationService.getNotificationById(id, false);
return this.notificationService.getNotificationById(id);
}

public setReceivedNotifications(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], filter?: NotificationDeeplinkFilter, fullFilter?: any): void {
this.notificationReceivedSubscription?.unsubscribe();
this.notificationReceivedSubscription = this.notificationService
.getReceived(page, pageSize, sorting, filter, fullFilter, false)
.getNotifications(page, pageSize, sorting, NotificationChannel.RECEIVER, filter, fullFilter)
.subscribe({
next: data => (this.notificationsState.notificationsReceived = { data: provideDataObject(data) }),
error: (error: Error) => (this.notificationsState.notificationsReceived = { error }),
Expand All @@ -67,7 +68,7 @@ export class NotificationsFacade {
public setQueuedAndRequestedNotifications(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], filter?: NotificationDeeplinkFilter, fullFilter?: any): void {
this.notificationQueuedAndRequestedSubscription?.unsubscribe();
this.notificationQueuedAndRequestedSubscription = this.notificationService
.getCreated(page, pageSize, sorting, filter, fullFilter, false)
.getNotifications(page, pageSize, sorting, NotificationChannel.SENDER, filter, fullFilter)
.subscribe({
next: data => (this.notificationsState.notificationsQueuedAndRequested = { data: provideDataObject(data) }),
error: (error: Error) => (this.notificationsState.notificationsQueuedAndRequested = { error }),
Expand All @@ -81,26 +82,26 @@ export class NotificationsFacade {


public closeNotification(notificationId: string, reason: string): Observable<void> {
return this.notificationService.closeNotification(notificationId, reason, false);
return this.notificationService.closeNotification(notificationId, reason);
}

public approveNotification(notificationId: string): Observable<void> {
return this.notificationService.approveNotification(notificationId, false);
return this.notificationService.approveNotification(notificationId);
}

public cancelNotification(notificationId: string): Observable<void> {
return this.notificationService.cancelNotification(notificationId, false);
return this.notificationService.cancelNotification(notificationId);
}

public acknowledgeNotification(notificationId: string): Observable<void> {
return this.notificationService.updateNotification(notificationId, NotificationStatus.ACKNOWLEDGED, null, false);
return this.notificationService.updateNotification(notificationId, NotificationStatus.ACKNOWLEDGED, null);
}

public acceptNotification(notificationId: string, reason: string): Observable<void> {
return this.notificationService.updateNotification(notificationId, NotificationStatus.ACCEPTED, reason, false);
return this.notificationService.updateNotification(notificationId, NotificationStatus.ACCEPTED, reason);
}

public declineNotification(notificationId: string, reason: string): Observable<void> {
return this.notificationService.updateNotification(notificationId, NotificationStatus.DECLINED, reason, false);
return this.notificationService.updateNotification(notificationId, NotificationStatus.DECLINED, reason);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
>
<app-button
*ngIf="actionHelperService.showApproveButton(selectedNotification)"
(click)="notificationCommonModalComponent?.show('approve')"
(click)="notificationCommonModalComponent?.show(NotificationStatus.APPROVED)"
[color]="'primary'"
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.APPROVE)"
>
Expand All @@ -60,7 +60,7 @@
>
<app-button
*ngIf="actionHelperService.showCancelButton(selectedNotification)"
(click)="notificationCommonModalComponent?.show('cancel')"
(click)="notificationCommonModalComponent?.show(NotificationStatus.CANCELED)"
[color]="'primary'"
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.CANCEL)"
>
Expand All @@ -80,7 +80,7 @@
>
<app-button
*ngIf="actionHelperService.showCloseButton(selectedNotification)"
(click)="notificationCommonModalComponent?.show('close')"
(click)="notificationCommonModalComponent?.show(NotificationStatus.CLOSED)"
[color]="'primary'"
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.CLOSE)"
>
Expand All @@ -100,7 +100,7 @@
>
<app-button
*ngIf="actionHelperService.showAcceptButton(selectedNotification)"
(click)="notificationCommonModalComponent?.show('accept')"
(click)="notificationCommonModalComponent?.show(NotificationStatus.ACCEPTED)"
[color]="'primary'"
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.ACCEPT)"
>
Expand All @@ -120,7 +120,7 @@
>
<app-button
*ngIf="actionHelperService.showAcknowledgeButton(selectedNotification)"
(click)="notificationCommonModalComponent?.show('acknowledge')"
(click)="notificationCommonModalComponent?.show(NotificationStatus.ACKNOWLEDGED)"
[color]="'primary'"
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.ACKNOWLEDGE)"
>
Expand All @@ -140,7 +140,7 @@
>
<app-button
*ngIf="actionHelperService.showDeclineButton(selectedNotification)"
(click)="notificationCommonModalComponent?.show('decline')"
(click)="notificationCommonModalComponent?.show(NotificationStatus.DECLINED)"
[color]="'primary'"
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.DECLINE)"
>
Expand All @@ -157,7 +157,6 @@
(confirmActionCompleted)="handleConfirmActionCompletedEvent()"
[helperService]="helperService"
[selectedNotification]="selectedNotification"
[translationContext]="TranslationContext.COMMONALERT"
></app-notification-common-modal>

<div class="detail--wrapper">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { NotificationActionHelperService } from '@shared/assembler/notification-
import { NotificationCommonModalComponent } from '@shared/components/notification-common-modal/notification-common-modal.component';
import { CreateHeaderFromColumns, TableConfig, TableEventConfig } from '@shared/components/table/table.model';
import { ToastService } from '@shared/components/toasts/toast.service';
import { Notification, NotificationType } from '@shared/model/notification.model';
import { Notification, NotificationStatus, NotificationType } from '@shared/model/notification.model';
import { TranslationContext } from '@shared/model/translation-context.model';
import { View } from '@shared/model/view.model';
import { NotificationAction } from '@shared/modules/notification/notification-action.enum';
Expand Down Expand Up @@ -196,7 +196,7 @@ export class NotificationDetailComponent implements AfterViewInit, OnDestroy {
}

private selectedNotificationBasedOnUrl(): void {
const notificationId = this.route.snapshot.paramMap.get('alertId');
const notificationId = this.route.snapshot.paramMap.get('notificationId');
this.notificationsFacade
.getNotification(notificationId)
.pipe(
Expand All @@ -206,8 +206,8 @@ export class NotificationDetailComponent implements AfterViewInit, OnDestroy {
.subscribe();
}

protected readonly TranslationContext = TranslationContext;
protected readonly NotificationType = NotificationType;
protected readonly NotificationAction = NotificationAction;

protected readonly NotificationStatus = NotificationStatus;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
<app-notification-common-modal
(confirmActionCompleted)="handleConfirmActionCompletedEvent()"
[helperService]="helperService"
[translationContext]="TranslationContext.COMMONALERT"
></app-notification-common-modal>

<app-notification
[notificationType]="NotificationType.ALERT"
[queuedAndRequestedNotifications$]="notificationsQueuedAndRequested$"
[receivedNotifications$]="notificationsReceived$"
[isInvestigation]="isInvestigation"
[translationContext]="TranslationContext.COMMONALERT"
[receivedOptionalColumns]="['severity', 'createdBy', 'createdByName', 'type']"
[receivedMultiSortList]="notificationReceivedSortList"
Expand All @@ -37,7 +34,7 @@
[queuedAndRequestedMultiSortList]="notificationQueuedAndRequestedSortList"
(onReceivedTableConfigChanged)="onReceivedTableConfigChange($event)"
(onQueuedAndRequestedTableConfigChanged)="onQueuedAndRequestedTableConfigChange($event)"
(alertFilterChanged)="filterNotifications($event)"
(notificationsFilterChanged)="filterNotifications($event)"
(selected)="openDetailPage($event)"
[menuActionsConfig]="menuActionsConfig"
></app-notification>
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export class NotificationsComponent {
public readonly notificationsReceived$;
public readonly notificationsQueuedAndRequested$;

public isInvestigation = false;
public menuActionsConfig: MenuActionConfig<Notification>[];

public notificationReceivedSortList: TableHeaderSort[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { NotificationMenuActionsAssembler } from '@shared/assembler/notification
import { NotificationCommonModalComponent } from '@shared/components/notification-common-modal/notification-common-modal.component';
import { Notification, NotificationStatus } from '@shared/model/notification.model';
import { Severity } from '@shared/model/severity.model';
import { CloseNotificationModalComponent } from '@shared/modules/notification/modal/close/close-notification-modal.component';
import { KeycloakService } from 'keycloak-angular';

describe('NotificationMenuActionsAssembler', () => {
Expand All @@ -52,7 +51,6 @@ describe('NotificationMenuActionsAssembler', () => {
NotificationActionHelperService,
NotificationCommonModalComponent,
NotificationMenuActionsAssembler,
CloseNotificationModalComponent,
],
});
notificationCommonModalComponent = TestBed.inject(NotificationCommonModalComponent);
Expand Down
Loading

0 comments on commit 06f17d2

Please sign in to comment.