Skip to content

Commit

Permalink
Merge branch 'main' into feature/#736-add-contract-detailed-view
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-mmaul authored Mar 26, 2024
2 parents f9402cd + c00a952 commit 1602b80
Show file tree
Hide file tree
Showing 184 changed files with 3,996 additions and 7,781 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,24 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- #596 Added Policy management documentation
- Added overview of the scheduler tasks in documentation
- #736 Added Contract Detailed View
- #706 Created notification classes to support both alert and investigations
- #706 Notification controller having the same endpoints as alerts and investigations controllers

### Changed
- #709 Bumped spring-core from 6.0.17 to 6.1.5
- #606 cucumber tests retry on error
- #606 refactored response model to only be used by common model package tx-models
- #709 Fixed CVE-2024-22257 overriding spring-security-core from 6.1.7 to 6.2.3
- #596 Policy management has been moved to different module
- #616 Merged quality investigations / alerts into a single view
- #762 updated documentation for release 24.5
- #706 StartNotificationRequest now requires additional parameter type ("ALERT", "INVESTIGATION") which
- #706 Search criteria allows to filter by new type parameter
- #706 Notification response have new title parameter

### Removed
- Shedlock, resilence4j, templateResolver as not used anymore
- #706 Removed alert and investigation specific classes and services to replace them with merged notification classes

### Added
- #630 Added Parts extended detailed view
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@startuml

title
==Send Quality Investigation
==Send Quality Notification
end title

autonumber "<B>[00]"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
= Receive Quality Investigation
= Receive Quality Notification

This sequence diagram describes the process of receiving a quality investigation from another Traceability partner.
This sequence diagram describes the process of receiving a quality notification from another Traceability partner.

[plantuml, target=business-context_quality-investigation, format=svg]
....
include::../../../../uml-diagrams/arc42/runtime-view/quality-investigation-receive.puml[]
....

== Overview
As for the sending of a quality investigation also for receiving of a notification EDC is used to push data from a sender to a receiver.
As for the sending of a quality notification also for receiving of a notification EDC is used to push data from a sender to a receiver.
To enable receiving a notification by a partner you need to

* Create notification endpoint for qualitynotifications/receive
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Send Quality Investigation
= Send Quality Notification

This sequence diagram describes the process of sending a quality investigation between Traceability applications.
This sequence diagram describes the process of sending a quality notification between Traceability applications.

[plantuml, target=business-context_quality-investigation_send, format=svg]
....
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@startuml

title
==Receive Quality Investigation
==Receive Quality Notification
end title

autonumber "<B>[00]"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@startuml

title
==Send Quality Investigation
==Send Quality Notification
end title

autonumber "<B>[00]"
Expand Down
4 changes: 0 additions & 4 deletions frontend/cypress/support/step_definitions/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ When("user navigate to {string}", function(desiredMenu) {
cy.get('[href="/dashboard"]').click();
break;
}
case 'Quality investigations': {
cy.get('[href="/investigations"]').click();
break;
}
case 'Quality alerts': {
cy.get('[href="/alerts"]').click();
break;
Expand Down
28 changes: 14 additions & 14 deletions frontend/src/app/mocks/services/alerts-mock/alerts.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ import {
} from './alerts.test.model';

const commonHandler = [
rest.post(`*${ environment.apiUrl }/alerts/:alertId/close`, (req, res, ctx) => {
rest.post(`*${ environment.apiUrl }/notifications/:alertId/close`, (req, res, ctx) => {
return res(ctx.status(204));
}),

rest.post(`*${ environment.apiUrl }/alerts/:alertId/approve`, (req, res, ctx) => {
rest.post(`*${ environment.apiUrl }/notifications/:alertId/approve`, (req, res, ctx) => {
return res(ctx.status(400), ctx.json({message: "Failed to send alert to EDC"}));
}),

rest.post(`*${ environment.apiUrl }/alerts/:alertId/cancel`, (req, res, ctx) => {
rest.post(`*${ environment.apiUrl }/notifications/:alertId/cancel`, (req, res, ctx) => {
return res(ctx.status(204));
}),

rest.post(`${ environment.apiUrl }/alerts/:alertId/update`, (req, res, ctx) => {
rest.post(`${ environment.apiUrl }/notifications/:alertId/update`, (req, res, ctx) => {
return res(ctx.status(204));
}),
];

export const alertsHandlers = [
rest.post(`*${ environment.apiUrl }/alerts/filter`, (req, res, ctx) => {
rest.post(`*${ environment.apiUrl }/notifications/filter`, (req, res, ctx) => {
const pagination = extractPaginationOfNotifications(req);

const currentStatus = [
Expand All @@ -65,7 +65,7 @@ export const alertsHandlers = [
return res(ctx.status(200), ctx.json(applyPagination(buildMockAlerts(currentStatus, 'SENDER'), pagination)));
}),

rest.post(`*${ environment.apiUrl }/alerts/filter`, (req, res, ctx) => {
rest.post(`*${ environment.apiUrl }/notifications/filter`, (req, res, ctx) => {
const pagination = extractPaginationOfNotifications(req);

const currentStatus = [
Expand All @@ -79,7 +79,7 @@ export const alertsHandlers = [
return res(ctx.status(200), ctx.json(applyPagination(buildMockAlerts(currentStatus, 'RECEIVER'), pagination)));
}),

rest.get(`*${ environment.apiUrl }/alerts/:alertId`, (req, res, ctx) => {
rest.get(`*${ environment.apiUrl }/notifications/:alertId`, (req, res, ctx) => {
const { alertId } = req.params;

const indexFromId = parseInt((alertId as string).replace('id-', ''), 10);
Expand All @@ -105,12 +105,12 @@ export const alertsHandlers = [

return res(ctx.status(200), ctx.json({ ...randomNotification, id: alertId }));
}),
rest.post(`*${ environment.apiUrl }/alerts`, (_, res, ctx) => {
rest.post(`*${ environment.apiUrl }/notifications`, (_, res, ctx) => {
return res(ctx.status(400), ctx.json({message: "Error while sending Alert to EDC"} ));
//return res(ctx.status(200), ctx.json({ id: AlertIdPrefix + 1 }));
}),

rest.put(`*${ environment.apiUrl }/alerts/:alertId/status`, async (req, res, ctx) => {
rest.put(`*${ environment.apiUrl }/notifications/:alertId/status`, async (req, res, ctx) => {
const { alertId } = req.params;
const { status } = await req.json();

Expand All @@ -121,7 +121,7 @@ export const alertsHandlers = [
];

export const alertsTestHandlers = [
rest.post(`*${ environment.apiUrl }/alerts/filter`, (req, res, ctx) => {
rest.post(`*${ environment.apiUrl }/notifications/filter`, (req, res, ctx) => {
const pagination = extractPaginationOfNotifications(req);

const currentStatus = [
Expand All @@ -135,14 +135,14 @@ export const alertsTestHandlers = [
return res(ctx.status(200), ctx.json(applyPagination(testBuildMockAlerts(currentStatus, 'SENDER'), pagination)));
}),

rest.post(`*${ environment.apiUrl }/alerts/filter`, (req, res, ctx) => {
rest.post(`*${ environment.apiUrl }/notifications/filter`, (req, res, ctx) => {
const pagination = extractPaginationOfNotifications(req);

const currentStatus = [ NotificationStatus.RECEIVED, NotificationStatus.ACKNOWLEDGED ];
return res(ctx.status(200), ctx.json(applyPagination(testBuildMockAlerts(currentStatus, 'RECEIVER'), pagination)));
}),

rest.get(`*${ environment.apiUrl }/alerts/:alertId`, (req, res, ctx) => {
rest.get(`*${ environment.apiUrl }/notifications/:alertId`, (req, res, ctx) => {
const { alertId } = req.params;

const indexFromId = parseInt((alertId as string).replace('id-', ''), 10);
Expand All @@ -163,11 +163,11 @@ export const alertsTestHandlers = [

return res(ctx.status(200), ctx.json({ ...randomNotification, id: alertId }));
}),
rest.post(`*${ environment.apiUrl }/alerts`, (_, res, ctx) => {
rest.post(`*${ environment.apiUrl }/notifications`, (_, res, ctx) => {
return res(ctx.status(200), ctx.json({ id: testAlertIdPrefix + 1 }));
}),

rest.put(`*${ environment.apiUrl }/alerts/:alertId/status`, async (req, res, ctx) => {
rest.put(`*${ environment.apiUrl }/notifications/:alertId/status`, async (req, res, ctx) => {
const { alertId } = req.params;
const { status } = await req.json();

Expand Down
6 changes: 5 additions & 1 deletion frontend/src/app/mocks/services/alerts-mock/alerts.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
********************************************************************************/

import type { NotificationResponse } from '@shared/model/notification.model';
import { NotificationStatus } from '@shared/model/notification.model';
import { NotificationStatus, NotificationTypeResponse } 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';
Expand Down Expand Up @@ -61,6 +61,7 @@ export const buildMockAlerts = (
return {
id: `${ AlertIdPrefix }${ index + 1 }`,
description: `Alert No ${ index + 1 } ${ getRandomText(getRandomIntFromInterval(15, 500)) }`,
title: 'title',
status,
severity,
channel,
Expand All @@ -73,13 +74,15 @@ export const buildMockAlerts = (
targetDate: `2022-${ numberToString(month) }-${ numberToString(day + 1) }T12:34:12`,
assetIds: [ MOCK_part_1.id, getRandomAsset().id, getRandomAsset().id, getRandomAsset().id ],
errorMessage: errorAlert,
type: NotificationTypeResponse.ALERT,
};
});

const MockEmptyAlert: NotificationResponse = {
id: `${ AlertIdPrefix }000`,
description: `Alert No 000`,
status: NotificationStatus.CREATED,
title: 'Title',
severity: Severity.MINOR,
createdBy: 'BPN10000000OEM0A',
createdByName: 'OEM xxxxxxxxxxxxxxx A',
Expand All @@ -90,6 +93,7 @@ const MockEmptyAlert: NotificationResponse = {
targetDate: `2022-02-01T12:34:12`,
assetIds: [ getRandomAsset().id ],
channel: 'SENDER',
type: NotificationTypeResponse.ALERT,
};

export const getAlertById = (id: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
********************************************************************************/

import type { NotificationResponse } from '@shared/model/notification.model';
import { NotificationStatus } from '@shared/model/notification.model';
import { NotificationStatus, NotificationTypeResponse } 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';
Expand Down Expand Up @@ -50,11 +50,13 @@ export const buildMockAlerts = (
createdBy: 'BPN10000000OEM0A',
createdByName: 'OEM xxxxxxxxxxxxxxx A',
sendTo: 'BPN20000000OEM0B',
title: 'Title',
sendToName: 'OEM xxxxxxxxxxxxxxx B',
reason: { close: '', accept: '', decline: '' },
createdDate: `2022-${ numberToString(month) }-${ numberToString(day) }T12:34:12`,
assetIds: [ MOCK_part_1.id, getRandomAsset().id, getRandomAsset().id, getRandomAsset().id ],
errorMessage: errorAlert,
type: NotificationTypeResponse.ALERT,
};
});

Expand All @@ -71,6 +73,8 @@ export const MockEmptyAlert: NotificationResponse = {
createdDate: `2022-05-01T12:34:12`,
assetIds: [ getRandomAsset().id ],
channel: 'SENDER',
title: 'Title',
type: NotificationTypeResponse.ALERT,
};

export const getAlertById = (id: string) => {
Expand Down
Loading

0 comments on commit 1602b80

Please sign in to comment.