Skip to content

Commit 0c912e2

Browse files
authored
Merge pull request #116 from 0x41head/angular-ui
Angular UI
2 parents ec408f2 + b2be917 commit 0c912e2

8 files changed

Lines changed: 241 additions & 33 deletions

File tree

package-lock.json

Lines changed: 137 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@angular/platform-browser": "~13.3.0",
2121
"@angular/platform-browser-dynamic": "~13.3.0",
2222
"@angular/router": "~13.3.0",
23+
"markdown-it": "^13.0.1",
2324
"rxjs": "~7.5.0",
2425
"tslib": "^2.3.0",
2526
"yamljs": "^0.3.0",
@@ -30,6 +31,7 @@
3031
"@angular/cli": "~13.3.6",
3132
"@angular/compiler-cli": "~13.3.0",
3233
"@types/jasmine": "~3.10.0",
34+
"@types/markdown-it": "^12.2.3",
3335
"@types/node": "^12.11.1",
3436
"@types/yamljs": "^0.2.31",
3537
"jasmine-core": "~4.0.0",

src/app/component/matrix/matrix.component.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@
2626
font-size: 16px;
2727
font-weight: bold;
2828
}
29-
29+
button{
30+
background-color: white;
31+
border: none;
32+
}
3033

src/app/component/matrix/matrix.component.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929

3030

3131
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8 matrix-table">
32-
32+
3333
<!-- Dimension Column -->
3434
<ng-container matColumnDef="Dimension">
3535
<th mat-header-cell *matHeaderCellDef> Dimension </th>
36-
<td mat-cell *matCellDef="let element"> {{element.Dimension}} </td>
36+
<td mat-cell *matCellDef="let element"> {{element.Dimension}}</td>
3737
</ng-container>
3838

3939
<!-- Sub Dimension Column -->
@@ -48,8 +48,10 @@
4848
<th mat-header-cell *matHeaderCellDef> {{levels[i]}} </th>
4949
<td mat-cell *matCellDef="let element">
5050
<ul>
51-
<li *ngFor="let task of element[lvl]" routerLink={{Routing}}>
51+
<li *ngFor="let task of element[lvl]; index as j" >
52+
<button (click)="navigate(element.Dimension,element.SubDimension,i+1,j)">
5253
{{task}}
54+
</button>
5355
</li>
5456
</ul>
5557
</td>

src/app/component/matrix/matrix.component.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {Observable} from 'rxjs';
66
import {map, startWith} from 'rxjs/operators';
77
import { MatTableDataSource } from '@angular/material/table';
88
import { ymlService } from '../../service/yaml-parser/yaml-parser.service';
9-
9+
import { Router, NavigationExtras } from '@angular/router';
1010

1111
export interface MatrixElement {
1212
Dimension: string;
@@ -38,7 +38,7 @@ export class MatrixComponent implements OnInit {
3838
dataSource:any= new MatTableDataSource<MatrixElement>(this.MATRIX_DATA);
3939
rows: string[] = [];
4040

41-
constructor(private yaml:ymlService) {
41+
constructor(private yaml:ymlService,private router: Router) {
4242
this.filteredRows = this.rowCtrl.valueChanges.pipe(
4343
startWith(null),
4444
map((row: string | null) => (row ? this._filter(row) : this.autoCompeteRows.slice())),
@@ -161,6 +161,22 @@ export class MatrixComponent implements OnInit {
161161
return this.autoCompeteRows.filter(row => row.toLowerCase().includes(filterValue));
162162
}
163163

164+
// task description routing + providing parameters
165+
166+
navigate(dim:string,subdim:string,lvl:Number,ti:Number) {
167+
let navigationExtras: NavigationExtras = {
168+
queryParams: {
169+
dimension:dim,
170+
subDimension:subdim,
171+
level:lvl,
172+
taskIndex:ti
173+
}
174+
}
175+
console.log(this.lvlColumn)
176+
console.log(this.levels)
177+
this.router.navigate([this.Routing], navigationExtras);
178+
}
179+
164180

165181

166182

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,33 @@
11
<div class="content-box">
2-
<h1>Build and Deployment -> Build: Building and testing of artifacts in virtual environments</h1>
2+
<h1>{{currentTask.dimension}} -> {{currentTask.subDimension}}: Building and testing of artifacts in virtual environments</h1>
33
<div class="example-action-buttons">
44
<button mat-raised-button (click)="openall()" >Expand All</button>
55
<button mat-raised-button (click)="closeall()">Collapse All</button>
66
</div>
77
<mat-accordion multi="true">
8-
<mat-expansion-panel>
8+
<mat-expansion-panel [expanded]="true">
99
<mat-expansion-panel-header>
1010
<mat-panel-title>
1111
<b>Description</b>
1212
</mat-panel-title>
1313
</mat-expansion-panel-header>
14-
<p>While building and testing artifacts, third party systems, application frameworks
15-
and 3rd party libraries are used. These might be malicious as a result of
16-
vulnerable libraries or because they are altered during the delivery phase.</p>
14+
<p [innerHTML]="description"></p>
1715
</mat-expansion-panel>
1816
<mat-expansion-panel>
1917
<mat-expansion-panel-header>
2018
<mat-panel-title>
2119
<b>Risk</b>
2220
</mat-panel-title>
2321
</mat-expansion-panel-header>
24-
<p>While building and testing artifacts, third party systems, application frameworks
25-
and 3rd party libraries are used. These might be malicious as a result of
26-
vulnerable libraries or because they are altered during the delivery phase.</p>
22+
<p [innerHTML]="risk"></p>
2723
</mat-expansion-panel>
2824
<mat-expansion-panel>
2925
<mat-expansion-panel-header>
3026
<mat-panel-title>
3127
<b>Measure</b>
3228
</mat-panel-title>
3329
</mat-expansion-panel-header>
34-
<p> Each step during within the build and testing phase is performed in
35-
a separate virtual environments, which is destroyed afterward.</p>
30+
<p [innerHTML]="measure"></p>
3631
</mat-expansion-panel>
3732
<mat-expansion-panel>
3833
<mat-expansion-panel-header>

0 commit comments

Comments
 (0)