Skip to content

Commit

Permalink
Merge pull request #305 from catenax-ng/main
Browse files Browse the repository at this point in the history
support more aspectmodels, filtering parts
  • Loading branch information
ds-mwesener authored Oct 6, 2023
2 parents 24b237e + f52a33c commit 7e68efd
Show file tree
Hide file tree
Showing 323 changed files with 25,873 additions and 1,346 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ The following people have contributed to this repository:
- Martin Maul, doubleSlash Net-Business GmbH, https://github.com/ds-mmaul
- Lucas Capellino, doubleSlash Net-Business GmbH, https://github.com/ds-lcapellino
- Abilash Shanmugavel, doubleSlash Net-Business GmbH, https://github.com/abi231002
- Sebastian Ceronik, doubleSlash Net-Business GmbH, https://github.com/ds-ext-sceronik
23 changes: 16 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]
### Added

- added multisorting in FE for notifications
- added possiblity to add operator to searchquery of assets
- added global search field and combined with the OR operator to be able to search for multiple elements in the database
- Filter for each assetAsBuilt table attribute
- Filter for each assetAsPlanned table attribute
- Extended testdata to reflect better overview of assets
- Extended testdata to reflect better overview of assets
- Support for TractionBatteryCode
- Support for JustInSequence Semantice data model in FE
- Added country flags icons to manufacturing Country
- new submodelserver related API endpoints for data provisioning /api/submodel/data/{id}

### Changed
- updated IRS helm chart from 6.6.1 to 6.7.2
- Updated policy related logic to reflect IRS changes

### Removed
- Updated user manual to reflect current state of the part views

### Removed
- Owner filter and replaced it with the new filter query param

## [7.1.0 - 29.09.2023]
Expand All @@ -23,11 +36,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- archunit tests as preparation for good quality architecture checks
- safety and security doc including roles matrix
- handling for duplicate shellDescriptor ids when refreshing registry
- Filter for each assetAsBuilt table attribute
- Filter for each assetAsPlanned table attribute
- Extended testdata to reflect better overview of assets
- Extended testdata to reflect better overview of assets
- Support for TractionBatteryCode


### Changed
- added sorting for /api/investigations received and created endpoints
Expand Down
2 changes: 1 addition & 1 deletion DEPENDENCIES_BACKEND
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ maven/mavencentral/org.eclipse.edc/transfer-spi/0.1.3, Apache-2.0, approved, tec
maven/mavencentral/org.eclipse.edc/transform-spi/0.1.3, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/validator-spi/0.1.3, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/web-spi/0.1.3, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.tractusx.irs/irs-registry-client/1.2.1-20230929.134937-6, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.irs/irs-registry-client/1.2.1-20231005.130041-12, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.traceability/tx-backend/0.0.1-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx.traceability/tx-models/0.0.1-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.flywaydb/flyway-core/9.16.3, Apache-2.0, approved, #7935
Expand Down
4 changes: 2 additions & 2 deletions DEPENDENCIES_FRONTEND
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ npm/npmjs/-/has-proto/1.0.1, MIT, approved, #6175
npm/npmjs/-/has-symbols/1.0.3, MIT, approved, clearlydefined
npm/npmjs/-/has-tostringtag/1.0.0, MIT, approved, clearlydefined
npm/npmjs/-/has-unicode/2.0.1, ISC, approved, clearlydefined
npm/npmjs/-/has/1.0.3, MIT, approved, clearlydefined
npm/npmjs/-/has/1.0.3, MIT, approved, #10930
npm/npmjs/-/hdr-histogram-js/2.0.3, BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND 0BSD, approved, #3301
npm/npmjs/-/hdr-histogram-percentiles-obj/3.0.0, MIT, approved, clearlydefined
npm/npmjs/-/headers-polyfill/3.1.2, MIT, approved, clearlydefined
Expand Down Expand Up @@ -848,7 +848,7 @@ npm/npmjs/-/readable-stream/3.6.2, MIT, approved, CQ22627
npm/npmjs/-/readdirp/3.6.0, MIT, approved, #2977
npm/npmjs/-/redent/3.0.0, MIT, approved, clearlydefined
npm/npmjs/-/reflect-metadata/0.1.13, Apache-2.0, approved, clearlydefined
npm/npmjs/-/regenerate-unicode-properties/10.1.0, MIT, approved, clearlydefined
npm/npmjs/-/regenerate-unicode-properties/10.1.0, MIT, approved, #10903
npm/npmjs/-/regenerate/1.4.2, MIT, approved, clearlydefined
npm/npmjs/-/regenerator-runtime/0.13.11, MIT, approved, #4978
npm/npmjs/-/regenerator-transform/0.15.1, MIT, approved, #5001
Expand Down
2 changes: 1 addition & 1 deletion charts/traceability-foss/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies:
condition: pgadmin4.enabled
- name: irs-helm
repository: https://eclipse-tractusx.github.io/item-relationship-service
version: 6.6.1
version: 6.7.2
condition: irs-helm.enabled
- name: tractusx-connector
repository: https://eclipse-tractusx.github.io/tractusx-edc
Expand Down
21 changes: 20 additions & 1 deletion docs/src/docs/user/user-manual.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,22 @@ By default, both tables are displayed. You can adjust the View of tables by acti

image::https://raw.githubusercontent.com/eclipse-tractusx/traceability-foss/main/docs/src/images/arc42/user-guide/parts-list-view.png[]

=== Parts Table

A Table View split into the different BOM Lifecycle phases (AsBuilt / AsPlanned) of a part.

Between the views, there is a slider to adjust the view to make either the left or the right table more visible.
Alternatively, you can use the view toggle to adjust the visibility of the tables.

Both tables can be sorted, filtered and searched.
The global search bar at the top returns part results from both Tables.

=== AsBuilt Lifecycle Parts
List view of own Parts with AsBuilt Lifecycle.
Gives detailed information on the assets registered in the Digital Twin Registry of Catena-X for the company. This includes data based on the aspect models of Use Case Traceability: Asbuilt, SerialPart, Batch.
Parts that are in a quality alert are highlighted yellow.

=== AsPlanned
=== AsPlanned Lifecycle Parts
List view of own Parts with AsPlanned Lifecycle.
Gives detailed information on the assets registered in the Digital Twin Registry of Catena-X for the company. This includes data based on the aspect models of Use Case Traceability: AsPlanned, SerialPart, Batch.
Parts that are in a quality alert are highlighted yellow.
Expand Down Expand Up @@ -106,6 +116,15 @@ Information about the identifiers at the customer for the respective part/batch.
List view of the supplied/delivered parts and batches (Supplier parts / Customer parts).
Gives detailed information on the assets registered in the Digital Twin Registry of Catena-X. This includes data based on the aspect models of Use Case Traceability: SerialPart, Batch.

=== Other parts Table

A Table View split into the different BOM Lifecycle phases (AsBuilt / AsPlanned) of a part.

Between the views, there is a slider to adjust the view to make either the left or the right table more visible.
Alternatively, you can use the view toggle to adjust the visibility of the tables.

Additionally, it's possible to switch between tabs above each of the table views to display either supplier or customer parts

=== Supplier parts
List view of supplied parts and batches.
Supplier parts that are in a quality investigation are highlighted yellow.
Expand Down
Binary file modified docs/src/images/arc42/user-guide/parts-list-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
********************************************************************************/

import { DetailAspectType } from '@page/parts/model/detailAspectModel.model';
import { Owner } from '@page/parts/model/owner.enum';
import { PartResponse, PartsResponse, QualityType, SemanticDataModel } from '@page/parts/model/parts.model';
import {Owner} from '@page/parts/model/owner.enum';

export const MOCK_part_5 = {
"id": "MOCK_part_5",
Expand Down Expand Up @@ -74,7 +74,7 @@ export const MOCK_part_4 = {
"underInvestigation": false,
"qualityType": QualityType.Ok,
"van": "--",
"semanticDataModel": SemanticDataModel.JUSTINSEQUENCEPART,
'semanticDataModel': SemanticDataModel.JUSTINSEQUENCE,
"classification": "product",
"detailAspectModels": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class OtherPartsService {
let params = new HttpParams()
.set('page', page)
.set('size', pageSize)
.set('filterOperator', "AND")
.set('filter', "owner,EQUAL," + owner);

sort.forEach(sortingItem => {
Expand All @@ -65,6 +66,7 @@ export class OtherPartsService {
let params = new HttpParams()
.set('page', page)
.set('size', pageSize)
.set('filterOperator', "AND")
.set('filter', "owner,EQUAL," + owner);

sort.forEach(sortingItem => {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/app/modules/page/parts/core/parts.facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Parts facade', () => {
partsFacade.setPartsAsBuilt(0, 10);

await waitFor(() => expect(serviceSpy).toHaveBeenCalledTimes(1));
await waitFor(() => expect(serviceSpy).toHaveBeenCalledWith(0, 10, [], undefined));
await waitFor(() => expect(serviceSpy).toHaveBeenCalledWith(0, 10, [], undefined, undefined));

const parts = await firstValueFrom(partsState.partsAsBuilt$);
await waitFor(() =>
Expand All @@ -78,7 +78,7 @@ describe('Parts facade', () => {
partsFacade.setPartsAsBuilt(0, 10, [], filter);

await waitFor(() => expect(serviceSpy).toHaveBeenCalledTimes(1));
await waitFor(() => expect(serviceSpy).toHaveBeenCalledWith(0, 10, [], filter));
await waitFor(() => expect(serviceSpy).toHaveBeenCalledWith(0, 10, [], filter, undefined));

const parts = await firstValueFrom(partsState.partsAsBuilt$);
await waitFor(() =>
Expand All @@ -98,7 +98,7 @@ describe('Parts facade', () => {
partsFacade.setPartsAsPlanned(0, 10, [], filter);

await waitFor(() => expect(serviceSpy).toHaveBeenCalledTimes(1));
await waitFor(() => expect(serviceSpy).toHaveBeenCalledWith(0, 10, [], filter));
await waitFor(() => expect(serviceSpy).toHaveBeenCalledWith(0, 10, [], filter, undefined));

const parts = await firstValueFrom(partsState.partsAsPlanned$);
await waitFor(() =>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/modules/page/parts/core/parts.facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ export class PartsFacade {
return this.partsState.partsAsPlanned$;
}

public setPartsAsBuilt(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], assetAsBuiltFilter?: AssetAsBuiltFilter): void {
public setPartsAsBuilt(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], assetAsBuiltFilter?: AssetAsBuiltFilter, isOrSearch?: boolean): void {
this.partsAsBuiltSubscription?.unsubscribe();
this.partsAsBuiltSubscription = this.partsService.getPartsAsBuilt(page, pageSize, sorting, assetAsBuiltFilter).subscribe({
this.partsAsBuiltSubscription = this.partsService.getPartsAsBuilt(page, pageSize, sorting, assetAsBuiltFilter, isOrSearch).subscribe({
next: data => (this.partsState.partsAsBuilt = {data}),
error: error => (this.partsState.partsAsBuilt = {error}),
});
}

public setPartsAsPlanned(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], assetAsPlannedFilter?: AssetAsPlannedFilter): void {
public setPartsAsPlanned(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], assetAsPlannedFilter?: AssetAsPlannedFilter, isOrSearch?: boolean): void {
this.partsAsPlannedSubscription?.unsubscribe();
this.partsAsPlannedSubscription = this.partsService.getPartsAsPlanned(page, pageSize, sorting, assetAsPlannedFilter).subscribe({
this.partsAsPlannedSubscription = this.partsService.getPartsAsPlanned(page, pageSize, sorting, assetAsPlannedFilter, isOrSearch).subscribe({
next: data => (this.partsState.partsAsPlanned = {data}),
error: error => (this.partsState.partsAsPlanned = {error}),
});
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/app/modules/page/parts/model/parts.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import type {PaginationResponse} from '@core/model/pagination.model';
import {SemanticModel} from '@page/parts/model/aspectModels.model';
import {DetailAspectModel} from '@page/parts/model/detailAspectModel.model';
import {MainAspectType} from '@page/parts/model/mainAspectType.enum';
import {Owner} from '@page/parts/model/owner.enum';
import type { PaginationResponse } from '@core/model/pagination.model';
import { SemanticModel } from '@page/parts/model/aspectModels.model';
import { DetailAspectModel } from '@page/parts/model/detailAspectModel.model';
import { MainAspectType } from '@page/parts/model/mainAspectType.enum';
import { Owner } from '@page/parts/model/owner.enum';

export interface Part {
id: string;
Expand Down Expand Up @@ -101,15 +101,15 @@ export enum SemanticDataModel {
BATCH = 'BATCH',
SERIALPART = 'SERIALPART',
PARTASPLANNED = 'PARTASPLANNED',
JUSTINSEQUENCEPART = 'JUSTINSEQUENCEPART',
JUSTINSEQUENCE = 'JUSTINSEQUENCE',
UNKNOWN = 'UNKNOWN'
}

export enum SemanticDataModelInCamelCase {
BATCH = "Batch",
SERIALPART = 'SerialPart',
PARTASPLANNED = 'PartAsPlanned',
JUSTINSEQUENCEPART = 'JustInSequencePart',
JUSTINSEQUENCE = 'JustInSequence',
UNKNOWN = 'Unknown'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@
-->

<div class="parts-table-container">
<div class="parts-search-input-wrapper" [formGroup]="searchFormGroup">
<app-input
[label]="'parts.input.global-search.placeholder' | i18n"
[suffixIconHover]="true"
[displayClearButton]="true"
(suffixIconClick)="triggerPartSearch()"
[onEnterActive]="true"
[suffixIcon]="'search'"
class="parts-search-input"
formControlName="partSearch"
[parentFormGroup]="searchFormGroup"
[parentControlName]="'partSearch'"
suffixIconColor="primary"
></app-input>
</div>
<div class="app-bom-lifecycle-activator-container">
<app-bom-lifecycle-activator [view]=UserSettingView.PARTS
(buttonClickEvent)="handleTableActivationEvent($event)"></app-bom-lifecycle-activator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@
margin: 16px;
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);
}

.parts-search-input-wrapper{
padding:20px;
}

Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ import {SharedModule} from '@shared/shared.module';
import {screen, waitFor} from '@testing-library/angular';
import {renderComponent} from '@tests/test-render.utils';
import {PartsModule} from '../parts.module';
import {AssetAsBuiltFilter, AssetAsPlannedFilter, Part} from "@page/parts/model/parts.model";
import {AssetAsBuiltFilter, AssetAsPlannedFilter} from "@page/parts/model/parts.model";
import {TableHeaderSort} from "@shared/components/table/table.model";
import {PartDetailsFacade} from "@shared/modules/part-details/core/partDetails.facade";
import {toGlobalSearchAssetFilter} from "@shared/helper/filter-helper";

describe('Parts', () => {

Expand Down Expand Up @@ -192,10 +193,10 @@ describe('Parts', () => {
});


it('should set selectedPart in PartDetailsFacade correctly',async () => {
it('should set selectedPart in PartDetailsFacade correctly', async () => {
const {fixture} = await renderParts();
const {componentInstance} = fixture;
const sampleEvent: Record<string, unknown> = { id: 123, name: 'Sample Part' };
const sampleEvent: Record<string, unknown> = {id: 123, name: 'Sample Part'};

componentInstance.onSelectItem(sampleEvent);
const partDetailsFacade = (componentInstance as any)['partDetailsFacade'];
Expand All @@ -221,4 +222,46 @@ describe('Parts', () => {
expect(partsFacadeSpy).toHaveBeenCalledWith(page, pageSize, componentInstance['tableAsBuiltSortList']);
});

it('should clear filters and call partsFacade methods with search value', async () => {

const {fixture} = await renderParts();
const {componentInstance} = fixture;
// Arrange
const searchValue = 'searchTerm';

const partsFacade = (componentInstance as any)['partsFacade'];
const partsFacadeSpy = spyOn(partsFacade, 'setPartsAsBuilt');
const partsFacadeAsPlannedSpy = spyOn(partsFacade, 'setPartsAsPlanned');
componentInstance.searchControl.setValue(searchValue);


// Act
componentInstance.triggerPartSearch();

// Assert
expect(partsFacadeAsPlannedSpy).toHaveBeenCalledWith(0, 50, [], toGlobalSearchAssetFilter(searchValue, false), true);
expect(partsFacadeSpy).toHaveBeenCalledWith(0, 50, [], toGlobalSearchAssetFilter(searchValue, true), true);
});

it('should not filter if filter search is unset', async () => {

const {fixture} = await renderParts();
const {componentInstance} = fixture;
// Arrange
const searchValue = '';

const partsFacade = (componentInstance as any)['partsFacade'];
const partsFacadeSpy = spyOn(partsFacade, 'setPartsAsBuilt');
const partsFacadeAsPlannedSpy = spyOn(partsFacade, 'setPartsAsPlanned');
componentInstance.searchControl.setValue(searchValue);


// Act
componentInstance.triggerPartSearch();

// Assert
expect(partsFacadeAsPlannedSpy).toHaveBeenCalledWith();
expect(partsFacadeSpy).toHaveBeenCalledWith();
});

});
Loading

0 comments on commit 7e68efd

Please sign in to comment.