Skip to content

Commit

Permalink
Merge pull request #967 from catenax-ng/main
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
ds-mwesener authored May 14, 2024
2 parents d26bd53 + b3a72be commit a0074e8
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 45 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
### Changed
- #778 return empty PageResult when no contract agreement Ids are found instead of http 404 in /contacts API
- #XXX Fixed some sonar issues in frontend application
- #XXX Switched eclipse-temurin:21-jre-alpine@sha256:fb4150a30569aadae9d693d949684a00653411528e62498b9900940c9b5b8a66 to 23467b3e42617ca197f43f58bc5fb03ca4cb059d68acd49c67128bfded132d67

## [11.0.0 - 08.05.2024]
### Added
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ COPY tx-backend tx-backend
RUN --mount=type=cache,target=/root/.m2 mvn -B clean package -pl :$BUILD_TARGET -am -DskipTests

# Copy the jar and build image
FROM eclipse-temurin:21-jre-alpine@sha256:fb4150a30569aadae9d693d949684a00653411528e62498b9900940c9b5b8a66 AS traceability-app
FROM eclipse-temurin:21-jre-alpine@sha256:23467b3e42617ca197f43f58bc5fb03ca4cb059d68acd49c67128bfded132d67 AS traceability-app

ARG UID=10000
ARG GID=1000
Expand Down
32 changes: 10 additions & 22 deletions frontend/cypress/support/step_definitions/quality-investigations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,10 @@ Then('select part with id {string}', function(id: string) {
});


Then('start {string} creation with description {string}', function(notificationType: string, description: string) {
Then('start notification creation with description {string}', function(notificationType: string, description: string) {
const date = new Date().getTime();
notificationDescription = description + '_' + date;
switch (notificationType) {
case 'investigation': {
cy.get('div').contains('Start investigation').click();
break;
}
case 'alert': {
cy.get('div').contains('Create alert').click();
break;
}
default: {
throw new Error('Set notification type \'' + notificationType + '\' is not one of valid types [investigation, alert].');
break;
}
}
cy.get('[data-testid="create-notification-button"]').click();
cy.get('mat-label').contains(/^Description$/i).click().type(notificationDescription);
});

Expand Down Expand Up @@ -196,31 +183,31 @@ When('user {string} selected {string}', function(action: string) {
//within opened detail view of quality investigation
switch (action) {
case 'edit': {
cy.get('div').contains('Edit').click();
cy.get('[data-testid="edit-button-icon"]').click();
break;
}
case 'approve': {
cy.get('div').contains('Approve').click();
cy.get('[data-testid="approve-button-icon"]').click();
break;
}
case 'cancel': {
cy.get('div').contains('Cancel').click();
cy.get('[data-testid="cancel-button-icon"]').click();
break;
}
case 'close': {
cy.get('div').contains('Close').click();
cy.get('[data-testid="close-button-icon"]').click();
break;
}
case 'acknowledge': {
cy.get('div').contains('Acknowledge').click();
cy.get('[data-testid="acknowledge-button-icon"]').click();
break;
}
case 'accept': {
cy.get('div').contains('Accept').click();
cy.get('[data-testid="accept-button-icon"]').click();
break;
}
case 'decline': {
cy.get('div').contains('Decline').click();
cy.get('[data-testid="decline-button-icon"]').click();
break;
}
default: {
Expand Down Expand Up @@ -248,6 +235,7 @@ Then('selected {string} has been {string} as expected', function(notificationTyp
break;
}
case 'approved': {
cy.wait(3000);
// same as "requested"
cy.get('[title="Requested"]', { timeout: 10000 }).should('be.visible');
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ export class NotificationEditComponent implements OnDestroy {
} else {
this.notificationsFacade.createNotification(this.affectedPartIds, type, title, bpn, severity, targetDate, description).subscribe({
next: () => {
this.toastService.success('requestNotification.saveSuccess');
this.toastService.success('requestNotification.saveSuccess', 5000, [ {
text: 'actions.goToQueue',
link: '/inbox',
} ]);
this.navigateBack();
this.updateSelectedNotificationState();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
[isDisabled]="!actionHelperService.isAllowedToEdit()"
>
<div class="flex justify-between items-center">
<mat-icon class="mr-2">edit</mat-icon>
<mat-icon class="mr-2" [attr.data-testid]="'edit-button-icon'">edit</mat-icon>
{{ 'actions.edit' | i18n }}
</div>
</app-button>
Expand All @@ -60,7 +60,7 @@
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.APPROVE)"
>
<div class="flex justify-between items-center">
<mat-icon class="mr-2">share</mat-icon>
<mat-icon class="mr-2" [attr.data-testid]="'approve-button-icon'">share</mat-icon>
{{ 'actions.approve' | i18n }}
</div>
</app-button>
Expand All @@ -81,7 +81,7 @@
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.CANCEL)"
>
<div class="flex justify-between items-center">
<mat-icon class="mr-2">cancel</mat-icon>
<mat-icon class="mr-2" [attr.data-testid]="'cancel-button-icon'">cancel</mat-icon>
{{ 'actions.cancel' | i18n }}
</div>
</app-button>
Expand All @@ -102,7 +102,7 @@
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.CLOSE)"
>
<div class="flex justify-between items-center">
<mat-icon class="mr-2">close</mat-icon>
<mat-icon class="mr-2" [attr.data-testid]="'close-button-icon'">close</mat-icon>
{{ 'actions.close' | i18n }}
</div>
</app-button>
Expand All @@ -123,7 +123,7 @@
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.ACCEPT)"
>
<div class="flex justify-between items-center">
<mat-icon class="mr-2">assignment_turned_in</mat-icon>
<mat-icon class="mr-2" [attr.data-testid]="'accept-button-icon'">assignment_turned_in</mat-icon>
{{ 'actions.accept' | i18n }}
</div>
</app-button>
Expand All @@ -144,7 +144,7 @@
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.ACKNOWLEDGE)"
>
<div class="flex justify-between items-center">
<mat-icon class="mr-2">work</mat-icon>
<mat-icon class="mr-2" [attr.data-testid]="'acknowledge-button-icon'">work</mat-icon>
{{ 'actions.acknowledge' | i18n }}
</div>
</app-button>
Expand All @@ -165,7 +165,7 @@
[isDisabled]="!actionHelperService.isAuthorizedForButton(NotificationAction.DECLINE)"
>
<div class="flex justify-between items-center">
<mat-icon class="mr-2">assignment_late</mat-icon>
<mat-icon class="mr-2" [attr.data-testid]="'decline-button-icon'">assignment_late</mat-icon>
{{ 'actions.decline' | i18n }}
</div>
</app-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<app-button
iconName="announcement"
class="action-button-tile"
[attr.data-testid]="'create-notification-button'"
[isDisabled]="!isAllowedToCreateAlert() && !isAllowedToCreateInvestigation()"
(click)="createQualityNotificationClicked()"
(keydown)="handleKeyDownQualityNotificationClicked($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public List<String> isValid(MultipartFile file) {
reader.close();

} catch (ProcessingException | IOException e) {
throw new JsonFileProcessingException(e);
return List.of("Json file is not processable." + e.getMessage());
}
errors.addAll(validateAspectPayload(file));
return errors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.eclipse.tractusx.irs.component.assetadministrationshell.SecurityAttribute;
import org.eclipse.tractusx.irs.component.assetadministrationshell.SemanticId;
import org.eclipse.tractusx.irs.component.assetadministrationshell.SubmodelDescriptor;
import org.eclipse.tractusx.irs.component.enums.BomLifecycle;
import org.eclipse.tractusx.irs.registryclient.decentral.DigitalTwinRegistryCreateShellService;
import org.eclipse.tractusx.irs.registryclient.decentral.exception.CreateDtrShellException;
import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase;
Expand Down Expand Up @@ -145,18 +144,7 @@ private AssetAdministrationShellDescriptor aasFrom(AssetBase assetBase, List<Sub

List<IdentifierKeyValuePair> aasIdentifiersFromAsset(AssetBase assetBase) {

final String digitalTwinType = assetBase.getBomLifecycle().equals(BomLifecycle.AS_BUILT) ? "PartInstance" : "PartType";

return List.of(
IdentifierKeyValuePair.builder()
.name("digitalTwinType")
.value(digitalTwinType)
.externalSubjectId(
Reference.builder()
.type(EXTERNAL_REFERENCE)
.keys(getExternalSubjectIds())
.build())
.build(),
List<IdentifierKeyValuePair> identifierKeyValuePairs = List.of(
IdentifierKeyValuePair.builder()
.name("manufacturerId")
.value(assetBase.getManufacturerId())
Expand All @@ -176,6 +164,8 @@ List<IdentifierKeyValuePair> aasIdentifiersFromAsset(AssetBase assetBase) {
.build())
.build()
);
log.info("IdentifierKeyValuePair {}", identifierKeyValuePairs);
return identifierKeyValuePairs;
}

private List<SemanticId> getExternalSubjectIds() {
Expand Down

0 comments on commit a0074e8

Please sign in to comment.