Skip to content

Commit 9e19b08

Browse files
committed
Changed knowledge, time and resources values by using label array
1 parent 5ac1062 commit 9e19b08

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/app/component/task-description/task-description.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ <h1>{{currentTask.dimension}} -> {{currentTask.subDimension}}: {{currentTask.tas
4545
<b>Difficulty of Implementation</b>
4646
</mat-panel-title>
4747
</mat-expansion-panel-header>
48-
<p>Knowledge: {{this.currentTask.knowledge}} </p>
49-
<p>Time: {{this.currentTask.time}} </p>
50-
<p>Resources: {{this.currentTask.resources}}</p>
48+
<p>Knowledge: {{this.KnowledgeLabels[this.currentTask.knowledge]}} </p>
49+
<p>Time: {{this.TimeAndResourceLabels[this.currentTask.knowledge]}} </p>
50+
<p>Resources: {{this.TimeAndResourceLabels[this.currentTask.knowledge]}}</p>
5151
</mat-expansion-panel>
5252
<mat-expansion-panel>
5353
<mat-expansion-panel-header>

src/app/component/task-description/task-description.component.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export class TaskDescriptionComponent implements OnInit {
4141
time:-1,dependsOn:[], implementation:[]}
4242

4343
YamlObject:any;
44-
44+
TimeAndResourceLabels:string[]=[];
45+
KnowledgeLabels:string[]=[];
4546
rowIndex:number=0;
4647
markdown:md = md()
4748

@@ -55,6 +56,15 @@ export class TaskDescriptionComponent implements OnInit {
5556
this.currentTask.level="level-"+params['level'];
5657
this.currentTask.taskName=params['taskName'];
5758
});
59+
60+
//gets value from sample file
61+
this.yaml.setURI('./assets/YAML/sample.yaml');
62+
// Function sets label data
63+
this.yaml.getJson().subscribe((data) => {
64+
this.YamlObject = data;
65+
this.TimeAndResourceLabels=this.YamlObject['strings']['en']['labels']
66+
this.KnowledgeLabels=this.YamlObject['strings']['en']['KnowledgeLabels']
67+
})
5868
//gets value from generated folder
5969
this.yaml.setURI('./assets/YAML/generated/sample.yaml');
6070
// Function sets data

src/assets/YAML/sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ strings:
1919
ISO 27001 / 2017
2020
2121
labels: ["Very Low", "Low", "Medium", "High", "Very High"]
22+
KnowledgeLabels: ["Very Low (one discipline)", "Low (one discipline)", "Medium (two disciplines)", "High (two disciplines)", "Very High (three or more disciplines)"]
2223
hardness: ["Very soft", "Soft", "Medium", "High", "Very high"]
2324
maturity_levels: ["Level 1: Basic understanding of security practices" ,
2425
"Level 2: Adoption of basic security practices",

0 commit comments

Comments
 (0)