Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NOT-CX-Release] Feature/tracefoss 2726 UI split #783

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
064c872
feature: TRACEFOSS-2726 split notifications in received and sent on d…
ds-lcapellino Nov 17, 2023
a6499ae
feature: TRACEFOSS-2726 split notifications in received and sent on d…
ds-lcapellino Nov 17, 2023
70911b9
chore: TRACEFOSS-2726 changing data model
ds-mwesener Nov 21, 2023
a57907b
chore: TRACEFOSS-2726 refactored filter / table configurations.
ds-mwesener Nov 22, 2023
cb3ef3f
chore: TRACEFOSS-2726 adapt wrong attributes
ds-mwesener Nov 22, 2023
b12bdaf
chore: TRACEFOSS-2726 adapt wrong attributes test
ds-mwesener Nov 22, 2023
3eefd18
chore: TRACEFOSS-2726 adapt wrong attributes test
ds-mwesener Nov 22, 2023
13ab288
chore: TRACEFOSS-2726 adapt wrong attributes test
ds-mwesener Nov 22, 2023
1e58a4a
chore: TRACEFOSS-2726 adapt wrong attributes test
ds-mwesener Nov 22, 2023
d17dfe6
chore: TRACEFOSS-2726 adapt wrong attributes test
ds-mwesener Nov 22, 2023
6f5b6cf
chore: TRACEFOSS-2726 changed implementation of asplanned / asbuilt i…
ds-mwesener Nov 22, 2023
85cf448
chore: TRACEFOSS-2726 changed implementation of asplanned / asbuilt i…
ds-mwesener Nov 22, 2023
8e7b03e
chore: TRACEFOSS-2726 changed implementation of asplanned / asbuilt i…
ds-mwesener Nov 22, 2023
376459c
chore: TRACEFOSS-2726 changed implementation of asplanned / asbuilt i…
ds-mwesener Nov 22, 2023
004e9f2
Merge branch 'main' into feature/TRACEFOSS-2726-split-notifications-i…
ds-mwesener Nov 22, 2023
d5a7593
Merge branch 'feature/TRACEFOSS-2726-split-notifications-in-received-…
ds-mwesener Nov 22, 2023
3a51b10
chore: TRACEFOSS-2726 refactored duplicate configurations.
ds-mwesener Nov 22, 2023
7dcfbe2
chore: TRACEFOSS-2726 finalized split columsn of investigation / aler…
ds-mwesener Nov 23, 2023
8baddc3
chore: TRACEFOSS-2726 removed investigation button from customer part…
ds-mwesener Nov 23, 2023
66b9205
chore: TRACEFOSS-2726 fixed filtering for notification count columns
ds-mwesener Nov 23, 2023
62dad63
chore: TRACEFOSS-2726 added tooltips
ds-mwesener Nov 23, 2023
f3c977a
chore: TRACEFOSS-2726 merge main into branch
ds-ext-sceronik Nov 23, 2023
b4d377a
Merge branch 'feature/TRACEFOSS-2726-split-notifications-in-received-…
ds-mwesener Nov 23, 2023
070e942
chore: TRACEFOSS-2726 filtering capabilities
ds-ext-sceronik Nov 23, 2023
a0ce5e9
chore: TRACEFOSS-2726 changelog
ds-ext-sceronik Nov 23, 2023
a1bfe28
chore: TRACEFOSS-2726 added tooltips
ds-mwesener Nov 23, 2023
0e39521
Merge pull request #791 from catenax-ng/feature/TRACEFOSS-2726-filter…
ds-mwesener Nov 23, 2023
ab0fe4c
Merge branch 'feature/TRACEFOSS-2726-split-notifications-in-received-…
ds-mwesener Nov 23, 2023
0c0d5ee
chore: TRACEFOSS-2726 added deeplinks
ds-mwesener Nov 23, 2023
d628881
Merge branch 'main' into feature/TRACEFOSS-2726-split-notifications-i…
ds-mwesener Nov 23, 2023
3f296c6
Merge branch 'feature/TRACEFOSS-2726-split-notifications-in-received-…
ds-mwesener Nov 23, 2023
62e62f1
chore: TRACEFOSS-2726 added deeplinks
ds-mwesener Nov 24, 2023
4a5220d
chore: TRACEFOSS-2726 added validation for localstorage invalid state.
ds-mwesener Nov 24, 2023
4382834
chore: TRACEFOSS-2726 added validation for localstorage invalid state.
ds-mwesener Nov 24, 2023
6ee3313
Merge branch 'main' into feature/TRACEFOSS-2726-split-notifications-i…
ds-mwesener Nov 24, 2023
7bd1f47
Merge branch 'feature/TRACEFOSS-2726-split-notifications-in-received-…
ds-mwesener Nov 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ 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)
- Filter configuration for tables to be resuable and easy to adapt
- Updated user manual
- Autocomplete endpoints changed owner String type param to Owner for input validation and sql injection prevention
- Autocomplete endpoints repository uses now criteria api rather than native query
- Fixed several bugs in local filtering of the parts table

### 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,80 +19,84 @@
* 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-';

// TODO: rethink this approach
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 NotificationFilter {
notificationIds: string[]
}

export const getInvestigationById = (id: string) => {
return [].find(investigation => investigation.id === id) || { ...MockEmptyInvestigation, id };
return [].find(investigation => investigation.id === id) || {...MockEmptyInvestigation, id};
};
Loading