Skip to content

Commit

Permalink
Merge pull request #806 from catenax-ng/main
Browse files Browse the repository at this point in the history
Renaming of Notifications Frontend
  • Loading branch information
ds-mmaul authored Mar 28, 2024
2 parents 517e11e + 10aca9c commit c4bf32f
Show file tree
Hide file tree
Showing 22 changed files with 160 additions and 490 deletions.
2 changes: 1 addition & 1 deletion frontend/cypress/support/step_definitions/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ When("user navigate to {string}", function(desiredMenu) {
break;
}
case 'Quality alerts': {
cy.get('[href="/alerts"]').click();
cy.get('[href="/inbox"]').click();
break;
}
case 'About': {
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/app/mocks/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
adminHandler,
dashboardHandler,
errorHandler,
investigationsHandlers,
otherPartsAsBuiltHandlers,
otherPartsAsPlannedHandlers,
partsAsBuiltHandlers,
Expand All @@ -39,10 +38,9 @@ const handlers = [
...otherPartsAsPlannedHandlers,
...partsAsBuiltHandlers,
...partsAsPlannedHandlers,
...investigationsHandlers,
...alertsHandlers,
...adminHandler,
...errorHandler,
...policyHandler
...policyHandler,
];
export const worker = setupWorker(...handlers);
16 changes: 8 additions & 8 deletions frontend/src/app/mocks/services/alerts-mock/alerts.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ import {
} from './alerts.test.model';

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

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

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

rest.post(`${ environment.apiUrl }/notifications/:alertId/update`, (req, res, ctx) => {
rest.post(`${ environment.apiUrl }/notifications/:notificationId/update`, (req, res, ctx) => {
return res(ctx.status(204));
}),
];
Expand Down Expand Up @@ -79,7 +79,7 @@ export const alertsHandlers = [
return res(ctx.status(200), ctx.json(applyPagination(buildMockAlerts(currentStatus, 'RECEIVER'), pagination)));
}),

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

const indexFromId = parseInt((alertId as string).replace('id-', ''), 10);
Expand Down Expand Up @@ -110,7 +110,7 @@ export const alertsHandlers = [
//return res(ctx.status(200), ctx.json({ id: AlertIdPrefix + 1 }));
}),

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

Expand Down Expand Up @@ -142,7 +142,7 @@ export const alertsTestHandlers = [
return res(ctx.status(200), ctx.json(applyPagination(testBuildMockAlerts(currentStatus, 'RECEIVER'), pagination)));
}),

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

const indexFromId = parseInt((alertId as string).replace('id-', ''), 10);
Expand All @@ -167,7 +167,7 @@ export const alertsTestHandlers = [
return res(ctx.status(200), ctx.json({ id: testAlertIdPrefix + 1 }));
}),

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

Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/mocks/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export {
otherPartsAsPlannedHandlers,
otherPartsAsPlannedHandlersTest,
} from './otherParts-mock/otherParts.handler';
export { investigationsHandlers, investigationsTestHandlers } from './investigations-mock/investigations.handler';
export { adminHandler } from './admin-mock/admin.handler';
export { errorHandler } from './error-mock/error.handler';
export { policyHandler } from './policy-mock/policy.handler'

This file was deleted.

This file was deleted.

Loading

0 comments on commit c4bf32f

Please sign in to comment.