Skip to content

Commit

Permalink
Merge pull request #735 from catenax-ng/main
Browse files Browse the repository at this point in the history
Improving Notifications & Providing EDC Contract API
  • Loading branch information
ds-mmaul authored Mar 7, 2024
2 parents 3b9c21b + 2fb3a5b commit 8132d1b
Show file tree
Hide file tree
Showing 100 changed files with 3,489 additions and 1,748 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

_**For better traceability add the corresponding GitHub issue number in each changelog entry, please.**_

## [UNRELEASED - DD.MM.YYYY]

### Added
- #515 Service Unavailable Response on Notification failure

- #420 add /contracts api to fetch contract agreement information from EDC for assets

### Changed
- Updated RELEASE.md to the latest release guide (added more steps)
- #515 Fixed notification toast click area
- #423 Moved errorMessages from investigation/alert to notification list

### Removed
- #625 Removed the header and breadcrumbs section from app layout

## [10.6.0 - 04.03.2024]

### Added
- Added concept #638: Contract agreement admin view
- Added support for meta key for multi sorting on tables
- Added concept #578: Consistent null values

- Added concept #578: Consistent null values
### Changed
- Spring-core bumped from 6.0.16 to 6.0.17
- Updated user manual
Expand All @@ -25,6 +40,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Bumped version ts-graphviz/setup-graphviz@v1 to ts-graphviz/setup-graphviz@v2
- Bumped version Schedlock 5.10.0 to 5.11.0
- updated yarn.lock file
- [#542](https://github.com/eclipse-tractusx/traceability-foss/issues/542) Fixed bug where it where filter was reset when sorting in other parts table

### Removed
- Removed EDC notification asset classes and replaced with IRS lib implementation
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ https://www.eclipse.org/projects/handbook/#resources-commit

## <ins>General contribution to the project</ins> <a name="general"></a>

### Maintaining [CHANGELOG.md](CHANGELOG.md)
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

_**For better traceability add the corresponding GitHub issue number in each changelog entry, please.**_

### Dash IP
Prerequisites:
1) Create access token
Expand Down
13 changes: 5 additions & 8 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ Make sure eclipse / catena git repositories are in sync
16) Verify that an automatic pull request has been opened (Prepare Helm release for next version)
17) Validate that the versions within that pull requests are correct
18) Merge pull request (Prepare Helm release for next version)
19) Merge release branch into main
19) Merge release branch into main (when merging make sure to restore release branch since it should stay)
20) Open the github action for helm release generation: https://github.com/catenax-ng/tx-traceability-foss/actions/workflows/helm-chart-release.yaml
21) Execute it from main branch
22) Validate that the helm charts release has been generated within the release page
23) Repeat step 8 to 23 for tractus-x: [GitHub Releases page](https://github.com/eclipse-tractusx/traceability-foss/releases)
24) Sync catena and eclipse main branch

// TODO @Martin Maul:
//1 We need to create a branch from the helm-environments branch which reflects the release state
// Create /release/helm-environments-<app-version> not the helm version
//2 Make sure that the merged release branch will not be deleted
23) Create a new branch from release/1.0.0 and name it release/helm-environments-1.0.0 (helm app version not chart version)
24) Repeat step 8 to 23 for tractus-x: [GitHub Releases page](https://github.com/eclipse-tractusx/traceability-foss/releases)
25) Sync catena and eclipse main branch
26) Create a message in the Trace-X channel of the Eclipse Foundation Chat to notify the community about the new release (add a link to the tractus-x release)
8 changes: 6 additions & 2 deletions docs/src/docs/arc42/building-block-view/whitebox-overall.adoc
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
= Whitebox overall system

== Component diagram
== [Outdated] Component diagram

[plantuml, target=whitebox-overview, format=svg]
....
include::../../../uml-diagrams/arc42/building-block-view/whitebox_overall.puml[]
....

== Component description
== [Outdated] Component description

|===
|Components |Description

|IRS
|The IRS consumes relationship information across the CX-Network and builds the graph view. Within this Documentation, the focus lies on the IRS

Expand All @@ -23,3 +26,4 @@ include::../../../uml-diagrams/arc42/building-block-view/whitebox_overall.puml[]

|IAM/DAPS
|DAPS as central Identity Provider
|===
3 changes: 1 addition & 2 deletions docs/src/docs/arc42/cross-cutting/development-concepts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ The generated OpenAPI specification file is automatically compared to a fixed, s

== Migration

There currently is no data migration mechanism for TraceX.
In case the model of the persisted data (Jobs) changes, data is dropped and Jobs will need to be recreated.
Data migration is handled by flyway.

== Configurability

Expand Down
10 changes: 8 additions & 2 deletions docs/src/docs/arc42/cross-cutting/domain-concepts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@

For detailed information about the API model, please refer to the link:https://catenax-ng.github.io/tx-traceability-foss/docs/api-specification/api-specification.html[API specification].

== Domain Model

== Domain Models

=== Assets
[plantuml, target=level-1, format=svg]
....
include::../../../uml-diagrams/arc42/cross-cutting/domain-model/domain-model.puml[]
....

=== Quality Notifications
[plantuml, target=level-2, format=svg]
....
include::../../../uml-diagrams/arc42/cross-cutting/domain-model/domain-model-quality-notifications.puml[]
....


6 changes: 3 additions & 3 deletions docs/src/docs/arc42/scope-context/technical-context.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ In order to use Trace-X frontend with Trace-X backend, users need to authenticat
By the frontend UI users provide valid credentials and the system generates a bearer token that it gets from Keycloak and attaches it to the HTTP header parameter Authorization.
Then once a user is authorized and has proper role within Trace-X backend, the backend delegates HTTP calls to specific service in their behalf as technical user in order to fulfill specific functionality.

=== Registry API
=== [Outdated] Registry API

[plantuml, target=technical-context-registry, format=svg]
....
Expand All @@ -34,7 +34,7 @@ include::../../../uml-diagrams/arc42/scope-context/technical-context/irs-api-vie
The Trace-X acts as a consumer of the IRS component. The Trace-X contains a Restful client (REST template) that build a REST call to the mentioned IRS API based on its known URL (the IRS URL is configurable in the Trace-X).
Request contains details required to start IRS fetch job provided by the component during assets synchronization. Like described in the above section, the security aspect is required in order to achieve a REST call against the IRS. As a response, the Trace-X gets the created job id and periodically pulls for the job details that contains assets that will be uploaded to the system. And as mentioned above, the transport protocol HTTP(S) is used for the REST call communication.

=== Portal API
=== [Outdated] Portal API

[plantuml, target=technical-context-portal, format=svg]
....
Expand All @@ -44,7 +44,7 @@ include::../../../uml-diagrams/arc42/scope-context/technical-context/portal-api-
The Trace-X acts as a consumer of the Portal component. The Trace-X contains a Restful client (REST template) that build a REST call to the mentioned Portal API based on its known URL (the Portal URL is configurable in the Trace-X).
Request contains "bpns" provided by the component during sending notifications. Like described in the above section, the security aspect is required in order to achieve a REST call against the Portal. As a response, the Trace-X gets the corresponding BPN mappings to EDC urls where a notification should be send over. And as mentioned above, the transport protocol HTTP(S) is used for the REST call communication.

=== EDC API
=== [Outdated] EDC API

[plantuml, target=technical-context-edc, format=svg]
....
Expand Down
8 changes: 7 additions & 1 deletion docs/src/docs/arc42/solution-strategy/structure.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ It roughly can be broken down into the following parts:
* Asset controllers to get the asset information
* Dashboard controller to get dashboard related summed up information
* Registry controller to fetch assets from the Digital Twin Registry
* Notification controllers to get notification information
* Notification controllers to get notification information and create EDC notification offers
* Submodel controller for providing asset data functionality
* Import controller for importing Trace-X data for data provisioning
* Contract controller to get information about contract agreements
* EDC controller to retrieve notifications
* IRS callback controller to retrieve asynchronous jobs completed by IRS
* Policy controller to retrieve information about policies
* BPN controller to retrieve information about business partners
The backend does a request to the Digital Twin Registry utilizing the Registry controller. Extracted data from the response is made available through the Asset controller and the Dashboard controller to the Frontend.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
@startuml
skinparam monochrome true
skinparam shadowing false
skinparam defaultFontName "Architects daughter"
skinparam linetype ortho
title: Quality Notification Domain

class QualityNotification {
bpn : BPN;
notificationId : QualityNotificationId;
notificationStatus : QualityNotificationStatus;
description: String;
createdAt: Instant;
notificationSide: QualityNotificationSide;
assetIds: ArrayList<String>();
closeReason: String;
acceptReason: String;
declineReason: String;
notifications: Map<String, QualityNotificationMessage>;
}

class QualityNotificationId {
id: Long;
}

enum QualityNotificationSide{
SENDER;
RECEIVER;
}
class BPN{
bpn: String;
}

enum QualityNotificationStatus{
CREATED(QualityNotificationSide.SENDER, emptySet()),
SENT(QualityNotificationSide.SENDER, Set.of(QualityNotificationSide.SENDER)),
RECEIVED(QualityNotificationSide.RECEIVER, emptySet()),
ACKNOWLEDGED(QualityNotificationSide.RECEIVER, Set.of(QualityNotificationSide.RECEIVER, QualityNotificationSide.SENDER)),
ACCEPTED(QualityNotificationSide.RECEIVER, Set.of(QualityNotificationSide.RECEIVER)),
DECLINED(QualityNotificationSide.RECEIVER, Set.of(QualityNotificationSide.RECEIVER)),
CANCELED(QualityNotificationSide.SENDER, Set.of(QualityNotificationSide.SENDER)),
CLOSED(QualityNotificationSide.SENDER, of(QualityNotificationSide.SENDER, QualityNotificationSide.RECEIVER));
}

QualityNotification *-- QualityNotificationId
QualityNotification *-- BPN
QualityNotification *-- QualityNotificationStatus
QualityNotification *-- QualityNotificationSide
@enduml

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ skinparam monochrome true
skinparam shadowing false
skinparam defaultFontName "Architects daughter"
skinparam linetype ortho
title: Domain Model
title: Asset Domain

class ImportJobs {
importId : String (max = 255)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('HttpErrorInterceptor', () => {
it('should intercept', async () => {
await initErrorInterceptor('403');
expect(
await waitFor(() => screen.getByText('Backend returned code 403: Permission denied error message')),
).toBeInTheDocument();
await waitFor(() => screen.queryByText('Backend returned code 403: Permission denied error message')),
).not.toBeInTheDocument();
});
});
4 changes: 2 additions & 2 deletions frontend/src/app/modules/core/api/http-error.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class HttpErrorInterceptor implements HttpInterceptor {
const errorMessage = !error.message ? message : `Backend returned code ${ error.status }: ${ error.message }`;

// Check if the request URL matches any pattern in the avoidList
if (this.shouldShowToast(request.url)) {
if (!this.isOnAlreadyHandledUrlList(request.url)) {
this.toastService.error(errorMessage);
}

Expand All @@ -56,7 +56,7 @@ export class HttpErrorInterceptor implements HttpInterceptor {
}

// Helper method to check if the URL matches any pattern in the avoidList
private shouldShowToast(url: string): boolean {
private isOnAlreadyHandledUrlList(url: string): boolean {
return !this.avoidList.some(pattern => this.urlMatchesPattern(url, pattern));
}

Expand Down
10 changes: 0 additions & 10 deletions frontend/src/app/modules/core/layout/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@
<app-user-navigation></app-user-navigation>
</div>
</nav>

<div class="header--breadcrumb-container">
<app-breadcrumbs></app-breadcrumbs>
</div>

<div *ngIf="activeMenu" class="header--app-header">
<h3>{{ 'pageTitle.' + activeMenu | i18n }}</h3>
</div>

<img src="/assets/images/header-subtract.png" class="header--stylish-curve" alt="" />
</div>

<ng-template let-type="value" let-role="role" #menuItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('LayoutComponent', () => {
imports: [ LayoutModule ],
providers: [ LayoutComponent ],
});
let header = fixture.debugElement.query(By.css('.header--breadcrumb-container'));
let header = fixture.debugElement.query(By.css('.layout-content__box-modal'));
expect(header).not.toBeNull();
let toast = fixture.debugElement.query(By.css('.layout-toast-component'));
let headerDistanceToTop = header.nativeElement.getBoundingClientRect().y + 'px';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export class LayoutComponent {
* This Block positions the toast component to the start of the header breadcrumb component (vertical top distance)
* so that on every screen size the position stays the same (not relative)
*/
const headerBreadCrumbRef = this.elementRef.nativeElement.querySelector('.header--breadcrumb-container');
const layoutContentRef = this.elementRef.nativeElement.querySelector('.layout-content__box-modal');
const toastLayoutRef = this.elementRef.nativeElement.querySelector('.layout-toast-component');
const elementTopDistance = headerBreadCrumbRef.getBoundingClientRect().top;
const elementTopDistance = layoutContentRef.getBoundingClientRect().top;
this.renderer.setStyle(toastLayoutRef, 'top', `${ elementTopDistance }px`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<ng-template #mainTmp let-parts="view" let-customContext="customContext">
<app-parts-table
[paginationData]="parts.data | formatPaginationSemanticDataModelToCamelCase"
[selectedPartsInfoLabel]="'page.selectedParts.info'"
[selectedPartsActionLabel]="'page.selectedParts.action'"
[noShadow]="true"
[labelId]="customContext.labelId"
(selected)="onSelectItem($event)"
Expand Down
Loading

0 comments on commit 8132d1b

Please sign in to comment.