Skip to content

Commit 5bb014c

Browse files
authored
Merge pull request #12 from catenax-ng/TRACEFOSS-1002-approve-to-sent
TRACEFOSS-1002: switched from approved state to sent
2 parents 8e1900e + d884d19 commit 5bb014c

File tree

10 files changed

+18
-23
lines changed

10 files changed

+18
-23
lines changed

src/app/mocks/mock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import { setupWorker } from 'msw';
2323
import {
2424
adminHandler,
2525
dashboardHandler,
26+
errorHandler,
2627
investigationsHandlers,
2728
otherPartsHandlers,
2829
partsHandlers,
29-
errorHandler,
3030
} from './services';
3131

3232
const handlers = [

src/app/mocks/services/investigations-mock/investigations.handler.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const investigationsHandlers = [
5454

5555
const currentStatus = [
5656
NotificationStatus.CREATED,
57-
NotificationStatus.APPROVED,
57+
NotificationStatus.SENT,
5858
NotificationStatus.ACKNOWLEDGED,
5959
NotificationStatus.ACCEPTED,
6060
NotificationStatus.DECLINED,
@@ -92,7 +92,7 @@ export const investigationsHandlers = [
9292

9393
const statusCollection = [
9494
NotificationStatus.CREATED,
95-
NotificationStatus.APPROVED,
95+
NotificationStatus.SENT,
9696
NotificationStatus.RECEIVED,
9797
NotificationStatus.CLOSED,
9898
NotificationStatus.CANCELED,
@@ -131,7 +131,7 @@ export const investigationsTestHandlers = [
131131

132132
const currentStatus = [
133133
NotificationStatus.CREATED,
134-
NotificationStatus.APPROVED,
134+
NotificationStatus.SENT,
135135
NotificationStatus.ACKNOWLEDGED,
136136
NotificationStatus.ACCEPTED,
137137
NotificationStatus.DECLINED,
@@ -160,7 +160,7 @@ export const investigationsTestHandlers = [
160160

161161
const statusCollection = [
162162
NotificationStatus.CREATED,
163-
NotificationStatus.APPROVED,
163+
NotificationStatus.SENT,
164164
NotificationStatus.RECEIVED,
165165
NotificationStatus.CLOSED,
166166
NotificationStatus.CANCELED,

src/app/modules/shared/assembler/investigations.assembler.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('InvestigationsAssembler', () => {
4343
id: 'test-1',
4444
description: 'test descr',
4545
createdDate: '2022-07-26T15:09:39.419Z',
46-
status: NotificationStatus.APPROVED,
46+
status: NotificationStatus.SENT,
4747
channel: 'SENDER',
4848
createdBy: '',
4949
sendTo: '',
@@ -72,7 +72,7 @@ describe('InvestigationsAssembler', () => {
7272
{
7373
id: 'test-1',
7474
description: 'test descr',
75-
status: NotificationStatus.APPROVED,
75+
status: NotificationStatus.SENT,
7676
createdDate: new CalendarDateModel('2022-07-26T15:09:39.419Z'),
7777
createdBy: '',
7878
sendTo: '',

src/app/modules/shared/components/notification-reason/notification-reason.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class NotificationReasonComponent {
4949
createdBy,
5050
sendTo,
5151
}: Notification) {
52-
const { ACCEPTED, APPROVED, CLOSED, CREATED, DECLINED } = NotificationStatus;
52+
const { ACCEPTED, SENT, CLOSED, CREATED, DECLINED } = NotificationStatus;
5353
const { accept, close, decline } = reason;
5454

5555
const senderDirection: TextMessageDirection = isFromSender ? 'right' : 'left';
@@ -59,7 +59,7 @@ export class NotificationReasonComponent {
5959
reason: description,
6060
direction: senderDirection,
6161
user: createdBy,
62-
status: [CREATED, APPROVED].includes(status) ? status : APPROVED,
62+
status: [CREATED, SENT].includes(status) ? status : SENT,
6363
date: createdDate,
6464
};
6565

src/app/modules/shared/model/notification.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import type { Pagination, PaginationResponse } from '@core/model/pagination.mode
2525
export enum NotificationStatus {
2626
ACCEPTED = 'ACCEPTED',
2727
ACKNOWLEDGED = 'ACKNOWLEDGED',
28-
APPROVED = 'APPROVED',
28+
APPROVED = 'SENT',
2929
CANCELED = 'CANCELED',
3030
CLOSED = 'CLOSED',
3131
CREATED = 'CREATED',

src/app/modules/shared/modules/notification/modal/close/close-notification-modal.component.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { screen, waitFor } from '@testing-library/angular';
2626

2727
describe('CloseNotificationModalComponent', () => {
2828
it('should create close modal', async () => {
29-
await renderCloseModal(NotificationStatus.APPROVED);
29+
await renderCloseModal(NotificationStatus.SENT);
3030
const title = await waitFor(() => screen.getByText('Close of investigation'));
3131
const hint = await waitFor(() => screen.getByText('Are you sure you want to close this investigation?'));
3232
const hint2 = await waitFor(() => screen.getByText('Enter the reason for close action.'));
@@ -41,14 +41,14 @@ describe('CloseNotificationModalComponent', () => {
4141
});
4242

4343
it('should render investigation description', async () => {
44-
const { notification } = await renderCloseModal(NotificationStatus.APPROVED);
44+
const { notification } = await renderCloseModal(NotificationStatus.SENT);
4545
const description = await waitFor(() => screen.getByText(notification.description));
4646

4747
expect(description).toBeInTheDocument();
4848
});
4949

5050
it('should check validation of textarea', async () => {
51-
const { fixture } = await renderCloseModal(NotificationStatus.APPROVED);
51+
const { fixture } = await renderCloseModal(NotificationStatus.SENT);
5252
const buttonR = await waitFor(() => screen.getByText('Close'));
5353
buttonR.click();
5454

@@ -65,7 +65,7 @@ describe('CloseNotificationModalComponent', () => {
6565
});
6666

6767
it('should call close function', async () => {
68-
const { fixture } = await renderCloseModal(NotificationStatus.APPROVED);
68+
const { fixture } = await renderCloseModal(NotificationStatus.SENT);
6969

7070
const textArea: HTMLTextAreaElement = await waitFor(() => screen.getByTestId('TextAreaComponent-0'));
7171
textArea.value = 'Some Text Some Text Some Text';

src/app/modules/shared/modules/notification/modal/content/notification-modal-content.component.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@
1919
* SPDX-License-Identifier: Apache-2.0
2020
********************************************************************************/
2121

22-
import { Component, EventEmitter, Input, Output, TemplateRef, ViewChild } from '@angular/core';
23-
import { FormControl, FormGroup, Validators } from '@angular/forms';
24-
import { ToastService } from '@shared/components/toasts/toast.service';
22+
import { Component, Input } from '@angular/core';
2523
import { Notification } from '@shared/model/notification.model';
26-
import { ModalData } from '@shared/modules/modal/core/modal.model';
27-
import { ModalService } from '@shared/modules/modal/core/modal.service';
28-
import { Observable } from 'rxjs';
2924

3025
@Component({
3126
selector: 'app-notification-modal-content',

src/app/modules/shared/pipes/format-date.pipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import { Inject, OnDestroy, Pipe, PipeTransform } from '@angular/core';
2323
import { CalendarDateModel } from '@core/model/calendar-date.model';
24-
import { I18NEXT_SERVICE, ITranslationService, PipeOptions } from 'angular-i18next';
24+
import { I18NEXT_SERVICE, ITranslationService } from 'angular-i18next';
2525
import { DateTimeFormatOptions } from 'luxon';
2626
import type { Subscription } from 'rxjs';
2727
import { filter } from 'rxjs/operators';

src/assets/locales/de/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"status": {
129129
"RECEIVED": "Erhalten",
130130
"CREATED": "Erstellt",
131-
"APPROVED": "Zugestellt",
131+
"SENT": "Zugestellt",
132132
"CANCELED": "Abgebrochen",
133133
"CLOSED": "Abgeschlossen",
134134
"ACCEPTED": "Akzeptiert",

src/assets/locales/en/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"queuedAndRequested": "Queued & Requested"
136136
},
137137
"status": {
138-
"APPROVED": "Requested",
138+
"SENT": "Requested",
139139
"CANCELED": "Cancelled",
140140
"CLOSED": "Closed",
141141
"CREATED": "Queued",

0 commit comments

Comments
 (0)