From 1debbff96d308dc8c7efbe9ac359e0cbc97ad82d Mon Sep 17 00:00:00 2001 From: Timo Pagel Date: Wed, 22 Nov 2023 16:44:01 +0100 Subject: [PATCH 1/3] feat: add openCRE --- .../activity-description.component.html | 14 ++++++++++++++ .../activity-description.component.spec.ts | 6 +++++- .../activity-description.component.ts | 7 +++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/app/component/activity-description/activity-description.component.html b/src/app/component/activity-description/activity-description.component.html index 484fcfa1..c71c118e 100644 --- a/src/app/component/activity-description/activity-description.component.html +++ b/src/app/component/activity-description/activity-description.component.html @@ -183,6 +183,20 @@

  • {{ iso22 }}
  • + + + + {{ openCREVersion }} + + + +

    diff --git a/src/app/component/activity-description/activity-description.component.spec.ts b/src/app/component/activity-description/activity-description.component.spec.ts index 1997878a..91cf3bb4 100644 --- a/src/app/component/activity-description/activity-description.component.spec.ts +++ b/src/app/component/activity-description/activity-description.component.spec.ts @@ -128,9 +128,11 @@ describe('ActivityDescriptionComponent', () => { const testSAMM = [' Sample SAMM ']; const testISO = [' Sample ISO']; const testISO22 = [' Sample ISO22']; + const testOpenCRE = [' Sample openCRE']; component.currentActivity.samm = testSAMM; component.currentActivity.iso = testISO; component.currentActivity.iso22 = testISO22; + component.currentActivity.openCRE = testOpenCRE; fixture.detectChanges(); const HTMLElement: HTMLElement = fixture.nativeElement; const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!; @@ -140,7 +142,9 @@ describe('ActivityDescriptionComponent', () => { component.ISOVersion + testISO[0] + component.ISO22Version + - testISO22[0] + testISO22[0] + + component.openCRE + + testOpenCRE[0] ); }); }); diff --git a/src/app/component/activity-description/activity-description.component.ts b/src/app/component/activity-description/activity-description.component.ts index c9a09fc0..d5857711 100644 --- a/src/app/component/activity-description/activity-description.component.ts +++ b/src/app/component/activity-description/activity-description.component.ts @@ -24,6 +24,7 @@ export interface activityDescription { iso: string[]; iso22: string[]; samm: string[]; + openCRE: string[]; knowledge: number; resources: number; time: number; @@ -57,6 +58,7 @@ export class ActivityDescriptionComponent implements OnInit { samm: [''], iso: [''], iso22: [''], + openCRE: [''], knowledge: -1, resources: -1, time: -1, @@ -78,6 +80,7 @@ export class ActivityDescriptionComponent implements OnInit { SAMMVersion: string = 'OWASP SAMM VERSION 2'; ISOVersion: string = 'ISO 27001:2017'; ISO22Version: string = 'ISO 27001:2022'; + openCREVersion: string = 'OpenCRE'; @ViewChildren(MatAccordion) accordion!: QueryList; constructor(private route: ActivatedRoute, private yaml: ymlService) {} @@ -170,6 +173,10 @@ export class ActivityDescriptionComponent implements OnInit { data['references']['samm2'], [] ); + this.currentActivity.openCRE = this.defineStringArrayValues( + data['references']['openCRE'], + [] + ); } catch { console.log('references does not exist'); } From ab1c226a7b4de80a03cbec713ae0c939e5b83aae Mon Sep 17 00:00:00 2001 From: Timo Pagel Date: Wed, 22 Nov 2023 17:21:16 +0100 Subject: [PATCH 2/3] fix: OpenCRE Version --- .../activity-description/activity-description.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/component/activity-description/activity-description.component.spec.ts b/src/app/component/activity-description/activity-description.component.spec.ts index 91cf3bb4..fafdf619 100644 --- a/src/app/component/activity-description/activity-description.component.spec.ts +++ b/src/app/component/activity-description/activity-description.component.spec.ts @@ -143,7 +143,7 @@ describe('ActivityDescriptionComponent', () => { testISO[0] + component.ISO22Version + testISO22[0] + - component.openCRE + + component.openCREVersion + testOpenCRE[0] ); }); From 9a0031bd198e8c7b482b77cd97fa1ed592a27eab Mon Sep 17 00:00:00 2001 From: Timo Pagel Date: Wed, 22 Nov 2023 17:48:49 +0100 Subject: [PATCH 3/3] chore: fix test --- .../activity-description.component.spec.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/component/activity-description/activity-description.component.spec.ts b/src/app/component/activity-description/activity-description.component.spec.ts index fafdf619..a19e887f 100644 --- a/src/app/component/activity-description/activity-description.component.spec.ts +++ b/src/app/component/activity-description/activity-description.component.spec.ts @@ -124,15 +124,17 @@ describe('ActivityDescriptionComponent', () => { ); }); - it('check if references is being genenrated', () => { + it('check if references is being generated', () => { const testSAMM = [' Sample SAMM ']; const testISO = [' Sample ISO']; const testISO22 = [' Sample ISO22']; - const testOpenCRE = [' Sample openCRE']; + const uuid = 'abcd'; // for openCRE + component.currentActivity.samm = testSAMM; component.currentActivity.iso = testISO; component.currentActivity.iso22 = testISO22; - component.currentActivity.openCRE = testOpenCRE; + component.currentActivity.uuid = uuid; + fixture.detectChanges(); const HTMLElement: HTMLElement = fixture.nativeElement; const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!; @@ -144,7 +146,7 @@ describe('ActivityDescriptionComponent', () => { component.ISO22Version + testISO22[0] + component.openCREVersion + - testOpenCRE[0] + uuid ); }); });