From 064c872f2f6dc78d8155bceb69620350ce7d26ec Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Fri, 17 Nov 2023 15:02:58 +0100 Subject: [PATCH 01/26] feature: TRACEFOSS-2726 split notifications in received and sent on domain level --- .../asbuilt/mapper/AssetAsBuiltResponseMapper.java | 6 ++++-- .../asplanned/mapper/AssetAsPlannedResponseMapper.java | 6 ++++-- .../traceability/assets/domain/base/model/AssetBase.java | 6 ++++-- .../infrastructure/asbuilt/model/AssetAsBuiltEntity.java | 7 +++++-- .../asplanned/model/AssetAsPlannedEntity.java | 8 ++++++-- .../main/java/assets/response/base/AssetBaseResponse.java | 8 ++++++-- 6 files changed, 29 insertions(+), 12 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltResponseMapper.java index ba2ab1a0cb..1e898bfdb4 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltResponseMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltResponseMapper.java @@ -54,8 +54,10 @@ public static AssetAsBuiltResponse from(final AssetBase asset) { .van(asset.getVan()) .semanticDataModel(from(asset.getSemanticDataModel())) .detailAspectModels(fromList(asset.getDetailAspectModels())) - .qualityAlertIdsInStatusActive(getNotificationIdsInActiveState(asset.getQualityAlerts())) - .qualityInvestigationIdsInStatusActive(getNotificationIdsInActiveState(asset.getQualityInvestigations())) + .sentQualityAlertIdsInStatusActive(getNotificationIdsInActiveState(asset.getSentQualityAlerts())) + .receivedQualityAlertIdsInStatusActive(getNotificationIdsInActiveState(asset.getReceivedQualityAlerts())) + .sentQualityInvestigationIdsInStatusActive(getNotificationIdsInActiveState(asset.getSentQualityInvestigations())) + .receivedQualityInvestigationIdsInStatusActive(getNotificationIdsInActiveState(asset.getReceivedQualityInvestigations())) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/mapper/AssetAsPlannedResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/mapper/AssetAsPlannedResponseMapper.java index f87420fbdc..50e872c1c1 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/mapper/AssetAsPlannedResponseMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asplanned/mapper/AssetAsPlannedResponseMapper.java @@ -54,8 +54,10 @@ public static AssetAsPlannedResponse from(final AssetBase asset) { .van(asset.getVan()) .semanticDataModel(from(asset.getSemanticDataModel())) .detailAspectModels(fromList(asset.getDetailAspectModels())) - .qualityAlertIdsInStatusActive(getNotificationIdsInActiveState(asset.getQualityAlerts())) - .qualityInvestigationIdsInStatusActive(getNotificationIdsInActiveState(asset.getQualityInvestigations())) + .sentQualityAlertIdsInStatusActive(getNotificationIdsInActiveState(asset.getSentQualityAlerts())) + .receivedQualityAlertIdsInStatusActive(getNotificationIdsInActiveState(asset.getReceivedQualityAlerts())) + .sentQualityInvestigationIdsInStatusActive(getNotificationIdsInActiveState(asset.getSentQualityInvestigations())) + .receivedQualityInvestigationIdsInStatusActive(getNotificationIdsInActiveState(asset.getReceivedQualityInvestigations())) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/AssetBase.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/AssetBase.java index f70d799b38..c955b6ea79 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/AssetBase.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/AssetBase.java @@ -55,6 +55,8 @@ public class AssetBase { private SemanticDataModel semanticDataModel; private String classification; private List detailAspectModels; - private List qualityAlerts; - private List qualityInvestigations; + private List sentQualityAlerts; + private List receivedQualityAlerts; + private List sentQualityInvestigations; + private List receivedQualityInvestigations; } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltEntity.java index 094607b922..bc25756d9b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/model/AssetAsBuiltEntity.java @@ -42,6 +42,7 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.SemanticDataModelEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import java.time.Instant; import java.util.ArrayList; @@ -143,8 +144,10 @@ public static AssetBase toDomain(AssetAsBuiltEntity entity) { .van(entity.getVan()) .classification(entity.getClassification()) .detailAspectModels(DetailAspectModel.from(entity)) - .qualityAlerts(emptyIfNull(entity.alerts).stream().map(AlertEntity::toDomain).toList()) - .qualityInvestigations(emptyIfNull(entity.investigations).stream().map(InvestigationEntity::toDomain).toList()) + .sentQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) + .receivedQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) + .sentQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) + .receivedQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/model/AssetAsPlannedEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/model/AssetAsPlannedEntity.java index bf5c927d5a..fdadaa1fb1 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/model/AssetAsPlannedEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/model/AssetAsPlannedEntity.java @@ -38,6 +38,7 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.SemanticDataModelEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import java.time.Instant; import java.util.ArrayList; @@ -130,8 +131,11 @@ public static AssetBase toDomain(AssetAsPlannedEntity entity) { .activeAlert(entity.isActiveAlert()) .qualityType(entity.getQualityType()) .detailAspectModels(DetailAspectModel.from(entity)) - .qualityAlerts(emptyIfNull(entity.alerts).stream().map(AlertEntity::toDomain).toList()) - .qualityInvestigations(emptyIfNull(entity.investigations).stream().map(InvestigationEntity::toDomain).toList()) + .sentQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) + .receivedQualityAlerts(emptyIfNull(entity.alerts).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(AlertEntity::toDomain).toList()) + .sentQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.SENDER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) + .receivedQualityInvestigations(emptyIfNull(entity.investigations).stream().filter(alert -> NotificationSideBaseEntity.RECEIVER.equals(alert.getSide())).map(InvestigationEntity::toDomain).toList()) + .build(); } diff --git a/tx-models/src/main/java/assets/response/base/AssetBaseResponse.java b/tx-models/src/main/java/assets/response/base/AssetBaseResponse.java index 7e6b1d5dc4..7c1f8b8821 100644 --- a/tx-models/src/main/java/assets/response/base/AssetBaseResponse.java +++ b/tx-models/src/main/java/assets/response/base/AssetBaseResponse.java @@ -76,7 +76,11 @@ public class AssetBaseResponse { private String classification; private List detailAspectModels; @ApiModelProperty(dataType = "List", example = "1") - private List qualityAlertIdsInStatusActive; + private List sentQualityAlertIdsInStatusActive; + @ApiModelProperty(dataType = "List", example = "1") + private List receivedQualityAlertIdsInStatusActive; + @ApiModelProperty(dataType = "List", example = "2") + private List sentQualityInvestigationIdsInStatusActive; @ApiModelProperty(dataType = "List", example = "2") - private List qualityInvestigationIdsInStatusActive; + private List receivedQualityInvestigationIdsInStatusActive; } From a6499aed136f7bebe981d056140aced583737831 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Fri, 17 Nov 2023 15:40:14 +0100 Subject: [PATCH 02/26] feature: TRACEFOSS-2726 split notifications in received and sent on domain level --- .../openapi/traceability-foss-backend.json | 1682 +++++++++-------- .../assets/AssetAsBuiltControllerByIdIT.java | 4 +- .../AssetAsPlannedControllerByIdIT.java | 5 +- 3 files changed, 909 insertions(+), 782 deletions(-) diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 7f7b8afe76..9f9259c456 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -41,20 +41,18 @@ "description" : "The endpoint returns a result of BPN EDC URL mappings.", "operationId" : "getBpnEdcs", "responses" : { - "200" : { - "description" : "Returns the paged result found", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -63,8 +61,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -93,8 +91,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -103,8 +101,8 @@ } } }, - "404" : { - "description" : "Not found.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -113,12 +111,14 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns the paged result found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } @@ -155,18 +155,20 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -175,20 +177,18 @@ } } }, - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -197,8 +197,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -207,8 +207,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -217,8 +217,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -227,8 +227,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -269,18 +269,20 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -289,20 +291,18 @@ } } }, - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -311,8 +311,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -321,8 +321,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -331,8 +331,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -341,8 +341,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -380,8 +380,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -390,8 +390,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -400,10 +400,14 @@ } } }, - "200" : { - "description" : "Returns the paged result found", + "400" : { + "description" : "Bad request.", "content" : { - "application/json" : {} + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } } }, "403" : { @@ -426,8 +430,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -436,8 +440,8 @@ } } }, - "404" : { - "description" : "Not found.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -446,14 +450,10 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns the paged result found", "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } + "application/json" : {} } } }, @@ -493,8 +493,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -503,8 +503,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -513,8 +513,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -523,8 +523,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -533,8 +533,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -543,8 +543,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -553,8 +553,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -603,8 +603,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -613,8 +613,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -623,8 +623,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -633,8 +633,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -643,18 +643,20 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns the paged result found for Asset", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -663,8 +665,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -673,14 +675,12 @@ } } }, - "200" : { - "description" : "Returns the paged result found for Asset", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -712,8 +712,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -722,8 +722,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -732,8 +732,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -742,8 +742,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -752,8 +752,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -762,8 +762,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -772,8 +772,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -832,8 +832,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -842,8 +842,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -852,18 +852,21 @@ } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { + "204" : { + "description" : "No content." + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { "schema" : { "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -872,11 +875,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -885,8 +885,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -895,8 +895,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -945,8 +945,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -955,8 +955,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -965,8 +965,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "204" : { + "description" : "No content." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -975,8 +978,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -985,11 +988,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -998,8 +998,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1008,8 +1008,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1048,8 +1048,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1058,8 +1058,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1068,8 +1068,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1078,8 +1078,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1088,8 +1088,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1098,8 +1098,11 @@ } } }, - "404" : { - "description" : "Not found.", + "204" : { + "description" : "No content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1108,8 +1111,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1117,9 +1120,6 @@ } } } - }, - "204" : { - "description" : "No content." } }, "security" : [ @@ -1151,8 +1151,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1161,8 +1161,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1171,8 +1171,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "204" : { + "description" : "No content." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1181,8 +1184,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1191,11 +1194,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1204,8 +1204,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1214,8 +1214,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1253,8 +1253,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1263,8 +1263,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1273,8 +1273,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1283,8 +1283,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1293,8 +1293,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1303,8 +1303,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1313,8 +1313,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1362,8 +1362,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1372,8 +1372,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1382,8 +1382,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1392,8 +1392,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1402,8 +1402,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1412,8 +1412,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1422,8 +1422,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1464,8 +1464,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1474,8 +1474,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1484,8 +1484,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1494,14 +1494,12 @@ } } }, - "200" : { - "description" : "Returns the paged result found for Asset", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -1516,18 +1514,20 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns the paged result found for Asset", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1536,8 +1536,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1575,8 +1575,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1585,8 +1585,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1595,8 +1595,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1605,8 +1605,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1615,8 +1615,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1625,8 +1625,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1635,8 +1635,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1677,20 +1677,18 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Returns the paged result found for Asset", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1699,8 +1697,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1729,8 +1727,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1739,8 +1737,8 @@ } } }, - "404" : { - "description" : "Not found.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1749,12 +1747,14 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns the paged result found for Asset", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } @@ -1796,8 +1796,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1806,8 +1806,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1816,8 +1816,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1826,8 +1826,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1836,8 +1836,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1846,8 +1846,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1856,8 +1856,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1904,8 +1904,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1914,8 +1914,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1924,8 +1924,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1934,8 +1934,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1944,8 +1944,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1954,8 +1954,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1964,8 +1964,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2024,8 +2024,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2034,8 +2034,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2044,8 +2044,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "204" : { + "description" : "No content." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2054,8 +2057,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2064,11 +2067,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2077,8 +2077,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2087,8 +2087,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2137,8 +2137,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2147,8 +2147,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2157,8 +2157,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "204" : { + "description" : "No content." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2167,8 +2170,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2177,11 +2180,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2190,8 +2190,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2200,8 +2200,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2240,8 +2240,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2250,8 +2250,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2260,8 +2260,11 @@ } } }, - "403" : { - "description" : "Forbidden.", + "204" : { + "description" : "No content." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2270,8 +2273,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2280,11 +2283,8 @@ } } }, - "204" : { - "description" : "No content." - }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2293,8 +2293,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2303,8 +2303,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2343,8 +2343,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2353,8 +2353,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2363,8 +2363,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2373,8 +2373,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2383,8 +2383,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2393,8 +2393,11 @@ } } }, - "404" : { - "description" : "Not found.", + "204" : { + "description" : "No content." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2403,8 +2406,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2412,9 +2415,6 @@ } } } - }, - "204" : { - "description" : "No content." } }, "security" : [ @@ -2445,8 +2445,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2455,8 +2455,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2465,8 +2465,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2475,8 +2475,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2485,8 +2485,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2495,8 +2495,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2505,8 +2505,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2628,14 +2628,28 @@ "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "qualityAlertIdsInStatusActive" : { + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "sentQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", "format" : "int64" } }, - "qualityInvestigationIdsInStatusActive" : { + "receivedQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", @@ -2685,8 +2699,8 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2695,8 +2709,38 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2818,14 +2862,28 @@ "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "qualityAlertIdsInStatusActive" : { + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "sentQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", "format" : "int64" } }, - "qualityInvestigationIdsInStatusActive" : { + "receivedQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", @@ -2838,38 +2896,8 @@ } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2878,8 +2906,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2917,8 +2945,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2927,8 +2955,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2937,8 +2965,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2947,8 +2975,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2957,8 +2985,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3080,14 +3108,28 @@ "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "qualityAlertIdsInStatusActive" : { + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "sentQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", "format" : "int64" } }, - "qualityInvestigationIdsInStatusActive" : { + "receivedQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", @@ -3100,8 +3142,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3110,8 +3152,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3157,6 +3199,16 @@ "required" : true }, "responses" : { + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -3270,14 +3322,28 @@ "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "qualityAlertIdsInStatusActive" : { + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "receivedQualityAlertIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", "format" : "int64" } }, - "qualityInvestigationIdsInStatusActive" : { + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", @@ -3290,8 +3356,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3300,8 +3366,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3330,18 +3396,8 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3350,8 +3406,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3379,8 +3435,8 @@ "description" : "The endpoint returns all shell descriptors.", "operationId" : "findAll", "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3389,8 +3445,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3399,8 +3455,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3409,8 +3465,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3419,8 +3475,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3442,8 +3498,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3452,8 +3508,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3480,8 +3536,8 @@ "description" : "The endpoint deletes all shell descriptors.", "operationId" : "deleteAll", "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3490,8 +3546,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3500,11 +3556,8 @@ } } }, - "204" : { - "description" : "Deleted." - }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3513,8 +3566,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3523,8 +3576,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "Deleted." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3533,8 +3589,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3543,8 +3599,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3572,8 +3628,8 @@ "description" : "The endpoint Triggers reload of shell descriptors.", "operationId" : "reload", "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3582,8 +3638,18 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3615,18 +3681,8 @@ "202" : { "description" : "Created registry reload job." }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3635,8 +3691,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3675,8 +3731,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3685,8 +3741,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3695,18 +3751,12 @@ } } }, - "200" : { - "description" : "OK.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : -2147483648, - "type" : "array", - "description" : "Investigations", - "items" : { - "$ref" : "#/components/schemas/InvestigationResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -3721,18 +3771,24 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : -2147483648, + "type" : "array", + "description" : "Investigations", + "items" : { + "$ref" : "#/components/schemas/InvestigationResponse" + } } } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3741,8 +3797,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3751,8 +3807,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3780,8 +3836,8 @@ "description" : "The endpoint can return limited data based on the user role", "operationId" : "dashboard", "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3790,8 +3846,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3800,8 +3856,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3810,12 +3866,12 @@ } } }, - "200" : { - "description" : "Returns dashboard data", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -3830,8 +3886,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3840,8 +3896,8 @@ } } }, - "404" : { - "description" : "Not found.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3850,12 +3906,12 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns dashboard data", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/DashboardResponse" } } } @@ -3897,8 +3953,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3907,8 +3963,28 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4034,14 +4110,28 @@ "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "qualityAlertIdsInStatusActive" : { + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "receivedQualityAlertIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", "format" : "int64" } }, - "qualityInvestigationIdsInStatusActive" : { + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", @@ -4055,16 +4145,6 @@ } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "401" : { "description" : "Authorization failed.", "content" : { @@ -4075,18 +4155,8 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4095,8 +4165,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4142,6 +4212,16 @@ } ], "responses" : { + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the asset by childId", "content" : { @@ -4255,14 +4335,28 @@ "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "qualityAlertIdsInStatusActive" : { + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "sentQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", "format" : "int64" } }, - "qualityInvestigationIdsInStatusActive" : { + "receivedQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", @@ -4275,8 +4369,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4285,8 +4379,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4315,18 +4409,8 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4335,8 +4419,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4389,23 +4473,29 @@ "schema" : { "type" : "string" } + }, + { + "name" : "owner", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" + } } ], "responses" : { - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4414,8 +4504,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4444,8 +4534,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4454,8 +4544,8 @@ } } }, - "404" : { - "description" : "Not found.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4464,12 +4554,14 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } @@ -4511,68 +4603,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4698,14 +4730,28 @@ "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "qualityAlertIdsInStatusActive" : { + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "sentQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", "format" : "int64" } }, - "qualityInvestigationIdsInStatusActive" : { + "receivedQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", @@ -4718,6 +4764,66 @@ } } } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -4756,8 +4862,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4766,8 +4872,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4776,8 +4882,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4786,8 +4892,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4796,8 +4902,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4806,8 +4912,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4816,8 +4922,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4939,14 +5045,28 @@ "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "qualityAlertIdsInStatusActive" : { + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" + } + }, + "sentQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", "format" : "int64" } }, - "qualityInvestigationIdsInStatusActive" : { + "receivedQualityInvestigationIdsInStatusActive" : { "type" : "array", "items" : { "type" : "integer", @@ -5003,23 +5123,29 @@ "schema" : { "type" : "string" } + }, + { + "name" : "owner", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" + } } ], "responses" : { - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5028,8 +5154,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5058,8 +5184,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5068,8 +5194,8 @@ } } }, - "404" : { - "description" : "Not found.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5078,12 +5204,14 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } @@ -5107,8 +5235,8 @@ "description" : "The endpoint returns a map for assets consumed by the map.", "operationId" : "assetsCountryMap", "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5117,8 +5245,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5127,16 +5255,12 @@ } } }, - "200" : { - "description" : "Returns the assets found", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int64" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -5151,18 +5275,22 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the assets found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int64" + } } } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5171,8 +5299,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5181,8 +5309,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5221,8 +5349,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5231,8 +5359,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5241,17 +5369,12 @@ } } }, - "200" : { - "description" : "OK.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Alerts", - "items" : { - "$ref" : "#/components/schemas/AlertResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -5266,18 +5389,23 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "type" : "array", + "description" : "Alerts", + "items" : { + "$ref" : "#/components/schemas/AlertResponse" + } } } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5286,8 +5414,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5296,8 +5424,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5325,8 +5453,8 @@ "description" : "Deletes all submodels from the system.", "operationId" : "deleteSubmodels", "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5335,8 +5463,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5345,8 +5473,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5355,8 +5483,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5365,8 +5493,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5375,8 +5503,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5385,8 +5513,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5427,8 +5555,8 @@ } ], "responses" : { - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5437,8 +5565,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5447,8 +5575,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5457,8 +5585,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5467,8 +5595,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5477,8 +5605,11 @@ } } }, - "404" : { - "description" : "Not found.", + "204" : { + "description" : "Deleted." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5487,8 +5618,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5496,9 +5627,6 @@ } } } - }, - "204" : { - "description" : "Deleted." } }, "security" : [ diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerByIdIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerByIdIT.java index d2788093ab..d126c6c675 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerByIdIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerByIdIT.java @@ -101,7 +101,7 @@ void givenAlertsForAsset_whenCallAssetById_thenReturnProperCount() throws JoseEx .log().all() .statusCode(200) .assertThat() - .body("qualityAlertIdsInStatusActive", hasSize(6)); + .body("receivedQualityAlertIdsInStatusActive", hasSize(6)); } @Test @@ -127,7 +127,7 @@ void givenInvestigationsForAsset_whenCallAssetById_thenReturnProperCount() throw .then() .statusCode(200) .assertThat() - .body("qualityInvestigationIdsInStatusActive", hasSize(6)); + .body("receivedQualityInvestigationIdsInStatusActive", hasSize(6)); } @Test diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsPlannedControllerByIdIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsPlannedControllerByIdIT.java index 9fb9bc8e15..00e53ece94 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsPlannedControllerByIdIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsPlannedControllerByIdIT.java @@ -49,7 +49,6 @@ import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.SENT; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.is; import static org.junit.jupiter.params.provider.Arguments.arguments; class AssetAsPlannedControllerByIdIT extends IntegrationTestSpecification { @@ -99,7 +98,7 @@ void givenAlertsForAsset_whenCallAssetById_thenReturnProperCount() throws JoseEx .log().all() .statusCode(200) .assertThat() - .body("qualityAlertIdsInStatusActive", hasSize(6)); + .body("receivedQualityAlertIdsInStatusActive", hasSize(6)); } @Test @@ -125,7 +124,7 @@ void givenInvestigationsForAsset_whenCallAssetById_thenReturnProperCount() throw .then() .statusCode(200) .assertThat() - .body("qualityInvestigationIdsInStatusActive", hasSize(6)); + .body("receivedQualityInvestigationIdsInStatusActive", hasSize(6)); } @Test From 70911b9b9a42b81db425a5662c182b28f8c65ef9 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Tue, 21 Nov 2023 07:34:54 +0100 Subject: [PATCH 03/26] chore: TRACEFOSS-2726 changing data model --- .../partsAsBuilt/partsAsBuilt.model.ts | 146 ++++--- .../partsAsBuilt/partsAsBuilt.test.model.ts | 30 +- .../modules/page/parts/model/parts.model.ts | 251 +++++------ .../parts-table/parts-table.component.ts | 399 +++++++++--------- 4 files changed, 434 insertions(+), 392 deletions(-) diff --git a/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.model.ts b/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.model.ts index 7c7a7af6a5..b650a9133c 100644 --- a/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.model.ts +++ b/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.model.ts @@ -31,8 +31,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-613963493493659233961306", "businessPartner": "BPNL00000003CML1", "manufacturerName": "BMW AG", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [ { @@ -64,8 +64,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e43842", @@ -73,8 +75,8 @@ export const mockBmwAssets = [ "semanticModelId": "12345678ABC", "businessPartner": "BPNL00000003CML1", "manufacturerName": "BMW AG", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [], "parentRelations": [], @@ -96,8 +98,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive:[], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:4a5e9ff6-2d5c-4510-a90e-d55af3ba502f", @@ -105,8 +109,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-246880451848384868750731", "businessPartner": "BPNL00000003CML1", "manufacturerName": "BMW AG", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [{ "id": "urn:uuid:c47b9f8b-48d0-4ef4-8f0b-e965a225cb8d", @@ -136,8 +140,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive:[], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa03", @@ -145,8 +151,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-341449848714937445621543", "businessPartner": "BPNL00000003CML1", "manufacturerName": "BMW AG", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [], "parentRelations": [ @@ -173,8 +179,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa01", @@ -182,8 +190,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-341449848714937445621543", "businessPartner": "BPNL00000003CML1", "manufacturerName": "BMW AG", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [], "parentRelations": [], @@ -205,8 +213,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccad12", @@ -214,8 +224,8 @@ export const mockBmwAssets = [ "semanticModelId": "OMAYSKEITUGNVHKKX", "businessPartner": "BPNL00000003CML1", "manufacturerName": "BMW AG", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [ { @@ -242,8 +252,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", @@ -251,8 +263,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-989134870198932317923938", "businessPartner": "BPNL00000003CNKC", "manufacturerName": "BMW AG", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [], "parentRelations": [], @@ -274,8 +286,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02", @@ -283,8 +297,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-341449848714937445621543", "businessPartner": "BPNL00000003CML1", "manufacturerName": "BMW AG", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [ { @@ -311,8 +325,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive:[], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fb01", @@ -320,8 +336,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-341449848714937445621543", "businessPartner": "BPNL00000003CNKC", "manufacturerName": "TEST_BPN_IRS_1", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [], "parentRelations": [], @@ -343,8 +359,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:6b2296cc-26c0-4f38-8a22-092338c36e22", @@ -352,8 +370,8 @@ export const mockBmwAssets = [ "semanticModelId": "OMAOYGBDTSRCMYSCX", "businessPartner": "BPNL00000003CML1", "manufacturerName": "MyAsBuiltPart", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [ { @@ -380,8 +398,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:c47b9f8b-48d0-4ef4-8f0b-e965a225cb8d", @@ -389,8 +409,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-477013846751358222215326", "businessPartner": "BPNL00000003CNKC", "manufacturerName": "TEST_BPN_IRS_1", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [], "parentRelations": [], @@ -412,8 +432,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd", @@ -421,8 +443,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-004314332935115065980115", "businessPartner": "BPNL00000003CNKC", "manufacturerName": "TEST_BPN_IRS_1", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [], "parentRelations": [], @@ -444,8 +466,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fb02", @@ -453,8 +477,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-341449848714937445621543", "businessPartner": "BPNL00000003CNKC", "manufacturerName": "TEST_BPN_IRS_1", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [], "parentRelations": [], @@ -476,8 +500,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive:[], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, { "id": "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd", @@ -485,8 +511,8 @@ export const mockBmwAssets = [ "semanticModelId": "NO-313869652971440618042264", "businessPartner": "BPNL00000003CNKC", "manufacturerName": "TEST_BPN_IRS_1", - nameAtManufacturer: "MyAsBuiltPartName", - manufacturerPartId: "ManuPartID", + "nameAtManufacturer": "MyAsBuiltPartName", + "manufacturerPartId": "ManuPartID", "owner": "OWN", "childRelations": [], "parentRelations": [], @@ -508,8 +534,10 @@ export const mockBmwAssets = [ } } ], - qualityAlertIdsInStatusActive:[], - qualityInvestigationIdsInStatusActive: [], + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }, ] as PartResponse[]; @@ -541,8 +569,10 @@ const MockEmptyPart: PartResponse = { qualityType: QualityType.Ok, van: null, semanticDataModel: SemanticDataModel.SERIALPART, - qualityAlertIdsInStatusActive: [], - qualityInvestigationIdsInStatusActive: [], + sentQualityAlertIdsInStatusActive: [], + receivedQualityAlertIdsInStatusActive: [], + sentQualityInvestigationIdsInStatusActive: [], + receivedQualityInvestigationIdsInStatusActive: [] }; diff --git a/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.test.model.ts b/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.test.model.ts index 08a9303ac9..315405622c 100644 --- a/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.test.model.ts +++ b/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.test.model.ts @@ -52,8 +52,10 @@ export const MOCK_part_5 = { } } ], - 'qualityAlertsInStatusActive': 0, - 'qualityInvestigationsInStatusActive': 0, + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }; export const MOCK_part_4 = { @@ -90,8 +92,10 @@ export const MOCK_part_4 = { } } ], - 'qualityAlertsInStatusActive': 0, - 'qualityInvestigationsInStatusActive': 0, + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }; export const MOCK_part_3 = { @@ -129,8 +133,10 @@ export const MOCK_part_3 = { } } ], - 'qualityAlertsInStatusActive': 0, - 'qualityInvestigationsInStatusActive': 0, + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }; export const MOCK_part_2 = { @@ -172,8 +178,10 @@ export const MOCK_part_2 = { } } ], - 'qualityAlertsInStatusActive': 0, - 'qualityInvestigationsInStatusActive': 0, + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }; export const MOCK_part_1 = { @@ -212,8 +220,10 @@ export const MOCK_part_1 = { } } ], - 'qualityAlertsInStatusActive': 0, - 'qualityInvestigationsInStatusActive': 0, + 'sentQualityAlertIdsInStatusActive': [], + 'receivedQualityAlertIdsInStatusActive': [], + 'sentQualityInvestigationIdsInStatusActive': [], + 'receivedQualityInvestigationIdsInStatusActive': [], }; export const mockAssets: PartsResponse = { diff --git a/frontend/src/app/modules/page/parts/model/parts.model.ts b/frontend/src/app/modules/page/parts/model/parts.model.ts index e9f775c89f..07d1f08f23 100644 --- a/frontend/src/app/modules/page/parts/model/parts.model.ts +++ b/frontend/src/app/modules/page/parts/model/parts.model.ts @@ -19,161 +19,162 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import type { PaginationResponse } from '@core/model/pagination.model'; -import { SemanticModel, TractionBatteryCode } 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, TractionBatteryCode} 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; - idShort: string; - name: string; - manufacturer: string; - manufacturerPartId: string; - nameAtManufacturer: string; - businessPartner: string; - semanticModel?: SemanticModel; - semanticModelId: string; - qualityType: QualityType; - children: string[]; - parents?: string[]; - error?: boolean; - activeInvestigation?: boolean; - activeAlert: boolean; - van: string; - semanticDataModel: SemanticDataModel; - classification: string; - - mainAspectType: MainAspectType; - - // aspectmodel props are temporarely hardcoded here because Tables and Views only accept root level prop array - // as built - partId?: string; - customerPartId?: string; - nameAtCustomer?: string; - manufacturingDate?: string; - manufacturingCountry?: string; - - productType?: string; - tractionBatteryCode?: string; - subcomponents: TractionBatteryCode[]; - - // as planned - validityPeriodFrom?: string; - validityPeriodTo?: string; - //partSiteInformationAsPlanned - catenaXSiteId: string; - psFunction: string; - functionValidFrom?: string; - functionValidUntil?: string; - - // count of notifications - activeAlerts: string []; - activeInvestigations: string []; + id: string; + idShort: string; + name: string; + manufacturer: string; + manufacturerPartId: string; + nameAtManufacturer: string; + businessPartner: string; + semanticModel?: SemanticModel; + semanticModelId: string; + qualityType: QualityType; + children: string[]; + parents?: string[]; + error?: boolean; + activeInvestigation?: boolean; + activeAlert: boolean; + van: string; + semanticDataModel: SemanticDataModel; + classification: string; + + mainAspectType: MainAspectType; + + // aspectmodel props are temporarely hardcoded here because Tables and Views only accept root level prop array + // as built + partId?: string; + customerPartId?: string; + nameAtCustomer?: string; + manufacturingDate?: string; + manufacturingCountry?: string; + + productType?: string; + tractionBatteryCode?: string; + subcomponents: TractionBatteryCode[]; + + // as planned + validityPeriodFrom?: string; + validityPeriodTo?: string; + //partSiteInformationAsPlanned + catenaXSiteId: string; + psFunction: string; + functionValidFrom?: string; + functionValidUntil?: string; + + // count of notifications + activeAlerts: string []; + activeInvestigations: string []; } export interface PartResponse { - id: string; - idShort: string; - semanticModelId: string; - manufacturerPartId: string; - businessPartner: string; - manufacturerName: string; - nameAtManufacturer: string; - owner: Owner; - childRelations: Relation[]; - parentRelations: Relation[]; - activeAlert: boolean; - underInvestigation: boolean; - qualityType: QualityType; - van: string; - semanticDataModel: SemanticDataModel; - classification: string; - detailAspectModels: DetailAspectModel[]; - - // TODO: Delete ? flag when AsPlanned Parts do not return the props anymore - qualityAlertIdsInStatusActive?: string[]; - qualityInvestigationIdsInStatusActive?: string[]; - + id: string; + idShort: string; + semanticModelId: string; + manufacturerPartId: string; + businessPartner: string; + manufacturerName: string; + nameAtManufacturer: string; + owner: Owner; + childRelations: Relation[]; + parentRelations: Relation[]; + activeAlert: boolean; + underInvestigation: boolean; + qualityType: QualityType; + van: string; + semanticDataModel: SemanticDataModel; + classification: string; + detailAspectModels: DetailAspectModel[]; + + // TODO: Delete ? flag when AsPlanned Parts do not return the props anymore + sentQualityAlertIdsInStatusActive: string[], + receivedQualityAlertIdsInStatusActive: string[], + sentQualityInvestigationIdsInStatusActive: string[], + receivedQualityInvestigationIdsInStatusActive: string[] } export type PartsResponse = PaginationResponse; // TODO: needs to be aligned with Severity in the future in terms of coding standards and use export enum QualityType { - Ok = 'Ok', - Minor = 'Minor', - Major = 'Major', - Critical = 'Critical', - LifeThreatening = 'LifeThreatening', + Ok = 'Ok', + Minor = 'Minor', + Major = 'Major', + Critical = 'Critical', + LifeThreatening = 'LifeThreatening', } export enum SemanticDataModel { - BATCH = 'BATCH', - SERIALPART = 'SERIALPART', - PARTASPLANNED = 'PARTASPLANNED', - JUSTINSEQUENCE = 'JUSTINSEQUENCE', - TRACTIONBATTERYCODE = 'TRACTIONBATTERYCODE', - UNKNOWN = 'UNKNOWN' + BATCH = 'BATCH', + SERIALPART = 'SERIALPART', + PARTASPLANNED = 'PARTASPLANNED', + JUSTINSEQUENCE = 'JUSTINSEQUENCE', + TRACTIONBATTERYCODE = 'TRACTIONBATTERYCODE', + UNKNOWN = 'UNKNOWN' } export enum SemanticDataModelInCamelCase { - BATCH = 'Batch', - SERIALPART = 'SerialPart', - PARTASPLANNED = 'PartAsPlanned', - JUSTINSEQUENCE = 'JustInSequence', - TRACTIONBATTERYCODE = 'TractionBatteryCode', - UNKNOWN = 'Unknown' + BATCH = 'Batch', + SERIALPART = 'SerialPart', + PARTASPLANNED = 'PartAsPlanned', + JUSTINSEQUENCE = 'JustInSequence', + TRACTIONBATTERYCODE = 'TractionBatteryCode', + UNKNOWN = 'Unknown' } export interface Relation { - id: string; - idShort: string; + id: string; + idShort: string; } export interface AssetAsBuiltFilter { - id?: string, - idShort?: string, - name?: string, - manufacturer?: string, - partId?: string, - manufacturerPartId?: string, - customerPartId?: string, - classification?: string, - nameAtCustomer?: string, - semanticModelId?: string, - semanticDataModel?: string[], - manufacturingDate?: string, - manufacturingCountry?: string + id?: string, + idShort?: string, + name?: string, + manufacturer?: string, + partId?: string, + manufacturerPartId?: string, + customerPartId?: string, + classification?: string, + nameAtCustomer?: string, + semanticModelId?: string, + semanticDataModel?: string[], + manufacturingDate?: string, + manufacturingCountry?: string } export interface AssetAsPlannedFilter { - id?: string, - idShort?: string, - name?: string, - manufacturer?: string, - manufacturerPartId?: string, - classification?: string, - semanticDataModel?: string[], - semanticModelId?: string, - validityPeriodFrom?: string, - validityPeriodTo?: string, - psFunction?: string, - catenaXSiteId?: string, - functionValidFrom?: string, - functionValidUntil?: string, + id?: string, + idShort?: string, + name?: string, + manufacturer?: string, + manufacturerPartId?: string, + classification?: string, + semanticDataModel?: string[], + semanticModelId?: string, + validityPeriodFrom?: string, + validityPeriodTo?: string, + psFunction?: string, + catenaXSiteId?: string, + functionValidFrom?: string, + functionValidUntil?: string, } export enum FilterOperator { - EQUAL = 'EQUAL', - AT_LOCAL_DATE = 'AT_LOCAL_DATE', - STARTS_WITH = 'STARTS_WITH', - BEFORE_LOCAL_DATE = 'BEFORE_LOCAL_DATE', - AFTER_LOCAL_DATE = 'AFTER_LOCAL_DATE', - NOTIFICATION_COUNT_EQUAL = 'NOTIFICATION_COUNT_EQUAL' + EQUAL = 'EQUAL', + AT_LOCAL_DATE = 'AT_LOCAL_DATE', + STARTS_WITH = 'STARTS_WITH', + BEFORE_LOCAL_DATE = 'BEFORE_LOCAL_DATE', + AFTER_LOCAL_DATE = 'AFTER_LOCAL_DATE', + NOTIFICATION_COUNT_EQUAL = 'NOTIFICATION_COUNT_EQUAL' } export function getFilterOperatorValue(operator: FilterOperator) { - return operator as string; + return operator as string; } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts index 4269889653..784eaa69e4 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts @@ -17,40 +17,42 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import { SelectionModel } from '@angular/cdk/collections'; -import { MenuStack } from '@angular/cdk/menu'; +import {SelectionModel} from '@angular/cdk/collections'; +import {MenuStack} from '@angular/cdk/menu'; import { - Component, - ElementRef, - EventEmitter, - Input, - OnInit, - Output, - QueryList, - ViewChild, - ViewChildren, + Component, + ElementRef, + EventEmitter, + Input, + OnInit, + Output, + QueryList, + ViewChild, + ViewChildren, } from '@angular/core'; -import { FormControl, FormGroup } from '@angular/forms'; -import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; -import { MatPaginator, PageEvent } from '@angular/material/paginator'; -import { MatSort, Sort } from '@angular/material/sort'; -import { MatTableDataSource } from '@angular/material/table'; -import { Pagination } from '@core/model/pagination.model'; -import { TableSettingsService } from '@core/user/table-settings.service'; -import { MainAspectType } from '@page/parts/model/mainAspectType.enum'; -import { SemanticDataModel } from '@page/parts/model/parts.model'; -import { MultiSelectAutocompleteComponent } from '@shared/components/multi-select-autocomplete/multi-select-autocomplete.component'; -import { TableViewConfig } from '@shared/components/parts-table/table-view-config.model'; -import { TableSettingsComponent } from '@shared/components/table-settings/table-settings.component'; +import {FormControl, FormGroup} from '@angular/forms'; +import {MatDialog, MatDialogConfig} from '@angular/material/dialog'; +import {MatPaginator, PageEvent} from '@angular/material/paginator'; +import {MatSort, Sort} from '@angular/material/sort'; +import {MatTableDataSource} from '@angular/material/table'; +import {Pagination} from '@core/model/pagination.model'; +import {TableSettingsService} from '@core/user/table-settings.service'; +import {MainAspectType} from '@page/parts/model/mainAspectType.enum'; +import {SemanticDataModel} from '@page/parts/model/parts.model'; import { - CreateHeaderFromColumns, - PartTableType, - TableConfig, - TableEventConfig, - TableHeaderSort, + MultiSelectAutocompleteComponent +} from '@shared/components/multi-select-autocomplete/multi-select-autocomplete.component'; +import {TableViewConfig} from '@shared/components/parts-table/table-view-config.model'; +import {TableSettingsComponent} from '@shared/components/table-settings/table-settings.component'; +import { + CreateHeaderFromColumns, + PartTableType, + TableConfig, + TableEventConfig, + TableHeaderSort, } from '@shared/components/table/table.model'; -import { isDateFilter } from '@shared/helper/filter-helper'; -import { addSelectedValues, removeSelectedValues } from '@shared/helper/table-helper'; +import {isDateFilter} from '@shared/helper/filter-helper'; +import {addSelectedValues, removeSelectedValues} from '@shared/helper/table-helper'; @Component({ @@ -121,7 +123,8 @@ export class PartsTableComponent implements OnInit { @Output() clickSelectAction = new EventEmitter(); @Output() filterActivated = new EventEmitter(); - constructor(private readonly tableSettingsService: TableSettingsService, private dialog: MatDialog) {} + constructor(private readonly tableSettingsService: TableSettingsService, private dialog: MatDialog) { + } public readonly dataSource = new MatTableDataSource(); @@ -142,7 +145,7 @@ export class PartsTableComponent implements OnInit { filterFormGroup = new FormGroup({}); - public isDateElement(key: string){ + public isDateElement(key: string) { return isDateFilter(key); } @@ -161,7 +164,7 @@ export class PartsTableComponent implements OnInit { 'filterSemanticDataModel', 'filterManufacturingDate', 'filterManufacturingCountry', - 'filterActiveAlerts', + 'filterActiveReceivedAlerts', 'filterActiveInvestigations', ]; @@ -198,7 +201,7 @@ export class PartsTableComponent implements OnInit { 'semanticDataModel', 'manufacturingDate', 'manufacturingCountry', - 'activeAlerts', + 'receivedAlerts', 'activeInvestigations', ]; @@ -219,7 +222,7 @@ export class PartsTableComponent implements OnInit { 'catenaXSiteId', 'functionValidFrom', 'functionValidUntil', - 'menu' + 'menu' ]; private readonly sortableColumnsAsBuilt: Record = { @@ -236,7 +239,7 @@ export class PartsTableComponent implements OnInit { semanticDataModel: true, manufacturingDate: true, manufacturingCountry: true, - activeAlerts: true, + receivedAlerts: true, activeInvestigations: true, }; @@ -284,7 +287,7 @@ export class PartsTableComponent implements OnInit { 'filterPartId', 'filterSemanticModelId', 'filterManufacturingDate', - 'filterActiveAlerts', + 'filterActiveReceivedAlerts', 'filterActiveInvestigations', ]; @@ -297,7 +300,7 @@ export class PartsTableComponent implements OnInit { 'filterPartId', 'filterSemanticModelId', 'filterManufacturingDate', - 'filterActiveAlerts', + 'filterActiveReceivedAlerts', 'filterActiveInvestigations', ]; @@ -308,7 +311,7 @@ export class PartsTableComponent implements OnInit { 'partId', 'semanticModelId', 'manufacturingDate', - 'activeAlerts', + 'receivedAlerts', 'activeInvestigations', ]; @@ -320,7 +323,7 @@ export class PartsTableComponent implements OnInit { partId: true, semanticModelId: true, manufacturingDate: true, - activeAlerts: true, + receivedAlerts: true, activeInvestigations: true, }; @@ -349,9 +352,9 @@ export class PartsTableComponent implements OnInit { 'partId', 'semanticModelId', 'manufacturingDate', - 'activeAlerts', + 'receivedAlerts', 'activeInvestigations', - 'menu' + 'menu' ]; private readonly sortableColumnsAsBuiltSupplier: Record = { @@ -361,7 +364,7 @@ export class PartsTableComponent implements OnInit { partId: true, semanticModelId: true, manufacturingDate: true, - activeAlerts: true, + receivedAlerts: true, activeInvestigations: true, }; @@ -372,7 +375,7 @@ export class PartsTableComponent implements OnInit { 'manufacturer', 'manufacturerPartId', 'semanticModelId', - 'menu' + 'menu' ]; private readonly sortableColumnsAsPlannedSupplier: Record = { @@ -387,156 +390,135 @@ export class PartsTableComponent implements OnInit { private sorting: TableHeaderSort; ngOnInit() { - this.initializeTableViewSettings(); - this.tableSettingsService.getEvent().subscribe(() => { + this.initializeTableViewSettings(); + this.tableSettingsService.getEvent().subscribe(() => { + this.setupTableViewSettings(); + }) this.setupTableViewSettings(); - }) - this.setupTableViewSettings(); this.filterFormGroup.valueChanges.subscribe((formValues) => { this.filterActivated.emit(formValues); }); } - private initializeTableViewSettings(): void { - switch (this.tableType) { - case PartTableType.AS_PLANNED_CUSTOMER: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsPlannedCustomer, - displayedColumnsForTable: this.displayedColumnsAsPlannedCustomerForTable, - filterConfiguration: this.assetAsPlannedCustomerFilterConfiguration, - filterFormGroup: this.assetAsPlannedCustomerFilterFormGroup, - sortableColumns: this.sortableColumnsAsPlannedCustomer - } - break; - case PartTableType.AS_PLANNED_OWN: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsPlanned, - displayedColumnsForTable: this.displayedColumnsAsPlannedForTable, - filterConfiguration: this.assetAsPlannedFilterConfiguration, - filterFormGroup: this.assetAsPlannedFilterFormGroup, - sortableColumns: this.sortableColumnsAsPlanned - } - break; - case PartTableType.AS_PLANNED_SUPPLIER: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsPlannedSupplier, - displayedColumnsForTable: this.displayedColumnsAsPlannedSupplierForTable, - filterConfiguration: this.assetAsPlannedSupplierFilterConfiguration, - filterFormGroup: this.assetAsPlannedSupplierFilterFormGroup, - sortableColumns: this.sortableColumnsAsPlannedSupplier - } - break; - case PartTableType.AS_BUILT_OWN: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsBuilt, - displayedColumnsForTable: this.displayedColumnsAsBuiltForTable, - filterConfiguration: this.assetAsBuiltFilterConfiguration, - filterFormGroup: this.assetAsBuiltFilterFormGroup, - sortableColumns: this.sortableColumnsAsBuilt - } - break; - case PartTableType.AS_BUILT_CUSTOMER: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsBuiltCustomer, - displayedColumnsForTable: this.displayedColumnsAsBuiltCustomerForTable, - filterConfiguration: this.assetAsBuiltCustomerFilterConfiguration, - filterFormGroup: this.assetAsBuiltCustomerFilterFormGroup, - sortableColumns: this.sortableColumnsAsBuiltCustomer + private initializeTableViewSettings(): void { + switch (this.tableType) { + case PartTableType.AS_PLANNED_CUSTOMER: + this.tableViewConfig = { + displayedColumns: this.displayedColumnsAsPlannedCustomer, + displayedColumnsForTable: this.displayedColumnsAsPlannedCustomerForTable, + filterConfiguration: this.assetAsPlannedCustomerFilterConfiguration, + filterFormGroup: this.assetAsPlannedCustomerFilterFormGroup, + sortableColumns: this.sortableColumnsAsPlannedCustomer + } + break; + case PartTableType.AS_PLANNED_OWN: + this.tableViewConfig = { + displayedColumns: this.displayedColumnsAsPlanned, + displayedColumnsForTable: this.displayedColumnsAsPlannedForTable, + filterConfiguration: this.assetAsPlannedFilterConfiguration, + filterFormGroup: this.assetAsPlannedFilterFormGroup, + sortableColumns: this.sortableColumnsAsPlanned + } + break; + case PartTableType.AS_PLANNED_SUPPLIER: + this.tableViewConfig = { + displayedColumns: this.displayedColumnsAsPlannedSupplier, + displayedColumnsForTable: this.displayedColumnsAsPlannedSupplierForTable, + filterConfiguration: this.assetAsPlannedSupplierFilterConfiguration, + filterFormGroup: this.assetAsPlannedSupplierFilterFormGroup, + sortableColumns: this.sortableColumnsAsPlannedSupplier + } + break; + case PartTableType.AS_BUILT_OWN: + this.tableViewConfig = { + displayedColumns: this.displayedColumnsAsBuilt, + displayedColumnsForTable: this.displayedColumnsAsBuiltForTable, + filterConfiguration: this.assetAsBuiltFilterConfiguration, + filterFormGroup: this.assetAsBuiltFilterFormGroup, + sortableColumns: this.sortableColumnsAsBuilt + } + break; + case PartTableType.AS_BUILT_CUSTOMER: + this.tableViewConfig = { + displayedColumns: this.displayedColumnsAsBuiltCustomer, + displayedColumnsForTable: this.displayedColumnsAsBuiltCustomerForTable, + filterConfiguration: this.assetAsBuiltCustomerFilterConfiguration, + filterFormGroup: this.assetAsBuiltCustomerFilterFormGroup, + sortableColumns: this.sortableColumnsAsBuiltCustomer + } + break; + case PartTableType.AS_BUILT_SUPPLIER: + this.tableViewConfig = { + displayedColumns: this.displayedColumnsAsBuiltSupplier, + displayedColumnsForTable: this.displayedColumnsAsBuiltSupplierForTable, + filterConfiguration: this.assetAsBuiltSupplierFilterConfiguration, + filterFormGroup: this.assetAsBuiltSupplierFilterFormGroup, + sortableColumns: this.sortableColumnsAsBuiltSupplier + } + break; } - break; - case PartTableType.AS_BUILT_SUPPLIER: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsBuiltSupplier, - displayedColumnsForTable: this.displayedColumnsAsBuiltSupplierForTable, - filterConfiguration: this.assetAsBuiltSupplierFilterConfiguration, - filterFormGroup: this.assetAsBuiltSupplierFilterFormGroup, - sortableColumns: this.sortableColumnsAsBuiltSupplier - } - break; } - } private setupTableViewSettings() { - const tableSettingsList = this.tableSettingsService.getStoredTableSettings(); - // check if there are table settings list - if(tableSettingsList) { - // if yes, check if there is a table-setting for this table type - if(tableSettingsList[this.tableType]) { - // if yes, get the effective displayedcolumns from the settings and set the tableconfig after it. - this.setupTableConfigurations(tableSettingsList[this.tableType].columnsForTable, tableSettingsList[this.tableType].filterColumnsForTable, this.tableViewConfig.sortableColumns, this.tableViewConfig.filterConfiguration, this.tableViewConfig.filterFormGroup); + const tableSettingsList = this.tableSettingsService.getStoredTableSettings(); + // check if there are table settings list + if (tableSettingsList) { + // if yes, check if there is a table-setting for this table type + if (tableSettingsList[this.tableType]) { + // if yes, get the effective displayedcolumns from the settings and set the tableconfig after it. + this.setupTableConfigurations(tableSettingsList[this.tableType].columnsForTable, tableSettingsList[this.tableType].filterColumnsForTable, this.tableViewConfig.sortableColumns, this.tableViewConfig.filterConfiguration, this.tableViewConfig.filterFormGroup); + } else { + // if no, create new a table setting for this.tabletype and put it into the list. Additionally, intitialize default table configuration + tableSettingsList[this.tableType] = { + columnsForDialog: this.tableViewConfig.displayedColumnsForTable, + columnSettingsOptions: this.getDefaultColumnVisibilityMap(), + columnsForTable: this.tableViewConfig.displayedColumnsForTable, + filterColumnsForTable: this.tableViewConfig.displayedColumns + }; + this.tableSettingsService.storeTableSettings(this.tableType, tableSettingsList); + this.setupTableConfigurations(this.tableViewConfig.displayedColumnsForTable, this.tableViewConfig.displayedColumns, this.tableViewConfig.sortableColumns, this.tableViewConfig.filterConfiguration, this.tableViewConfig.filterFormGroup); + } } else { - // if no, create new a table setting for this.tabletype and put it into the list. Additionally, intitialize default table configuration - tableSettingsList[this.tableType] = { - columnsForDialog: this.tableViewConfig.displayedColumnsForTable, - columnSettingsOptions: this.getDefaultColumnVisibilityMap(), - columnsForTable: this.tableViewConfig.displayedColumnsForTable, - filterColumnsForTable: this.tableViewConfig.displayedColumns - }; - this.tableSettingsService.storeTableSettings(this.tableType, tableSettingsList); - this.setupTableConfigurations(this.tableViewConfig.displayedColumnsForTable, this.tableViewConfig.displayedColumns, this.tableViewConfig.sortableColumns, this.tableViewConfig.filterConfiguration, this.tableViewConfig.filterFormGroup); - } - } else { - // if no, create new list and a settings entry for this.tabletype with default values and set correspondingly the tableconfig - const newTableSettingsList = { - [this.tableType]: { - columnsForDialog: this.tableViewConfig.displayedColumnsForTable, - columnSettingsOptions: this.getDefaultColumnVisibilityMap(), - columnsForTable: this.tableViewConfig.displayedColumnsForTable, - filterColumnsForTable: this.tableViewConfig.displayedColumns - } + // if no, create new list and a settings entry for this.tabletype with default values and set correspondingly the tableconfig + const newTableSettingsList = { + [this.tableType]: { + columnsForDialog: this.tableViewConfig.displayedColumnsForTable, + columnSettingsOptions: this.getDefaultColumnVisibilityMap(), + columnsForTable: this.tableViewConfig.displayedColumnsForTable, + filterColumnsForTable: this.tableViewConfig.displayedColumns + } + } + this.tableSettingsService.storeTableSettings(this.tableType, newTableSettingsList); + this.setupTableConfigurations(this.tableViewConfig.displayedColumnsForTable, this.tableViewConfig.displayedColumns, this.tableViewConfig.sortableColumns, this.tableViewConfig.filterConfiguration, this.tableViewConfig.filterFormGroup); } - this.tableSettingsService.storeTableSettings(this.tableType, newTableSettingsList); - this.setupTableConfigurations(this.tableViewConfig.displayedColumnsForTable, this.tableViewConfig.displayedColumns, this.tableViewConfig.sortableColumns, this.tableViewConfig.filterConfiguration, this.tableViewConfig.filterFormGroup); - } - } - - private getDefaultColumnVisibilityMap(): Map { - const initialColumnMap = new Map(); - for(const column of this.tableViewConfig.displayedColumnsForTable) { - initialColumnMap.set(column,true); - } - return initialColumnMap; } - - private setupTableConfigurations(displayedColumnsForTable: string[], displayedColumns: string[], sortableColumns: Record, filterConfiguration: any[], filterFormGroup: any): any { - const headerKey = 'table.column'; - this.tableConfig = { - displayedColumns: displayedColumnsForTable, - header: CreateHeaderFromColumns(displayedColumnsForTable, headerKey), - sortableColumns: sortableColumns, - }; - this.filterConfiguration = filterConfiguration; - this.displayedColumns = displayedColumns; - for (const controlName in filterFormGroup) { - if (filterFormGroup.hasOwnProperty(controlName)) { - this.filterFormGroup.addControl(controlName, filterFormGroup[controlName]); - } + private getDefaultColumnVisibilityMap(): Map { + const initialColumnMap = new Map(); + for (const column of this.tableViewConfig.displayedColumnsForTable) { + initialColumnMap.set(column, true); + } + return initialColumnMap; } - } + private setupTableConfigurations(displayedColumnsForTable: string[], displayedColumns: string[], sortableColumns: Record, filterConfiguration: any[], filterFormGroup: any): any { + const headerKey = 'table.column'; + this.tableConfig = { + displayedColumns: displayedColumnsForTable, + header: CreateHeaderFromColumns(displayedColumnsForTable, headerKey), + sortableColumns: sortableColumns, + }; + this.filterConfiguration = filterConfiguration; + this.displayedColumns = displayedColumns; + for (const controlName in filterFormGroup) { + if (filterFormGroup.hasOwnProperty(controlName)) { + this.filterFormGroup.addControl(controlName, filterFormGroup[controlName]); + } + } - semanticDataModelOptions = [ - { - display: 'Batch', - value: SemanticDataModel.BATCH, - }, { - display: 'JustInSequence', - value: SemanticDataModel.JUSTINSEQUENCE, - }, { - display: 'SerialPart', - value: SemanticDataModel.SERIALPART, - }, { - display: 'Unknown', - value: SemanticDataModel.UNKNOWN, - }, { - display: 'PartAsPlanned', - value: SemanticDataModel.PARTASPLANNED, - }, - ]; + } - // TODO: create a type for the filterconfig public readonly assetAsBuiltFilterConfiguration: any[] = [ {filterKey: 'Filter', headerKey: 'Filter'}, {filterKey: 'id', headerKey: 'filterId'}, @@ -552,7 +534,8 @@ export class PartsTableComponent implements OnInit { {filterKey: 'semanticDataModel', headerKey: 'filterSemanticDataModel'}, {filterKey: 'manufacturingDate', headerKey: 'filterManufacturingDate', isDate: true}, {filterKey: 'manufacturingCountry', headerKey: 'filterManufacturingCountry'}, - {filterKey: 'activeAlerts', headerKey: 'filterActiveAlerts', singleSearch: true}, + {filterKey: 'receivedAlerts', headerKey: 'filterActiveReceivedAlerts', singleSearch: true}, + {filterKey: 'sentAlerts', headerKey: 'filterActiveSentAlerts', singleSearch: true}, {filterKey: 'activeInvestigations', headerKey: 'filterActiveInvestigations', singleSearch: true}, ]; @@ -571,8 +554,10 @@ export class PartsTableComponent implements OnInit { semanticDataModel: new FormControl([]), manufacturingDate: new FormControl([]), manufacturingCountry: new FormControl([]), - activeAlerts: new FormControl([]), - activeInvestigations: new FormControl([]), + receivedAlerts: new FormControl([]), + sentAlerts: new FormControl([]), + receivedActiveInvestigations: new FormControl([]), + sentActiveInvestigations: new FormControl([]) }; assetAsPlannedFilterFormGroup = { @@ -600,7 +585,7 @@ export class PartsTableComponent implements OnInit { manufacturerName: new FormControl([]), manufacturerPartId: new FormControl([]), semanticModelId: new FormControl([]), - menu: new FormControl([]) + menu: new FormControl([]) }; assetAsPlannedCustomerFilterFormGroup = { @@ -620,9 +605,11 @@ export class PartsTableComponent implements OnInit { manufacturerPartId: new FormControl([]), semanticModelId: new FormControl([]), manufacturingDate: new FormControl([]), - activeAlerts: new FormControl([]), - activeInvestigations: new FormControl([]), - menu: new FormControl([]) + receivedAlerts: new FormControl([]), + sentAlerts: new FormControl([]), + receivedActiveInvestigations: new FormControl([]), + sentActiveInvestigations: new FormControl([]), + menu: new FormControl([]) }; assetAsBuiltCustomerFilterFormGroup = { @@ -632,8 +619,10 @@ export class PartsTableComponent implements OnInit { manufacturerPartId: new FormControl([]), semanticModelId: new FormControl([]), manufacturingDate: new FormControl([]), - activeAlerts: new FormControl([]), - activeInvestigations: new FormControl([]), + receivedAlerts: new FormControl([]), + sentAlerts: new FormControl([]), + receivedActiveInvestigations: new FormControl([]), + sentActiveInvestigations: new FormControl([]) }; private readonly assetAsPlannedCustomerFilterConfiguration: any[] = [ @@ -661,8 +650,14 @@ export class PartsTableComponent implements OnInit { {filterKey: 'manufacturerPartId', headerKey: 'filterPartId'}, {filterKey: 'semanticModelId', headerKey: 'filterSemanticModelId'}, {filterKey: 'manufacturingDate', headerKey: 'filterManufacturingDate', isDate: true}, - {filterKey: 'activeAlerts', headerKey: 'filterActiveAlerts', singleSearch: true}, - {filterKey: 'activeInvestigations', headerKey: 'filterActiveInvestigations', singleSearch: true}, + {filterKey: 'receivedAlerts', headerKey: 'filterActiveReceivedAlerts', singleSearch: true}, + {filterKey: 'sentAlerts', headerKey: 'filterActiveSentAlerts', singleSearch: true}, + { + filterKey: 'receivedActiveInvestigations', + headerKey: 'filterReceivedActiveInvestigations', + singleSearch: true + }, + {filterKey: 'sentActiveInvestigations', headerKey: 'filterSentActiveInvestigations', singleSearch: true} ]; @@ -674,8 +669,14 @@ export class PartsTableComponent implements OnInit { {filterKey: 'manufacturerPartId', headerKey: 'filterPartId'}, {filterKey: 'semanticModelId', headerKey: 'filterSemanticModelId'}, {filterKey: 'manufacturingDate', headerKey: 'filterManufacturingDate', isDate: true}, - {filterKey: 'activeAlerts', headerKey: 'filterActiveAlerts', singleSearch: true}, - {filterKey: 'activeInvestigations', headerKey: 'filterActiveInvestigations', singleSearch: true}, + {filterKey: 'receivedAlerts', headerKey: 'filterActiveReceivedAlerts', singleSearch: true}, + {filterKey: 'sentAlerts', headerKey: 'filterActiveSentAlerts', singleSearch: true}, + { + filterKey: 'receivedActiveInvestigations', + headerKey: 'filterReceivedActiveInvestigations', + singleSearch: true + }, + {filterKey: 'sentActiveInvestigations', headerKey: 'filterSentActiveInvestigations', singleSearch: true} ]; @@ -765,18 +766,18 @@ export class PartsTableComponent implements OnInit { } openDialog(): void { - const config = new MatDialogConfig(); - config.data = { - title: "table.tableSettings.title", - panelClass: "custom", - tableType: this.tableType, - defaultColumns: this.tableViewConfig.displayedColumnsForTable, - defaultFilterColumns: this.tableViewConfig.displayedColumns - }; - this.dialog.open(TableSettingsComponent, config ) + const config = new MatDialogConfig(); + config.data = { + title: "table.tableSettings.title", + panelClass: "custom", + tableType: this.tableType, + defaultColumns: this.tableViewConfig.displayedColumnsForTable, + defaultFilterColumns: this.tableViewConfig.displayedColumns + }; + this.dialog.open(TableSettingsComponent, config) } - protected readonly MenuStack = MenuStack; - protected readonly MainAspectType = MainAspectType; + protected readonly MenuStack = MenuStack; + protected readonly MainAspectType = MainAspectType; } From a57907b61c35639b9cdac2a8f92e202070377f4d Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 08:32:33 +0100 Subject: [PATCH 04/26] chore: TRACEFOSS-2726 refactored filter / table configurations. --- .../partsAsPlanned/partsAsPlanned.model.ts | 955 +++++++++--------- .../partsAsPlanned.test.model.ts | 22 +- .../modules/page/parts/model/parts.model.ts | 7 +- .../parts/presentation/parts.component.html | 2 +- .../shared/assembler/parts.assembler.ts | 459 ++++----- .../multi-select-autocomplete.component.ts | 4 - .../parts-as-built-configuration.model.ts | 67 ++ ...s-as-built-customer-configuration.model.ts | 63 ++ ...s-as-built-supplier-configuration.model.ts | 61 ++ .../parts-as-planned-configuration.model.ts | 62 ++ ...as-planned-customer-configuration.model.ts | 55 + ...as-planned-supplier-configuration.model.ts | 55 + .../parts-table/parts-table-config.utils.ts | 56 + .../parts-table/parts-table.component.html | 4 +- .../parts-table/parts-table.component.ts | 452 +-------- frontend/src/assets/locales/de/common.json | 8 +- frontend/src/assets/locales/en/common.json | 8 +- frontend/src/theme/base.scss | 6 + 18 files changed, 1226 insertions(+), 1120 deletions(-) create mode 100644 frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts create mode 100644 frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts create mode 100644 frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts create mode 100644 frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts create mode 100644 frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts create mode 100644 frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts create mode 100644 frontend/src/app/modules/shared/components/parts-table/parts-table-config.utils.ts diff --git a/frontend/src/app/mocks/services/parts-mock/partsAsPlanned/partsAsPlanned.model.ts b/frontend/src/app/mocks/services/parts-mock/partsAsPlanned/partsAsPlanned.model.ts index 37b3ecbc96..530acda114 100644 --- a/frontend/src/app/mocks/services/parts-mock/partsAsPlanned/partsAsPlanned.model.ts +++ b/frontend/src/app/mocks/services/parts-mock/partsAsPlanned/partsAsPlanned.model.ts @@ -19,499 +19,502 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import { DetailAspectType } from '@page/parts/model/detailAspectModel.model'; -import { Owner } from '@page/parts/model/owner.enum'; -import { PartResponse, QualityType, SemanticDataModel } from '@page/parts/model/parts.model'; -import { otherPartsAssets } from '../../otherParts-mock/otherParts.model'; +import {DetailAspectType} from '@page/parts/model/detailAspectModel.model'; +import {Owner} from '@page/parts/model/owner.enum'; +import {PartResponse, QualityType, SemanticDataModel} from '@page/parts/model/parts.model'; +import {otherPartsAssets} from '../../otherParts-mock/otherParts.model'; export const mockBmwAsPlannedAssets = [ - { - "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa01", - "idShort": "--", - "semanticModelId": "NO-341449848714937445621543", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [], - "parentRelations": [], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "--", - "semanticDataModel": "BATCH", - "classification": "component", - "detailAspectModels": [ - { - "type": "AS_PLANNED", - "data": { - validityPeriodFrom: "01.01.2020", - functionValidUntil: "01.02.2020" - } - }, - { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] - }, - { - "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa03", - "idShort": "--", - "semanticModelId": "NO-341449848714937445621543", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [], - "parentRelations": [ - { - "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fb02", - "idShort": null - } - ], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "--", - "semanticDataModel": "BATCH", - "classification": "component", - "detailAspectModels": [ - { - "type": "AS_PLANNED", - "data": { - validityPeriodFrom: "01.01.2020", - functionValidUntil: "01.02.2020" - } - }, - { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] - }, - { - "id": "urn:uuid:4a5e9ff6-2d5c-4510-a90e-d55af3ba502f", - "idShort": "--", - "semanticModelId": "NO-246880451848384868750731", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [], - "parentRelations": [ - { - "id": "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd", - "idShort": null - } - ], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "--", - "semanticDataModel": "SERIALPART", - "classification": "component", - "detailAspectModels": [ - { - "type": "AS_PLANNED", - "data": { - validityPeriodFrom: "01.01.2020", - functionValidUntil: "01.02.2020" - } - }, - { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] - }, - { - "id": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e43842", - "idShort": "--", - "semanticModelId": "12345678ABC", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [], - "parentRelations": [], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "--", - "semanticDataModel": "JUSTINSEQUENCE", - "classification": "product", - "detailAspectModels": [ - { - "type": "AS_PLANNED", - "data": { - validityPeriodFrom: "01.01.2023", - validityPeriodTo: "01.02.2023", - } - }, - { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] - }, - { - "id": "urn:uuid:6ec3f1db-2798-454b-a73f-0d21a8966c74", - "idShort": "--", - "semanticModelId": "NO-613963493493659233961306", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [{ - "id": "urn:uuid:c47b9f8b-48d0-4ef4-8f0b-e965a225cb8d", - "idShort": null - }], - "parentRelations": [ - { - "id": "urn:uuid:c47b9f8b-48d0-4ef4-8f0b-e965a225cb8d", - "idShort": null - } - ], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "--", - "semanticDataModel": "SERIALPART", - "classification": "component", - "detailAspectModels": [ - { - "type": "AS_PLANNED", - "data": { - "validityPeriodFrom": "01.01.2023", - "validityPeriodTo": "01.02.2023", - } - }, - { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] - }, - -{ - "id": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e43842", - "idShort": "--", - "semanticModelId": "12345678ABC", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [], - "parentRelations": [], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "--", - "semanticDataModel": "JUSTINSEQUENCE", - "classification": "product", - "detailAspectModels": [ { - "type": "AS_PLANNED", - "data": { - validityPeriodFrom: "01.01.2023", - validityPeriodTo: "01.02.2023", - } + "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa01", + "idShort": "--", + "semanticModelId": "NO-341449848714937445621543", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [], + "parentRelations": [], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "--", + "semanticDataModel": "BATCH", + "classification": "component", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + validityPeriodFrom: "01.01.2020", + functionValidUntil: "01.02.2020" + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] }, { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] -}, + "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa03", + "idShort": "--", + "semanticModelId": "NO-341449848714937445621543", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [], + "parentRelations": [ + { + "id": "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fb02", + "idShort": null + } + ], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "--", + "semanticDataModel": "BATCH", + "classification": "component", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + validityPeriodFrom: "01.01.2020", + functionValidUntil: "01.02.2020" + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] + }, + { + "id": "urn:uuid:4a5e9ff6-2d5c-4510-a90e-d55af3ba502f", + "idShort": "--", + "semanticModelId": "NO-246880451848384868750731", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [], + "parentRelations": [ + { + "id": "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd", + "idShort": null + } + ], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "--", + "semanticDataModel": "SERIALPART", + "classification": "component", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + validityPeriodFrom: "01.01.2020", + functionValidUntil: "01.02.2020" + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] + }, + { + "id": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e43842", + "idShort": "--", + "semanticModelId": "12345678ABC", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [], + "parentRelations": [], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "--", + "semanticDataModel": "JUSTINSEQUENCE", + "classification": "product", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + validityPeriodFrom: "01.01.2023", + validityPeriodTo: "01.02.2023", + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] + }, + { + "id": "urn:uuid:6ec3f1db-2798-454b-a73f-0d21a8966c74", + "idShort": "--", + "semanticModelId": "NO-613963493493659233961306", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [{ + "id": "urn:uuid:c47b9f8b-48d0-4ef4-8f0b-e965a225cb8d", + "idShort": null + }], + "parentRelations": [ + { + "id": "urn:uuid:c47b9f8b-48d0-4ef4-8f0b-e965a225cb8d", + "idShort": null + } + ], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "--", + "semanticDataModel": "SERIALPART", + "classification": "component", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + "validityPeriodFrom": "01.01.2023", + "validityPeriodTo": "01.02.2023", + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] + }, - { - "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccad12", - "idShort": "--", - "semanticModelId": "OMAYSKEITUGNVHKKX", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [ - { - "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", - "idShort": null - } - ], - "parentRelations": [], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "OMAYSKEITUGNVHKKX", - "semanticDataModel": "SERIALPART", - "classification": "product", - "detailAspectModels": [ - { - "type": "AS_PLANNED", - "data": { - validityPeriodFrom: "01.01.2023", - validityPeriodTo: "01.02.2023", - } - }, - { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] - }, + { + "id": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e43842", + "idShort": "--", + "semanticModelId": "12345678ABC", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [], + "parentRelations": [], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "--", + "semanticDataModel": "JUSTINSEQUENCE", + "classification": "product", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + validityPeriodFrom: "01.01.2023", + validityPeriodTo: "01.02.2023", + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] + }, - { - "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccvf54", - "idShort": "--", - "semanticModelId": "OMAYSKEITUGNVHKKX", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [ - { - "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", - "idShort": null - } - ], - "parentRelations": [], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "OMAYSKEITUGNVHKKX", - "semanticDataModel": "SERIALPART", - "classification": "product", - "detailAspectModels": [ - { - "type": "AS_PLANNED", - "data": { - validityPeriodFrom: "01.01.2023", - validityPeriodTo: "01.02.2023", - } - }, - { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] - }, - { - "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccaf88", - "idShort": "--", - "semanticModelId": "OMAYSKEITUGNVHKKX", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [ - { - "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", - "idShort": null - } - ], - "parentRelations": [], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "OMAYSKEITUGNVHKKX", - "semanticDataModel": "SERIALPART", - "classification": "product", - "detailAspectModels": [ - { - "type": "AS_PLANNED", - "data": { - validityPeriodFrom: "01.01.2023", - validityPeriodTo: "01.02.2023", - } - }, - { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] - }, - { - "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccav85", - "idShort": "myShortId", - "semanticModelId": "OMAYSKEITUGNVHKKX", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [ - { - "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", - "idShort": null - } - ], - "parentRelations": [], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "OMAYSKEITUGNVHKKX", - "semanticDataModel": "SERIALPART", - "classification": "product", - "detailAspectModels": [ - { - "type": "AS_PLANNED", - "data": { - validityPeriodFrom: "01.01.2023", - validityPeriodTo: "01.02.2023", - } - }, - { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] - }, - { - "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccag25", - "idShort": "--", - "semanticModelId": "OMAYSKEITUGNVHKKX", - "businessPartner": "BPNL00000003CML1", - "manufacturerName": "MyManufacturerName", - nameAtManufacturer: "MyAsPlannedPartName", - manufacturerPartId: "ManuPartID", - "owner": "OWN", - "childRelations": [ - { - "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", - "idShort": null - } - ], - "parentRelations": [], - "activeAlert": false, - "underInvestigation": false, - "qualityType": "Ok", - "van": "OMAYSKEITUGNVHKKX", - "semanticDataModel": "SERIALPART", - "classification": "product", - "detailAspectModels": [ - { - "type": "AS_PLANNED", - "data": { - validityPeriodFrom: "01.01.2023", - validityPeriodTo: "01.02.2023", - } - }, - { - "type": "PART_SITE_INFORMATION_AS_PLANNED", - "data": { - "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", - "function": "production", - "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", - "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - } - ] - }, + { + "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccad12", + "idShort": "--", + "semanticModelId": "OMAYSKEITUGNVHKKX", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [ + { + "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", + "idShort": null + } + ], + "parentRelations": [], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "OMAYSKEITUGNVHKKX", + "semanticDataModel": "SERIALPART", + "classification": "product", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + validityPeriodFrom: "01.01.2023", + validityPeriodTo: "01.02.2023", + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] + }, + + { + "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccvf54", + "idShort": "--", + "semanticModelId": "OMAYSKEITUGNVHKKX", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [ + { + "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", + "idShort": null + } + ], + "parentRelations": [], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "OMAYSKEITUGNVHKKX", + "semanticDataModel": "SERIALPART", + "classification": "product", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + validityPeriodFrom: "01.01.2023", + validityPeriodTo: "01.02.2023", + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] + }, + { + "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccaf88", + "idShort": "--", + "semanticModelId": "OMAYSKEITUGNVHKKX", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [ + { + "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", + "idShort": null + } + ], + "parentRelations": [], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "OMAYSKEITUGNVHKKX", + "semanticDataModel": "SERIALPART", + "classification": "product", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + validityPeriodFrom: "01.01.2023", + validityPeriodTo: "01.02.2023", + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] + }, + { + "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccav85", + "idShort": "myShortId", + "semanticModelId": "OMAYSKEITUGNVHKKX", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [ + { + "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", + "idShort": null + } + ], + "parentRelations": [], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "OMAYSKEITUGNVHKKX", + "semanticDataModel": "SERIALPART", + "classification": "product", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + validityPeriodFrom: "01.01.2023", + validityPeriodTo: "01.02.2023", + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] + }, + { + "id": "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccag25", + "idShort": "--", + "semanticModelId": "OMAYSKEITUGNVHKKX", + "businessPartner": "BPNL00000003CML1", + "manufacturerName": "MyManufacturerName", + nameAtManufacturer: "MyAsPlannedPartName", + manufacturerPartId: "ManuPartID", + "owner": "OWN", + "childRelations": [ + { + "id": "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", + "idShort": null + } + ], + "parentRelations": [], + "activeAlert": false, + "underInvestigation": false, + "qualityType": "Ok", + "van": "OMAYSKEITUGNVHKKX", + "semanticDataModel": "SERIALPART", + "classification": "product", + "detailAspectModels": [ + { + "type": "AS_PLANNED", + "data": { + validityPeriodFrom: "01.01.2023", + validityPeriodTo: "01.02.2023", + } + }, + { + "type": "PART_SITE_INFORMATION_AS_PLANNED", + "data": { + "functionValidUntil": "Sat Feb 08 03:30:48 GMT 2025", + "function": "production", + "functionValidFrom": "Wed Aug 21 00:10:36 GMT 2019", + "catenaXSiteId": "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + } + ] + }, ] as PartResponse[]; const MockEmptyPart: PartResponse = { - id: 'urn:uuid:a000a0aa-00a0-0000-000a-0a0000a0a000', - idShort: '--', - businessPartner: 'OEM A', - semanticModelId: "emptySematicModelId", - "manufacturerName": "MyDefaultManufacturerName", - nameAtManufacturer: "MyDefaultAsPlannedPartName", - manufacturerPartId: "ManuDefaultPartID", - classification: "B-Level", - detailAspectModels: [{ - type: DetailAspectType.AS_PLANNED, - data: { - validityPeriodFrom: "01.01.2023", - validityPeriodTo: "01.02.2023", - } + id: 'urn:uuid:a000a0aa-00a0-0000-000a-0a0000a0a000', + idShort: '--', + businessPartner: 'OEM A', + semanticModelId: "emptySematicModelId", + manufacturerName: "MyDefaultManufacturerName", + nameAtManufacturer: "MyDefaultAsPlannedPartName", + manufacturerPartId: "ManuDefaultPartID", + classification: "B-Level", + detailAspectModels: [{ + type: DetailAspectType.AS_PLANNED, + data: { + validityPeriodFrom: "01.01.2023", + validityPeriodTo: "01.02.2023", + } }, - { - type: DetailAspectType.PART_SITE_INFORMATION_AS_PLANNED, - data: { - functionValidUntil: "Sat Feb 08 03:30:48 GMT 2025", - function: "production", - functionValidFrom: "Wed Aug 21 00:10:36 GMT 2019", - catenaXSiteId: "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" - } - }] , - owner: Owner.OWN, - childRelations: [], - parentRelations: [], - activeAlert: false, - underInvestigation: false, - qualityType: QualityType.Ok, - van: null, - semanticDataModel: SemanticDataModel.PARTASPLANNED + { + type: DetailAspectType.PART_SITE_INFORMATION_AS_PLANNED, + data: { + functionValidUntil: "Sat Feb 08 03:30:48 GMT 2025", + function: "production", + functionValidFrom: "Wed Aug 21 00:10:36 GMT 2019", + catenaXSiteId: "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01" + } + }], + owner: Owner.OWN, + childRelations: [], + parentRelations: [], + activeAlert: false, + underInvestigation: false, + qualityType: QualityType.Ok, + van: null, + semanticDataModel: SemanticDataModel.PARTASPLANNED, + sentQualityAlertIdsInStatusActive: [], + receivedQualityAlertIdsInStatusActive: [], + sentQualityInvestigationIdsInStatusActive: [], + receivedQualityInvestigationIdsInStatusActive: [] }; - export const getAssetAsPlannedById = (id: string) => { - return [...mockBmwAsPlannedAssets, ...otherPartsAssets].find(asset => asset.id === id) || { ...MockEmptyPart, id }; + return [...mockBmwAsPlannedAssets, ...otherPartsAssets].find(asset => asset.id === id) || {...MockEmptyPart, id}; }; export const getRandomAsset = () => { - const parts = [...mockBmwAsPlannedAssets, ...otherPartsAssets]; - return parts[Math.floor(Math.random() * parts.length)]; + const parts = [...mockBmwAsPlannedAssets, ...otherPartsAssets]; + return parts[Math.floor(Math.random() * parts.length)]; }; diff --git a/frontend/src/app/mocks/services/parts-mock/partsAsPlanned/partsAsPlanned.test.model.ts b/frontend/src/app/mocks/services/parts-mock/partsAsPlanned/partsAsPlanned.test.model.ts index a0613ae5dc..7393dcb575 100644 --- a/frontend/src/app/mocks/services/parts-mock/partsAsPlanned/partsAsPlanned.test.model.ts +++ b/frontend/src/app/mocks/services/parts-mock/partsAsPlanned/partsAsPlanned.test.model.ts @@ -57,6 +57,10 @@ export const MOCK_part_5 = { qualityType: QualityType.LifeThreatening, van: 'myvan5', semanticDataModel: SemanticDataModel.SERIALPART, + sentQualityAlertIdsInStatusActive: [], + receivedQualityAlertIdsInStatusActive: [], + sentQualityInvestigationIdsInStatusActive: [], + receivedQualityInvestigationIdsInStatusActive: [] }; export const MOCK_part_4 = { @@ -93,6 +97,10 @@ export const MOCK_part_4 = { qualityType: QualityType.Critical, van: 'myvan4', semanticDataModel: SemanticDataModel.SERIALPART, + sentQualityAlertIdsInStatusActive: [], + receivedQualityAlertIdsInStatusActive: [], + sentQualityInvestigationIdsInStatusActive: [], + receivedQualityInvestigationIdsInStatusActive: [] }; export const MOCK_part_3 = { @@ -129,6 +137,10 @@ export const MOCK_part_3 = { qualityType: QualityType.Major, van: 'myvan3', semanticDataModel: SemanticDataModel.PARTASPLANNED, + sentQualityAlertIdsInStatusActive: [], + receivedQualityAlertIdsInStatusActive: [], + sentQualityInvestigationIdsInStatusActive: [], + receivedQualityInvestigationIdsInStatusActive: [] }; export const MOCK_part_2 = { @@ -165,6 +177,10 @@ export const MOCK_part_2 = { qualityType: QualityType.Minor, van: 'myvan2', semanticDataModel: SemanticDataModel.SERIALPART, + sentQualityAlertIdsInStatusActive: [], + receivedQualityAlertIdsInStatusActive: [], + sentQualityInvestigationIdsInStatusActive: [], + receivedQualityInvestigationIdsInStatusActive: [] }; export const MOCK_part_1 = { @@ -203,7 +219,11 @@ export const MOCK_part_1 = { underInvestigation: false, qualityType: QualityType.Ok, van: 'myvan1', - semanticDataModel: SemanticDataModel.SERIALPART + semanticDataModel: SemanticDataModel.SERIALPART, + sentQualityAlertIdsInStatusActive: [], + receivedQualityAlertIdsInStatusActive: [], + sentQualityInvestigationIdsInStatusActive: [], + receivedQualityInvestigationIdsInStatusActive: [] }; export const mockAssets: PartsResponse = { diff --git a/frontend/src/app/modules/page/parts/model/parts.model.ts b/frontend/src/app/modules/page/parts/model/parts.model.ts index 07d1f08f23..f5fa754fa3 100644 --- a/frontend/src/app/modules/page/parts/model/parts.model.ts +++ b/frontend/src/app/modules/page/parts/model/parts.model.ts @@ -69,8 +69,10 @@ export interface Part { functionValidUntil?: string; // count of notifications - activeAlerts: string []; - activeInvestigations: string []; + sentActiveAlerts: string []; + sentActiveInvestigations: string []; + receivedActiveAlerts: string []; + receivedActiveInvestigations: string []; } export interface PartResponse { @@ -91,7 +93,6 @@ export interface PartResponse { semanticDataModel: SemanticDataModel; classification: string; detailAspectModels: DetailAspectModel[]; - // TODO: Delete ? flag when AsPlanned Parts do not return the props anymore sentQualityAlertIdsInStatusActive: string[], receivedQualityAlertIdsInStatusActive: string[], diff --git a/frontend/src/app/modules/page/parts/presentation/parts.component.html b/frontend/src/app/modules/page/parts/presentation/parts.component.html index bceceb610d..77746c5d88 100644 --- a/frontend/src/app/modules/page/parts/presentation/parts.component.html +++ b/frontend/src/app/modules/page/parts/presentation/parts.component.html @@ -53,7 +53,7 @@ *viewContainer="partsAsBuilt$ | async; main: mainTmp; error: errorTmp; loading: loaderTmp"> - { - proplist = {...proplist, ...detailAspectModel.data}; - }) + public static createSemanticModelFromPartResponse(partResponse: PartResponse): SemanticModel { + let proplist = {}; + partResponse.detailAspectModels.forEach((detailAspectModel) => { + proplist = {...proplist, ...detailAspectModel.data}; + }) - return proplist; - } + return proplist; + } + + public static assemblePart(partResponse: PartResponse, mainAspectType: MainAspectType): Part { + if (!partResponse) { + return null; + } - public static assemblePart(partResponse: PartResponse, mainAspectType: MainAspectType): Part { - if (!partResponse) { - return null; + let createdSemanticModel = PartsAssembler.createSemanticModelFromPartResponse(partResponse); + + // Access the partId property + + const partId = (partResponse.detailAspectModels[0].data as AsBuiltAspectModel)?.partId; + const customerPartId = (partResponse.detailAspectModels[0].data as AsBuiltAspectModel)?.customerPartId; + const nameAtCustomer = (partResponse.detailAspectModels[0].data as AsBuiltAspectModel)?.nameAtCustomer; + const manufacturingDate = (partResponse.detailAspectModels[0].data as AsBuiltAspectModel)?.manufacturingDate; + const manufacturingCountry = (partResponse.detailAspectModels[0].data as AsBuiltAspectModel)?.manufacturingCountry; + + const validityPeriodFrom = (partResponse.detailAspectModels[0].data as AsPlannedAspectModel)?.validityPeriodFrom; + const validityPeriodTo = (partResponse.detailAspectModels[0].data as AsPlannedAspectModel)?.validityPeriodTo; + const catenaXSiteId = (partResponse.detailAspectModels[1]?.data as PartSiteInformationAsPlanned)?.catenaXSiteId; + const psFunction = (partResponse.detailAspectModels[1]?.data as PartSiteInformationAsPlanned)?.function; + const functionValidFrom = (partResponse.detailAspectModels[1]?.data as PartSiteInformationAsPlanned)?.functionValidFrom; + const functionValidUntil = (partResponse.detailAspectModels[1]?.data as PartSiteInformationAsPlanned)?.functionValidUntil; + + // traction battery code + const productType = (partResponse.detailAspectModels[1]?.data as TractionBatteryCode)?.productType; + const tractionBatteryCode = (partResponse.detailAspectModels[1]?.data as TractionBatteryCode)?.tractionBatteryCode; + const subcomponents = (partResponse.detailAspectModels[1]?.data as TractionBatteryCode)?.subcomponents; + + return { + id: partResponse.id, + idShort: partResponse.idShort, + semanticModelId: partResponse.semanticModelId, + manufacturer: partResponse.manufacturerName, + manufacturerPartId: partResponse.manufacturerPartId, + nameAtManufacturer: partResponse.nameAtManufacturer, + businessPartner: partResponse.businessPartner, + name: partResponse.nameAtManufacturer, + children: partResponse.childRelations.map(child => child.id) || [], + parents: partResponse.parentRelations?.map(parent => parent.id) || [], + activeAlert: partResponse.activeAlert || false, + activeInvestigation: partResponse.underInvestigation || false, + qualityType: partResponse.qualityType || QualityType.Ok, + van: partResponse.van || '--', + semanticDataModel: partResponse.semanticDataModel, + classification: partResponse.classification, + semanticModel: createdSemanticModel, + + mainAspectType: mainAspectType, + + // as built + partId: partId, // is partInstance, BatchId, jisNumber + customerPartId: customerPartId, + nameAtCustomer: nameAtCustomer, + manufacturingDate: manufacturingDate === "null" ? null : manufacturingDate, + manufacturingCountry: manufacturingCountry, + + // tractionBatteryCode + productType: productType, + tractionBatteryCode: tractionBatteryCode, + subcomponents: subcomponents, + + // as planned + validityPeriodFrom: validityPeriodFrom === "null" ? null : validityPeriodFrom, + validityPeriodTo: validityPeriodTo === "null" ? null : validityPeriodTo, + + //partSiteInformationAsPlanned + catenaXSiteId: catenaXSiteId, + psFunction: psFunction, + functionValidFrom: functionValidFrom === "null" ? null : functionValidFrom, + functionValidUntil: functionValidUntil === "null" ? null : functionValidUntil, + + // count of notifications + sentActiveAlerts: partResponse.sentQualityAlertIdsInStatusActive, + receivedActiveAlerts: partResponse.receivedQualityAlertIdsInStatusActive, + sentActiveInvestigations: partResponse.sentQualityInvestigationIdsInStatusActive, + receivedActiveInvestigations: partResponse.receivedQualityInvestigationIdsInStatusActive, + + + }; } - let createdSemanticModel = PartsAssembler.createSemanticModelFromPartResponse(partResponse); - - // Access the partId property - - const partId = (partResponse.detailAspectModels[0].data as AsBuiltAspectModel)?.partId; - const customerPartId = (partResponse.detailAspectModels[0].data as AsBuiltAspectModel)?.customerPartId; - const nameAtCustomer = (partResponse.detailAspectModels[0].data as AsBuiltAspectModel)?.nameAtCustomer; - const manufacturingDate = (partResponse.detailAspectModels[0].data as AsBuiltAspectModel)?.manufacturingDate; - const manufacturingCountry = (partResponse.detailAspectModels[0].data as AsBuiltAspectModel)?.manufacturingCountry; - - const validityPeriodFrom = (partResponse.detailAspectModels[0].data as AsPlannedAspectModel)?.validityPeriodFrom; - const validityPeriodTo = (partResponse.detailAspectModels[0].data as AsPlannedAspectModel)?.validityPeriodTo; - const catenaXSiteId = (partResponse.detailAspectModels[1]?.data as PartSiteInformationAsPlanned)?.catenaXSiteId; - const psFunction = (partResponse.detailAspectModels[1]?.data as PartSiteInformationAsPlanned)?.function; - const functionValidFrom = (partResponse.detailAspectModels[1]?.data as PartSiteInformationAsPlanned)?.functionValidFrom; - const functionValidUntil = (partResponse.detailAspectModels[1]?.data as PartSiteInformationAsPlanned)?.functionValidUntil; - - // traction battery code - const productType = (partResponse.detailAspectModels[1]?.data as TractionBatteryCode)?.productType; - const tractionBatteryCode = (partResponse.detailAspectModels[1]?.data as TractionBatteryCode)?.tractionBatteryCode; - const subcomponents = (partResponse.detailAspectModels[1]?.data as TractionBatteryCode)?.subcomponents; - - let mappedPart = { - id: partResponse.id, - idShort: partResponse.idShort, - semanticModelId: partResponse.semanticModelId, - manufacturer: partResponse.manufacturerName, - manufacturerPartId: partResponse.manufacturerPartId, - nameAtManufacturer: partResponse.nameAtManufacturer, - businessPartner: partResponse.businessPartner, - name: partResponse.nameAtManufacturer, - children: partResponse.childRelations.map(child => child.id) || [], - parents: partResponse.parentRelations?.map(parent => parent.id) || [], - activeAlert: partResponse.activeAlert || false, - activeInvestigation: partResponse.underInvestigation || false, - qualityType: partResponse.qualityType || QualityType.Ok, - van: partResponse.van || '--', - semanticDataModel: partResponse.semanticDataModel, - classification: partResponse.classification, - semanticModel: createdSemanticModel, - - mainAspectType: mainAspectType, - - // as built - partId: partId, // is partInstance, BatchId, jisNumber - customerPartId: customerPartId, - nameAtCustomer: nameAtCustomer, - manufacturingDate: manufacturingDate === "null" ? null : manufacturingDate , - manufacturingCountry: manufacturingCountry, - - // tractionBatteryCode - productType: productType, - tractionBatteryCode: tractionBatteryCode, - subcomponents: subcomponents, - - // as planned - validityPeriodFrom: validityPeriodFrom === "null" ? null : validityPeriodFrom, - validityPeriodTo: validityPeriodTo === "null" ? null : validityPeriodTo, - - //partSiteInformationAsPlanned - catenaXSiteId: catenaXSiteId, - psFunction: psFunction, - functionValidFrom: functionValidFrom=== "null" ? null : functionValidFrom, - functionValidUntil: functionValidUntil=== "null" ? null : functionValidUntil, - - // count of notifications - activeAlerts: partResponse.qualityAlertIdsInStatusActive, - activeInvestigations: partResponse.qualityInvestigationIdsInStatusActive, + public static assembleOtherPart(partResponse: PartResponse, mainAspectType: MainAspectType): Part { + if (!partResponse) { + return null; + } + return {...PartsAssembler.assemblePart(partResponse, mainAspectType), qualityType: partResponse.qualityType}; } - return mappedPart; - } - public static assembleOtherPart(partResponse: PartResponse, mainAspectType: MainAspectType): Part { - if (!partResponse) { - return null; + + public static assembleParts(parts: PaginationResponse, mainAspectType: MainAspectType): Pagination { + return PaginationAssembler.assemblePagination(PartsAssembler.assemblePart, parts, mainAspectType); } - return { ...PartsAssembler.assemblePart(partResponse, mainAspectType), qualityType: partResponse.qualityType }; - } + public static assemblePartList(parts: PartResponse[], mainAspectType: MainAspectType): Part[] { + const partCopy = [...parts]; + return partCopy.map(part => PartsAssembler.assemblePart(part, mainAspectType)); + } - public static assembleParts(parts: PaginationResponse, mainAspectType: MainAspectType): Pagination { - return PaginationAssembler.assemblePagination(PartsAssembler.assemblePart, parts, mainAspectType); - } + public static assembleOtherParts(parts: PaginationResponse, mainAspectType: MainAspectType): Pagination { + return PaginationAssembler.assemblePagination(PartsAssembler.assembleOtherPart, parts, mainAspectType); + } - public static assemblePartList(parts: PartResponse[], mainAspectType: MainAspectType): Part[] { - const partCopy = [...parts]; - return partCopy.map(part => PartsAssembler.assemblePart(part, mainAspectType)); - } + public static filterPartForView(viewData: View): View { + if (!viewData?.data) { + return viewData; + } - public static assembleOtherParts(parts: PaginationResponse, mainAspectType: MainAspectType): Pagination { - return PaginationAssembler.assemblePagination(PartsAssembler.assembleOtherPart, parts, mainAspectType); - } + const { + name, + semanticDataModel, + semanticModelId, + manufacturingDate, + manufacturingCountry, + classification, + + } = viewData.data; + return { + data: { + name, + semanticDataModel, + semanticModelId, + manufacturingDate, + manufacturingCountry, + classification, + + + } as Part + }; + } - public static filterPartForView(viewData: View): View { - if (!viewData?.data) { - return viewData; + public static mapPartForView(): OperatorFunction, View> { + return map(PartsAssembler.filterPartForView); } - const { - name, - semanticDataModel, - semanticModelId, - manufacturingDate, - manufacturingCountry, - classification , - - } = viewData.data; - return { data: { - name, - semanticDataModel, - semanticModelId, - manufacturingDate, - manufacturingCountry, - classification , - - - } as Part }; - } - - public static mapPartForView(): OperatorFunction, View> { - return map(PartsAssembler.filterPartForView); - } - - public static mapPartForManufacturerView(): OperatorFunction, View> { - return map(viewData => { - if (!viewData.data) { - return viewData; - } - - // exclude 'van' if is a partAsPlanned - if(viewData.data?.mainAspectType === MainAspectType.AS_BUILT) { - const { - manufacturer, - manufacturerPartId, - nameAtManufacturer, - van, - } = viewData.data; - return { data: { manufacturer, manufacturerPartId, nameAtManufacturer, van } as Part }; - } else { - const { - manufacturer, - manufacturerPartId, - nameAtManufacturer, - } = viewData.data; - return { data: { manufacturer, manufacturerPartId, nameAtManufacturer } as Part }; - } - }); - } - - public static mapPartForCustomerOrPartSiteView(): OperatorFunction, View> { - return map(viewData => { - if (!viewData.data) { - return; - } - // if no customer data is available then return partSiteInformation - if(!viewData.data?.nameAtCustomer && !viewData.data?.customerPartId && viewData.data?.functionValidFrom) { - const { catenaXSiteId, psFunction, functionValidFrom, functionValidUntil } = viewData.data; - return { data: { catenaXSiteId, psFunction, functionValidFrom, functionValidUntil } as Part }; - } - - const { nameAtCustomer, customerPartId } = viewData.data; - return { data: { nameAtCustomer, customerPartId } as Part }; - }); - } - - public static mapPartForTractionBatteryCodeDetailsView(): OperatorFunction, View> { - return map(viewData => { - if (!viewData?.data?.tractionBatteryCode) { - return; - } - - const { productType, tractionBatteryCode } = viewData.data; - return { data: { productType, tractionBatteryCode } as Part }; - }); - } - - public static mapPartForTractionBatteryCodeSubComponentsView(): OperatorFunction, View> { - return map(viewData => { - if (!viewData?.data?.tractionBatteryCode || !viewData?.data?.subcomponents?.length) { - return; - } - - const { productType, tractionBatteryCode, subcomponents } = viewData.data; - return { data: { productType, tractionBatteryCode, subcomponents } as Part }; - }); - } - - public static mapSortToApiSort(sorting: TableHeaderSort): string { - if (!sorting) { - return ''; + public static mapPartForManufacturerView(): OperatorFunction, View> { + return map(viewData => { + if (!viewData.data) { + return viewData; + } + + // exclude 'van' if is a partAsPlanned + if (viewData.data?.mainAspectType === MainAspectType.AS_BUILT) { + const { + manufacturer, + manufacturerPartId, + nameAtManufacturer, + van, + } = viewData.data; + return {data: {manufacturer, manufacturerPartId, nameAtManufacturer, van} as Part}; + } else { + const { + manufacturer, + manufacturerPartId, + nameAtManufacturer, + } = viewData.data; + return {data: {manufacturer, manufacturerPartId, nameAtManufacturer} as Part}; + } + }); } + public static mapPartForCustomerOrPartSiteView(): OperatorFunction, View> { + return map(viewData => { + if (!viewData.data) { + return; + } + // if no customer data is available then return partSiteInformation + if (!viewData.data?.nameAtCustomer && !viewData.data?.customerPartId && viewData.data?.functionValidFrom) { + const {catenaXSiteId, psFunction, functionValidFrom, functionValidUntil} = viewData.data; + return {data: {catenaXSiteId, psFunction, functionValidFrom, functionValidUntil} as Part}; + } + + const {nameAtCustomer, customerPartId} = viewData.data; + return {data: {nameAtCustomer, customerPartId} as Part}; + }); + } + + public static mapPartForTractionBatteryCodeDetailsView(): OperatorFunction, View> { + return map(viewData => { + if (!viewData?.data?.tractionBatteryCode) { + return; + } + + const {productType, tractionBatteryCode} = viewData.data; + return {data: {productType, tractionBatteryCode} as Part}; + }); + } + + public static mapPartForTractionBatteryCodeSubComponentsView(): OperatorFunction, View> { + return map(viewData => { + if (!viewData?.data?.tractionBatteryCode || !viewData?.data?.subcomponents?.length) { + return; + } + const {productType, tractionBatteryCode, subcomponents} = viewData.data; + return {data: {productType, tractionBatteryCode, subcomponents} as Part}; + }); + } + + public static mapSortToApiSort(sorting: TableHeaderSort): string { + if (!sorting) { + return ''; + } - const localToApiMapping = new Map([ - ['id', 'id'], - ['idShort', 'idShort'], - ['semanticModelId', 'semanticModelId'], - ['manufacturer', 'manufacturerName'], - ['manufacturerPartId', 'manufacturerPartId'], - ['partId', "manufacturerPartId"], - ['nameAtManufacturer', 'nameAtManufacturer'], - ['businessPartner', 'businessPartner'], - ['name', 'nameAtManufacturer'], - ['qualityType', 'qualityType'], - ['van', 'van'], - ['semanticDataModel', 'semanticDataModel'], - ['classification', 'classification'], - ['customerPartId', 'customerPartId'], - ['nameAtCustomer', 'nameAtCustomer'], - ['manufacturingDate', 'manufacturingDate'], - ['manufacturingCountry', 'manufacturingCountry'], - ['validityPeriodFrom', 'validityPeriodFrom'], - ['validityPeriodTo', 'validityPeriodTo'], - ['catenaXSiteId', 'catenaXSiteId'], - ['psFunction', 'function'], - ['functionValidFrom', 'functionValidFrom'], - ['functionValidUntil', 'functionValidUntil'], - [ 'activeAlerts', 'qualityAlertIdsInStatusActive' ], - [ 'activeInvestigations', 'qualityInvestigationIdsInStatusActive' ], - - ]); - - - - return `${localToApiMapping.get(sorting[0]) || sorting},${sorting[1]}`; - } + + const localToApiMapping = new Map([ + ['id', 'id'], + ['idShort', 'idShort'], + ['semanticModelId', 'semanticModelId'], + ['manufacturer', 'manufacturerName'], + ['manufacturerPartId', 'manufacturerPartId'], + ['partId', "manufacturerPartId"], + ['nameAtManufacturer', 'nameAtManufacturer'], + ['businessPartner', 'businessPartner'], + ['name', 'nameAtManufacturer'], + ['qualityType', 'qualityType'], + ['van', 'van'], + ['semanticDataModel', 'semanticDataModel'], + ['classification', 'classification'], + ['customerPartId', 'customerPartId'], + ['nameAtCustomer', 'nameAtCustomer'], + ['manufacturingDate', 'manufacturingDate'], + ['manufacturingCountry', 'manufacturingCountry'], + ['validityPeriodFrom', 'validityPeriodFrom'], + ['validityPeriodTo', 'validityPeriodTo'], + ['catenaXSiteId', 'catenaXSiteId'], + ['psFunction', 'function'], + ['functionValidFrom', 'functionValidFrom'], + ['functionValidUntil', 'functionValidUntil'], + ['sentActiveAlerts', 'sentQualityAlertIdsInStatusActive'], + ['receivedActiveAlerts', 'receivedQualityAlertIdsInStatusActive'], + ['sentActiveInvestigations', 'receivedQualityAlertIdsInStatusActive'], + ['receivedActiveInvestigations', 'receivedQualityAlertIdsInStatusActive'] + ]); + + return `${localToApiMapping.get(sorting[0]) || sorting},${sorting[1]}`; + } } diff --git a/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts b/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts index afe296d52c..eb4313f940 100644 --- a/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts +++ b/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts @@ -239,10 +239,6 @@ export class MultiSelectAutocompleteComponent implements OnChanges { } - isUnsupportedAutoCompleteField(fieldName: string) { - return fieldName === 'activeAlerts' || fieldName === 'activeInvestigations'; - } - hideOption(option: any): boolean { return !(this.filteredOptions.indexOf(option) > -1); } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts new file mode 100644 index 0000000000..69547af7fa --- /dev/null +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts @@ -0,0 +1,67 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +import {FormControl} from "@angular/forms"; +import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; +import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; + +export class PartsAsBuiltConfigurationModel { + public static filterConfiguration(): TableViewConfig { + + return { + displayedColumns: this.filterColumns, + displayedColumnsForTable: this.displayedColumns, + filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterFormGroup: this.formGroup, + sortableColumns: this.sortableColumns + } + } + + private static sortableColumns: Record = { + select: false, + id: true, + idShort: true, + name: true, + manufacturer: true, + partId: true, + manufacturerPartId: true, + customerPartId: true, + classification: true, + nameAtCustomer: true, + semanticModelId: true, + semanticDataModel: true, + manufacturingDate: true, + manufacturingCountry: true, + receivedActiveAlerts: true, + receivedActiveInvestigations: true, + sentActiveAlerts: true, + sentActiveInvestigations: true, + menu: false + }; + + private static displayedColumns = Object.keys(this.sortableColumns); + + private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); + + private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); + private static dateFields = ['manufacturingDate']; + private static singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; + private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns, this.dateFields, this.singleSearchFields); + +} + diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts new file mode 100644 index 0000000000..f1dc8d372b --- /dev/null +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts @@ -0,0 +1,63 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +import {FormControl} from "@angular/forms"; +import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; +import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; + +export class PartsAsBuiltCustomerConfigurationModel{ + + public static filterConfiguration(): TableViewConfig { + + return { + displayedColumns: this.filterColumns, + displayedColumnsForTable: this.displayedColumns, + filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterFormGroup: this.formGroup, + sortableColumns: this.sortableColumns + } + } + + private static sortableColumns: Record = { + select: false, + semanticDataModel: true, + nameAtManufacturer: true, + manufacturerName: true, + manufacturerPartId: true, + semanticModelId: true, + manufacturingDate: true, + receivedActiveAlerts: true, + receivedActiveInvestigations: true, + sentActiveAlerts: true, + sentActiveInvestigations: true, + menu: false + }; + + private static displayedColumns = Object.keys(this.sortableColumns); + + private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); + + private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns, true); + + private static dateFields = ['manufacturingDate']; + private static singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; + private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns, this.dateFields, this.singleSearchFields); + + +} + diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts new file mode 100644 index 0000000000..00dfc3d4c8 --- /dev/null +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts @@ -0,0 +1,61 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +import {FormControl} from "@angular/forms"; +import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; +import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; + +export class PartsAsBuiltSupplierConfigurationModel { + + public static filterConfiguration(): TableViewConfig { + + return { + displayedColumns: this.filterColumns, + displayedColumnsForTable: this.displayedColumns, + filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterFormGroup: this.formGroup, + sortableColumns: this.sortableColumns + } + } + + private static sortableColumns: Record = { + select: false, + semanticDataModel: true, + nameAtManufacturer: true, + manufacturerName: true, + manufacturerPartId: true, + semanticModelId: true, + manufacturingDate: true, + receivedActiveAlerts: true, + receivedActiveInvestigations: true, + sentActiveAlerts: true, + sentActiveInvestigations: true, + menu: false + }; + private static displayedColumns = Object.keys(this.sortableColumns); + + private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); + + private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); + + private static dateFields = ['manufacturingDate']; + private static singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; + private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns, this.dateFields, this.singleSearchFields); + +} + diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts new file mode 100644 index 0000000000..d651b47983 --- /dev/null +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts @@ -0,0 +1,62 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +import {FormControl} from "@angular/forms"; +import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; +import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; + +export class PartsAsPlannedConfigurationModel { + + public static filterConfiguration(): TableViewConfig { + + return { + displayedColumns: this.filterColumns, + displayedColumnsForTable: this.displayedColumns, + filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterFormGroup: this.formGroup, + sortableColumns: this.sortableColumns + } + } + + private static sortableColumns: Record = { + select: false, + id: true, + idShort: true, + name: true, + manufacturer: true, + manufacturerPartId: true, + classification: true, + semanticDataModel: true, + semanticModelId: true, + validityPeriodFrom: true, + validityPeriodTo: true, + function: true, + catenaXSiteId: true, + functionValidFrom: true, + functionValidUntil: true, + menu: false + }; + + private static displayedColumns = Object.keys(this.sortableColumns); + private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); + private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); + private static dateFields = ['validityPeriodFrom', 'validityPeriodTo', 'functionValidFrom', 'functionValidUntil']; + private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns, this.dateFields); + +} + diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts new file mode 100644 index 0000000000..0629558b37 --- /dev/null +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts @@ -0,0 +1,55 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +import {FormControl} from "@angular/forms"; +import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; +import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; + +export class PartsAsPlannedCustomerConfigurationModel { + + public static filterConfiguration(): TableViewConfig { + + return { + displayedColumns: this.filterColumns, + displayedColumnsForTable: this.displayedColumns, + filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterFormGroup: this.formGroup, + sortableColumns: this.sortableColumns + } + } + + private static sortableColumns: Record = { + select: false, + semanticDataModel: true, + nameAtManufacturer: true, + manufacturer: true, + manufacturerPartId: true, + semanticModelId: true, + menu: false + }; + + private static displayedColumns = Object.keys(this.sortableColumns); + + private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); + + private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns, true); + private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns); + + +} + diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts new file mode 100644 index 0000000000..41c50e3a48 --- /dev/null +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts @@ -0,0 +1,55 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +import {FormControl} from "@angular/forms"; +import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; +import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; + +export class PartsAsPlannedSupplierConfigurationModel { + + public static filterConfiguration(): TableViewConfig { + + return { + displayedColumns: this.filterColumns, + displayedColumnsForTable: this.displayedColumns, + filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterFormGroup: this.formGroup, + sortableColumns: this.sortableColumns + } + } + + private static sortableColumns: Record = { + select: false, + semanticDataModel: true, + nameAtManufacturer: true, + manufacturerName: true, + manufacturerPartId: true, + semanticModelId: true, + menu: false + }; + + private static displayedColumns = Object.keys(this.sortableColumns); + + private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); + + private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); + private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns); + + +} + diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table-config.utils.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table-config.utils.ts new file mode 100644 index 0000000000..87db66aef6 --- /dev/null +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table-config.utils.ts @@ -0,0 +1,56 @@ +import {FormControl} from "@angular/forms"; + +export class PartsTableConfigUtils { + + public static createFormGroup(displayedColumns: any): Record { + const formGroup: Record = {}; + + for (const column of displayedColumns) { + if (column !== 'select' && column !== 'menu') { + formGroup[column] = new FormControl([]); + } + + } + return formGroup; + } + + public static createFilterColumns(displayedColumns: string[], noSelect?: boolean): string[] { + const array = displayedColumns.filter((column: string) => 'select' !== column && 'menu' !== column).map((column: string) => 'filter' + column); + + if (noSelect) { + return array; + } else { + return ["Filter", ...array]; + } + + } + + public static generateFilterColumnsMapping(sortableColumns: any, dateFields?: string[], singleSearchFields?: string[]): any[] { + const filterColumnsMapping: any[] = []; + const firstElement = {filterKey: 'Filter', headerKey: 'Filter'}; + + const excludedFields = ['select', 'menu']; + for (const key in sortableColumns) { + if (sortableColumns.hasOwnProperty(key) && !excludedFields.includes(key)) { + // This key goes to the backend rest api + const filterKey = key; + const headerKey = 'filter' + key; + + let columnMapping: { filterKey: string; headerKey: string; isDate?: boolean; singleSearch?: boolean; }; + if (dateFields?.includes(filterKey)) { + columnMapping = {filterKey, headerKey, isDate: true}; + } else if (singleSearchFields?.includes(filterKey)){ + columnMapping = {filterKey, headerKey, singleSearch: true}; + } + else { + columnMapping = {filterKey, headerKey}; + } + + filterColumnsMapping.push(columnMapping); + } + } + + return [firstElement, ...filterColumnsMapping]; + + } +} diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html index 444b55bb46..de0d4ff072 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html @@ -83,7 +83,7 @@ *matRowDef="let row; columns: tableConfig.displayedColumns" [class.loading]="isDataLoading" [class.no-hover]="!showHover" - [ngClass]="{'highlighted': row?.activeInvestigation || row?.activeAlert, 'error': row?.errorMessage }" + [ngClass]="{'highlighted': (row?.receivedActiveInvestigations?.length > 0 || row?.receivedActiveAlerts?.length > 0 || row?.sentActiveAlerts?.length > 0 || row?.sentActiveInvestigations?.length > 0), 'error': row?.errorMessage }" (click)="selectElement(row)" mat-row data-testid="table-component--body-row" @@ -195,7 +195,7 @@

{{ 'table.noResultFound' | i18n }}

- + {{isDateElement(column) ? (element[column] | date:'yyyy-MM-dd') : element[column]?.length }} diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts index 784eaa69e4..e7586ad576 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts @@ -38,7 +38,6 @@ import {MatTableDataSource} from '@angular/material/table'; import {Pagination} from '@core/model/pagination.model'; import {TableSettingsService} from '@core/user/table-settings.service'; import {MainAspectType} from '@page/parts/model/mainAspectType.enum'; -import {SemanticDataModel} from '@page/parts/model/parts.model'; import { MultiSelectAutocompleteComponent } from '@shared/components/multi-select-autocomplete/multi-select-autocomplete.component'; @@ -53,6 +52,20 @@ import { } from '@shared/components/table/table.model'; import {isDateFilter} from '@shared/helper/filter-helper'; import {addSelectedValues, removeSelectedValues} from '@shared/helper/table-helper'; +import {PartsAsBuiltConfigurationModel} from "@shared/components/parts-table/parts-as-built-configuration.model"; +import { + PartsAsBuiltSupplierConfigurationModel +} from "@shared/components/parts-table/parts-as-built-supplier-configuration.model"; +import { + PartsAsBuiltCustomerConfigurationModel +} from "@shared/components/parts-table/parts-as-built-customer-configuration.model"; +import {PartsAsPlannedConfigurationModel} from "@shared/components/parts-table/parts-as-planned-configuration.model"; +import { + PartsAsPlannedSupplierConfigurationModel +} from "@shared/components/parts-table/parts-as-planned-supplier-configuration.model"; +import { + PartsAsPlannedCustomerConfigurationModel +} from "@shared/components/parts-table/parts-as-planned-customer-configuration.model"; @Component({ @@ -141,125 +154,26 @@ export class PartsTableComponent implements OnInit { public displayedColumns: string[]; public defaultColumns: string[]; - private tableViewConfig: TableViewConfig; + public tableViewConfig: TableViewConfig; filterFormGroup = new FormGroup({}); - public isDateElement(key: string) { - return isDateFilter(key); + public isNotificationCountColumn(column: any) { + return column === 'receivedActiveAlerts' || column === 'sentActiveAlerts' || column === 'receivedActiveInvestigations' || column === 'sentActiveInvestigations'; } - private readonly displayedColumnsAsBuilt: string[] = [ - 'Filter', - 'filterId', - 'filterIdShort', - 'filterName', // nameAtManufacturer - 'filterManufacturer', - 'filterPartId', // Part number / Batch Number / JIS Number - 'filterManufacturerPartId', - 'filterCustomerPartId', // --> semanticModel.customerPartId - 'filterClassification', - 'filterNameAtCustomer', // --> semanticModel.nameAtCustomer - 'filterSemanticModelId', - 'filterSemanticDataModel', - 'filterManufacturingDate', - 'filterManufacturingCountry', - 'filterActiveReceivedAlerts', - 'filterActiveInvestigations', - ]; - - private readonly displayedColumnsAsPlanned: string[] = [ - 'Filter', - 'filterId', - 'filterIdShort', - 'filterName', - 'filterManufacturer', - 'filterManufacturerPartId', - 'filterClassification', - 'filterSemanticDataModel', - 'filterSemanticModelId', - 'filterValidityPeriodFrom', - 'filterValidityPeriodTo', - 'filterPsFunction', - 'filterCatenaXSiteId', - 'filterFunctionValidFrom', - 'filterFunctionValidUntil', - ]; - - private readonly displayedColumnsAsBuiltForTable: string[] = [ - 'select', - 'id', - 'idShort', - 'name', - 'manufacturer', - 'partId', - 'manufacturerPartId', - 'customerPartId', - 'classification', - 'nameAtCustomer', - 'semanticModelId', - 'semanticDataModel', - 'manufacturingDate', - 'manufacturingCountry', - 'receivedAlerts', - 'activeInvestigations', - ]; - - - private readonly displayedColumnsAsPlannedForTable: string[] = [ - 'select', - 'id', - 'idShort', - 'name', - 'manufacturer', - 'manufacturerPartId', - 'classification', - 'semanticDataModel', - 'semanticModelId', - 'validityPeriodFrom', - 'validityPeriodTo', - 'psFunction', - 'catenaXSiteId', - 'functionValidFrom', - 'functionValidUntil', - 'menu' - ]; + public isAlertColumnCount(column: any) { + return column === 'receivedActiveAlerts'; + } - private readonly sortableColumnsAsBuilt: Record = { - id: true, - idShort: true, - name: true, - manufacturer: true, - partId: true, - manufacturerPartId: true, - customerPartId: true, - classification: true, - nameAtCustomer: true, - semanticModelId: true, - semanticDataModel: true, - manufacturingDate: true, - manufacturingCountry: true, - receivedAlerts: true, - activeInvestigations: true, + public isInvestigationColumnCount(column: any) { + return column === 'receivedInvestigations'; + } - }; + public isDateElement(key: string) { + return isDateFilter(key); + } - private readonly sortableColumnsAsPlanned: Record = { - id: true, - idShort: true, - name: true, - manufacturer: true, - manufacturerPartId: true, - classification: true, - semanticDataModel: true, - semanticModelId: true, - validityPeriodFrom: true, - validityPeriodTo: true, - psFunction: true, - catenaXSiteId: true, - functionValidFrom: true, - functionValidUntil: true, - }; private readonly displayedColumnsAsPlannedCustomer: string[] = [ 'filterSemanticDataModel', @@ -280,53 +194,17 @@ export class PartsTableComponent implements OnInit { ]; - private readonly displayedColumnsAsBuiltCustomer: string[] = [ - 'filterSemanticDataModel', - 'filterName', - 'filterManufacturer', - 'filterPartId', - 'filterSemanticModelId', - 'filterManufacturingDate', - 'filterActiveReceivedAlerts', - 'filterActiveInvestigations', - ]; - - - private readonly displayedColumnsAsBuiltSupplier: string[] = [ - 'Filter', - 'filterSemanticDataModel', - 'filterName', - 'filterManufacturer', - 'filterPartId', - 'filterSemanticModelId', - 'filterManufacturingDate', - 'filterActiveReceivedAlerts', - 'filterActiveInvestigations', - ]; - - private readonly displayedColumnsAsBuiltCustomerForTable: string[] = [ + private readonly displayedColumnsAsPlannedSupplierForTable: string[] = [ + 'select', 'semanticDataModel', 'name', 'manufacturer', - 'partId', + 'manufacturerPartId', 'semanticModelId', - 'manufacturingDate', - 'receivedAlerts', - 'activeInvestigations', + 'menu' ]; - private readonly sortableColumnsAsBuiltCustomer: Record = { - semanticDataModel: true, - name: true, - manufacturer: true, - partId: true, - semanticModelId: true, - manufacturingDate: true, - receivedAlerts: true, - activeInvestigations: true, - }; - private readonly displayedColumnsAsPlannedCustomerForTable: string[] = [ 'semanticDataModel', 'name', @@ -335,48 +213,31 @@ export class PartsTableComponent implements OnInit { 'semanticModelId', ]; - private readonly sortableColumnsAsPlannedCustomer: Record = { - semanticDataModel: true, - name: true, - manufacturer: true, - manufacturerPartId: true, - semanticModelId: true, - manufacturingDate: true, - }; - private readonly displayedColumnsAsBuiltSupplierForTable: string[] = [ - 'select', - 'semanticDataModel', - 'name', - 'manufacturer', - 'partId', - 'semanticModelId', - 'manufacturingDate', - 'receivedAlerts', - 'activeInvestigations', - 'menu' - ]; - private readonly sortableColumnsAsBuiltSupplier: Record = { - semanticDataModel: true, - name: true, - manufacturer: true, - partId: true, - semanticModelId: true, - manufacturingDate: true, - receivedAlerts: true, - activeInvestigations: true, - }; - private readonly displayedColumnsAsPlannedSupplierForTable: string[] = [ - 'select', - 'semanticDataModel', - 'name', - 'manufacturer', - 'manufacturerPartId', - 'semanticModelId', - 'menu' - ]; + private initializeTableViewSettings(): void { + switch (this.tableType) { + case PartTableType.AS_PLANNED_CUSTOMER: + this.tableViewConfig = PartsAsPlannedCustomerConfigurationModel.filterConfiguration(); + break; + case PartTableType.AS_PLANNED_OWN: + this.tableViewConfig = PartsAsPlannedConfigurationModel.filterConfiguration(); + break; + case PartTableType.AS_PLANNED_SUPPLIER: + this.tableViewConfig = PartsAsPlannedSupplierConfigurationModel.filterConfiguration(); + break; + case PartTableType.AS_BUILT_OWN: + this.tableViewConfig = PartsAsBuiltConfigurationModel.filterConfiguration(); + break; + case PartTableType.AS_BUILT_CUSTOMER: + this.tableViewConfig = PartsAsBuiltCustomerConfigurationModel.filterConfiguration(); + break; + case PartTableType.AS_BUILT_SUPPLIER: + this.tableViewConfig = PartsAsBuiltSupplierConfigurationModel.filterConfiguration(); + break; + } + } private readonly sortableColumnsAsPlannedSupplier: Record = { semanticDataModel: true, @@ -400,64 +261,6 @@ export class PartsTableComponent implements OnInit { }); } - private initializeTableViewSettings(): void { - switch (this.tableType) { - case PartTableType.AS_PLANNED_CUSTOMER: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsPlannedCustomer, - displayedColumnsForTable: this.displayedColumnsAsPlannedCustomerForTable, - filterConfiguration: this.assetAsPlannedCustomerFilterConfiguration, - filterFormGroup: this.assetAsPlannedCustomerFilterFormGroup, - sortableColumns: this.sortableColumnsAsPlannedCustomer - } - break; - case PartTableType.AS_PLANNED_OWN: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsPlanned, - displayedColumnsForTable: this.displayedColumnsAsPlannedForTable, - filterConfiguration: this.assetAsPlannedFilterConfiguration, - filterFormGroup: this.assetAsPlannedFilterFormGroup, - sortableColumns: this.sortableColumnsAsPlanned - } - break; - case PartTableType.AS_PLANNED_SUPPLIER: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsPlannedSupplier, - displayedColumnsForTable: this.displayedColumnsAsPlannedSupplierForTable, - filterConfiguration: this.assetAsPlannedSupplierFilterConfiguration, - filterFormGroup: this.assetAsPlannedSupplierFilterFormGroup, - sortableColumns: this.sortableColumnsAsPlannedSupplier - } - break; - case PartTableType.AS_BUILT_OWN: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsBuilt, - displayedColumnsForTable: this.displayedColumnsAsBuiltForTable, - filterConfiguration: this.assetAsBuiltFilterConfiguration, - filterFormGroup: this.assetAsBuiltFilterFormGroup, - sortableColumns: this.sortableColumnsAsBuilt - } - break; - case PartTableType.AS_BUILT_CUSTOMER: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsBuiltCustomer, - displayedColumnsForTable: this.displayedColumnsAsBuiltCustomerForTable, - filterConfiguration: this.assetAsBuiltCustomerFilterConfiguration, - filterFormGroup: this.assetAsBuiltCustomerFilterFormGroup, - sortableColumns: this.sortableColumnsAsBuiltCustomer - } - break; - case PartTableType.AS_BUILT_SUPPLIER: - this.tableViewConfig = { - displayedColumns: this.displayedColumnsAsBuiltSupplier, - displayedColumnsForTable: this.displayedColumnsAsBuiltSupplierForTable, - filterConfiguration: this.assetAsBuiltSupplierFilterConfiguration, - filterFormGroup: this.assetAsBuiltSupplierFilterFormGroup, - sortableColumns: this.sortableColumnsAsBuiltSupplier - } - break; - } - } private setupTableViewSettings() { const tableSettingsList = this.tableSettingsService.getStoredTableSettings(); @@ -509,6 +312,7 @@ export class PartsTableComponent implements OnInit { header: CreateHeaderFromColumns(displayedColumnsForTable, headerKey), sortableColumns: sortableColumns, }; + // todo check if this breaks this.filterConfiguration = filterConfiguration; this.displayedColumns = displayedColumns; for (const controlName in filterFormGroup) { @@ -519,64 +323,6 @@ export class PartsTableComponent implements OnInit { } - public readonly assetAsBuiltFilterConfiguration: any[] = [ - {filterKey: 'Filter', headerKey: 'Filter'}, - {filterKey: 'id', headerKey: 'filterId'}, - {filterKey: 'idShort', headerKey: 'filterIdShort'}, - {filterKey: 'nameAtManufacturer', headerKey: 'filterName'}, // nameAtManufacturer - {filterKey: 'manufacturerName', headerKey: 'filterManufacturer'}, - {filterKey: 'manufacturerPartId', headerKey: 'filterPartId'}, // Part number / Batch Number / JIS Number - {filterKey: 'manufacturerPartId', headerKey: 'filterManufacturerPartId'}, - {filterKey: 'customerPartId', headerKey: 'filterCustomerPartId'}, // --> semanticModel.customerPartId - {filterKey: 'classification', headerKey: 'filterClassification'}, - {filterKey: 'nameAtCustomer', headerKey: 'filterNameAtCustomer'}, // --> semanticModel.nameAtCustomer - {filterKey: 'semanticModelId', headerKey: 'filterSemanticModelId'}, - {filterKey: 'semanticDataModel', headerKey: 'filterSemanticDataModel'}, - {filterKey: 'manufacturingDate', headerKey: 'filterManufacturingDate', isDate: true}, - {filterKey: 'manufacturingCountry', headerKey: 'filterManufacturingCountry'}, - {filterKey: 'receivedAlerts', headerKey: 'filterActiveReceivedAlerts', singleSearch: true}, - {filterKey: 'sentAlerts', headerKey: 'filterActiveSentAlerts', singleSearch: true}, - {filterKey: 'activeInvestigations', headerKey: 'filterActiveInvestigations', singleSearch: true}, - ]; - - - assetAsBuiltFilterFormGroup = { - id: new FormControl([]), - idShort: new FormControl([]), - nameAtManufacturer: new FormControl([]), - manufacturerName: new FormControl([]), - partId: new FormControl([]), - manufacturerPartId: new FormControl([]), - customerPartId: new FormControl([]), - classification: new FormControl([]), - nameAtCustomer: new FormControl([]), - semanticModelId: new FormControl([]), - semanticDataModel: new FormControl([]), - manufacturingDate: new FormControl([]), - manufacturingCountry: new FormControl([]), - receivedAlerts: new FormControl([]), - sentAlerts: new FormControl([]), - receivedActiveInvestigations: new FormControl([]), - sentActiveInvestigations: new FormControl([]) - }; - - assetAsPlannedFilterFormGroup = { - id: new FormControl([]), - idShort: new FormControl([]), - nameAtManufacturer: new FormControl([]), - manufacturerName: new FormControl([]), - manufacturerPartId: new FormControl([]), - classification: new FormControl([]), - semanticDataModel: new FormControl([]), - semanticModelId: new FormControl([]), - validityPeriodFrom: new FormControl([]), - validityPeriodTo: new FormControl([]), - function: new FormControl([]), - catenaxSiteId: new FormControl([]), - functionValidFrom: new FormControl([]), - functionValidUntil: new FormControl([]) - }; - assetAsPlannedSupplierFilterFormGroup = { select: new FormControl([]), @@ -597,34 +343,6 @@ export class PartsTableComponent implements OnInit { }; - assetAsBuiltSupplierFilterFormGroup = { - select: new FormControl([]), - semanticDataModel: new FormControl([]), - nameAtManufacturer: new FormControl([]), - manufacturerName: new FormControl([]), - manufacturerPartId: new FormControl([]), - semanticModelId: new FormControl([]), - manufacturingDate: new FormControl([]), - receivedAlerts: new FormControl([]), - sentAlerts: new FormControl([]), - receivedActiveInvestigations: new FormControl([]), - sentActiveInvestigations: new FormControl([]), - menu: new FormControl([]) - }; - - assetAsBuiltCustomerFilterFormGroup = { - semanticDataModel: new FormControl([]), - nameAtManufacturer: new FormControl([]), - manufacturerName: new FormControl([]), - manufacturerPartId: new FormControl([]), - semanticModelId: new FormControl([]), - manufacturingDate: new FormControl([]), - receivedAlerts: new FormControl([]), - sentAlerts: new FormControl([]), - receivedActiveInvestigations: new FormControl([]), - sentActiveInvestigations: new FormControl([]) - }; - private readonly assetAsPlannedCustomerFilterConfiguration: any[] = [ {filterKey: 'semanticDataModel', headerKey: 'filterSemanticDataModel'}, {filterKey: 'nameAtManufacturer', headerKey: 'filterName'}, @@ -633,70 +351,6 @@ export class PartsTableComponent implements OnInit { {filterKey: 'semanticModelId', headerKey: 'filterSemanticModelId'} ]; - private readonly assetAsPlannedSupplierFilterConfiguration: any[] = [ - {filterKey: 'Filter', headerKey: 'Filter'}, - {filterKey: 'semanticDataModel', headerKey: 'filterSemanticDataModel'}, - {filterKey: 'nameAtManufacturer', headerKey: 'filterName'}, - {filterKey: 'manufacturerName', headerKey: 'filterManufacturer'}, - {filterKey: 'manufacturerPartId', headerKey: 'filterManufacturerPartId'}, - {filterKey: 'semanticModelId', headerKey: 'filterSemanticModelId'} - ]; - - - private readonly assetAsBuiltCustomerFilterConfiguration: any[] = [ - {filterKey: 'semanticDataModel', headerKey: 'filterSemanticDataModel'}, - {filterKey: 'nameAtManufacturer', headerKey: 'filterName'}, - {filterKey: 'manufacturerName', headerKey: 'filterManufacturer'}, - {filterKey: 'manufacturerPartId', headerKey: 'filterPartId'}, - {filterKey: 'semanticModelId', headerKey: 'filterSemanticModelId'}, - {filterKey: 'manufacturingDate', headerKey: 'filterManufacturingDate', isDate: true}, - {filterKey: 'receivedAlerts', headerKey: 'filterActiveReceivedAlerts', singleSearch: true}, - {filterKey: 'sentAlerts', headerKey: 'filterActiveSentAlerts', singleSearch: true}, - { - filterKey: 'receivedActiveInvestigations', - headerKey: 'filterReceivedActiveInvestigations', - singleSearch: true - }, - {filterKey: 'sentActiveInvestigations', headerKey: 'filterSentActiveInvestigations', singleSearch: true} - ]; - - - private readonly assetAsBuiltSupplierFilterConfiguration: any[] = [ - {filterKey: 'Filter', headerKey: 'Filter'}, - {filterKey: 'semanticDataModel', headerKey: 'filterSemanticDataModel'}, - {filterKey: 'nameAtManufacturer', headerKey: 'filterName'}, - {filterKey: 'manufacturerName', headerKey: 'filterManufacturer'}, - {filterKey: 'manufacturerPartId', headerKey: 'filterPartId'}, - {filterKey: 'semanticModelId', headerKey: 'filterSemanticModelId'}, - {filterKey: 'manufacturingDate', headerKey: 'filterManufacturingDate', isDate: true}, - {filterKey: 'receivedAlerts', headerKey: 'filterActiveReceivedAlerts', singleSearch: true}, - {filterKey: 'sentAlerts', headerKey: 'filterActiveSentAlerts', singleSearch: true}, - { - filterKey: 'receivedActiveInvestigations', - headerKey: 'filterReceivedActiveInvestigations', - singleSearch: true - }, - {filterKey: 'sentActiveInvestigations', headerKey: 'filterSentActiveInvestigations', singleSearch: true} - ]; - - - private readonly assetAsPlannedFilterConfiguration: any[] = [ - {filterKey: 'Filter', headerKey: 'Filter'}, - {filterKey: 'id', headerKey: 'filterId'}, - {filterKey: 'idShort', headerKey: 'filterIdShort'}, - {filterKey: 'nameAtManufacturer', headerKey: 'filterName'}, // nameAtManufacturer - {filterKey: 'manufacturerName', headerKey: 'filterManufacturer'}, - {filterKey: 'manufacturerPartId', headerKey: 'filterManufacturerPartId'}, // Part number / Batch Number / JIS Number - {filterKey: 'classification', headerKey: 'filterClassification'}, - {filterKey: 'semanticDataModel', headerKey: 'filterSemanticDataModel'}, - {filterKey: 'semanticModelId', headerKey: 'filterSemanticModelId'}, - {filterKey: 'validityPeriodFrom', headerKey: 'filterValidityPeriodFrom', isDate: true}, - {filterKey: 'validityPeriodTo', headerKey: 'filterValidityPeriodTo', isDate: true}, - {filterKey: 'function', headerKey: 'filterPsFunction'}, - {filterKey: 'catenaxSiteId', headerKey: 'filterCatenaXSiteId'}, - {filterKey: 'functionValidFrom', headerKey: 'filterFunctionValidFrom', isDate: true}, - {filterKey: 'functionValidUntil', headerKey: 'filterFunctionValidUntil', isDate: true} - ]; public areAllRowsSelected(): boolean { diff --git a/frontend/src/assets/locales/de/common.json b/frontend/src/assets/locales/de/common.json index b2219e5fc0..6dfc16cfe7 100644 --- a/frontend/src/assets/locales/de/common.json +++ b/frontend/src/assets/locales/de/common.json @@ -78,7 +78,7 @@ "id": "ID", "idShort": "Kurz-ID", "name": "Name", - "manufacturer": "Hersteller", + "manufacturerName": "Hersteller", "partId": "Produktnummer", "manufacturerPartId": "Hersteller Produktnummer", "customerPartId": "Kunden Produktnummer", @@ -104,8 +104,10 @@ "psFunction": "Funktion", "functionValidFrom": "Funktion gültig von", "functionValidUntil" : "Funktion gültig bis", - "activeAlerts" : "Aktive Qualitätswarnungen", - "activeInvestigations" : "Aktive Qualitätsuntersuchungen" + "sentActiveAlerts" : "Aktive erstellte Qualitätswarnungen", + "receivedActiveInvestigations" : "Aktive empfangene Qualitätsuntersuchungen", + "receivedActiveAlerts" : "Aktive empfangene Qualitätswarnungen", + "sentActiveInvestigations" : "Aktive erstellte Qualitätsuntersuchungen" } }, "dataLoading": { diff --git a/frontend/src/assets/locales/en/common.json b/frontend/src/assets/locales/en/common.json index b60eb73e16..bfb9ea3b2a 100644 --- a/frontend/src/assets/locales/en/common.json +++ b/frontend/src/assets/locales/en/common.json @@ -78,7 +78,7 @@ "id": "ID", "idShort": "ID Short", "name": "Name", - "manufacturer": "Manufacturer", + "manufacturerName": "Manufacturer", "partId": "Part number", "manufacturerPartId": "Manufacturer part ID", "customerPartId": "Customer part ID", @@ -103,8 +103,10 @@ "psFunction": "Function", "functionValidFrom": "Function valid from", "functionValidUntil" : "Function valid until", - "activeAlerts" : "Active Quality alerts", - "activeInvestigations" : "Active Quality investigations" + "sentActiveAlerts" : "Active created Quality alerts", + "receivedActiveInvestigations" : "Active received Quality investigations", + "receivedActiveAlerts" : "Active received Quality alerts", + "sentActiveInvestigations" : "Active created Quality investigations" } }, "dataLoading": { diff --git a/frontend/src/theme/base.scss b/frontend/src/theme/base.scss index 3b8f1a06a7..bce663263c 100644 --- a/frontend/src/theme/base.scss +++ b/frontend/src/theme/base.scss @@ -161,6 +161,12 @@ as-split-area { } app-parts-table { + + th{ + white-space: normal!important; + word-wrap: break-word!important; + } + /* Avoid sticky head to be over sidenav component*/ th { z-index: 1 !important; From cb3ef3f010c3270c9d5bdedf6743f8657e3570d7 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 10:32:19 +0100 Subject: [PATCH 05/26] chore: TRACEFOSS-2726 adapt wrong attributes --- .../core/user/table-settings.service.ts | 1 + .../parts-as-built-configuration.model.ts | 8 +- ...s-as-built-customer-configuration.model.ts | 6 +- ...s-as-built-supplier-configuration.model.ts | 6 +- .../parts-as-planned-configuration.model.ts | 8 +- ...as-planned-customer-configuration.model.ts | 6 +- ...as-planned-supplier-configuration.model.ts | 6 +- .../parts-table/parts-table.component.ts | 114 ++---------------- .../parts-table/table-view-config.model.ts | 4 +- .../table-settings.component.ts | 22 ++-- frontend/src/assets/locales/de/common.json | 2 +- frontend/src/assets/locales/en/common.json | 2 +- 12 files changed, 50 insertions(+), 135 deletions(-) diff --git a/frontend/src/app/modules/core/user/table-settings.service.ts b/frontend/src/app/modules/core/user/table-settings.service.ts index e2f93d02b2..ab1e6aac50 100644 --- a/frontend/src/app/modules/core/user/table-settings.service.ts +++ b/frontend/src/app/modules/core/user/table-settings.service.ts @@ -31,6 +31,7 @@ export class TableSettingsService { storeTableSettings(partTableType: PartTableType, tableSettingsList: any ): void { // before setting anything, all maps in new tableSettingList should be stringified Object.keys(tableSettingsList).forEach(tableSetting => { + console.log(tableSetting, "settings"); const newMap = tableSettingsList[tableSetting].columnSettingsOptions; tableSettingsList[tableSetting].columnSettingsOptions = JSON.stringify(Array.from(newMap.entries())); }) diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts index 69547af7fa..f5e70f3001 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts @@ -24,9 +24,9 @@ export class PartsAsBuiltConfigurationModel { public static filterConfiguration(): TableViewConfig { return { - displayedColumns: this.filterColumns, - displayedColumnsForTable: this.displayedColumns, - filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterColumns: this.filterColumns, + displayedColumns: this.displayedColumns, + displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, filterFormGroup: this.formGroup, sortableColumns: this.sortableColumns } @@ -55,9 +55,7 @@ export class PartsAsBuiltConfigurationModel { }; private static displayedColumns = Object.keys(this.sortableColumns); - private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); - private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); private static dateFields = ['manufacturingDate']; private static singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts index f1dc8d372b..4c79c3a06b 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts @@ -25,9 +25,9 @@ export class PartsAsBuiltCustomerConfigurationModel{ public static filterConfiguration(): TableViewConfig { return { - displayedColumns: this.filterColumns, - displayedColumnsForTable: this.displayedColumns, - filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterColumns: this.filterColumns, + displayedColumns: this.displayedColumns, + displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, filterFormGroup: this.formGroup, sortableColumns: this.sortableColumns } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts index 00dfc3d4c8..c17c310e1a 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts @@ -25,9 +25,9 @@ export class PartsAsBuiltSupplierConfigurationModel { public static filterConfiguration(): TableViewConfig { return { - displayedColumns: this.filterColumns, - displayedColumnsForTable: this.displayedColumns, - filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterColumns: this.filterColumns, + displayedColumns: this.displayedColumns, + displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, filterFormGroup: this.formGroup, sortableColumns: this.sortableColumns } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts index d651b47983..1fb2cb8725 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts @@ -25,9 +25,9 @@ export class PartsAsPlannedConfigurationModel { public static filterConfiguration(): TableViewConfig { return { - displayedColumns: this.filterColumns, - displayedColumnsForTable: this.displayedColumns, - filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterColumns: this.filterColumns, + displayedColumns: this.displayedColumns, + displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, filterFormGroup: this.formGroup, sortableColumns: this.sortableColumns } @@ -45,7 +45,7 @@ export class PartsAsPlannedConfigurationModel { semanticModelId: true, validityPeriodFrom: true, validityPeriodTo: true, - function: true, + psFunction: true, catenaXSiteId: true, functionValidFrom: true, functionValidUntil: true, diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts index 0629558b37..d41b7dc9f1 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts @@ -25,9 +25,9 @@ export class PartsAsPlannedCustomerConfigurationModel { public static filterConfiguration(): TableViewConfig { return { - displayedColumns: this.filterColumns, - displayedColumnsForTable: this.displayedColumns, - filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterColumns: this.filterColumns, + displayedColumns: this.displayedColumns, + displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, filterFormGroup: this.formGroup, sortableColumns: this.sortableColumns } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts index 41c50e3a48..96e165dfcc 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts @@ -25,9 +25,9 @@ export class PartsAsPlannedSupplierConfigurationModel { public static filterConfiguration(): TableViewConfig { return { - displayedColumns: this.filterColumns, - displayedColumnsForTable: this.displayedColumns, - filterConfiguration: this.displayColumnsToFilterColumnsMapping, + filterColumns: this.filterColumns, + displayedColumns: this.displayedColumns, + displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, filterFormGroup: this.formGroup, sortableColumns: this.sortableColumns } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts index e7586ad576..84404f8b30 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts @@ -30,7 +30,7 @@ import { ViewChild, ViewChildren, } from '@angular/core'; -import {FormControl, FormGroup} from '@angular/forms'; +import {FormGroup} from '@angular/forms'; import {MatDialog, MatDialogConfig} from '@angular/material/dialog'; import {MatPaginator, PageEvent} from '@angular/material/paginator'; import {MatSort, Sort} from '@angular/material/sort'; @@ -162,60 +162,10 @@ export class PartsTableComponent implements OnInit { return column === 'receivedActiveAlerts' || column === 'sentActiveAlerts' || column === 'receivedActiveInvestigations' || column === 'sentActiveInvestigations'; } - public isAlertColumnCount(column: any) { - return column === 'receivedActiveAlerts'; - } - - public isInvestigationColumnCount(column: any) { - return column === 'receivedInvestigations'; - } - public isDateElement(key: string) { return isDateFilter(key); } - - private readonly displayedColumnsAsPlannedCustomer: string[] = [ - 'filterSemanticDataModel', - 'filterName', - 'filterManufacturer', - 'filterManufacturerPartId', - 'filterSemanticModelId', - ]; - - - private readonly displayedColumnsAsPlannedSupplier: string[] = [ - 'Filter', - 'filterSemanticDataModel', - 'filterName', - 'filterManufacturer', - 'filterManufacturerPartId', - 'filterSemanticModelId', - ]; - - - private readonly displayedColumnsAsPlannedSupplierForTable: string[] = [ - 'select', - 'semanticDataModel', - 'name', - 'manufacturer', - 'manufacturerPartId', - 'semanticModelId', - 'menu' - ]; - - - private readonly displayedColumnsAsPlannedCustomerForTable: string[] = [ - 'semanticDataModel', - 'name', - 'manufacturer', - 'manufacturerPartId', - 'semanticModelId', - ]; - - - - private initializeTableViewSettings(): void { switch (this.tableType) { case PartTableType.AS_PLANNED_CUSTOMER: @@ -239,14 +189,6 @@ export class PartsTableComponent implements OnInit { } } - private readonly sortableColumnsAsPlannedSupplier: Record = { - semanticDataModel: true, - name: true, - manufacturer: true, - manufacturerPartId: true, - semanticModelId: true, - }; - private pageSize: number; private sorting: TableHeaderSort; @@ -269,36 +211,36 @@ export class PartsTableComponent implements OnInit { // if yes, check if there is a table-setting for this table type if (tableSettingsList[this.tableType]) { // if yes, get the effective displayedcolumns from the settings and set the tableconfig after it. - this.setupTableConfigurations(tableSettingsList[this.tableType].columnsForTable, tableSettingsList[this.tableType].filterColumnsForTable, this.tableViewConfig.sortableColumns, this.tableViewConfig.filterConfiguration, this.tableViewConfig.filterFormGroup); + this.setupTableConfigurations(tableSettingsList[this.tableType].columnsForTable, tableSettingsList[this.tableType].filterColumnsForTable, this.tableViewConfig.sortableColumns, this.tableViewConfig.displayFilterColumnMappings, this.tableViewConfig.filterFormGroup); } else { // if no, create new a table setting for this.tabletype and put it into the list. Additionally, intitialize default table configuration tableSettingsList[this.tableType] = { - columnsForDialog: this.tableViewConfig.displayedColumnsForTable, + columnsForDialog: this.tableViewConfig.displayedColumns, columnSettingsOptions: this.getDefaultColumnVisibilityMap(), - columnsForTable: this.tableViewConfig.displayedColumnsForTable, - filterColumnsForTable: this.tableViewConfig.displayedColumns + columnsForTable: this.tableViewConfig.displayedColumns, + filterColumnsForTable: this.tableViewConfig.filterColumns }; this.tableSettingsService.storeTableSettings(this.tableType, tableSettingsList); - this.setupTableConfigurations(this.tableViewConfig.displayedColumnsForTable, this.tableViewConfig.displayedColumns, this.tableViewConfig.sortableColumns, this.tableViewConfig.filterConfiguration, this.tableViewConfig.filterFormGroup); + this.setupTableConfigurations(this.tableViewConfig.displayedColumns, this.tableViewConfig.filterColumns, this.tableViewConfig.sortableColumns, this.tableViewConfig.displayFilterColumnMappings, this.tableViewConfig.filterFormGroup); } } else { // if no, create new list and a settings entry for this.tabletype with default values and set correspondingly the tableconfig const newTableSettingsList = { [this.tableType]: { - columnsForDialog: this.tableViewConfig.displayedColumnsForTable, + columnsForDialog: this.tableViewConfig.displayedColumns, columnSettingsOptions: this.getDefaultColumnVisibilityMap(), - columnsForTable: this.tableViewConfig.displayedColumnsForTable, - filterColumnsForTable: this.tableViewConfig.displayedColumns + columnsForTable: this.tableViewConfig.displayedColumns, + filterColumnsForTable: this.tableViewConfig.filterColumns } } this.tableSettingsService.storeTableSettings(this.tableType, newTableSettingsList); - this.setupTableConfigurations(this.tableViewConfig.displayedColumnsForTable, this.tableViewConfig.displayedColumns, this.tableViewConfig.sortableColumns, this.tableViewConfig.filterConfiguration, this.tableViewConfig.filterFormGroup); + this.setupTableConfigurations(this.tableViewConfig.displayedColumns, this.tableViewConfig.filterColumns, this.tableViewConfig.sortableColumns, this.tableViewConfig.displayFilterColumnMappings, this.tableViewConfig.filterFormGroup); } } private getDefaultColumnVisibilityMap(): Map { const initialColumnMap = new Map(); - for (const column of this.tableViewConfig.displayedColumnsForTable) { + for (const column of this.tableViewConfig.displayedColumns) { initialColumnMap.set(column, true); } return initialColumnMap; @@ -323,36 +265,6 @@ export class PartsTableComponent implements OnInit { } - - assetAsPlannedSupplierFilterFormGroup = { - select: new FormControl([]), - semanticDataModel: new FormControl([]), - nameAtManufacturer: new FormControl([]), - manufacturerName: new FormControl([]), - manufacturerPartId: new FormControl([]), - semanticModelId: new FormControl([]), - menu: new FormControl([]) - }; - - assetAsPlannedCustomerFilterFormGroup = { - semanticDataModel: new FormControl([]), - nameAtManufacturer: new FormControl([]), - manufacturerName: new FormControl([]), - semanticModelId: new FormControl([]), - manufacturerPartId: new FormControl([]) - }; - - - private readonly assetAsPlannedCustomerFilterConfiguration: any[] = [ - {filterKey: 'semanticDataModel', headerKey: 'filterSemanticDataModel'}, - {filterKey: 'nameAtManufacturer', headerKey: 'filterName'}, - {filterKey: 'manufacturerName', headerKey: 'filterManufacturer'}, - {filterKey: 'manufacturerPartId', headerKey: 'filterManufacturerPartId'}, - {filterKey: 'semanticModelId', headerKey: 'filterSemanticModelId'} - ]; - - - public areAllRowsSelected(): boolean { return this.dataSource.data.every(data => this.isSelected(data)); } @@ -425,8 +337,8 @@ export class PartsTableComponent implements OnInit { title: "table.tableSettings.title", panelClass: "custom", tableType: this.tableType, - defaultColumns: this.tableViewConfig.displayedColumnsForTable, - defaultFilterColumns: this.tableViewConfig.displayedColumns + defaultColumns: this.tableViewConfig.displayedColumns, + defaultFilterColumns: this.tableViewConfig.filterColumns }; this.dialog.open(TableSettingsComponent, config) } diff --git a/frontend/src/app/modules/shared/components/parts-table/table-view-config.model.ts b/frontend/src/app/modules/shared/components/parts-table/table-view-config.model.ts index d2b0600e15..b3acca0e34 100644 --- a/frontend/src/app/modules/shared/components/parts-table/table-view-config.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/table-view-config.model.ts @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ export interface TableViewConfig { - displayedColumnsForTable: string[], displayedColumns: string[], + filterColumns: string[], sortableColumns: Record, - filterConfiguration: any[], + displayFilterColumnMappings: any[], filterFormGroup: any } diff --git a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.ts b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.ts index 7c27ad6232..e50d1ec4c5 100644 --- a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.ts +++ b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.ts @@ -56,14 +56,14 @@ export class TableSettingsComponent { this.isCustomerTable = data.tableType === PartTableType.AS_BUILT_CUSTOMER || data.tableType === PartTableType.AS_PLANNED_CUSTOMER // Passed Data this.tableType = data.tableType; - this.defaultColumns = data.defaultColumns; - this.defaultFilterColumns = data.defaultFilterColumns; + this.defaultColumns = data.defaultColumns.filter((column: string) => column !== 'menu'); + this.defaultFilterColumns = data.defaultFilterColumns.filter((column: string) => column !== 'menu'); // Storage Data this.columnOptions = tableSettingsService.getStoredTableSettings()[this.tableType].columnSettingsOptions; - this.dialogColumns = tableSettingsService.getStoredTableSettings()[this.tableType].columnsForDialog; - this.tableColumns = tableSettingsService.getStoredTableSettings()[this.tableType].columnsForTable; - this.filterColumns = tableSettingsService.getStoredTableSettings()[this.tableType].filterColumnsForTable; + this.dialogColumns = tableSettingsService.getStoredTableSettings()[this.tableType].columnsForDialog.filter((column: string) => column !== 'menu');; + this.tableColumns = tableSettingsService.getStoredTableSettings()[this.tableType].columnsForTable.filter((column: string) => column !== 'menu');; + this.filterColumns = tableSettingsService.getStoredTableSettings()[this.tableType].filterColumnsForTable.filter((column: string) => column !== 'menu');; this.selectAllSelected = this.dialogColumns.length === this.tableColumns.length; @@ -79,10 +79,13 @@ export class TableSettingsComponent { if(this.columnOptions.get(column)) { newTableColumns.push(column); // ignore select column in customertable - if(column === 'select' && !this.isCustomerTable) { + if(column === 'select') { newTableFilterColumns.push('Filter'); - } else { - newTableFilterColumns.push('filter'+ column.charAt(0).toUpperCase() + column.slice(1)) + } else if(column === 'menu'){ + + } + else { + newTableFilterColumns.push('filter'+ column) } } } @@ -140,7 +143,7 @@ export class TableSettingsComponent { selectAll(isChecked: boolean) { for(let column of this.dialogColumns) { - if(column === 'select'){ + if(column === 'select' || column === 'menu'){ continue; } this.columnOptions.set(column,isChecked); @@ -149,6 +152,7 @@ export class TableSettingsComponent { } resetColumns() { + this.dialogColumns = [...this.defaultColumns.filter(value => value!=='menu')]; this.selectAll(true); } diff --git a/frontend/src/assets/locales/de/common.json b/frontend/src/assets/locales/de/common.json index 6dfc16cfe7..aa533c23c6 100644 --- a/frontend/src/assets/locales/de/common.json +++ b/frontend/src/assets/locales/de/common.json @@ -78,7 +78,7 @@ "id": "ID", "idShort": "Kurz-ID", "name": "Name", - "manufacturerName": "Hersteller", + "manufacturer": "Hersteller", "partId": "Produktnummer", "manufacturerPartId": "Hersteller Produktnummer", "customerPartId": "Kunden Produktnummer", diff --git a/frontend/src/assets/locales/en/common.json b/frontend/src/assets/locales/en/common.json index bfb9ea3b2a..e61578d1ac 100644 --- a/frontend/src/assets/locales/en/common.json +++ b/frontend/src/assets/locales/en/common.json @@ -78,7 +78,7 @@ "id": "ID", "idShort": "ID Short", "name": "Name", - "manufacturerName": "Manufacturer", + "manufacturer": "Manufacturer", "partId": "Part number", "manufacturerPartId": "Manufacturer part ID", "customerPartId": "Customer part ID", From b12bdaf646494b036523ea1de5d00ec40fd4641e Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 10:46:05 +0100 Subject: [PATCH 06/26] chore: TRACEFOSS-2726 adapt wrong attributes test --- CHANGELOG.md | 1 + .../multi-select-autocomplete.component.ts | 4 ++++ .../table-settings/table-settings.component.spec.ts | 8 ++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7919c6bb80..b328d865dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Changed - Fixed helm repository path for backend & frontend (wrong prefix) +- Filter configuration for tables to be resuable and easy to adapt ### Removed diff --git a/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts b/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts index eb4313f940..023e2d0b25 100644 --- a/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts +++ b/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts @@ -238,6 +238,10 @@ export class MultiSelectAutocompleteComponent implements OnChanges { this.delayTimeoutId = setTimeout(timeoutCallback, 500); } +// This is used by parent component + isUnsupportedAutoCompleteField(fieldName: string) { + return fieldName === 'activeAlerts' || fieldName === 'activeInvestigations'; + } hideOption(option: any): boolean { return !(this.filteredOptions.indexOf(option) > -1); diff --git a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.spec.ts b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.spec.ts index 7a3f065136..cf25872f32 100644 --- a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.spec.ts +++ b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.spec.ts @@ -43,7 +43,7 @@ describe('TableSettingsComponent', () => { columnSettingsOptions: new Map(), columnsForDialog: ['column1', 'column2'], columnsForTable: ['column1'], - filterColumnsForTable: ['filterColumn1'], + filterColumnsForTable: ['filtercolumn1'], }, }; }); @@ -72,7 +72,7 @@ describe('TableSettingsComponent', () => { panelClass: 'test-dialog', tableType: PartTableType.AS_BUILT_OWN, defaultColumns: ['column1', 'column2'], - defaultFilterColumns: ['filterColumn1', 'filterColumn2'], + defaultFilterColumns: ['filtercolumn1', 'filtercolumn2'], }, }, { @@ -111,7 +111,7 @@ describe('TableSettingsComponent', () => { expect(component.panelClass).toEqual('test-dialog'); expect(component.tableType).toEqual(PartTableType.AS_BUILT_OWN); expect(component.defaultColumns).toEqual(['column1', 'column2']); - expect(component.defaultFilterColumns).toEqual(['filterColumn1', 'filterColumn2']); + expect(component.defaultFilterColumns).toEqual(['filtercolumn1', 'filtercolumn2']); expect(component.isCustomerTable).toEqual(false); }); @@ -128,7 +128,7 @@ describe('TableSettingsComponent', () => { columnSettingsOptions: columnOptions, columnsForDialog: ['column1', 'column2'], columnsForTable: ['column1'], - filterColumnsForTable: ['filterColumn1'], + filterColumnsForTable: ['filtercolumn1'], }, }); }); From 3eefd183e9826b64123124800bceb5b239f1ec97 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 11:01:22 +0100 Subject: [PATCH 07/26] chore: TRACEFOSS-2726 adapt wrong attributes test --- ...s-as-built-customer-configuration.model.ts | 4 +- ...s-as-built-supplier-configuration.model.ts | 4 +- ...as-planned-customer-configuration.model.ts | 2 +- ...as-planned-supplier-configuration.model.ts | 4 +- .../parts-table/parts-table.component.spec.ts | 60 ++++++++++--------- 5 files changed, 38 insertions(+), 36 deletions(-) diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts index 4c79c3a06b..41236ada85 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts @@ -36,8 +36,8 @@ export class PartsAsBuiltCustomerConfigurationModel{ private static sortableColumns: Record = { select: false, semanticDataModel: true, - nameAtManufacturer: true, - manufacturerName: true, + name: true, + manufacturer: true, manufacturerPartId: true, semanticModelId: true, manufacturingDate: true, diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts index c17c310e1a..e1390f94d5 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts @@ -36,8 +36,8 @@ export class PartsAsBuiltSupplierConfigurationModel { private static sortableColumns: Record = { select: false, semanticDataModel: true, - nameAtManufacturer: true, - manufacturerName: true, + name: true, + manufacturer: true, manufacturerPartId: true, semanticModelId: true, manufacturingDate: true, diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts index d41b7dc9f1..85310acf01 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts @@ -36,7 +36,7 @@ export class PartsAsPlannedCustomerConfigurationModel { private static sortableColumns: Record = { select: false, semanticDataModel: true, - nameAtManufacturer: true, + name: true, manufacturer: true, manufacturerPartId: true, semanticModelId: true, diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts index 96e165dfcc..c5fdd64c48 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts @@ -36,8 +36,8 @@ export class PartsAsPlannedSupplierConfigurationModel { private static sortableColumns: Record = { select: false, semanticDataModel: true, - nameAtManufacturer: true, - manufacturerName: true, + name: true, + manufacturer: true, manufacturerPartId: true, semanticModelId: true, menu: false diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts index 9ed6822e5b..8736f71fca 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts @@ -73,22 +73,24 @@ describe('PartsTableComponent', () => { // Expect that the event was emitted with the correct data expect(componentInstance.displayedColumns).toEqual([ 'Filter', - 'filterId', - 'filterIdShort', - 'filterName', // nameAtManufacturer - 'filterManufacturer', - 'filterPartId', // Part number / Batch Number / JIS Number - 'filterManufacturerPartId', - 'filterCustomerPartId', // --> semanticModel.customerPartId - 'filterClassification', + 'filterid', + 'filteridShort', + 'filtername', // nameAtManufacturer + 'filtermanufacturer', + 'filterpartId', // Part number / Batch Number / JIS Number + 'filtermanufacturerPartId', + 'filtercustomerPartId', // --> semanticModel.customerPartId + 'filterclassification', //'nameAtManufacturer', --> already in name - 'filterNameAtCustomer', // --> semanticModel.nameAtCustomer - 'filterSemanticModelId', - 'filterSemanticDataModel', - 'filterManufacturingDate', - 'filterManufacturingCountry', - 'filterActiveAlerts', - 'filterActiveInvestigations', + 'filternameAtCustomer', // --> semanticModel.nameAtCustomer + 'filtersemanticModelId', + 'filtersemanticDataModel', + 'filtermanufacturingDate', + 'filtermanufacturingCountry', + 'filterreceivedActiveAlerts', + 'filterreceivedActiveInvestigations', + 'filtersentActiveAlerts', + 'filtersentActiveInvestigations', ]); }); @@ -100,20 +102,20 @@ describe('PartsTableComponent', () => { expect(componentInstance.displayedColumns).toEqual([ 'Filter', - 'filterId', - 'filterIdShort', - 'filterName', - 'filterManufacturer', - 'filterManufacturerPartId', - 'filterClassification', - 'filterSemanticDataModel', - 'filterSemanticModelId', - 'filterValidityPeriodFrom', - 'filterValidityPeriodTo', - 'filterPsFunction', - 'filterCatenaXSiteId', - 'filterFunctionValidFrom', - 'filterFunctionValidUntil', + 'filterid', + 'filteridShort', + 'filtername', + 'filtermanufacturer', + 'filtermanufacturerPartId', + 'filterclassification', + 'filtersemanticDataModel', + 'filtersemanticModelId', + 'filtervalidityPeriodFrom', + 'filtervalidityPeriodTo', + 'filterpsFunction', + 'filtercatenaXSiteId', + 'filterfunctionValidFrom', + 'filterfunctionValidUntil', ]); }); From 13ab288b800643917d957af021c482409691c651 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 11:48:44 +0100 Subject: [PATCH 08/26] chore: TRACEFOSS-2726 adapt wrong attributes test --- .../parts-table/parts-as-built-configuration.model.ts | 4 ++-- .../parts-as-built-customer-configuration.model.ts | 4 ++-- .../parts-as-built-supplier-configuration.model.ts | 4 ++-- .../parts-table/parts-as-planned-configuration.model.ts | 4 ++-- .../parts-as-planned-customer-configuration.model.ts | 6 ++---- .../parts-as-planned-supplier-configuration.model.ts | 4 ++-- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts index f5e70f3001..46e23ab63b 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts @@ -36,8 +36,8 @@ export class PartsAsBuiltConfigurationModel { select: false, id: true, idShort: true, - name: true, - manufacturer: true, + nameAtManufacturer: true, + manufacturerName: true, partId: true, manufacturerPartId: true, customerPartId: true, diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts index 41236ada85..4c79c3a06b 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts @@ -36,8 +36,8 @@ export class PartsAsBuiltCustomerConfigurationModel{ private static sortableColumns: Record = { select: false, semanticDataModel: true, - name: true, - manufacturer: true, + nameAtManufacturer: true, + manufacturerName: true, manufacturerPartId: true, semanticModelId: true, manufacturingDate: true, diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts index e1390f94d5..c17c310e1a 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts @@ -36,8 +36,8 @@ export class PartsAsBuiltSupplierConfigurationModel { private static sortableColumns: Record = { select: false, semanticDataModel: true, - name: true, - manufacturer: true, + nameAtManufacturer: true, + manufacturerName: true, manufacturerPartId: true, semanticModelId: true, manufacturingDate: true, diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts index 1fb2cb8725..3bb8ece114 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts @@ -37,8 +37,8 @@ export class PartsAsPlannedConfigurationModel { select: false, id: true, idShort: true, - name: true, - manufacturer: true, + nameAtManufacturer: true, + manufacturerName: true, manufacturerPartId: true, classification: true, semanticDataModel: true, diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts index 85310acf01..a1d814fc22 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts @@ -36,17 +36,15 @@ export class PartsAsPlannedCustomerConfigurationModel { private static sortableColumns: Record = { select: false, semanticDataModel: true, - name: true, - manufacturer: true, + nameAtManufacturer: true, + manufacturerName: true, manufacturerPartId: true, semanticModelId: true, menu: false }; private static displayedColumns = Object.keys(this.sortableColumns); - private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); - private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns, true); private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns); diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts index c5fdd64c48..96e165dfcc 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts @@ -36,8 +36,8 @@ export class PartsAsPlannedSupplierConfigurationModel { private static sortableColumns: Record = { select: false, semanticDataModel: true, - name: true, - manufacturer: true, + nameAtManufacturer: true, + manufacturerName: true, manufacturerPartId: true, semanticModelId: true, menu: false From 1e58a4ac905b52b3f80884e0ec1241619cb7ca4a Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 11:52:18 +0100 Subject: [PATCH 09/26] chore: TRACEFOSS-2726 adapt wrong attributes test --- .../supplier-parts/supplier-parts.component.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts index 8134f71ad7..895d6caeda 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts +++ b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts @@ -77,7 +77,7 @@ describe('SupplierPartsComponent', () => { const { fixture } = await renderSupplierParts({ roles: [ 'admin' ] }); const supplierPartsComponent = fixture.componentInstance; - let nameHeader = await screen.findByText('table.column.name'); + let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); fireEvent.click(nameHeader); expect(supplierPartsComponent['tableSupplierAsBuiltSortList']).toEqual([ [ 'name', 'asc' ] ]); @@ -88,7 +88,7 @@ describe('SupplierPartsComponent', () => { const { fixture } = await renderSupplierParts({ roles: [ 'admin' ] }); const supplierPartsComponent = fixture.componentInstance; - let nameHeader = await screen.findByText('table.column.name'); + let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); fireEvent.click(nameHeader); let semanticModelIdHeader = await screen.findByText('table.column.semanticModelId'); @@ -120,7 +120,7 @@ describe('SupplierPartsComponent', () => { const { fixture } = await renderSupplierParts({ roles: [ 'admin' ] }); const supplierPartsComponent = fixture.componentInstance; - let nameHeader = await screen.findByText('table.column.name'); + let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); fireEvent.click(nameHeader); let semanticModelIdHeader = await screen.findByText('table.column.semanticModelId'); From d17dfe68cbea1efde25919694227bb6ab2bf93c0 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 13:08:09 +0100 Subject: [PATCH 10/26] chore: TRACEFOSS-2726 adapt wrong attributes test --- .../presentation/other-parts.component.spec.ts | 8 ++++---- .../supplier-parts/supplier-parts.component.spec.ts | 2 +- .../components/parts-table/parts-table.component.spec.ts | 6 +++--- frontend/src/assets/locales/de/common.json | 2 +- frontend/src/assets/locales/en/common.json | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/modules/page/other-parts/presentation/other-parts.component.spec.ts b/frontend/src/app/modules/page/other-parts/presentation/other-parts.component.spec.ts index 614bb3b3f0..9509a35640 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/other-parts.component.spec.ts +++ b/frontend/src/app/modules/page/other-parts/presentation/other-parts.component.spec.ts @@ -114,8 +114,8 @@ describe('Other Parts', () => { await renderOtherParts({ roles: [ 'user' ] }); fireEvent.click(screen.getAllByText('pageOtherParts.tab.supplier')[0]); - await waitFor(() => expect(screen.getByText('table.column.manufacturer')).toBeInTheDocument()); - fireEvent.click(screen.getByText('table.column.manufacturer')); + await waitFor(() => expect(screen.getByText('table.column.manufacturerName')).toBeInTheDocument()); + fireEvent.click(screen.getByText('table.column.manufacturerName')); const supplierParts = await firstValueFrom(otherPartsState.supplierPartsAsBuilt$); await waitFor(() => @@ -143,8 +143,8 @@ describe('Other Parts', () => { let tabs = screen.getAllByText('pageOtherParts.tab.customer'); fireEvent.click(tabs[0]); - await waitFor(() => expect(screen.getByText('table.column.manufacturer')).toBeInTheDocument()); - fireEvent.click(screen.getByText('table.column.manufacturer')); + await waitFor(() => expect(screen.getByText('table.column.manufacturerName')).toBeInTheDocument()); + fireEvent.click(screen.getByText('table.column.manufacturerName')); const customerParts = await firstValueFrom(otherPartsState.customerPartsAsBuilt$); await waitFor(() => diff --git a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts index 895d6caeda..46d5b3ab15 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts +++ b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts @@ -80,7 +80,7 @@ describe('SupplierPartsComponent', () => { let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); fireEvent.click(nameHeader); - expect(supplierPartsComponent['tableSupplierAsBuiltSortList']).toEqual([ [ 'name', 'asc' ] ]); + expect(supplierPartsComponent['tableSupplierAsBuiltSortList']).toEqual([ [ 'nameAtManufacturer', 'asc' ] ]); }); diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts index 8736f71fca..a1dac99812 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts @@ -75,8 +75,8 @@ describe('PartsTableComponent', () => { 'Filter', 'filterid', 'filteridShort', - 'filtername', // nameAtManufacturer - 'filtermanufacturer', + 'filternameAtManufacturer', // nameAtManufacturer + 'filtermanufacturerName', 'filterpartId', // Part number / Batch Number / JIS Number 'filtermanufacturerPartId', 'filtercustomerPartId', // --> semanticModel.customerPartId @@ -104,7 +104,7 @@ describe('PartsTableComponent', () => { 'Filter', 'filterid', 'filteridShort', - 'filtername', + 'filternameAtManufacturer', 'filtermanufacturer', 'filtermanufacturerPartId', 'filterclassification', diff --git a/frontend/src/assets/locales/de/common.json b/frontend/src/assets/locales/de/common.json index aa533c23c6..6dfc16cfe7 100644 --- a/frontend/src/assets/locales/de/common.json +++ b/frontend/src/assets/locales/de/common.json @@ -78,7 +78,7 @@ "id": "ID", "idShort": "Kurz-ID", "name": "Name", - "manufacturer": "Hersteller", + "manufacturerName": "Hersteller", "partId": "Produktnummer", "manufacturerPartId": "Hersteller Produktnummer", "customerPartId": "Kunden Produktnummer", diff --git a/frontend/src/assets/locales/en/common.json b/frontend/src/assets/locales/en/common.json index e61578d1ac..bfb9ea3b2a 100644 --- a/frontend/src/assets/locales/en/common.json +++ b/frontend/src/assets/locales/en/common.json @@ -78,7 +78,7 @@ "id": "ID", "idShort": "ID Short", "name": "Name", - "manufacturer": "Manufacturer", + "manufacturerName": "Manufacturer", "partId": "Part number", "manufacturerPartId": "Manufacturer part ID", "customerPartId": "Customer part ID", From 6f5b6cf09c597d3d78d5097066b0b472cdf42070 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 16:35:57 +0100 Subject: [PATCH 11/26] chore: TRACEFOSS-2726 changed implementation of asplanned / asbuilt injections to be correct inside table settings for proper requests --- .../customer-parts/customer-parts.component.html | 2 ++ .../customer-parts.component.spec.ts | 10 +++++----- .../supplier-parts/supplier-parts.component.html | 2 ++ .../app/modules/page/parts/model/parts.model.ts | 4 ++-- .../modules/shared/assembler/parts.assembler.ts | 14 ++++++-------- .../parts-as-built-configuration.model.ts | 2 +- ...arts-as-built-customer-configuration.model.ts | 4 ++-- ...arts-as-built-supplier-configuration.model.ts | 2 +- .../parts-as-planned-configuration.model.ts | 2 +- ...ts-as-planned-customer-configuration.model.ts | 4 ++-- ...ts-as-planned-supplier-configuration.model.ts | 2 +- .../parts-table/parts-table-config.utils.ts | 14 +++++--------- .../parts-table/parts-table.component.html | 16 +++++++++++++--- .../parts-table/parts-table.component.spec.ts | 2 +- .../parts-table/parts-table.component.ts | 10 ++++++---- .../src/assets/locales/de/page.otherParts.json | 2 +- frontend/src/assets/locales/de/partDetail.json | 2 +- .../src/assets/locales/en/page.otherParts.json | 2 +- frontend/src/assets/locales/en/partDetail.json | 2 +- 19 files changed, 54 insertions(+), 44 deletions(-) diff --git a/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.html b/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.html index ddabac0f7a..c71275fd18 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.html +++ b/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.html @@ -39,6 +39,7 @@ [tableHeader]='"page.asBuiltParts" | i18n' (filterActivated)="filterActivated(true, $event )" [tableType]="PartTableType.AS_BUILT_CUSTOMER" + [mainAspectType]="MainAspectType.AS_BUILT" >
@@ -66,6 +67,7 @@ [multiSelectActive]="true" (filterActivated)="filterActivated(false, $event )" [tableType]="PartTableType.AS_PLANNED_CUSTOMER" + [mainAspectType]="MainAspectType.AS_PLANNED" >
diff --git a/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.spec.ts b/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.spec.ts index 6d0973ab15..cf3ebe8bb2 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.spec.ts +++ b/frontend/src/app/modules/page/other-parts/presentation/customer-parts/customer-parts.component.spec.ts @@ -58,10 +58,10 @@ describe('CustomerPartsComponent', () => { const { fixture } = await renderCustomerParts(); const customerPartsComponent = fixture.componentInstance; - let nameHeader = await screen.findByText('table.column.name'); + let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); fireEvent.click(nameHeader); - expect(customerPartsComponent['tableCustomerAsBuiltSortList']).toEqual([ [ 'name', 'asc' ] ]); + expect(customerPartsComponent['tableCustomerAsBuiltSortList']).toEqual([ [ 'nameAtManufacturer', 'asc' ] ]); }); @@ -69,7 +69,7 @@ describe('CustomerPartsComponent', () => { const { fixture } = await renderCustomerParts(); const customerPartsComponent = fixture.componentInstance; - let nameHeader = await screen.findByText('table.column.name'); + let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); fireEvent.click(nameHeader); let semanticModelIdHeader = await screen.findByText('table.column.semanticModelId'); @@ -94,7 +94,7 @@ describe('CustomerPartsComponent', () => { await waitFor(() => { fireEvent.click(semanticModelIdHeader); }); - expect(customerPartsComponent['tableCustomerAsBuiltSortList']).toEqual([ [ 'name', 'asc' ], [ 'semanticModelId', 'desc' ] ]); + expect(customerPartsComponent['tableCustomerAsBuiltSortList']).toEqual([ [ 'nameAtManufacturer', 'asc' ], [ 'semanticModelId', 'desc' ] ]); }); it('should reset sorting on third click', async () => { @@ -103,7 +103,7 @@ describe('CustomerPartsComponent', () => { customerPartsComponent.bomLifecycle = MainAspectType.AS_BUILT; fixture.detectChanges(); - let nameHeader = await screen.findByText('table.column.name'); + let nameHeader = await screen.findByText('table.column.nameAtManufacturer'); fireEvent.click(nameHeader); let semanticModelIdHeader = await screen.findByText('table.column.semanticModelId'); diff --git a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.html b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.html index 82e8ccceed..ef075cd293 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.html +++ b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.html @@ -46,6 +46,7 @@ [multiSortList]="tableSupplierAsBuiltSortList" (filterActivated)="filterActivated(true, $event )" [tableType]="PartTableType.AS_BUILT_SUPPLIER" + [mainAspectType]="MainAspectType.AS_BUILT" > @@ -77,6 +78,7 @@ [multiSelectActive]="true" (filterActivated)="filterActivated(false, $event )" [tableType]="PartTableType.AS_PLANNED_SUPPLIER" + [mainAspectType]="MainAspectType.AS_PLANNED" > diff --git a/frontend/src/app/modules/page/parts/model/parts.model.ts b/frontend/src/app/modules/page/parts/model/parts.model.ts index f5fa754fa3..b50b42b67c 100644 --- a/frontend/src/app/modules/page/parts/model/parts.model.ts +++ b/frontend/src/app/modules/page/parts/model/parts.model.ts @@ -29,7 +29,7 @@ export interface Part { id: string; idShort: string; name: string; - manufacturer: string; + manufacturerName: string; manufacturerPartId: string; nameAtManufacturer: string; businessPartner: string; @@ -138,7 +138,7 @@ export interface AssetAsBuiltFilter { id?: string, idShort?: string, name?: string, - manufacturer?: string, + manufacturerName?: string, partId?: string, manufacturerPartId?: string, customerPartId?: string, diff --git a/frontend/src/app/modules/shared/assembler/parts.assembler.ts b/frontend/src/app/modules/shared/assembler/parts.assembler.ts index 7ea33022e7..2aa76a4ccd 100644 --- a/frontend/src/app/modules/shared/assembler/parts.assembler.ts +++ b/frontend/src/app/modules/shared/assembler/parts.assembler.ts @@ -77,7 +77,7 @@ export class PartsAssembler { id: partResponse.id, idShort: partResponse.idShort, semanticModelId: partResponse.semanticModelId, - manufacturer: partResponse.manufacturerName, + manufacturerName: partResponse.manufacturerName, manufacturerPartId: partResponse.manufacturerPartId, nameAtManufacturer: partResponse.nameAtManufacturer, businessPartner: partResponse.businessPartner, @@ -168,9 +168,7 @@ export class PartsAssembler { semanticModelId, manufacturingDate, manufacturingCountry, - classification, - - + classification } as Part }; } @@ -188,19 +186,19 @@ export class PartsAssembler { // exclude 'van' if is a partAsPlanned if (viewData.data?.mainAspectType === MainAspectType.AS_BUILT) { const { - manufacturer, + manufacturerName, manufacturerPartId, nameAtManufacturer, van, } = viewData.data; - return {data: {manufacturer, manufacturerPartId, nameAtManufacturer, van} as Part}; + return {data: {manufacturerName, manufacturerPartId, nameAtManufacturer, van} as Part}; } else { const { - manufacturer, + manufacturerName, manufacturerPartId, nameAtManufacturer, } = viewData.data; - return {data: {manufacturer, manufacturerPartId, nameAtManufacturer} as Part}; + return {data: {manufacturerName, manufacturerPartId, nameAtManufacturer} as Part}; } }); } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts index 46e23ab63b..ffcf96b787 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts @@ -51,7 +51,7 @@ export class PartsAsBuiltConfigurationModel { receivedActiveInvestigations: true, sentActiveAlerts: true, sentActiveInvestigations: true, - menu: false + // menu: false }; private static displayedColumns = Object.keys(this.sortableColumns); diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts index 4c79c3a06b..d4abeb26e3 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts @@ -45,14 +45,14 @@ export class PartsAsBuiltCustomerConfigurationModel{ receivedActiveInvestigations: true, sentActiveAlerts: true, sentActiveInvestigations: true, - menu: false + //menu: false }; private static displayedColumns = Object.keys(this.sortableColumns); private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); - private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns, true); + private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); private static dateFields = ['manufacturingDate']; private static singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts index c17c310e1a..bcc814abeb 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts @@ -45,7 +45,7 @@ export class PartsAsBuiltSupplierConfigurationModel { receivedActiveInvestigations: true, sentActiveAlerts: true, sentActiveInvestigations: true, - menu: false + //menu: false }; private static displayedColumns = Object.keys(this.sortableColumns); diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts index 3bb8ece114..a9bddc3060 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts @@ -49,7 +49,7 @@ export class PartsAsPlannedConfigurationModel { catenaXSiteId: true, functionValidFrom: true, functionValidUntil: true, - menu: false + // menu: false }; private static displayedColumns = Object.keys(this.sortableColumns); diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts index a1d814fc22..29c3d326ff 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts @@ -40,12 +40,12 @@ export class PartsAsPlannedCustomerConfigurationModel { manufacturerName: true, manufacturerPartId: true, semanticModelId: true, - menu: false + // menu: false }; private static displayedColumns = Object.keys(this.sortableColumns); private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); - private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns, true); + private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns); diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts index 96e165dfcc..a913add89d 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts @@ -40,7 +40,7 @@ export class PartsAsPlannedSupplierConfigurationModel { manufacturerName: true, manufacturerPartId: true, semanticModelId: true, - menu: false + //menu: false }; private static displayedColumns = Object.keys(this.sortableColumns); diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table-config.utils.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table-config.utils.ts index 87db66aef6..c74c2cc185 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table-config.utils.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table-config.utils.ts @@ -14,14 +14,11 @@ export class PartsTableConfigUtils { return formGroup; } - public static createFilterColumns(displayedColumns: string[], noSelect?: boolean): string[] { + public static createFilterColumns(displayedColumns: string[]): string[] { const array = displayedColumns.filter((column: string) => 'select' !== column && 'menu' !== column).map((column: string) => 'filter' + column); - if (noSelect) { - return array; - } else { - return ["Filter", ...array]; - } + return ["Filter", ...array]; + } @@ -39,10 +36,9 @@ export class PartsTableConfigUtils { let columnMapping: { filterKey: string; headerKey: string; isDate?: boolean; singleSearch?: boolean; }; if (dateFields?.includes(filterKey)) { columnMapping = {filterKey, headerKey, isDate: true}; - } else if (singleSearchFields?.includes(filterKey)){ + } else if (singleSearchFields?.includes(filterKey)) { columnMapping = {filterKey, headerKey, singleSearch: true}; - } - else { + } else { columnMapping = {filterKey, headerKey}; } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html index de0d4ff072..11ece86aba 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html @@ -62,7 +62,7 @@ [hidden]="displayedFilter"> - + {{ 'table.noResultFound' | i18n }} - + notification_important - + + + notification_important + + + + + inbox + + + inbox diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts index a1dac99812..ec7bb144c8 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.spec.ts @@ -105,7 +105,7 @@ describe('PartsTableComponent', () => { 'filterid', 'filteridShort', 'filternameAtManufacturer', - 'filtermanufacturer', + 'filtermanufacturerName', 'filtermanufacturerPartId', 'filterclassification', 'filtersemanticDataModel', diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts index 84404f8b30..9692c481b6 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts @@ -150,14 +150,17 @@ export class PartsTableComponent implements OnInit { public isMenuOpen: boolean; public displayedFilter: boolean; + // TODO remove it and set only in tableViewConfig public filterConfiguration: any[]; + // TODO remove it and set only in tableViewConfig public displayedColumns: string[]; + // TODO remove it and set only in tableViewConfig public defaultColumns: string[]; + // TODO remove it and set only in tableViewConfig + filterFormGroup = new FormGroup({}); public tableViewConfig: TableViewConfig; - filterFormGroup = new FormGroup({}); - public isNotificationCountColumn(column: any) { return column === 'receivedActiveAlerts' || column === 'sentActiveAlerts' || column === 'receivedActiveInvestigations' || column === 'sentActiveInvestigations'; } @@ -254,8 +257,7 @@ export class PartsTableComponent implements OnInit { header: CreateHeaderFromColumns(displayedColumnsForTable, headerKey), sortableColumns: sortableColumns, }; - // todo check if this breaks - this.filterConfiguration = filterConfiguration; + this.displayedColumns = displayedColumns; for (const controlName in filterFormGroup) { if (filterFormGroup.hasOwnProperty(controlName)) { diff --git a/frontend/src/assets/locales/de/page.otherParts.json b/frontend/src/assets/locales/de/page.otherParts.json index 651242e793..fcf10f1899 100644 --- a/frontend/src/assets/locales/de/page.otherParts.json +++ b/frontend/src/assets/locales/de/page.otherParts.json @@ -14,7 +14,7 @@ "partId": "Produktnummer", "semanticModelId": "Semantische Modellnummer", "manufacturingDate": "Produktionsdatum", - "manufacturer": "Hersteller", + "manufacturerName": "Hersteller", "nameAtCustomer": "Name beim Kunden", "customerPartId": "Kunden Produktnummer", "semanticDataModel": "Semantisches Datenmodell" diff --git a/frontend/src/assets/locales/de/partDetail.json b/frontend/src/assets/locales/de/partDetail.json index 87be49bda4..61fba07fb5 100644 --- a/frontend/src/assets/locales/de/partDetail.json +++ b/frontend/src/assets/locales/de/partDetail.json @@ -12,7 +12,7 @@ "semanticModelId": "Semantische Modellnummer", "qualityType": "Qualitätsstufe", "productionDate": "Produktionsdatum", - "manufacturer": "Hersteller", + "manufacturerName": "Hersteller", "manufacturerPartId": "Hersteller Produktnummer", "nameAtManufacturer": "Hersteller Produktname", "nameAtCustomer": "Name beim Kunden", diff --git a/frontend/src/assets/locales/en/page.otherParts.json b/frontend/src/assets/locales/en/page.otherParts.json index ecdc572afe..9f411c78aa 100644 --- a/frontend/src/assets/locales/en/page.otherParts.json +++ b/frontend/src/assets/locales/en/page.otherParts.json @@ -14,7 +14,7 @@ "partId": "Part number", "semanticModelId": "Semantic Model ID", "manufacturingDate": "Production date", - "manufacturer": "Manufacturer", + "manufacturerName": "Manufacturer", "nameAtCustomer": "Name at customer", "customerPartId": "Customer part ID", "semanticDataModel": "Semantic Data Model" diff --git a/frontend/src/assets/locales/en/partDetail.json b/frontend/src/assets/locales/en/partDetail.json index 7e1f707f8e..a5b9531cb7 100644 --- a/frontend/src/assets/locales/en/partDetail.json +++ b/frontend/src/assets/locales/en/partDetail.json @@ -12,7 +12,7 @@ "semanticModelId": "Semantic Model ID", "qualityType": "Quality type", "productionDate": "Production date", - "manufacturer": "Manufacturer", + "manufacturerName": "Manufacturer", "manufacturerPartId": "Manufacturer part ID", "nameAtManufacturer": "Name at manufacturer", "nameAtCustomer": "Name at customer", From 85cf4483a08e8d4985b1a21b235a84343adfcd4a Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 16:56:33 +0100 Subject: [PATCH 12/26] chore: TRACEFOSS-2726 changed implementation of asplanned / asbuilt injections to be correct inside table settings for proper requests --- .../supplier-parts/supplier-parts.component.spec.ts | 2 +- .../src/app/modules/page/parts/model/parts.model.ts | 1 - .../shared/assembler/parts.assembler.spec.ts | 13 ++++--------- .../app/modules/shared/assembler/parts.assembler.ts | 5 +---- .../request-notification.base.html | 10 +++++----- .../modules/relations/core/relations.assembler.ts | 2 +- 6 files changed, 12 insertions(+), 21 deletions(-) diff --git a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts index 46d5b3ab15..157d509768 100644 --- a/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts +++ b/frontend/src/app/modules/page/other-parts/presentation/supplier-parts/supplier-parts.component.spec.ts @@ -113,7 +113,7 @@ describe('SupplierPartsComponent', () => { await waitFor(() => { fireEvent.click(semanticModelIdHeader); }); - expect(supplierPartsComponent['tableSupplierAsBuiltSortList']).toEqual([ [ 'name', 'asc' ], [ 'semanticModelId', 'desc' ] ]); + expect(supplierPartsComponent['tableSupplierAsBuiltSortList']).toEqual([ [ 'nameAtManufacturer', 'asc' ], [ 'semanticModelId', 'desc' ] ]); }); it('should reset sorting on third click', async () => { diff --git a/frontend/src/app/modules/page/parts/model/parts.model.ts b/frontend/src/app/modules/page/parts/model/parts.model.ts index b50b42b67c..7d918a23f0 100644 --- a/frontend/src/app/modules/page/parts/model/parts.model.ts +++ b/frontend/src/app/modules/page/parts/model/parts.model.ts @@ -28,7 +28,6 @@ import {Owner} from '@page/parts/model/owner.enum'; export interface Part { id: string; idShort: string; - name: string; manufacturerName: string; manufacturerPartId: string; nameAtManufacturer: string; diff --git a/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts b/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts index 8b5f8e2151..a7b4c8eb5f 100644 --- a/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts +++ b/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts @@ -116,12 +116,10 @@ describe('PartsAssembler', () => { id, idShort: idShort, semanticModelId: semanticModelId, - - manufacturer: manufacturerName, + manufacturerName: manufacturerName, manufacturerPartId: manufacturerPartId, nameAtManufacturer: nameAtManufacturer, businessPartner: businessPartner, - name: nameAtManufacturer, children: [], parents: [], activeAlert: false, @@ -130,11 +128,8 @@ describe('PartsAssembler', () => { van: 'van', semanticDataModel: SemanticDataModel.BATCH, classification: classification, - semanticModel: semanticModel, - mainAspectType: mainAspectType, - partId: partId, // is partInstance, BatchId, jisNumber customerPartId: customerPartId, nameAtCustomer: nameAtCustomer, @@ -169,19 +164,19 @@ describe('PartsAssembler', () => { }); describe('mapPartForManufacturerView', () => { - const manufacturer = 'manufacturer'; + const manufacturerName = 'manufacturerName'; const manufacturerPartId = 'manufacturerPartId'; const nameAtManufacturer = 'nameAtManufacturer'; const van = 'van'; const mainAspectType = MainAspectType.AS_BUILT it('should clean up data for manufacturer view', done => { - const data = { manufacturer, manufacturerPartId, nameAtManufacturer, test: '', van, mainAspectType } as unknown as Part; + const data = { manufacturerName, manufacturerPartId, nameAtManufacturer, test: '', van, mainAspectType } as unknown as Part; of({ data }) .pipe(PartsAssembler.mapPartForManufacturerView()) .subscribe(result => { expect(result).toEqual({ - data: { manufacturer, manufacturerPartId, nameAtManufacturer, van } as unknown as Part, + data: { manufacturerName, manufacturerPartId, nameAtManufacturer, van } as unknown as Part, }); done(); }); diff --git a/frontend/src/app/modules/shared/assembler/parts.assembler.ts b/frontend/src/app/modules/shared/assembler/parts.assembler.ts index 2aa76a4ccd..8c2fb2526d 100644 --- a/frontend/src/app/modules/shared/assembler/parts.assembler.ts +++ b/frontend/src/app/modules/shared/assembler/parts.assembler.ts @@ -81,7 +81,6 @@ export class PartsAssembler { manufacturerPartId: partResponse.manufacturerPartId, nameAtManufacturer: partResponse.nameAtManufacturer, businessPartner: partResponse.businessPartner, - name: partResponse.nameAtManufacturer, children: partResponse.childRelations.map(child => child.id) || [], parents: partResponse.parentRelations?.map(parent => parent.id) || [], activeAlert: partResponse.activeAlert || false, @@ -120,7 +119,7 @@ export class PartsAssembler { sentActiveAlerts: partResponse.sentQualityAlertIdsInStatusActive, receivedActiveAlerts: partResponse.receivedQualityAlertIdsInStatusActive, sentActiveInvestigations: partResponse.sentQualityInvestigationIdsInStatusActive, - receivedActiveInvestigations: partResponse.receivedQualityInvestigationIdsInStatusActive, + receivedActiveInvestigations: partResponse.receivedQualityInvestigationIdsInStatusActive }; @@ -153,7 +152,6 @@ export class PartsAssembler { } const { - name, semanticDataModel, semanticModelId, manufacturingDate, @@ -163,7 +161,6 @@ export class PartsAssembler { } = viewData.data; return { data: { - name, semanticDataModel, semanticModelId, manufacturingDate, diff --git a/frontend/src/app/modules/shared/components/request-notification/request-notification.base.html b/frontend/src/app/modules/shared/components/request-notification/request-notification.base.html index 0f834850ed..31fb4503d4 100644 --- a/frontend/src/app/modules/shared/components/request-notification/request-notification.base.html +++ b/frontend/src/app/modules/shared/components/request-notification/request-notification.base.html @@ -26,12 +26,12 @@

{{ this.context + '.headline' close - - {{ part.name || part.id }} + + {{ part.nameAtManufacturer || part.id }} @@ -42,13 +42,13 @@

{{ this.context + '.headline'

{{ 'requestNotification.restoreItem' | i18n }}

restore - {{ removedItemsHistory[0].name || removedItemsHistory[0].id }} + {{ removedItemsHistory[0].nameAtManufacturer || removedItemsHistory[0].id }} diff --git a/frontend/src/app/modules/shared/modules/relations/core/relations.assembler.ts b/frontend/src/app/modules/shared/modules/relations/core/relations.assembler.ts index 0d142d356c..5eadc211d6 100644 --- a/frontend/src/app/modules/shared/modules/relations/core/relations.assembler.ts +++ b/frontend/src/app/modules/shared/modules/relations/core/relations.assembler.ts @@ -25,7 +25,7 @@ import _deepClone from 'lodash-es/cloneDeep'; export class RelationsAssembler { public static assemblePartForRelation(part: Part, idFallback?: string): TreeElement { - const { id, name: text = idFallback, semanticDataModel, children, parents } = part || {}; + const { id, nameAtManufacturer: text = idFallback, semanticDataModel, children, parents } = part || {}; const mapBatchToState = (type: SemanticDataModel): SemanticDataModel | string => { if(type && type.toUpperCase() in SemanticDataModel) { From 8e7b03e87b2aeef9390ebb47983bc9a5b5cc7c94 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 21:48:45 +0100 Subject: [PATCH 13/26] chore: TRACEFOSS-2726 changed implementation of asplanned / asbuilt injections to be correct inside table settings for proper requests --- .../src/app/modules/shared/assembler/parts.assembler.spec.ts | 2 +- .../request-notification/request-notification.base.spec.ts | 2 +- .../shared/modules/relations/core/relations.assembler.spec.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts b/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts index a7b4c8eb5f..d3255f2f1a 100644 --- a/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts +++ b/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts @@ -152,7 +152,7 @@ describe('PartsAssembler', () => { it('should clean up data for part view', () => { const data = { semanticDataModel, semanticModelId, manufacturingDate, manufacturingCountry, classification, test: '' } as unknown as Part; expect(PartsAssembler.filterPartForView({ data })).toEqual({ - data: { name: undefined, manufacturingDate, semanticModelId, semanticDataModel, manufacturingCountry, classification } as unknown as Part, + data: { nameAtManufacturer: undefined, manufacturingDate, semanticModelId, semanticDataModel, manufacturingCountry, classification } as unknown as Part, }); }); diff --git a/frontend/src/app/modules/shared/components/request-notification/request-notification.base.spec.ts b/frontend/src/app/modules/shared/components/request-notification/request-notification.base.spec.ts index b7f2780d8d..8959e9546f 100644 --- a/frontend/src/app/modules/shared/components/request-notification/request-notification.base.spec.ts +++ b/frontend/src/app/modules/shared/components/request-notification/request-notification.base.spec.ts @@ -33,7 +33,7 @@ describe('requestInvestigationComponent', () => { let deselectPartMock: jasmine.Spy; let clearSelectedMock: jasmine.Spy; let submittedMock: jasmine.Spy; - const currentSelectedItems = [{ name: 'part_1' }, { name: 'part_2' }, { name: 'part_3' }]; + const currentSelectedItems = [{ nameAtManufacturer: 'part_1' }, { nameAtManufacturer: 'part_2' }, { nameAtManufacturer: 'part_3' }]; const renderRequestInvestigationComponent = async () => { return renderComponent( diff --git a/frontend/src/app/modules/shared/modules/relations/core/relations.assembler.spec.ts b/frontend/src/app/modules/shared/modules/relations/core/relations.assembler.spec.ts index 075e9c1e2e..e11667be06 100644 --- a/frontend/src/app/modules/shared/modules/relations/core/relations.assembler.spec.ts +++ b/frontend/src/app/modules/shared/modules/relations/core/relations.assembler.spec.ts @@ -26,7 +26,7 @@ import { TreeElement, TreeStructure } from '@shared/modules/relations/model/rela describe('Relations assembler', () => { describe('assemblePartForRelation', () => { it('should assemble loading part', () => { - const part = { id: 'id', name: 'name', semanticModelId: 'semanticModelId', children: null, parents: null } as Part; + const part = { id: 'id', nameAtManufacturer: 'name', semanticModelId: 'semanticModelId', children: null, parents: null } as Part; const expected = { children: null, parents: null, @@ -38,7 +38,7 @@ describe('Relations assembler', () => { expect(RelationsAssembler.assemblePartForRelation(part)).toEqual(expected); }); it('should assemble finished loading part', () => { - const part = { id: 'id', name: 'name', semanticModelId: 'semanticModelId', children: [], parents: [] } as Part; + const part = { id: 'id', nameAtManufacturer: 'name', semanticModelId: 'semanticModelId', children: [], parents: [] } as Part; const expected = { children: [], parents: [], From 376459c387ca061b066808b6e48c650586413b87 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 21:51:21 +0100 Subject: [PATCH 14/26] chore: TRACEFOSS-2726 changed implementation of asplanned / asbuilt injections to be correct inside table settings for proper requests --- .../src/app/modules/shared/assembler/parts.assembler.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts b/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts index d3255f2f1a..689f00724d 100644 --- a/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts +++ b/frontend/src/app/modules/shared/assembler/parts.assembler.spec.ts @@ -149,10 +149,11 @@ describe('PartsAssembler', () => { const manufacturingCountry = 'manufacturingCountry'; const classification = 'classification'; + it('should clean up data for part view', () => { const data = { semanticDataModel, semanticModelId, manufacturingDate, manufacturingCountry, classification, test: '' } as unknown as Part; expect(PartsAssembler.filterPartForView({ data })).toEqual({ - data: { nameAtManufacturer: undefined, manufacturingDate, semanticModelId, semanticDataModel, manufacturingCountry, classification } as unknown as Part, + data: { manufacturingDate, semanticModelId, semanticDataModel, manufacturingCountry, classification } as unknown as Part, }); }); From 3a51b102d00234f03194f905c4e04b1a12219ee8 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Wed, 22 Nov 2023 22:49:34 +0100 Subject: [PATCH 15/26] chore: TRACEFOSS-2726 refactored duplicate configurations. --- .../parts-as-built-configuration.model.ts | 69 ++++++++----------- ...s-as-built-customer-configuration.model.ts | 64 ++++++----------- ...s-as-built-supplier-configuration.model.ts | 59 ++++++---------- .../parts-as-planned-configuration.model.ts | 61 +++++++--------- ...as-planned-customer-configuration.model.ts | 47 ++++--------- ...as-planned-supplier-configuration.model.ts | 47 ++++--------- .../parts-table/parts-config.model.ts | 54 +++++++++++++++ .../parts-table/parts-table.component.ts | 13 ++-- 8 files changed, 184 insertions(+), 230 deletions(-) create mode 100644 frontend/src/app/modules/shared/components/parts-table/parts-config.model.ts diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts index ffcf96b787..f62d29cfee 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-configuration.model.ts @@ -16,50 +16,35 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import {FormControl} from "@angular/forms"; -import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; -import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; +import {TableFilterConfiguration} from "@shared/components/parts-table/parts-config.model"; -export class PartsAsBuiltConfigurationModel { - public static filterConfiguration(): TableViewConfig { +export class PartsAsBuiltConfigurationModel extends TableFilterConfiguration { + constructor() { + const sortableColumns = { + select: false, + id: true, + idShort: true, + nameAtManufacturer: true, + manufacturerName: true, + partId: true, + manufacturerPartId: true, + customerPartId: true, + classification: true, + nameAtCustomer: true, + semanticModelId: true, + semanticDataModel: true, + manufacturingDate: true, + manufacturingCountry: true, + receivedActiveAlerts: true, + receivedActiveInvestigations: true, + sentActiveAlerts: true, + sentActiveInvestigations: true, + // menu: false + }; - return { - filterColumns: this.filterColumns, - displayedColumns: this.displayedColumns, - displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, - filterFormGroup: this.formGroup, - sortableColumns: this.sortableColumns - } + const dateFields = ['manufacturingDate']; + const singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; + super(sortableColumns, dateFields, singleSearchFields); } - private static sortableColumns: Record = { - select: false, - id: true, - idShort: true, - nameAtManufacturer: true, - manufacturerName: true, - partId: true, - manufacturerPartId: true, - customerPartId: true, - classification: true, - nameAtCustomer: true, - semanticModelId: true, - semanticDataModel: true, - manufacturingDate: true, - manufacturingCountry: true, - receivedActiveAlerts: true, - receivedActiveInvestigations: true, - sentActiveAlerts: true, - sentActiveInvestigations: true, - // menu: false - }; - - private static displayedColumns = Object.keys(this.sortableColumns); - private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); - private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); - private static dateFields = ['manufacturingDate']; - private static singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; - private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns, this.dateFields, this.singleSearchFields); - } - diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts index d4abeb26e3..ba48c6bb14 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-customer-configuration.model.ts @@ -16,48 +16,28 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import {FormControl} from "@angular/forms"; -import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; -import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; - -export class PartsAsBuiltCustomerConfigurationModel{ - - public static filterConfiguration(): TableViewConfig { - - return { - filterColumns: this.filterColumns, - displayedColumns: this.displayedColumns, - displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, - filterFormGroup: this.formGroup, - sortableColumns: this.sortableColumns - } +import {TableFilterConfiguration} from "@shared/components/parts-table/parts-config.model"; + +export class PartsAsBuiltCustomerConfigurationModel extends TableFilterConfiguration { + + constructor() { + const sortableColumns = { + select: false, + semanticDataModel: true, + nameAtManufacturer: true, + manufacturerName: true, + manufacturerPartId: true, + semanticModelId: true, + manufacturingDate: true, + receivedActiveAlerts: true, + receivedActiveInvestigations: true, + sentActiveAlerts: true, + sentActiveInvestigations: true, + //menu: false + }; + const dateFields = ['manufacturingDate']; + const singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; + super(sortableColumns, dateFields, singleSearchFields); } - - private static sortableColumns: Record = { - select: false, - semanticDataModel: true, - nameAtManufacturer: true, - manufacturerName: true, - manufacturerPartId: true, - semanticModelId: true, - manufacturingDate: true, - receivedActiveAlerts: true, - receivedActiveInvestigations: true, - sentActiveAlerts: true, - sentActiveInvestigations: true, - //menu: false - }; - - private static displayedColumns = Object.keys(this.sortableColumns); - - private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); - - private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); - - private static dateFields = ['manufacturingDate']; - private static singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; - private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns, this.dateFields, this.singleSearchFields); - - } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts index bcc814abeb..082a9089d7 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-built-supplier-configuration.model.ts @@ -16,46 +16,29 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import {FormControl} from "@angular/forms"; -import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; -import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; - -export class PartsAsBuiltSupplierConfigurationModel { - - public static filterConfiguration(): TableViewConfig { - - return { - filterColumns: this.filterColumns, - displayedColumns: this.displayedColumns, - displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, - filterFormGroup: this.formGroup, - sortableColumns: this.sortableColumns - } +import {TableFilterConfiguration} from "@shared/components/parts-table/parts-config.model"; + +export class PartsAsBuiltSupplierConfigurationModel extends TableFilterConfiguration { + constructor() { + const sortableColumns = { + select: false, + semanticDataModel: true, + nameAtManufacturer: true, + manufacturerName: true, + manufacturerPartId: true, + semanticModelId: true, + manufacturingDate: true, + receivedActiveAlerts: true, + receivedActiveInvestigations: true, + sentActiveAlerts: true, + sentActiveInvestigations: true, + //menu: false + }; + const dateFields = ['manufacturingDate']; + const singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; + super(sortableColumns, dateFields, singleSearchFields); } - private static sortableColumns: Record = { - select: false, - semanticDataModel: true, - nameAtManufacturer: true, - manufacturerName: true, - manufacturerPartId: true, - semanticModelId: true, - manufacturingDate: true, - receivedActiveAlerts: true, - receivedActiveInvestigations: true, - sentActiveAlerts: true, - sentActiveInvestigations: true, - //menu: false - }; - private static displayedColumns = Object.keys(this.sortableColumns); - - private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); - - private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); - - private static dateFields = ['manufacturingDate']; - private static singleSearchFields = ['receivedActiveAlerts', 'sentActiveAlerts', 'receivedActiveInvestigations', 'sentActiveInvestigations']; - private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns, this.dateFields, this.singleSearchFields); } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts index a9bddc3060..5ed4fd3e05 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-configuration.model.ts @@ -16,47 +16,32 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import {FormControl} from "@angular/forms"; -import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; -import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; +import {TableFilterConfiguration} from "@shared/components/parts-table/parts-config.model"; -export class PartsAsPlannedConfigurationModel { +export class PartsAsPlannedConfigurationModel extends TableFilterConfiguration { - public static filterConfiguration(): TableViewConfig { + constructor() { + const sortableColumns = { + select: false, + id: true, + idShort: true, + nameAtManufacturer: true, + manufacturerName: true, + manufacturerPartId: true, + classification: true, + semanticDataModel: true, + semanticModelId: true, + validityPeriodFrom: true, + validityPeriodTo: true, + psFunction: true, + catenaXSiteId: true, + functionValidFrom: true, + functionValidUntil: true, + // menu: false + }; - return { - filterColumns: this.filterColumns, - displayedColumns: this.displayedColumns, - displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, - filterFormGroup: this.formGroup, - sortableColumns: this.sortableColumns - } + const dateFields = ['validityPeriodFrom', 'validityPeriodTo', 'functionValidFrom', 'functionValidUntil']; + super(sortableColumns, dateFields); } - - private static sortableColumns: Record = { - select: false, - id: true, - idShort: true, - nameAtManufacturer: true, - manufacturerName: true, - manufacturerPartId: true, - classification: true, - semanticDataModel: true, - semanticModelId: true, - validityPeriodFrom: true, - validityPeriodTo: true, - psFunction: true, - catenaXSiteId: true, - functionValidFrom: true, - functionValidUntil: true, - // menu: false - }; - - private static displayedColumns = Object.keys(this.sortableColumns); - private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); - private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); - private static dateFields = ['validityPeriodFrom', 'validityPeriodTo', 'functionValidFrom', 'functionValidUntil']; - private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns, this.dateFields); - } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts index 29c3d326ff..3529e0465b 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-customer-configuration.model.ts @@ -16,38 +16,21 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import {FormControl} from "@angular/forms"; -import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; -import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; - -export class PartsAsPlannedCustomerConfigurationModel { - - public static filterConfiguration(): TableViewConfig { - - return { - filterColumns: this.filterColumns, - displayedColumns: this.displayedColumns, - displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, - filterFormGroup: this.formGroup, - sortableColumns: this.sortableColumns - } +import {TableFilterConfiguration} from "@shared/components/parts-table/parts-config.model"; + +export class PartsAsPlannedCustomerConfigurationModel extends TableFilterConfiguration { + + constructor() { + const sortableColumns = { + select: false, + semanticDataModel: true, + nameAtManufacturer: true, + manufacturerName: true, + manufacturerPartId: true, + semanticModelId: true, + // menu: false + }; + super(sortableColumns); } - - private static sortableColumns: Record = { - select: false, - semanticDataModel: true, - nameAtManufacturer: true, - manufacturerName: true, - manufacturerPartId: true, - semanticModelId: true, - // menu: false - }; - - private static displayedColumns = Object.keys(this.sortableColumns); - private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); - private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); - private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns); - - } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts index a913add89d..6551e7ab8f 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts @@ -16,40 +16,23 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import {FormControl} from "@angular/forms"; -import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; -import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; - -export class PartsAsPlannedSupplierConfigurationModel { - - public static filterConfiguration(): TableViewConfig { - - return { - filterColumns: this.filterColumns, - displayedColumns: this.displayedColumns, - displayFilterColumnMappings: this.displayColumnsToFilterColumnsMapping, - filterFormGroup: this.formGroup, - sortableColumns: this.sortableColumns - } +import {TableFilterConfiguration} from "@shared/components/parts-table/parts-config.model"; + +export class PartsAsPlannedSupplierConfigurationModel extends TableFilterConfiguration { + + constructor() { + const sortableColumns = { + select: false, + semanticDataModel: true, + nameAtManufacturer: true, + manufacturerName: true, + manufacturerPartId: true, + semanticModelId: true, + //menu: false + }; + super(sortableColumns); } - private static sortableColumns: Record = { - select: false, - semanticDataModel: true, - nameAtManufacturer: true, - manufacturerName: true, - manufacturerPartId: true, - semanticModelId: true, - //menu: false - }; - - private static displayedColumns = Object.keys(this.sortableColumns); - - private static formGroup: Record = PartsTableConfigUtils.createFormGroup(this.displayedColumns); - - private static filterColumns: string[] = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); - private static displayColumnsToFilterColumnsMapping: any[] = PartsTableConfigUtils.generateFilterColumnsMapping(this.sortableColumns); - } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-config.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-config.model.ts new file mode 100644 index 0000000000..27d8b4ff33 --- /dev/null +++ b/frontend/src/app/modules/shared/components/parts-table/parts-config.model.ts @@ -0,0 +1,54 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + + +import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; + + +import {PartsTableConfigUtils} from "@shared/components/parts-table/parts-table-config.utils"; + + +export class TableFilterConfiguration implements TableViewConfig { + filterColumns: any; + displayedColumns: any; + displayFilterColumnMappings: any; + filterFormGroup: any; + sortableColumns: any; + + constructor(sortableColumns: any, dateFields?: any, singleSearchFields?: any) { + this.displayedColumns = Object.keys(sortableColumns); + this.filterFormGroup = PartsTableConfigUtils.createFormGroup(this.displayedColumns); + this.filterColumns = PartsTableConfigUtils.createFilterColumns(this.displayedColumns); + this.sortableColumns = sortableColumns; + this.displayFilterColumnMappings = PartsTableConfigUtils.generateFilterColumnsMapping(sortableColumns, dateFields, singleSearchFields); + + } + + public filterConfiguration(): TableViewConfig { + return { + filterColumns: this.filterColumns, + displayedColumns: this.displayedColumns, + displayFilterColumnMappings: this.displayFilterColumnMappings, + filterFormGroup: this.filterFormGroup, + sortableColumns: this.sortableColumns + } + } + +} + diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts index 9692c481b6..7e7c095648 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts @@ -170,24 +170,25 @@ export class PartsTableComponent implements OnInit { } private initializeTableViewSettings(): void { + switch (this.tableType) { case PartTableType.AS_PLANNED_CUSTOMER: - this.tableViewConfig = PartsAsPlannedCustomerConfigurationModel.filterConfiguration(); + this.tableViewConfig = new PartsAsPlannedCustomerConfigurationModel().filterConfiguration(); break; case PartTableType.AS_PLANNED_OWN: - this.tableViewConfig = PartsAsPlannedConfigurationModel.filterConfiguration(); + this.tableViewConfig = new PartsAsPlannedConfigurationModel().filterConfiguration(); break; case PartTableType.AS_PLANNED_SUPPLIER: - this.tableViewConfig = PartsAsPlannedSupplierConfigurationModel.filterConfiguration(); + this.tableViewConfig = new PartsAsPlannedSupplierConfigurationModel().filterConfiguration(); break; case PartTableType.AS_BUILT_OWN: - this.tableViewConfig = PartsAsBuiltConfigurationModel.filterConfiguration(); + this.tableViewConfig = new PartsAsBuiltConfigurationModel().filterConfiguration(); break; case PartTableType.AS_BUILT_CUSTOMER: - this.tableViewConfig = PartsAsBuiltCustomerConfigurationModel.filterConfiguration(); + this.tableViewConfig = new PartsAsBuiltCustomerConfigurationModel().filterConfiguration(); break; case PartTableType.AS_BUILT_SUPPLIER: - this.tableViewConfig = PartsAsBuiltSupplierConfigurationModel.filterConfiguration(); + this.tableViewConfig = new PartsAsBuiltSupplierConfigurationModel().filterConfiguration(); break; } } From 7dcfbe2025ad1347a3377c8939cd382b44be02e6 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 23 Nov 2023 11:19:15 +0100 Subject: [PATCH 16/26] chore: TRACEFOSS-2726 finalized split columsn of investigation / alert based on channel --- ...as-planned-supplier-configuration.model.ts | 2 -- .../parts-table/parts-table.component.html | 14 +++++++++++++ .../parts-table/parts-table.component.ts | 1 + .../table-settings.component.html | 20 ++++++++++++++++++ .../table-settings.component.scss | 1 + frontend/src/assets/locales/de/common.json | 12 ++++++----- frontend/src/assets/locales/en/common.json | 12 ++++++----- frontend/src/theme/base.scss | 21 ++++++++++++++++++- 8 files changed, 70 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts index 6551e7ab8f..81c65511f4 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-as-planned-supplier-configuration.model.ts @@ -32,7 +32,5 @@ export class PartsAsPlannedSupplierConfigurationModel extends TableFilterConfigu }; super(sortableColumns); } - - } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html index 11ece86aba..dbe543df86 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html @@ -176,9 +176,23 @@

{{ 'table.noResultFound' | i18n }}

mat-header-cell class="table--cell table--header--normal--cell" > + {{ tableConfig?.header?.[column] | i18n }} + + + notification_important + + + + + + inbox + + + + diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts index 7e7c095648..7ada945e28 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts @@ -259,6 +259,7 @@ export class PartsTableComponent implements OnInit { sortableColumns: sortableColumns, }; + console.log(this.tableConfig, "tableconfig"); this.displayedColumns = displayedColumns; for (const controlName in filterFormGroup) { if (filterFormGroup.hasOwnProperty(controlName)) { diff --git a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.html b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.html index dc2097d368..a0d7c53d86 100644 --- a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.html +++ b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.html @@ -63,6 +63,26 @@ class="dialog--columns--columns--list" > {{'table.column.' + item | i18n}} + + + notification_important + + + + + inbox + + + + diff --git a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.scss b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.scss index fdd42215f2..15bcdd3e68 100644 --- a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.scss +++ b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.scss @@ -44,6 +44,7 @@ padding-bottom: 24px; } + .mat-icon { width: 32px; height: 32px; diff --git a/frontend/src/assets/locales/de/common.json b/frontend/src/assets/locales/de/common.json index 6dfc16cfe7..6e12fd9f09 100644 --- a/frontend/src/assets/locales/de/common.json +++ b/frontend/src/assets/locales/de/common.json @@ -64,7 +64,9 @@ "selectAll": "Alle", "orderTooltip": "Die Anordnung der Tabellenspalten kann über die Auswahl einer Spalte und einem Klick auf die Pfeilsymbole angepasst werden. ↑ (hoch) oder ↓ (runter)", "refreshTooltip": "Zurücksetzen der individuellen Einstellung der Tabellenspalten auf die Standardeinstellung", - "saveAction": "Speichern" + "saveAction": "Speichern", + "alert": "Qualitätswarnung", + "investigation": "Qualitätsuntersuchung" }, "adminColumn": { "startDate": "Startdatum", @@ -104,10 +106,10 @@ "psFunction": "Funktion", "functionValidFrom": "Funktion gültig von", "functionValidUntil" : "Funktion gültig bis", - "sentActiveAlerts" : "Aktive erstellte Qualitätswarnungen", - "receivedActiveInvestigations" : "Aktive empfangene Qualitätsuntersuchungen", - "receivedActiveAlerts" : "Aktive empfangene Qualitätswarnungen", - "sentActiveInvestigations" : "Aktive erstellte Qualitätsuntersuchungen" + "sentActiveAlerts" : "Erstellte", + "receivedActiveInvestigations" : "Empfangene", + "receivedActiveAlerts" : "Empfangene", + "sentActiveInvestigations" : "Erstellte" } }, "dataLoading": { diff --git a/frontend/src/assets/locales/en/common.json b/frontend/src/assets/locales/en/common.json index bfb9ea3b2a..b56811a109 100644 --- a/frontend/src/assets/locales/en/common.json +++ b/frontend/src/assets/locales/en/common.json @@ -64,7 +64,9 @@ "selectAll": "All", "orderTooltip": "Table column order can be changed by selecting a column and move it up or down by clicking on the icon ↑ (up) or ↓ (down)", "refreshTooltip": "Reset individual table column settings to default", - "saveAction": "Save" + "saveAction": "Save", + "alert": "Quality Alert", + "investigation": "Quality Investigation" }, "adminColumn": { "startDate": "Start date", @@ -103,10 +105,10 @@ "psFunction": "Function", "functionValidFrom": "Function valid from", "functionValidUntil" : "Function valid until", - "sentActiveAlerts" : "Active created Quality alerts", - "receivedActiveInvestigations" : "Active received Quality investigations", - "receivedActiveAlerts" : "Active received Quality alerts", - "sentActiveInvestigations" : "Active created Quality investigations" + "sentActiveAlerts" : "Created", + "receivedActiveInvestigations" : "Received", + "receivedActiveAlerts" : "Received", + "sentActiveInvestigations" : "Created" } }, "dataLoading": { diff --git a/frontend/src/theme/base.scss b/frontend/src/theme/base.scss index bce663263c..9d987ed6bb 100644 --- a/frontend/src/theme/base.scss +++ b/frontend/src/theme/base.scss @@ -223,7 +223,6 @@ app-parts, app-other-parts, app-notifications-tab { border-radius: 24px 24px 0 0; background-color: rgba(0, 0, 0, 0.02); box-shadow: 0 3px 5px #888; - // box-shadow: 0 2px 2px -3px rgba(0, 0, 0, 0.2), 0px 4px 6px -1px rgba(0, 0, 0, 0.14), 0px 1px 8px -2px rgba(0, 0, 0, 0.12); .table-header-container { justify-content: center; @@ -265,6 +264,26 @@ app-parts, app-other-parts, app-notifications-tab { } +/* Align icon with text centered*/ +app-table-settings{ + .mat-mdc-checkbox label{ + display:flex; + align-items:center; + } +} + +/* Make sure multi-select text field does fit with other content and does not extend the column width */ +app-multiselect{ + .mat-mdc-form-field{ + width:100%; + } +} + +/* Make sure multi-select text field does fit with other content and does not extend the column width */ +app-multiselect .mdc-text-field--no-label:not(.mdc-text-field--outlined):not(.mdc-text-field--textarea) .mat-mdc-form-field-infix{ + width:100%; +} + /* Apply correct padding for text value inside of textarea*/ app-textarea { .mat-mdc-form-field-infix { From 8baddc3a7084084e85db32f18245e33ffec338f1 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 23 Nov 2023 12:34:18 +0100 Subject: [PATCH 17/26] chore: TRACEFOSS-2726 removed investigation button from customer parts table --- .../shared/components/parts-table/parts-table.component.html | 2 +- .../shared/components/parts-table/parts-table.component.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html index dbe543df86..08583f5a9e 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html @@ -27,7 +27,7 @@

{{ selectedPartsInfoLabel | i18n : {count: selection?.selected?.length || 0} }}

Date: Thu, 23 Nov 2023 12:43:10 +0100 Subject: [PATCH 18/26] chore: TRACEFOSS-2726 fixed filtering for notification count columns --- .../app/modules/shared/helper/filter-helper.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/modules/shared/helper/filter-helper.ts b/frontend/src/app/modules/shared/helper/filter-helper.ts index faac1d5f9a..a4bdfdbdb6 100644 --- a/frontend/src/app/modules/shared/helper/filter-helper.ts +++ b/frontend/src/app/modules/shared/helper/filter-helper.ts @@ -86,7 +86,7 @@ export function isStartsWithFilter(key: string): boolean { } export function isNotificationCountFilter(key: string): boolean { - return 'qualityAlertIdsInStatusActive' === key || 'qualityInvestigationIdsInStatusActive' === key; + return 'receivedQualityAlertIdsInStatusActive' === key || 'sentQualityAlertIdsInStatusActive' === key || 'receivedQualityInvestigationIdsInStatusActive' === key || 'sentQualityInvestigationIdsInStatusActive' === key; } export function isDateFilter(key: string): boolean { @@ -108,12 +108,20 @@ export function toAssetFilter(formValues: any, isAsBuilt: boolean): AssetAsPlann // Loop through each form control and add it to the transformedFilter if it has a non-null and non-undefined value for (const key in formValues) { if (formValues[key] !== null && formValues[key] !== undefined) { - if ('activeAlerts' === key) { - transformedFilter['qualityAlertIdsInStatusActive'] = formValues[key]; + if ('receivedActiveAlerts' === key) { + transformedFilter['receivedQualityAlertIdsInStatusActive'] = formValues[key]; continue; } - if ('activeInvestigations' === key) { - transformedFilter['qualityInvestigationIdsInStatusActive'] = formValues[key]; + if ('sentActiveAlerts' === key) { + transformedFilter['sentQualityAlertIdsInStatusActive'] = formValues[key]; + continue; + } + if ('receivedActiveInvestigations' === key) { + transformedFilter['receivedQualityInvestigationIdsInStatusActive'] = formValues[key]; + continue; + } + if ('sentActiveInvestigations' === key) { + transformedFilter['sentQualityInvestigationIdsInStatusActive'] = formValues[key]; continue; } transformedFilter[key] = formValues[key]; From 62dad63c6b23ff549e4b06f100aa956921234f90 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 23 Nov 2023 12:54:37 +0100 Subject: [PATCH 19/26] chore: TRACEFOSS-2726 added tooltips --- .../parts-table/parts-table.component.html | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html index 08583f5a9e..0d1171d665 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html @@ -182,13 +182,22 @@

{{ 'table.noResultFound' | i18n }}

>{{ tableConfig?.header?.[column] | i18n }} - notification_important + notification_important - inbox + inbox @@ -224,22 +233,38 @@

{{ 'table.noResultFound' | i18n }}

- notification_important + notification_important - notification_important + notification_important - inbox + inbox - inbox + inbox From 070e9423aa9e447523511ae7248352e999e091b6 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Thu, 23 Nov 2023 13:06:43 +0100 Subject: [PATCH 20/26] chore: TRACEFOSS-2726 filtering capabilities --- .../mapper/AssetAsBuiltFieldMapper.java | 6 +- .../repository/AssetAsBuildSpecification.java | 24 +++- .../AssetAsBuiltControllerFilteringIT.java | 122 +++++++++++++++--- .../common/support/AlertsSupport.java | 6 +- .../common/support/InvestigationsSupport.java | 6 +- 5 files changed, 141 insertions(+), 23 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltFieldMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltFieldMapper.java index 550c9e007a..0db5c4b341 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltFieldMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/asbuilt/mapper/AssetAsBuiltFieldMapper.java @@ -50,8 +50,10 @@ public class AssetAsBuiltFieldMapper extends BaseRequestFieldMapper { Map.entry("van", "van"), Map.entry("businessPartner", "manufacturerId"), Map.entry("alerts", "alerts"), - Map.entry("qualityAlertIdsInStatusActive", "activeAlertsCount"), - Map.entry("qualityInvestigationIdsInStatusActive", "activeInvestigationsCount") + Map.entry("sentQualityAlertIdsInStatusActive", "sentActiveAlertsCount"), + Map.entry("sentQualityInvestigationIdsInStatusActive", "sentActiveInvestigationsCount"), + Map.entry("receivedQualityAlertIdsInStatusActive", "receivedActiveAlertsCount"), + Map.entry("receivedQualityInvestigationIdsInStatusActive", "receivedActiveInvestigationsCount") ); @Override diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuildSpecification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuildSpecification.java index d7aeff40ca..dd6b4b2676 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuildSpecification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuildSpecification.java @@ -33,6 +33,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.jetbrains.annotations.NotNull; import org.springframework.data.jpa.domain.Specification; @@ -57,14 +58,28 @@ public Predicate toPredicate(@NotNull Root root, @NotNull Cr private static Predicate activeNotificationCountEqualPredicate(SearchCriteriaFilter criteria, Root root, CriteriaBuilder builder, String expectedFieldValue) { String joinTableName; Class notificationClass; + NotificationSideBaseEntity side; switch (criteria.getKey()) { - case "activeAlertsCount" -> { + case "sentActiveAlertsCount" -> { notificationClass = AlertEntity.class; joinTableName = "alerts"; + side = NotificationSideBaseEntity.SENDER; } - case "activeInvestigationsCount" -> { + case "sentActiveInvestigationsCount" -> { notificationClass = InvestigationEntity.class; joinTableName = "investigations"; + side = NotificationSideBaseEntity.SENDER; + } + case "receivedActiveAlertsCount" -> { + notificationClass = AlertEntity.class; + joinTableName = "alerts"; + side = NotificationSideBaseEntity.RECEIVER; + + } + case "receivedActiveInvestigationsCount" -> { + notificationClass = InvestigationEntity.class; + joinTableName = "investigations"; + side = NotificationSideBaseEntity.RECEIVER; } default -> throw new UnsupportedOperationException(); } @@ -81,6 +96,7 @@ private static Predicate activeNotificationCountEqualPredicate(SearchCriteriaFil builder.or( activeNotificationPredicates(builder, subRoot) ), + notificationSidePredicate(builder, subRoot, side), builder.equal(assetJoin.get("id"), root.get("id"))) ); @@ -94,4 +110,8 @@ private static Predicate[] activeNotificationPredicates(CriteriaBuilder builder, return predicates.toArray(new Predicate[0]); } + + private static Predicate notificationSidePredicate(CriteriaBuilder builder, Root root, NotificationSideBaseEntity side) { + return builder.equal(root.get("side").as(String.class), side.name()); + } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java index f1a90cae8c..951fe3cec9 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilteringIT.java @@ -26,6 +26,7 @@ import org.eclipse.tractusx.traceability.integration.common.support.AlertsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; import org.eclipse.tractusx.traceability.integration.common.support.InvestigationsSupport; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -34,6 +35,8 @@ import static io.restassured.RestAssured.given; import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity.RECEIVER; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity.SENDER; import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.ACCEPTED; import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.ACKNOWLEDGED; import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CANCELED; @@ -353,7 +356,7 @@ void givenAssetsWithAlerts_whenGetAssetsWithActiveAlertCountFilter_thenReturnPro alertsSupport.storeAlertWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); alertsSupport.storeAlertWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "qualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,6,AND"; + final String filter = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,6,AND"; // When given() @@ -385,7 +388,7 @@ void givenAssetsWithAlerts_whenGetAssetsWithActiveAlertCountFilter2_thenReturnPr alertsSupport.storeAlertWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); alertsSupport.storeAlertWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "qualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; + final String filter = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; // When given() @@ -402,20 +405,60 @@ void givenAssetsWithAlerts_whenGetAssetsWithActiveAlertCountFilter2_thenReturnPr } @Test - void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilter_thenReturnProperAssets() throws JoseException { + void givenAssetsWithInvestigations_whenGetAssetsWithActiveSentInvestigationCountFilter_thenReturnProperAssets() throws JoseException { // Given assetsSupport.defaultAssetsStored(); AssetAsBuiltEntity assetAsBuilt = jpaAssetAsBuiltRepository.findById("urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb").orElseThrow(); - investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt), null); - investigationsSupport.storeInvestigationWithStatusAndAssets(SENT, List.of(assetAsBuilt), null); - investigationsSupport.storeInvestigationWithStatusAndAssets(RECEIVED, List.of(assetAsBuilt), null); - investigationsSupport.storeInvestigationWithStatusAndAssets(ACKNOWLEDGED, List.of(assetAsBuilt), null); - investigationsSupport.storeInvestigationWithStatusAndAssets(ACCEPTED, List.of(assetAsBuilt), null); - investigationsSupport.storeInvestigationWithStatusAndAssets(DECLINED, List.of(assetAsBuilt), null); - investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); - investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); + investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(SENT, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(RECEIVED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(ACKNOWLEDGED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(ACCEPTED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(DECLINED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt), null, RECEIVER); + + final String filter = "sentQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,6,AND"; + + + // When + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .when() + .param("filter", filter) + .get("/api/assets/as-built") + .then() + .statusCode(200) + .assertThat() + .body("totalItems", equalTo(1)); + } - final String filter = "qualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,6,AND"; + @Test + void givenAssetsWithInvestigations_whenGetAssetsWithActiveReceivedInvestigationCountFilter_thenReturnProperAssets() throws JoseException { + // Given + assetsSupport.defaultAssetsStored(); + AssetAsBuiltEntity assetAsBuilt = jpaAssetAsBuiltRepository.findById("urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb").orElseThrow(); + investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(SENT, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(RECEIVED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(ACKNOWLEDGED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(ACCEPTED, List.of(assetAsBuilt), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(DECLINED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null, SENDER); + + investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(SENT, List.of(assetAsBuilt), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(RECEIVED, List.of(assetAsBuilt), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(ACKNOWLEDGED, List.of(assetAsBuilt), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(ACCEPTED, List.of(assetAsBuilt), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(DECLINED, List.of(assetAsBuilt), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null, RECEIVER); + + final String filter = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,7,AND"; // When @@ -447,7 +490,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "qualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; + final String filter = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; // When @@ -479,7 +522,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "qualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; + final String filter = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; // When @@ -511,7 +554,7 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter = "qualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; + final String filter = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; // When @@ -543,9 +586,52 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt investigationsSupport.storeInvestigationWithStatusAndAssets(CANCELED, List.of(assetAsBuilt), null); investigationsSupport.storeInvestigationWithStatusAndAssets(CLOSED, List.of(assetAsBuilt), null); - final String filter1 = "qualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; - final String filter2 = "qualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; + final String filter1 = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,0,AND"; + final String filter2 = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; + + + // When + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .when() + .param("filter", filter1) + .param("filter", filter2) + .get("/api/assets/as-built") + .then() + .statusCode(200) + .assertThat() + .body("totalItems", equalTo(1)); + } + + @Test + void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilter6_thenReturnProperAssets() throws JoseException { + // Given + assetsSupport.defaultAssetsStored(); + AssetAsBuiltEntity assetAsBuilt = jpaAssetAsBuiltRepository.findById("urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb").orElseThrow(); + AssetAsBuiltEntity assetAsBuilt1 = jpaAssetAsBuiltRepository.findById("urn:uuid:7fa65f10-9dc1-49fe-818a-09c7313a4562").orElseThrow(); + + alertsSupport.storeAlertWithStatusAndAssets(CREATED, List.of(assetAsBuilt, assetAsBuilt1), null, SENDER); + alertsSupport.storeAlertWithStatusAndAssets(SENT, List.of(assetAsBuilt1), null, SENDER); + + investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt, assetAsBuilt1), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt, assetAsBuilt1), null, SENDER); + investigationsSupport.storeInvestigationWithStatusAndAssets(SENT, List.of(assetAsBuilt1), null, SENDER); + + alertsSupport.storeAlertWithStatusAndAssets(CREATED, List.of(assetAsBuilt, assetAsBuilt1), null, RECEIVER); + alertsSupport.storeAlertWithStatusAndAssets(SENT, List.of(assetAsBuilt), null, RECEIVER); + alertsSupport.storeAlertWithStatusAndAssets(SENT, List.of(assetAsBuilt), null, RECEIVER); + + investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt, assetAsBuilt1), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt, assetAsBuilt1), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(SENT, List.of(assetAsBuilt), null, RECEIVER); + investigationsSupport.storeInvestigationWithStatusAndAssets(SENT, List.of(assetAsBuilt), null, RECEIVER); + + final String filter1 = "receivedQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,3,AND"; + final String filter2 = "receivedQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,4,AND"; + final String filter3 = "sentQualityAlertIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,1,AND"; + final String filter4 = "sentQualityInvestigationIdsInStatusActive,NOTIFICATION_COUNT_EQUAL,2,AND"; // When given() @@ -554,6 +640,8 @@ void givenAssetsWithInvestigations_whenGetAssetsWithActiveInvestigationCountFilt .when() .param("filter", filter1) .param("filter", filter2) + .param("filter", filter3) + .param("filter", filter4) .get("/api/assets/as-built") .then() .statusCode(200) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java index a19cf40f2d..10a2f2b20a 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java @@ -60,11 +60,15 @@ public Long defaultReceivedAlertStored() { } public Long storeAlertWithStatusAndAssets(NotificationStatusBaseEntity status, List assetsAsBuilt, List assetsAsPlanned) { + return storeAlertWithStatusAndAssets(status, assetsAsBuilt, assetsAsPlanned, NotificationSideBaseEntity.RECEIVER); + } + + public Long storeAlertWithStatusAndAssets(NotificationStatusBaseEntity status, List assetsAsBuilt, List assetsAsPlanned, NotificationSideBaseEntity side) { AlertEntity entity = AlertEntity.builder() .assets(Collections.emptyList()) .bpn("BPNL00000003AXS3") .status(status) - .side(NotificationSideBaseEntity.RECEIVER) + .side(side) .createdDate(Instant.now()) .build(); Long alertId = storedAlert(entity); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java index e1fb906b3c..55c18e7a36 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java @@ -56,11 +56,15 @@ public Long defaultReceivedInvestigationStored() { } public Long storeInvestigationWithStatusAndAssets(NotificationStatusBaseEntity status, List assetsAsBuilt, List assetsAsPlanned) { + return storeInvestigationWithStatusAndAssets(status, assetsAsBuilt, assetsAsPlanned, NotificationSideBaseEntity.RECEIVER); + } + + public Long storeInvestigationWithStatusAndAssets(NotificationStatusBaseEntity status, List assetsAsBuilt, List assetsAsPlanned, NotificationSideBaseEntity side) { InvestigationEntity entity = InvestigationEntity.builder() .assets(Collections.emptyList()) .bpn("BPNL00000003AXS3") .status(status) - .side(NotificationSideBaseEntity.RECEIVER) + .side(side) .createdDate(Instant.now()) .build(); Long alertId = storedInvestigation(entity); From a0ce5e9f5d5f74b4d79367917aa7a157146aa3a6 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Thu, 23 Nov 2023 13:32:19 +0100 Subject: [PATCH 21/26] chore: TRACEFOSS-2726 changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13f70eb7bf..695419aa27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - DEPENDENCIES_FRONTEND, SECURITY.md, NOTICE.md, LICENSE file to frontend docker image - Added a step-by-step guide to register a server in pgAdmin in the database dump README - Documentation about technical users +- new filtering capabilities ( receivedQualityAlertIdsInStatusActive, sentQualityAlertIdsInStatusActive, receivedQualityInvestigationIdsInStatusActive, sentQualityInvestigationIdsInStatusActive ) ### Changed - Fixed helm repository path for backend & frontend (wrong prefix) @@ -19,6 +20,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Removed - apk upgrade in docker image built as requested by TRG 4.02 +- removed asset filters ( qualityInvestigationIdsInStatusActive, qualityInvestigationIdsInStatusActive ) ## [9.0.0-rc2 - 15.11.2023] ### Added From a1bfe28c02cb5487131d3562efdcf68212c0b5ba Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 23 Nov 2023 13:42:23 +0100 Subject: [PATCH 22/26] chore: TRACEFOSS-2726 added tooltips --- .../investigations.model.ts | 4 + .../core/investigations.facade.ts | 5 +- .../presentation/investigations.component.ts | 12 +- .../parts-table/parts-table.component.html | 105 ++++++++++-------- .../parts-table/parts-table.component.ts | 9 +- .../shared/service/investigations.service.ts | 7 +- 6 files changed, 87 insertions(+), 55 deletions(-) diff --git a/frontend/src/app/mocks/services/investigations-mock/investigations.model.ts b/frontend/src/app/mocks/services/investigations-mock/investigations.model.ts index 93e98945da..7de1edb2a1 100644 --- a/frontend/src/app/mocks/services/investigations-mock/investigations.model.ts +++ b/frontend/src/app/mocks/services/investigations-mock/investigations.model.ts @@ -93,6 +93,10 @@ const MockEmptyInvestigation: NotificationResponse = { channel: 'SENDER', }; +export interface InvestigationFilter{ + +} + export const getInvestigationById = (id: string) => { return [].find(investigation => investigation.id === id) || { ...MockEmptyInvestigation, id }; }; diff --git a/frontend/src/app/modules/page/investigations/core/investigations.facade.ts b/frontend/src/app/modules/page/investigations/core/investigations.facade.ts index 405fc11489..a4ad906fa4 100644 --- a/frontend/src/app/modules/page/investigations/core/investigations.facade.ts +++ b/frontend/src/app/modules/page/investigations/core/investigations.facade.ts @@ -26,6 +26,7 @@ import { View } from '@shared/model/view.model'; import { InvestigationsService } from '@shared/service/investigations.service'; import { Observable, Subscription } from 'rxjs'; import { InvestigationsState } from './investigations.state'; +import {InvestigationFilter} from "../../../../mocks/services/investigations-mock/investigations.model"; @Injectable() export class InvestigationsFacade { @@ -49,10 +50,10 @@ export class InvestigationsFacade { return this.investigationsService.getInvestigation(id); } - public setReceivedInvestigation(page = 0, pageSize = 50, sorting: TableHeaderSort[] = []): void { + public setReceivedInvestigation(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], filter?: InvestigationFilter): void { this.investigationReceivedSubscription?.unsubscribe(); this.investigationReceivedSubscription = this.investigationsService - .getReceivedInvestigations(page, pageSize, sorting) + .getReceivedInvestigations(page, pageSize, sorting, filter) .subscribe({ next: data => (this.investigationsState.investigationsReceived = { data }), error: (error: Error) => (this.investigationsState.investigationsReceived = { error }), diff --git a/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts b/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts index fd4af6a9b1..f674adc35c 100644 --- a/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts +++ b/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts @@ -75,10 +75,16 @@ export class InvestigationsComponent { } public ngOnInit(): void { + this.paramSubscription = this.route.queryParams.subscribe(params => { - this.pagination.page = params?.pageNumber; - this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList); - this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList); + if (params.deeplink){ + + } else { + this.pagination.page = params?.pageNumber; + this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList); + this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList); + } + }); } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html index 0d1171d665..3e8636a1e0 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html @@ -18,28 +18,29 @@ --> -
-
-
{{tableHeader}} - settings -
-
-

{{ selectedPartsInfoLabel | i18n : {count: selection?.selected?.length || 0} }}

- -
- announcement - {{ selectedPartsActionLabel | i18n }} +
+
{{tableHeader}} + + settings +
- +
+

{{ selectedPartsInfoLabel | i18n : {count: selection?.selected?.length || 0} }}

+ +
+ announcement + {{ selectedPartsActionLabel | i18n }} +
+
+
-
@@ -58,27 +59,28 @@ data-testid="table-component--head-row" class="table--header--row"> - + - - - - {{ ''}} - - + + + + {{ ''}} + + {{ 'table.noResultFound' | i18n }}

{{ tableConfig?.header?.[column] | i18n }} - + notification_important + class="table--notification--icon">notification_important - + @@ -197,7 +199,7 @@

{{ 'table.noResultFound' | i18n }}

matTooltipPosition="above" [matTooltipShowDelay]="100" - class="table--notification--icon">inbox + class="table--notification--icon">inbox
@@ -218,10 +220,17 @@

{{ 'table.noResultFound' | i18n }}

- - - {{isDateElement(column) ? (element[column] | date:'yyyy-MM-dd') : element[column]?.length }} - + + + {{(element[column] | date:'yyyy-MM-dd')}} + + + + + + {{element[column]?.length}} + + {{ 'table.noResultFound' | i18n }}

matTooltipClass="table--header--tooltip" matTooltipPosition="above" [matTooltipShowDelay]="100" - class="table--notification--icon">notification_important + class="table--notification--icon">notification_important
@@ -246,7 +255,7 @@

{{ 'table.noResultFound' | i18n }}

matTooltipClass="table--header--tooltip" matTooltipPosition="above" [matTooltipShowDelay]="100" - class="table--notification--icon">notification_important + class="table--notification--icon">notification_important
@@ -255,7 +264,7 @@

{{ 'table.noResultFound' | i18n }}

matTooltipClass="table--header--tooltip" matTooltipPosition="above" [matTooltipShowDelay]="100" - class="table--notification--icon">inbox + class="table--notification--icon">inbox
diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts index 11f08f79c0..5d5ad68c8f 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts @@ -66,6 +66,8 @@ import { import { PartsAsPlannedCustomerConfigurationModel } from "@shared/components/parts-table/parts-as-planned-customer-configuration.model"; +import {Router} from "@angular/router"; +import {INVESTIGATION_BASE_ROUTE} from "@core/known-route"; @Component({ @@ -136,7 +138,7 @@ export class PartsTableComponent implements OnInit { @Output() clickSelectAction = new EventEmitter(); @Output() filterActivated = new EventEmitter(); - constructor(private readonly tableSettingsService: TableSettingsService, private dialog: MatDialog) { + constructor(private readonly tableSettingsService: TableSettingsService, private dialog: MatDialog, private router: Router) { } @@ -161,6 +163,11 @@ export class PartsTableComponent implements OnInit { public tableViewConfig: TableViewConfig; + + public deeplinkToNotification(column: any){ + console.log(column, "col"); + this.router.navigate([INVESTIGATION_BASE_ROUTE], { queryParams: { deeplink: true } }) + } public isNotificationCountColumn(column: any) { return column === 'receivedActiveAlerts' || column === 'sentActiveAlerts' || column === 'receivedActiveInvestigations' || column === 'sentActiveInvestigations'; } diff --git a/frontend/src/app/modules/shared/service/investigations.service.ts b/frontend/src/app/modules/shared/service/investigations.service.ts index 8729fe73b4..d2a0f9d4a3 100644 --- a/frontend/src/app/modules/shared/service/investigations.service.ts +++ b/frontend/src/app/modules/shared/service/investigations.service.ts @@ -38,6 +38,7 @@ import { NotificationStatus, NotificationType, } from '../model/notification.model'; +import {InvestigationFilter} from "../../../mocks/services/investigations-mock/investigations.model"; @Injectable({ providedIn: 'root', @@ -63,7 +64,7 @@ export class InvestigationsService { .pipe(map(investigations => NotificationAssembler.assembleNotifications(investigations, NotificationType.INVESTIGATION))); } - public getReceivedInvestigations(page: number, pageSize: number, sorting: TableHeaderSort[]): Observable { + public getReceivedInvestigations(page: number, pageSize: number, sorting: TableHeaderSort[], filter?: InvestigationFilter): Observable { let sort = sorting.length ? sorting : ['createdDate,desc']; let params = new HttpParams() .set('page', page) @@ -74,6 +75,10 @@ export class InvestigationsService { params = params.append('sort', sortingItem); }) + if (filter) { + // params = enrichFilterAndGetUpdatedParams(assetAsBuiltFilter, params, filterOperator); + } + return this.apiService .getBy(`${this.url}/investigations`, params) .pipe(map(investigations => NotificationAssembler.assembleNotifications(investigations, NotificationType.INVESTIGATION))); From 0c0d5ee5a4d13dd18176a4aa2410dc104317d5bd Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 23 Nov 2023 22:22:09 +0100 Subject: [PATCH 23/26] chore: TRACEFOSS-2726 added deeplinks --- .../investigations.model.ts | 120 +++++----- .../modules/page/alerts/core/alerts.facade.ts | 9 +- .../alerts/presentation/alerts.component.ts | 24 +- .../core/investigations.facade.ts | 10 +- .../presentation/investigations.component.ts | 221 +++++++++--------- .../parts-table/parts-table.component.html | 2 +- .../parts-table/parts-table.component.ts | 37 ++- .../modules/shared/helper/filter-helper.ts | 219 +++++++++-------- .../modules/shared/service/alerts.service.ts | 10 +- .../shared/service/investigations.service.ts | 182 ++++++++------- 10 files changed, 458 insertions(+), 376 deletions(-) diff --git a/frontend/src/app/mocks/services/investigations-mock/investigations.model.ts b/frontend/src/app/mocks/services/investigations-mock/investigations.model.ts index 7de1edb2a1..0cc82b64cd 100644 --- a/frontend/src/app/mocks/services/investigations-mock/investigations.model.ts +++ b/frontend/src/app/mocks/services/investigations-mock/investigations.model.ts @@ -19,12 +19,12 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import type { NotificationResponse } from '@shared/model/notification.model'; -import { NotificationStatus, NotificationType } from '@shared/model/notification.model'; -import { Severity } from '@shared/model/severity.model'; -import { getRandomAsset } from '../parts-mock/partsAsPlanned/partsAsPlanned.model'; -import { MOCK_part_1 } from '../parts-mock/partsAsPlanned/partsAsPlanned.test.model'; -import { getRandomIntFromInterval, getRandomText } from '../text-generator.helper'; +import type {NotificationResponse} from '@shared/model/notification.model'; +import {NotificationStatus, NotificationType} from '@shared/model/notification.model'; +import {Severity} from '@shared/model/severity.model'; +import {getRandomAsset} from '../parts-mock/partsAsPlanned/partsAsPlanned.model'; +import {MOCK_part_1} from '../parts-mock/partsAsPlanned/partsAsPlanned.test.model'; +import {getRandomIntFromInterval, getRandomText} from '../text-generator.helper'; export const InvestigationIdPrefix = 'id-'; @@ -32,71 +32,71 @@ export const InvestigationIdPrefix = 'id-'; const severities = [Severity.MINOR, Severity.MAJOR, Severity.CRITICAL, Severity.LIFE_THREATENING]; export const buildMockInvestigations = ( - statuses: NotificationStatus[], - channel: 'SENDER' | 'RECEIVER', + statuses: NotificationStatus[], + channel: 'SENDER' | 'RECEIVER', ): NotificationResponse[] => - new Array(101).fill(null).map((_, index) => { - const status = statuses[index % statuses.length]; - const severity = severities[index % severities.length]; - // every 10th alert should have an error - const errorInvestigation = (index+1) % 10 === 0 ? "The Services returned an Error while processing this Investigation" : undefined; + new Array(101).fill(null).map((_, index) => { + const status = statuses[index % statuses.length]; + const severity = severities[index % severities.length]; + // every 10th alert should have an error + const errorInvestigation = (index + 1) % 10 === 0 ? "The Services returned an Error while processing this Investigation" : undefined; - const close = status === NotificationStatus.CLOSED ? getRandomText(getRandomIntFromInterval(15, 500)) : ''; - const isDeclined = Math.random() >= 0.5; + const close = status === NotificationStatus.CLOSED ? getRandomText(getRandomIntFromInterval(15, 500)) : ''; + const isDeclined = Math.random() >= 0.5; - const decline = - status === NotificationStatus.DECLINED || (!!close && isDeclined) - ? getRandomText(getRandomIntFromInterval(15, 500)) - : ''; + const decline = + status === NotificationStatus.DECLINED || (!!close && isDeclined) + ? getRandomText(getRandomIntFromInterval(15, 500)) + : ''; - const accept = - status === NotificationStatus.ACCEPTED || (!!close && !isDeclined) - ? getRandomText(getRandomIntFromInterval(15, 500)) - : ''; + const accept = + status === NotificationStatus.ACCEPTED || (!!close && !isDeclined) + ? getRandomText(getRandomIntFromInterval(15, 500)) + : ''; - const numberToString = (i: number) => i.toString().padStart(2, '0'); - const month = getRandomIntFromInterval(1, 12); - const day = getRandomIntFromInterval(1, 27); + const numberToString = (i: number) => i.toString().padStart(2, '0'); + const month = getRandomIntFromInterval(1, 12); + const day = getRandomIntFromInterval(1, 27); - return { - id: `${InvestigationIdPrefix}${index + 1}`, - description: `Investigation No ${index + 1} ${getRandomText(getRandomIntFromInterval(15, 500))}`, - status, - severity, - channel, - createdBy: 'BPN10000000OEM0A', - createdByName: 'OEM xxxxxxxxxxxxxxx A', - sendTo: 'BPN20000000OEM0B', - sendToName: 'OEM xxxxxxxxxxxxxxx B', - reason: { close, decline, accept }, - createdDate: `2022-${numberToString(month)}-${numberToString(day)}T12:34:12`, - targetDate: `2022-${numberToString(month)}-${numberToString(day + 1)}T11:34:12Z`, - assetIds: [MOCK_part_1.id, getRandomAsset().id, getRandomAsset().id, getRandomAsset().id], - errorMessage: errorInvestigation, - notificationType: NotificationType.INVESTIGATION, - }; - }); + return { + id: `${InvestigationIdPrefix}${index + 1}`, + description: `Investigation No ${index + 1} ${getRandomText(getRandomIntFromInterval(15, 500))}`, + status, + severity, + channel, + createdBy: 'BPN10000000OEM0A', + createdByName: 'OEM xxxxxxxxxxxxxxx A', + sendTo: 'BPN20000000OEM0B', + sendToName: 'OEM xxxxxxxxxxxxxxx B', + reason: {close, decline, accept}, + createdDate: `2022-${numberToString(month)}-${numberToString(day)}T12:34:12`, + targetDate: `2022-${numberToString(month)}-${numberToString(day + 1)}T11:34:12Z`, + assetIds: [MOCK_part_1.id, getRandomAsset().id, getRandomAsset().id, getRandomAsset().id], + errorMessage: errorInvestigation, + notificationType: NotificationType.INVESTIGATION, + }; + }); const MockEmptyInvestigation: NotificationResponse = { - id: `${InvestigationIdPrefix}000`, - description: `Investigation No 000`, - status: NotificationStatus.CREATED, - severity: Severity.MINOR, - createdBy: 'BPN10000000OEM0A', - createdByName: 'OEM xxxxxxxxxxxxxxx A', - sendTo: 'BPN20000000OEM0B', - sendToName: 'OEM xxxxxxxxxxxxxxx B', - reason: { close: '', decline: '', accept: '' }, - createdDate: `2022-05-01T12:34:12`, - targetDate: `2022-02-01T12:34:12`, - assetIds: [getRandomAsset().id], - channel: 'SENDER', + id: `${InvestigationIdPrefix}000`, + description: `Investigation No 000`, + status: NotificationStatus.CREATED, + severity: Severity.MINOR, + createdBy: 'BPN10000000OEM0A', + createdByName: 'OEM xxxxxxxxxxxxxxx A', + sendTo: 'BPN20000000OEM0B', + sendToName: 'OEM xxxxxxxxxxxxxxx B', + reason: {close: '', decline: '', accept: ''}, + createdDate: `2022-05-01T12:34:12`, + targetDate: `2022-02-01T12:34:12`, + assetIds: [getRandomAsset().id], + channel: 'SENDER', }; -export interface InvestigationFilter{ - +export interface NotificationFilter { + notificationIds: string[] } export const getInvestigationById = (id: string) => { - return [].find(investigation => investigation.id === id) || { ...MockEmptyInvestigation, id }; + return [].find(investigation => investigation.id === id) || {...MockEmptyInvestigation, id}; }; diff --git a/frontend/src/app/modules/page/alerts/core/alerts.facade.ts b/frontend/src/app/modules/page/alerts/core/alerts.facade.ts index 6595100e6b..16f5a69fa1 100644 --- a/frontend/src/app/modules/page/alerts/core/alerts.facade.ts +++ b/frontend/src/app/modules/page/alerts/core/alerts.facade.ts @@ -24,6 +24,7 @@ import { Notification, Notifications, NotificationStatus } from '@shared/model/n import { View } from '@shared/model/view.model'; import { AlertsService } from '@shared/service/alerts.service'; import { Observable, Subscription } from 'rxjs'; +import {NotificationFilter} from "../../../../mocks/services/investigations-mock/investigations.model"; @Injectable() export class AlertsFacade { @@ -47,20 +48,20 @@ export class AlertsFacade { return this.alertsService.getAlert(id); } - public setReceivedAlerts(page = 0, pageSize = 50, sorting: TableHeaderSort[] = []): void { + public setReceivedAlerts(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], filter?: NotificationFilter): void { this.alertReceivedSubscription?.unsubscribe(); this.alertReceivedSubscription = this.alertsService - .getReceivedAlerts(page, pageSize, sorting) + .getReceivedAlerts(page, pageSize, sorting, filter) .subscribe({ next: data => (this.alertsState.alertsReceived = { data }), error: (error: Error) => (this.alertsState.alertsReceived = { error }), }); } - public setQueuedAndRequestedAlerts(page = 0, pageSize = 50, sorting: TableHeaderSort[] = []): void { + public setQueuedAndRequestedAlerts(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], filter?: NotificationFilter): void { this.alertQueuedAndRequestedSubscription?.unsubscribe(); this.alertQueuedAndRequestedSubscription = this.alertsService - .getCreatedAlerts(page, pageSize, sorting) + .getCreatedAlerts(page, pageSize, sorting,filter) .subscribe({ next: data => (this.alertsState.alertsQueuedAndRequested = { data }), error: (error: Error) => (this.alertsState.alertsQueuedAndRequested = { error }), diff --git a/frontend/src/app/modules/page/alerts/presentation/alerts.component.ts b/frontend/src/app/modules/page/alerts/presentation/alerts.component.ts index 6cdde6cb81..df87bfc6f5 100644 --- a/frontend/src/app/modules/page/alerts/presentation/alerts.component.ts +++ b/frontend/src/app/modules/page/alerts/presentation/alerts.component.ts @@ -73,10 +73,28 @@ export class AlertsComponent { } public ngOnInit(): void { + this.paramSubscription = this.route.queryParams.subscribe(params => { - this.pagination.page = params?.pageNumber; - this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList); - this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList); + if (params.deeplink){ + this.pagination.page = 0; + if (params.received === 'true' && params?.notificationIds?.length > 0) { + console.log("Received"); + const filter = {notificationIds: params.notificationIds}; + this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList, filter); + this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList); + } + if (params.received === 'false' && params?.notificationIds?.length > 0) { + console.log("Sent"); + const filter = {notificationIds: params.notificationIds}; + this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList, filter); + this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList); + } + } else { + this.pagination.page = params?.pageNumber; + this.alertsFacade.setReceivedAlerts(this.pagination.page, this.pagination.pageSize, this.alertReceivedSortList); + this.alertsFacade.setQueuedAndRequestedAlerts(this.pagination.page, this.pagination.pageSize, this.alertQueuedAndRequestedSortList); + } + }) } diff --git a/frontend/src/app/modules/page/investigations/core/investigations.facade.ts b/frontend/src/app/modules/page/investigations/core/investigations.facade.ts index a4ad906fa4..18b784d32b 100644 --- a/frontend/src/app/modules/page/investigations/core/investigations.facade.ts +++ b/frontend/src/app/modules/page/investigations/core/investigations.facade.ts @@ -26,7 +26,9 @@ import { View } from '@shared/model/view.model'; import { InvestigationsService } from '@shared/service/investigations.service'; import { Observable, Subscription } from 'rxjs'; import { InvestigationsState } from './investigations.state'; -import {InvestigationFilter} from "../../../../mocks/services/investigations-mock/investigations.model"; +import { + NotificationFilter +} from "../../../../mocks/services/investigations-mock/investigations.model"; @Injectable() export class InvestigationsFacade { @@ -50,7 +52,7 @@ export class InvestigationsFacade { return this.investigationsService.getInvestigation(id); } - public setReceivedInvestigation(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], filter?: InvestigationFilter): void { + public setReceivedInvestigation(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], filter?: NotificationFilter): void { this.investigationReceivedSubscription?.unsubscribe(); this.investigationReceivedSubscription = this.investigationsService .getReceivedInvestigations(page, pageSize, sorting, filter) @@ -60,10 +62,10 @@ export class InvestigationsFacade { }); } - public setQueuedAndRequestedInvestigations(page = 0, pageSize = 50, sorting: TableHeaderSort[] = []): void { + public setQueuedAndRequestedInvestigations(page = 0, pageSize = 50, sorting: TableHeaderSort[] = [], filter?: NotificationFilter): void { this.investigationQueuedAndRequestedSubscription?.unsubscribe(); this.investigationQueuedAndRequestedSubscription = this.investigationsService - .getCreatedInvestigations(page, pageSize, sorting, ) + .getCreatedInvestigations(page, pageSize, sorting, filter) .subscribe({ next: data => (this.investigationsState.investigationsQueuedAndRequested = { data }), error: (error: Error) => (this.investigationsState.investigationsQueuedAndRequested = { error }), diff --git a/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts b/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts index f674adc35c..74a1bd112e 100644 --- a/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts +++ b/frontend/src/app/modules/page/investigations/presentation/investigations.component.ts @@ -19,115 +19,126 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import { ChangeDetectorRef, Component, ViewChild } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { getRoute, INVESTIGATION_BASE_ROUTE } from '@core/known-route'; -import { InvestigationDetailFacade } from '@page/investigations/core/investigation-detail.facade'; -import { InvestigationHelperService } from '@page/investigations/core/investigation-helper.service'; -import { NotificationMenuActionsAssembler } from '@shared/assembler/notificationMenuActions.assembler'; -import { NotificationCommonModalComponent } from '@shared/components/notification-common-modal/notification-common-modal.component'; -import { TableSortingUtil } from '@shared/components/table/table-sorting.util'; -import { MenuActionConfig, TableEventConfig, TableHeaderSort } from '@shared/components/table/table.model'; -import { NotificationTabInformation } from '@shared/model/notification-tab-information'; -import { Notification, NotificationStatusGroup, NotificationType } from '@shared/model/notification.model'; -import { TranslationContext } from '@shared/model/translation-context.model'; -import { Subscription } from 'rxjs'; -import { InvestigationsFacade } from '../core/investigations.facade'; +import {ChangeDetectorRef, Component, ViewChild} from '@angular/core'; +import {ActivatedRoute, Router} from '@angular/router'; +import {getRoute, INVESTIGATION_BASE_ROUTE} from '@core/known-route'; +import {InvestigationDetailFacade} from '@page/investigations/core/investigation-detail.facade'; +import {InvestigationHelperService} from '@page/investigations/core/investigation-helper.service'; +import {NotificationMenuActionsAssembler} from '@shared/assembler/notificationMenuActions.assembler'; +import { + NotificationCommonModalComponent +} from '@shared/components/notification-common-modal/notification-common-modal.component'; +import {TableSortingUtil} from '@shared/components/table/table-sorting.util'; +import {MenuActionConfig, TableEventConfig, TableHeaderSort} from '@shared/components/table/table.model'; +import {NotificationTabInformation} from '@shared/model/notification-tab-information'; +import {Notification, NotificationStatusGroup, NotificationType} from '@shared/model/notification.model'; +import {TranslationContext} from '@shared/model/translation-context.model'; +import {Subscription} from 'rxjs'; +import {InvestigationsFacade} from '../core/investigations.facade'; @Component({ - selector: 'app-investigations', - templateUrl: './investigations.component.html', + selector: 'app-investigations', + templateUrl: './investigations.component.html', }) export class InvestigationsComponent { - @ViewChild(NotificationCommonModalComponent) notificationCommonModalComponent: NotificationCommonModalComponent; - - public readonly investigationsReceived$; - public readonly investigationsQueuedAndRequested$; - - public menuActionsConfig: MenuActionConfig[]; - - public investigationReceivedSortList: TableHeaderSort[] = []; - public investigationQueuedAndRequestedSortList: TableHeaderSort[] = []; - private ctrlKeyState: boolean = false; - - private paramSubscription: Subscription; - - private pagination: TableEventConfig = { page: 0, pageSize: 50, sorting: [ 'createdDate', 'desc' ] }; - - constructor( - public readonly helperService: InvestigationHelperService, - public readonly investigationsFacade: InvestigationsFacade, - private readonly investigationDetailFacade: InvestigationDetailFacade, - private readonly router: Router, - private readonly route: ActivatedRoute, - private readonly cd: ChangeDetectorRef, - ) { - this.investigationsReceived$ = this.investigationsFacade.investigationsReceived$; - this.investigationsQueuedAndRequested$ = this.investigationsFacade.investigationsQueuedAndRequested$; - - window.addEventListener('keydown', (event) => { - this.ctrlKeyState = event.ctrlKey; - }); - window.addEventListener('keyup', (event) => { - this.ctrlKeyState = event.ctrlKey; - }); - - } - - public ngOnInit(): void { - - this.paramSubscription = this.route.queryParams.subscribe(params => { - if (params.deeplink){ - - } else { - this.pagination.page = params?.pageNumber; + @ViewChild(NotificationCommonModalComponent) notificationCommonModalComponent: NotificationCommonModalComponent; + + public readonly investigationsReceived$; + public readonly investigationsQueuedAndRequested$; + + public menuActionsConfig: MenuActionConfig[]; + + public investigationReceivedSortList: TableHeaderSort[] = []; + public investigationQueuedAndRequestedSortList: TableHeaderSort[] = []; + private ctrlKeyState: boolean = false; + + private paramSubscription: Subscription; + + private pagination: TableEventConfig = {page: 0, pageSize: 50, sorting: ['createdDate', 'desc']}; + + constructor( + public readonly helperService: InvestigationHelperService, + public readonly investigationsFacade: InvestigationsFacade, + private readonly investigationDetailFacade: InvestigationDetailFacade, + private readonly router: Router, + private readonly route: ActivatedRoute, + private readonly cd: ChangeDetectorRef, + ) { + this.investigationsReceived$ = this.investigationsFacade.investigationsReceived$; + this.investigationsQueuedAndRequested$ = this.investigationsFacade.investigationsQueuedAndRequested$; + + window.addEventListener('keydown', (event) => { + this.ctrlKeyState = event.ctrlKey; + }); + window.addEventListener('keyup', (event) => { + this.ctrlKeyState = event.ctrlKey; + }); + + } + + public ngOnInit(): void { + + this.paramSubscription = this.route.queryParams.subscribe(params => { + if (params.deeplink) { + this.pagination.page = 0; + if (params.received === 'true' && params?.notificationIds?.length > 0) { + const filter = {notificationIds: params.notificationIds}; + this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList, filter); + this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList,); + } + if (params.received === 'false' && params?.notificationIds?.length > 0) { + const filter = {notificationIds: params.notificationIds}; + this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList, filter); + this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList); + } + } else { + this.pagination.page = params?.pageNumber; + this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList); + this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList); + } + }) + } + + public ngAfterViewInit(): void { + this.menuActionsConfig = NotificationMenuActionsAssembler.getMenuActions(this.helperService, this.notificationCommonModalComponent); + this.cd.detectChanges(); + } + + public ngOnDestroy(): void { + this.investigationsFacade.stopInvestigations(); + this.paramSubscription?.unsubscribe(); + } + + public onReceivedTableConfigChanged(pagination: TableEventConfig) { + this.pagination = pagination; + this.setTableSortingList(pagination.sorting, NotificationStatusGroup.RECEIVED); this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList); + } + + public onQueuedAndRequestedTableConfigChanged(pagination: TableEventConfig) { + this.pagination = pagination; + this.setTableSortingList(pagination.sorting, NotificationStatusGroup.QUEUED_AND_REQUESTED); this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList); - } - - }); - } - - public ngAfterViewInit(): void { - this.menuActionsConfig = NotificationMenuActionsAssembler.getMenuActions(this.helperService, this.notificationCommonModalComponent); - this.cd.detectChanges(); - } - - public ngOnDestroy(): void { - this.investigationsFacade.stopInvestigations(); - this.paramSubscription?.unsubscribe(); - } - - public onReceivedTableConfigChanged(pagination: TableEventConfig) { - this.pagination = pagination; - this.setTableSortingList(pagination.sorting, NotificationStatusGroup.RECEIVED); - this.investigationsFacade.setReceivedInvestigation(this.pagination.page, this.pagination.pageSize, this.investigationReceivedSortList); - } - - public onQueuedAndRequestedTableConfigChanged(pagination: TableEventConfig) { - this.pagination = pagination; - this.setTableSortingList(pagination.sorting, NotificationStatusGroup.QUEUED_AND_REQUESTED); - this.investigationsFacade.setQueuedAndRequestedInvestigations(this.pagination.page, this.pagination.pageSize, this.investigationQueuedAndRequestedSortList); - } - - public openDetailPage(notification: Notification): void { - this.investigationDetailFacade.selected = { data: notification }; - const { link } = getRoute(INVESTIGATION_BASE_ROUTE); - const tabIndex = this.route.snapshot.queryParamMap.get('tabIndex'); - const tabInformation: NotificationTabInformation = { tabIndex: tabIndex, pageNumber: this.pagination.page }; - this.router.navigate([ `/${ link }/${ notification.id }` ], { queryParams: tabInformation }); - } - - public handleConfirmActionCompletedEvent() { - this.ngOnInit(); - } - - private setTableSortingList(sorting: TableHeaderSort, notificationTable: NotificationStatusGroup): void { - const tableSortList = notificationTable === NotificationStatusGroup.RECEIVED ? - this.investigationReceivedSortList : this.investigationQueuedAndRequestedSortList; - TableSortingUtil.setTableSortingList(sorting, tableSortList, this.ctrlKeyState); - } - - protected readonly TranslationContext = TranslationContext; - protected readonly NotificationType = NotificationType; + } + + public openDetailPage(notification: Notification): void { + this.investigationDetailFacade.selected = {data: notification}; + const {link} = getRoute(INVESTIGATION_BASE_ROUTE); + const tabIndex = this.route.snapshot.queryParamMap.get('tabIndex'); + const tabInformation: NotificationTabInformation = {tabIndex: tabIndex, pageNumber: this.pagination.page}; + this.router.navigate([`/${link}/${notification.id}`], {queryParams: tabInformation}); + } + + public handleConfirmActionCompletedEvent() { + this.ngOnInit(); + } + + private setTableSortingList(sorting: TableHeaderSort, notificationTable: NotificationStatusGroup): void { + const tableSortList = notificationTable === NotificationStatusGroup.RECEIVED ? + this.investigationReceivedSortList : this.investigationQueuedAndRequestedSortList; + TableSortingUtil.setTableSortingList(sorting, tableSortList, this.ctrlKeyState); + } + + protected readonly TranslationContext = TranslationContext; + protected readonly NotificationType = NotificationType; } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html index 3e8636a1e0..f52296f091 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html @@ -227,7 +227,7 @@

{{ 'table.noResultFound' | i18n }}

- + {{element[column]?.length}} diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts index 5d5ad68c8f..c65e34d97c 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts @@ -67,7 +67,7 @@ import { PartsAsPlannedCustomerConfigurationModel } from "@shared/components/parts-table/parts-as-planned-customer-configuration.model"; import {Router} from "@angular/router"; -import {INVESTIGATION_BASE_ROUTE} from "@core/known-route"; +import {ALERT_BASE_ROUTE, INVESTIGATION_BASE_ROUTE} from "@core/known-route"; @Component({ @@ -164,10 +164,39 @@ export class PartsTableComponent implements OnInit { public tableViewConfig: TableViewConfig; - public deeplinkToNotification(column: any){ - console.log(column, "col"); - this.router.navigate([INVESTIGATION_BASE_ROUTE], { queryParams: { deeplink: true } }) + public deeplinkToNotification(column: any, notificationId: string[]) { + let route; + let received; + let tabIndex; + switch (column) { + case "receivedActiveAlerts": { + received = true; + route = ALERT_BASE_ROUTE; + tabIndex = 0; + break; + } + case "sentActiveAlerts": { + received = false; + route = ALERT_BASE_ROUTE; + tabIndex = 1; + break; + } + case "receivedActiveInvestigations": { + received = true; + route = INVESTIGATION_BASE_ROUTE; + tabIndex = 0; + break; + } + case "sentActiveInvestigations": { + received = false; + route = INVESTIGATION_BASE_ROUTE; + tabIndex = 1; + break; + } + } + this.router.navigate([route], {queryParams: {tabIndex: tabIndex, deeplink: true, received: received, notificationIds: notificationId}}) } + public isNotificationCountColumn(column: any) { return column === 'receivedActiveAlerts' || column === 'sentActiveAlerts' || column === 'receivedActiveInvestigations' || column === 'sentActiveInvestigations'; } diff --git a/frontend/src/app/modules/shared/helper/filter-helper.ts b/frontend/src/app/modules/shared/helper/filter-helper.ts index a4bdfdbdb6..ee6009f790 100644 --- a/frontend/src/app/modules/shared/helper/filter-helper.ts +++ b/frontend/src/app/modules/shared/helper/filter-helper.ts @@ -18,147 +18,160 @@ ********************************************************************************/ import {HttpParams} from '@angular/common/http'; import { - AssetAsBuiltFilter, - AssetAsPlannedFilter, - FilterOperator, - getFilterOperatorValue, + AssetAsBuiltFilter, + AssetAsPlannedFilter, + FilterOperator, + getFilterOperatorValue, } from '@page/parts/model/parts.model'; -export const DATE_FILTER_KEYS = [ 'manufacturingDate', 'functionValidFrom', 'functionValidUntil', 'validityPeriodFrom', 'validityPeriodTo' ]; +export const DATE_FILTER_KEYS = ['manufacturingDate', 'functionValidFrom', 'functionValidUntil', 'validityPeriodFrom', 'validityPeriodTo']; // TODO: Refactor function export function enrichFilterAndGetUpdatedParams(filter: AssetAsBuiltFilter, params: HttpParams, filterOperator: string): HttpParams { - for (const key in filter) { - let operator: string; - const filterValues: string = filter[key]; - if (!filterValues){ - continue; - } - // has date - if (isDateFilter(key)) { - if (isDateRangeFilter(filterValues)) { - const [ startDate, endDate ] = filterValues.split(','); - if (isSameDate(startDate, endDate)) { - operator = getFilterOperatorValue(FilterOperator.AT_LOCAL_DATE); - params = params.append('filter', `${ key },${ operator },${ startDate },${ filterOperator }`); - continue; + for (const key in filter) { + let operator: string; + const filterValues: string = filter[key]; + if (!filterValues) { + continue; + } + // has date + if (isDateFilter(key)) { + if (isDateRangeFilter(filterValues)) { + const [startDate, endDate] = filterValues.split(','); + if (isSameDate(startDate, endDate)) { + operator = getFilterOperatorValue(FilterOperator.AT_LOCAL_DATE); + params = params.append('filter', `${key},${operator},${startDate},${filterOperator}`); + continue; + } + let endDateOperator = getFilterOperatorValue(FilterOperator.BEFORE_LOCAL_DATE); + operator = getFilterOperatorValue((FilterOperator.AFTER_LOCAL_DATE)); + params = params.append('filter', `${key},${operator},${startDate},${filterOperator}`); + params = params.append('filter', `${key},${endDateOperator},${endDate},${filterOperator}`); + continue; + } else if (filterValues && filterValues.length != 0) { + console.log(filterValues, "filtervalues"); + operator = getFilterOperatorValue(FilterOperator.AT_LOCAL_DATE); + params = params.append('filter', `${key},${operator},${filterValues},${filterOperator}`); + } } - let endDateOperator = getFilterOperatorValue(FilterOperator.BEFORE_LOCAL_DATE); - operator = getFilterOperatorValue((FilterOperator.AFTER_LOCAL_DATE)); - params = params.append('filter', `${ key },${ operator },${ startDate },${ filterOperator }`); - params = params.append('filter', `${ key },${ endDateOperator },${ endDate },${ filterOperator }`); - continue; - } else if (filterValues && filterValues.length != 0) { - console.log(filterValues, "filtervalues"); - operator = getFilterOperatorValue(FilterOperator.AT_LOCAL_DATE); - params = params.append('filter', `${ key },${ operator },${ filterValues },${ filterOperator }`); - } - } - // has multiple values - if (isStartsWithFilter(key) && Array.isArray(filter[key])) { - operator = getFilterOperatorValue(FilterOperator.EQUAL); + // has multiple values + if (isStartsWithFilter(key) && Array.isArray(filter[key])) { + operator = getFilterOperatorValue(FilterOperator.EQUAL); - for (const value of filter[key]) { - params = params.append('filter', `${ key },${ operator },${ value },${ filterOperator }`); - } - } + for (const value of filter[key]) { + params = params.append('filter', `${key},${operator},${value},${filterOperator}`); + } + } - // has single value - if (isStartsWithFilter(key) && !Array.isArray(filter[key])) { - operator = getFilterOperatorValue(FilterOperator.STARTS_WITH); - params = params.append('filter', `${ key },${ operator },${ filterValues },${ filterOperator }`); - } + // has single value + if (isStartsWithFilter(key) && !Array.isArray(filter[key])) { + operator = getFilterOperatorValue(FilterOperator.STARTS_WITH); + params = params.append('filter', `${key},${operator},${filterValues},${filterOperator}`); + } - if (isNotificationCountFilter(key) && filterValues && filterValues.length != 0) { - operator = getFilterOperatorValue(FilterOperator.NOTIFICATION_COUNT_EQUAL); - params = params.append('filter', `${ key },${ operator },${ filterValues },${ filterOperator }`); - } + if (isNotificationCountFilter(key) && filterValues && filterValues.length != 0) { + operator = getFilterOperatorValue(FilterOperator.NOTIFICATION_COUNT_EQUAL); + params = params.append('filter', `${key},${operator},${filterValues},${filterOperator}`); + } - } + } - return params; + return params; } export function isStartsWithFilter(key: string): boolean { - return !isDateFilter(key) && !isNotificationCountFilter(key); + return !isDateFilter(key) && !isNotificationCountFilter(key); } export function isNotificationCountFilter(key: string): boolean { - return 'receivedQualityAlertIdsInStatusActive' === key || 'sentQualityAlertIdsInStatusActive' === key || 'receivedQualityInvestigationIdsInStatusActive' === key || 'sentQualityInvestigationIdsInStatusActive' === key; + return 'receivedQualityAlertIdsInStatusActive' === key || 'sentQualityAlertIdsInStatusActive' === key || 'receivedQualityInvestigationIdsInStatusActive' === key || 'sentQualityInvestigationIdsInStatusActive' === key; } export function isDateFilter(key: string): boolean { - return DATE_FILTER_KEYS.includes(key); + return DATE_FILTER_KEYS.includes(key); } export function isDateRangeFilter(filterValues: string): boolean { - return filterValues.includes(','); + return filterValues.includes(','); } export function isSameDate(startDate: string, endDate: string): boolean { - return startDate === endDate; + return startDate === endDate; } export function toAssetFilter(formValues: any, isAsBuilt: boolean): AssetAsPlannedFilter | AssetAsBuiltFilter { - const transformedFilter: any = {}; - - // Loop through each form control and add it to the transformedFilter if it has a non-null and non-undefined value - for (const key in formValues) { - if (formValues[key] !== null && formValues[key] !== undefined) { - if ('receivedActiveAlerts' === key) { - transformedFilter['receivedQualityAlertIdsInStatusActive'] = formValues[key]; - continue; - } - if ('sentActiveAlerts' === key) { - transformedFilter['sentQualityAlertIdsInStatusActive'] = formValues[key]; - continue; - } - if ('receivedActiveInvestigations' === key) { - transformedFilter['receivedQualityInvestigationIdsInStatusActive'] = formValues[key]; - continue; - } - if ('sentActiveInvestigations' === key) { - transformedFilter['sentQualityInvestigationIdsInStatusActive'] = formValues[key]; - continue; - } - transformedFilter[key] = formValues[key]; + const transformedFilter: any = {}; + + // Loop through each form control and add it to the transformedFilter if it has a non-null and non-undefined value + for (const key in formValues) { + if (formValues[key] !== null && formValues[key] !== undefined) { + if ('receivedActiveAlerts' === key) { + transformedFilter['receivedQualityAlertIdsInStatusActive'] = formValues[key]; + continue; + } + if ('sentActiveAlerts' === key) { + transformedFilter['sentQualityAlertIdsInStatusActive'] = formValues[key]; + continue; + } + if ('receivedActiveInvestigations' === key) { + transformedFilter['receivedQualityInvestigationIdsInStatusActive'] = formValues[key]; + continue; + } + if ('sentActiveInvestigations' === key) { + transformedFilter['sentQualityInvestigationIdsInStatusActive'] = formValues[key]; + continue; + } + transformedFilter[key] = formValues[key]; + } } - } - const filterIsSet = Object.values(transformedFilter).some(value => value !== undefined && value !== null); - if (filterIsSet) { - if (isAsBuilt) { - return transformedFilter as AssetAsBuiltFilter; + const filterIsSet = Object.values(transformedFilter).some(value => value !== undefined && value !== null); + if (filterIsSet) { + if (isAsBuilt) { + return transformedFilter as AssetAsBuiltFilter; + } else { + return transformedFilter as AssetAsPlannedFilter; + } } else { - return transformedFilter as AssetAsPlannedFilter; + return null; + } + +} + +export function enrichDeeplinkFilterAndGetUpdatedParams(filter: any, httpParams: HttpParams): HttpParams { + + if (filter?.notificationIds) { + filter.notificationIds.forEach(notificationId => { + httpParams = httpParams.append('filter', 'id,EQUAL,' + notificationId + ',OR') + }) } - } else { - return null; - } + console.log(httpParams, "params"); + return httpParams; } + export function toGlobalSearchAssetFilter(formValues: string, isAsBuilt: boolean) { - let filter; - if (isAsBuilt) { - filter = { - id: formValues, - semanticModelId: formValues, - idShort: formValues, - customerPartId: formValues, - manufacturerPartId: formValues, - } as AssetAsBuiltFilter; - } else { - filter = { - id: formValues, - idShort: formValues, - semanticModelId: formValues, - manufacturerPartId: formValues, - } as AssetAsPlannedFilter; - } - - return filter; + let filter; + if (isAsBuilt) { + filter = { + id: formValues, + semanticModelId: formValues, + idShort: formValues, + customerPartId: formValues, + manufacturerPartId: formValues, + } as AssetAsBuiltFilter; + } else { + filter = { + id: formValues, + idShort: formValues, + semanticModelId: formValues, + manufacturerPartId: formValues, + } as AssetAsPlannedFilter; + } + + return filter; } diff --git a/frontend/src/app/modules/shared/service/alerts.service.ts b/frontend/src/app/modules/shared/service/alerts.service.ts index 6bc4c2a55b..18dbdd3e55 100644 --- a/frontend/src/app/modules/shared/service/alerts.service.ts +++ b/frontend/src/app/modules/shared/service/alerts.service.ts @@ -37,6 +37,8 @@ import { NotificationStatus, NotificationType, } from '../model/notification.model'; +import {NotificationFilter} from "../../../mocks/services/investigations-mock/investigations.model"; +import {enrichDeeplinkFilterAndGetUpdatedParams} from "@shared/helper/filter-helper"; @Injectable({ providedIn: 'root', @@ -46,7 +48,7 @@ export class AlertsService { constructor(private readonly apiService: ApiService) {} - public getCreatedAlerts(page: number, pageSize: number, sorting: TableHeaderSort[]): Observable { + public getCreatedAlerts(page: number, pageSize: number, sorting: TableHeaderSort[], filter?: NotificationFilter): Observable { let sort = sorting.length ? sorting : ['createdDate,desc']; let params = new HttpParams() .set('page', page) @@ -57,12 +59,14 @@ export class AlertsService { params = params.append('sort', sortingItem); }) + params = enrichDeeplinkFilterAndGetUpdatedParams(filter, params); + return this.apiService .getBy(`${this.url}/alerts`, params) .pipe(map(alerts => NotificationAssembler.assembleNotifications(alerts, NotificationType.ALERT))); } - public getReceivedAlerts(page: number, pageSize: number, sorting: TableHeaderSort[]): Observable { + public getReceivedAlerts(page: number, pageSize: number, sorting: TableHeaderSort[], filter?: NotificationFilter): Observable { let sort = sorting.length ? sorting : ['createdDate,desc']; let params = new HttpParams() .set('page', page) @@ -73,6 +77,8 @@ export class AlertsService { params = params.append('sort', sortingItem); }) + params = enrichDeeplinkFilterAndGetUpdatedParams(filter, params); + return this.apiService .getBy(`${this.url}/alerts`, params) .pipe(map(alerts => NotificationAssembler.assembleNotifications(alerts, NotificationType.ALERT))); diff --git a/frontend/src/app/modules/shared/service/investigations.service.ts b/frontend/src/app/modules/shared/service/investigations.service.ts index d2a0f9d4a3..5a020daaa0 100644 --- a/frontend/src/app/modules/shared/service/investigations.service.ts +++ b/frontend/src/app/modules/shared/service/investigations.service.ts @@ -30,101 +30,103 @@ import type {Observable} from 'rxjs'; import {map} from 'rxjs/operators'; import {NotificationAssembler} from '../assembler/notification.assembler'; import { - Notification, - NotificationCreateResponse, - NotificationResponse, - Notifications, - NotificationsResponse, - NotificationStatus, - NotificationType, + Notification, + NotificationCreateResponse, + NotificationResponse, + Notifications, + NotificationsResponse, + NotificationStatus, + NotificationType, } from '../model/notification.model'; -import {InvestigationFilter} from "../../../mocks/services/investigations-mock/investigations.model"; +import {NotificationFilter} from "../../../mocks/services/investigations-mock/investigations.model"; +import {enrichDeeplinkFilterAndGetUpdatedParams} from "@shared/helper/filter-helper"; @Injectable({ - providedIn: 'root', + providedIn: 'root', }) export class InvestigationsService { - private readonly url = environment.apiUrl; - - constructor(private readonly apiService: ApiService) {} - - public getCreatedInvestigations(page: number, pageSize: number, sorting: TableHeaderSort[]): Observable { - let sort = sorting.length ? sorting : ['createdDate,desc']; - let params = new HttpParams() - .set('page', page) - .set('size', pageSize) - .set('filter', 'channel,EQUAL,SENDER,AND') - - sort.forEach(sortingItem => { - params = params.append('sort', sortingItem); - }) - - return this.apiService - .getBy(`${this.url}/investigations`, params) - .pipe(map(investigations => NotificationAssembler.assembleNotifications(investigations, NotificationType.INVESTIGATION))); - } - - public getReceivedInvestigations(page: number, pageSize: number, sorting: TableHeaderSort[], filter?: InvestigationFilter): Observable { - let sort = sorting.length ? sorting : ['createdDate,desc']; - let params = new HttpParams() - .set('page', page) - .set('size', pageSize) - .set('filter', 'channel,EQUAL,RECEIVER,AND') - - sort.forEach(sortingItem => { - params = params.append('sort', sortingItem); - }) - - if (filter) { - // params = enrichFilterAndGetUpdatedParams(assetAsBuiltFilter, params, filterOperator); + private readonly url = environment.apiUrl; + + constructor(private readonly apiService: ApiService) { + } + + public getCreatedInvestigations(page: number, pageSize: number, sorting: TableHeaderSort[], filter?: NotificationFilter): Observable { + let sort = sorting.length ? sorting : ['createdDate,desc']; + let params = new HttpParams() + .set('page', page) + .set('size', pageSize) + .set('filter', 'channel,EQUAL,SENDER,AND') + + sort.forEach(sortingItem => { + params = params.append('sort', sortingItem); + }) + + params = enrichDeeplinkFilterAndGetUpdatedParams(filter, params); + + return this.apiService + .getBy(`${this.url}/investigations`, params) + .pipe(map(investigations => NotificationAssembler.assembleNotifications(investigations, NotificationType.INVESTIGATION))); } - return this.apiService - .getBy(`${this.url}/investigations`, params) - .pipe(map(investigations => NotificationAssembler.assembleNotifications(investigations, NotificationType.INVESTIGATION))); - } - - public getInvestigation(id: string): Observable { - return this.apiService - .get(`${this.url}/investigations/${id}`) - .pipe(map(notification => NotificationAssembler.assembleNotification(notification, NotificationType.INVESTIGATION))); - } - - public postInvestigation( - partIds: string[], - description: string, - severity: Severity, - dateString: DateTimeString, - ): Observable { - // targetDate is an optional field - const targetDate = null === dateString ? null : new Date(dateString).toISOString(); - const body = { partIds, description, severity, targetDate }; - - return this.apiService - .post(`${this.url}/investigations`, body) - .pipe(map(({ id }) => id)); - } - - public closeInvestigation(id: string, reason: string): Observable { - const body = { reason }; - - return this.apiService.post(`${this.url}/investigations/${id}/close`, body); - } - - public approveInvestigation(id: string): Observable { - return this.apiService.post(`${this.url}/investigations/${id}/approve`); - } - - public cancelInvestigation(id: string): Observable { - return this.apiService.post(`${this.url}/investigations/${id}/cancel`); - } - - public updateInvestigation( - id: string, - status: NotificationStatus.ACKNOWLEDGED | NotificationStatus.ACCEPTED | NotificationStatus.DECLINED, - reason = '', - ): Observable { - const body = { reason, status }; - return this.apiService.post(`${this.url}/investigations/${id}/update`, body); - } + public getReceivedInvestigations(page: number, pageSize: number, sorting: TableHeaderSort[], filter?: NotificationFilter): Observable { + let sort = sorting.length ? sorting : ['createdDate,desc']; + + let params = new HttpParams() + .set('page', page) + .set('size', pageSize) + .set('filter', 'channel,EQUAL,RECEIVER,AND') + + sort.forEach(sortingItem => { + params = params.append('sort', sortingItem); + }) + params = enrichDeeplinkFilterAndGetUpdatedParams(filter, params); + + return this.apiService + .getBy(`${this.url}/investigations`, params) + .pipe(map(investigations => NotificationAssembler.assembleNotifications(investigations, NotificationType.INVESTIGATION))); + } + + public getInvestigation(id: string): Observable { + return this.apiService + .get(`${this.url}/investigations/${id}`) + .pipe(map(notification => NotificationAssembler.assembleNotification(notification, NotificationType.INVESTIGATION))); + } + + public postInvestigation( + partIds: string[], + description: string, + severity: Severity, + dateString: DateTimeString, + ): Observable { + // targetDate is an optional field + const targetDate = null === dateString ? null : new Date(dateString).toISOString(); + const body = {partIds, description, severity, targetDate}; + + return this.apiService + .post(`${this.url}/investigations`, body) + .pipe(map(({id}) => id)); + } + + public closeInvestigation(id: string, reason: string): Observable { + const body = {reason}; + + return this.apiService.post(`${this.url}/investigations/${id}/close`, body); + } + + public approveInvestigation(id: string): Observable { + return this.apiService.post(`${this.url}/investigations/${id}/approve`); + } + + public cancelInvestigation(id: string): Observable { + return this.apiService.post(`${this.url}/investigations/${id}/cancel`); + } + + public updateInvestigation( + id: string, + status: NotificationStatus.ACKNOWLEDGED | NotificationStatus.ACCEPTED | NotificationStatus.DECLINED, + reason = '', + ): Observable { + const body = {reason, status}; + return this.apiService.post(`${this.url}/investigations/${id}/update`, body); + } } From 62e62f1065e8fa2c32904704500c64ea973cb699 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Fri, 24 Nov 2023 09:01:42 +0100 Subject: [PATCH 24/26] chore: TRACEFOSS-2726 added deeplinks --- .../modules/core/user/table-settings.service.ts | 16 +++++++++++++++- .../parts-table/parts-table.component.ts | 15 ++++++++++++--- .../table-settings/table-settings.component.ts | 2 +- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/modules/core/user/table-settings.service.ts b/frontend/src/app/modules/core/user/table-settings.service.ts index ab1e6aac50..d49cee7fcb 100644 --- a/frontend/src/app/modules/core/user/table-settings.service.ts +++ b/frontend/src/app/modules/core/user/table-settings.service.ts @@ -20,6 +20,7 @@ import { Injectable } from '@angular/core'; import { PartTableType } from '@shared/components/table/table.model'; import { Subject } from 'rxjs'; +import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; @Injectable({ providedIn: 'root', @@ -28,7 +29,7 @@ export class TableSettingsService { private settingsKey = 'TableViewSettings'; private changeEvent = new Subject(); - storeTableSettings(partTableType: PartTableType, tableSettingsList: any ): void { + storeTableSettings(tableSettingsList: any ): void { // before setting anything, all maps in new tableSettingList should be stringified Object.keys(tableSettingsList).forEach(tableSetting => { console.log(tableSetting, "settings"); @@ -52,6 +53,19 @@ export class TableSettingsService { return settingsObject; } + storedTableSettingsInvalid(tableViewConfig: TableViewConfig, tableType: PartTableType):boolean{ + let isInvalid = false; + const storage = this.getStoredTableSettings(); + for (const col of tableViewConfig.displayedColumns.values()){ + if (!storage[tableType].columnsForDialog.include(col)){ + console.warn("Found issue in tablesettings", col); + isInvalid = true; + } + } + localStorage.removeItem(this.settingsKey); + return isInvalid; + } + emitChangeEvent() { this.changeEvent.next(); } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts index c65e34d97c..0ce227e83c 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts @@ -68,6 +68,7 @@ import { } from "@shared/components/parts-table/parts-as-planned-customer-configuration.model"; import {Router} from "@angular/router"; import {ALERT_BASE_ROUTE, INVESTIGATION_BASE_ROUTE} from "@core/known-route"; +import {ToastService} from "@shared/components/toasts/toast.service"; @Component({ @@ -138,7 +139,11 @@ export class PartsTableComponent implements OnInit { @Output() clickSelectAction = new EventEmitter(); @Output() filterActivated = new EventEmitter(); - constructor(private readonly tableSettingsService: TableSettingsService, private dialog: MatDialog, private router: Router) { + constructor( + private readonly tableSettingsService: TableSettingsService, + private dialog: MatDialog, + private router: Router, + private toastService: ToastService) { } @@ -246,6 +251,10 @@ export class PartsTableComponent implements OnInit { private setupTableViewSettings() { const tableSettingsList = this.tableSettingsService.getStoredTableSettings(); + + if (this.tableSettingsService.storedTableSettingsInvalid(this.tableViewConfig, this.tableType)){ + + } // check if there are table settings list if (tableSettingsList) { // if yes, check if there is a table-setting for this table type @@ -260,7 +269,7 @@ export class PartsTableComponent implements OnInit { columnsForTable: this.tableViewConfig.displayedColumns, filterColumnsForTable: this.tableViewConfig.filterColumns }; - this.tableSettingsService.storeTableSettings(this.tableType, tableSettingsList); + this.tableSettingsService.storeTableSettings(tableSettingsList); this.setupTableConfigurations(this.tableViewConfig.displayedColumns, this.tableViewConfig.filterColumns, this.tableViewConfig.sortableColumns, this.tableViewConfig.displayFilterColumnMappings, this.tableViewConfig.filterFormGroup); } } else { @@ -273,7 +282,7 @@ export class PartsTableComponent implements OnInit { filterColumnsForTable: this.tableViewConfig.filterColumns } } - this.tableSettingsService.storeTableSettings(this.tableType, newTableSettingsList); + this.tableSettingsService.storeTableSettings(newTableSettingsList); this.setupTableConfigurations(this.tableViewConfig.displayedColumns, this.tableViewConfig.filterColumns, this.tableViewConfig.sortableColumns, this.tableViewConfig.displayFilterColumnMappings, this.tableViewConfig.filterFormGroup); } } diff --git a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.ts b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.ts index e50d1ec4c5..2870512f33 100644 --- a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.ts +++ b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.ts @@ -102,7 +102,7 @@ export class TableSettingsComponent { } as TableViewSettings; // save all values back to localstorage - this.tableSettingsService.storeTableSettings(this.tableType, tableSettingsList); + this.tableSettingsService.storeTableSettings(tableSettingsList); // trigger action that table will refresh this.tableSettingsService.emitChangeEvent(); From 4a5220d9e3ec1be551381752bb4b54337ad3f5bf Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Fri, 24 Nov 2023 14:23:45 +0100 Subject: [PATCH 25/26] chore: TRACEFOSS-2726 added validation for localstorage invalid state. --- .../core/user/table-settings.service.ts | 105 +++++++++++------- .../parts-table/parts-table.component.ts | 6 +- frontend/src/assets/locales/de/common.json | 1 + frontend/src/assets/locales/en/common.json | 1 + 4 files changed, 67 insertions(+), 46 deletions(-) diff --git a/frontend/src/app/modules/core/user/table-settings.service.ts b/frontend/src/app/modules/core/user/table-settings.service.ts index d49cee7fcb..74dd9e1b27 100644 --- a/frontend/src/app/modules/core/user/table-settings.service.ts +++ b/frontend/src/app/modules/core/user/table-settings.service.ts @@ -17,60 +17,79 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -import { Injectable } from '@angular/core'; -import { PartTableType } from '@shared/components/table/table.model'; -import { Subject } from 'rxjs'; +import {Injectable} from '@angular/core'; +import {PartTableType} from '@shared/components/table/table.model'; +import {Subject} from 'rxjs'; import {TableViewConfig} from "@shared/components/parts-table/table-view-config.model"; @Injectable({ - providedIn: 'root', + providedIn: 'root', }) export class TableSettingsService { - private settingsKey = 'TableViewSettings'; - private changeEvent = new Subject(); + private settingsKey = 'TableViewSettings'; + private changeEvent = new Subject(); - storeTableSettings(tableSettingsList: any ): void { - // before setting anything, all maps in new tableSettingList should be stringified - Object.keys(tableSettingsList).forEach(tableSetting => { - console.log(tableSetting, "settings"); - const newMap = tableSettingsList[tableSetting].columnSettingsOptions; - tableSettingsList[tableSetting].columnSettingsOptions = JSON.stringify(Array.from(newMap.entries())); - }) - localStorage.setItem(this.settingsKey, JSON.stringify(tableSettingsList)); - } + storeTableSettings(tableSettingsList: any): void { + // before setting anything, all maps in new tableSettingList should be stringified + Object.keys(tableSettingsList).forEach(tableSetting => { + const newMap = tableSettingsList[tableSetting].columnSettingsOptions; + tableSettingsList[tableSetting].columnSettingsOptions = JSON.stringify(Array.from(newMap.entries())); + }) + localStorage.setItem(this.settingsKey, JSON.stringify(tableSettingsList)); + } + + // this returns whole settings whether empty / not for part / etc. + getStoredTableSettings(): any { + const settingsJson = localStorage.getItem(this.settingsKey); + let settingsObject = settingsJson ? JSON.parse(settingsJson) : null; + if (!settingsObject) return; + + // iterate through all tabletypes and parse columnSettingsOption to a map + Object.keys(settingsObject).forEach(tableSetting => { + settingsObject[tableSetting].columnSettingsOptions = new Map(JSON.parse(settingsObject[tableSetting].columnSettingsOptions)); + + }); - // this returns whole settings whether empty / not for part / etc. - getStoredTableSettings(): any { - const settingsJson = localStorage.getItem(this.settingsKey); - let settingsObject = settingsJson ? JSON.parse(settingsJson) : null; - if(!settingsObject) return; + return settingsObject; + } + + storedTableSettingsInvalid(tableViewConfig: TableViewConfig, tableType: PartTableType): boolean { + let isInvalid = false; - // iterate through all tabletypes and parse columnSettingsOption to a map - Object.keys(settingsObject).forEach(tableSetting => { - settingsObject[tableSetting].columnSettingsOptions = new Map(JSON.parse(settingsObject[tableSetting].columnSettingsOptions)); + const storage = this.getStoredTableSettings(); + if (!storage || !storage[tableType]){ + return false; + } + const storageElement = storage[tableType]; - }); - return settingsObject; - } + if (!storageElement || !storageElement.columnsForDialog) { + return false; + } - storedTableSettingsInvalid(tableViewConfig: TableViewConfig, tableType: PartTableType):boolean{ - let isInvalid = false; - const storage = this.getStoredTableSettings(); - for (const col of tableViewConfig.displayedColumns.values()){ - if (!storage[tableType].columnsForDialog.include(col)){ - console.warn("Found issue in tablesettings", col); - isInvalid = true; - } + if (tableViewConfig.displayedColumns.length !== storageElement.columnsForDialog.length) { + isInvalid = true; + } + for (const col of tableViewConfig.displayedColumns.values()) { + if (!storageElement.columnsForDialog.includes(col)) { + isInvalid = true; + } + } + for (const col of storage[tableType]?.columnsForDialog) { + if (!tableViewConfig.displayedColumns.includes(col)) { + isInvalid = true; + } + } + if (isInvalid) { + localStorage.removeItem(this.settingsKey); + } + return isInvalid; } - localStorage.removeItem(this.settingsKey); - return isInvalid; - } - emitChangeEvent() { - this.changeEvent.next(); - } + emitChangeEvent() { + this.changeEvent.next(); + } - getEvent() { - return this.changeEvent.asObservable(); - } + getEvent() { + return this.changeEvent.asObservable(); + } } diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts index 0ce227e83c..0aad0633b6 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.ts @@ -250,11 +250,11 @@ export class PartsTableComponent implements OnInit { private setupTableViewSettings() { - const tableSettingsList = this.tableSettingsService.getStoredTableSettings(); - - if (this.tableSettingsService.storedTableSettingsInvalid(this.tableViewConfig, this.tableType)){ + if (this.tableSettingsService.storedTableSettingsInvalid(this.tableViewConfig, this.tableType)) { + this.toastService.warning("table.tableSettings.invalid", 10000); } + const tableSettingsList = this.tableSettingsService.getStoredTableSettings(); // check if there are table settings list if (tableSettingsList) { // if yes, check if there is a table-setting for this table type diff --git a/frontend/src/assets/locales/de/common.json b/frontend/src/assets/locales/de/common.json index 6e12fd9f09..f5b6511c26 100644 --- a/frontend/src/assets/locales/de/common.json +++ b/frontend/src/assets/locales/de/common.json @@ -60,6 +60,7 @@ "multiSortingTooltip": "Erster Klick: aufsteigend sortieren ↑ Zweiter Klick: absteigend sortieren ↓ Dritter Klick: Sortierung zurücksetzen", "filterTitle" : "Filter", "tableSettings": { + "invalid": "Auf Grund eines Fehlers werden die Tabelleneinstellungen zurückgesetzt", "title": "Tabellenspalten Einstellungen", "selectAll": "Alle", "orderTooltip": "Die Anordnung der Tabellenspalten kann über die Auswahl einer Spalte und einem Klick auf die Pfeilsymbole angepasst werden. ↑ (hoch) oder ↓ (runter)", diff --git a/frontend/src/assets/locales/en/common.json b/frontend/src/assets/locales/en/common.json index b56811a109..ed8d1812f5 100644 --- a/frontend/src/assets/locales/en/common.json +++ b/frontend/src/assets/locales/en/common.json @@ -60,6 +60,7 @@ "multiSortingTooltip": "First click: sort in ascending order ↑ Second click: sort in descending order ↓ Third click: reset sorting", "filterTitle": "Filter", "tableSettings": { + "invalid": "Due to an error table settings have been reset", "title": "Table column settings", "selectAll": "All", "orderTooltip": "Table column order can be changed by selecting a column and move it up or down by clicking on the icon ↑ (up) or ↓ (down)", From 43828346a07f357b4189824ffb0df4dd3c6c487b Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Fri, 24 Nov 2023 19:02:22 +0100 Subject: [PATCH 26/26] chore: TRACEFOSS-2726 added validation for localstorage invalid state. --- .../components/table-settings/table-settings.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.spec.ts b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.spec.ts index cf25872f32..707091423d 100644 --- a/frontend/src/app/modules/shared/components/table-settings/table-settings.component.spec.ts +++ b/frontend/src/app/modules/shared/components/table-settings/table-settings.component.spec.ts @@ -123,7 +123,7 @@ describe('TableSettingsComponent', () => { component.save(); // Check that setColumnVisibilitySettings was called with the updated settings - expect(tableSettingsService.storeTableSettings).toHaveBeenCalledWith(PartTableType.AS_BUILT_OWN, { + expect(tableSettingsService.storeTableSettings).toHaveBeenCalledWith({ [PartTableType.AS_BUILT_OWN]: { columnSettingsOptions: columnOptions, columnsForDialog: ['column1', 'column2'],