Skip to content

Commit 3478b78

Browse files
committed
Re-routed to make matrix section the homepage + Added excel export option to mapping section
1 parent f0bf6d0 commit 3478b78

7 files changed

Lines changed: 222 additions & 14 deletions

File tree

package-lock.json

Lines changed: 156 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"markdown-it": "^13.0.1",
2626
"rxjs": "~7.5.0",
2727
"tslib": "^2.3.0",
28+
"xlsx": "^0.18.5",
2829
"yamljs": "^0.3.0",
2930
"zone.js": "~0.11.4"
3031
},

src/app/app-routing.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { UsageComponent } from './component/usage/usage.component';
1010

1111

1212
const routes: Routes = [
13-
{path: '',component: MainContentComponent},
14-
{path: 'matrix', component: MatrixComponent},
13+
{path: 'home',component: MainContentComponent},
14+
{path: '', component: MatrixComponent},
1515
{path: 'circular-heatmap', component: CircularHeatmapComponent},
1616
{path: 'task-description', component: TaskDescriptionComponent},
1717
{path: 'mapping', component: MappingComponent},

src/app/component/mapping/mapping.component.css

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,27 @@
2929
font-weight: bold;
3030
}
3131

32-
.sortSection{
32+
.sort-section{
3333
margin: 30px;
3434
margin-right: 60px;
35-
background-color: mediumorchid;
36-
float: right;
35+
float: right;
3736
}
3837

3938
.filterandsort{
4039
background-color: brown;
40+
}
41+
42+
.hide{
43+
display: none;
44+
}
45+
46+
.export-button{
47+
margin: 30px;
48+
margin-top: 35px;
49+
float: right;
50+
}
51+
52+
.right-section{
53+
background-color: mediumorchid;
54+
float: right;
4155
}

src/app/component/mapping/mapping.component.html

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@
2727
</mat-autocomplete>
2828
</mat-form-field>
2929

30-
31-
<section class="sortSection">
32-
<mat-button-toggle-group [formControl]="SortCtrl" aria-label="Sort By">
33-
<mat-button-toggle value="sortByTask" (click)="changeTableBasedOnCurrentSort()">Activity</mat-button-toggle>
34-
<mat-button-toggle value="sortBySAMM" (click)="changeTableBasedOnCurrentSort()">SAMM</mat-button-toggle>
35-
<mat-button-toggle value="sortByISO" (click)="changeTableBasedOnCurrentSort()">ISO</mat-button-toggle>
36-
</mat-button-toggle-group>
37-
</section>
30+
<div class="right-section">
31+
<section class="export-button">
32+
<button mat-raised-button color="primary" (click)="exportToExcel()">
33+
<mat-icon>file_download</mat-icon>
34+
</button>
35+
</section>
36+
<section class="sort-section">
37+
<mat-button-toggle-group [formControl]="SortCtrl" aria-label="Sort By">
38+
<mat-button-toggle value="sortByTask" (click)="changeTableBasedOnCurrentSort()">Activity</mat-button-toggle>
39+
<mat-button-toggle value="sortBySAMM" (click)="changeTableBasedOnCurrentSort()">SAMM</mat-button-toggle>
40+
<mat-button-toggle value="sortByISO" (click)="changeTableBasedOnCurrentSort()">ISO</mat-button-toggle>
41+
</mat-button-toggle-group>
42+
</section>
43+
</div>
3844
</div>
3945

4046

@@ -94,5 +100,22 @@
94100
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
95101
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
96102
</table>
103+
104+
<table id="excel-table" class="hide">
105+
<tr>
106+
<th>Dimension</th>
107+
<th>Sub Dimension</th>
108+
<th>Activity</th>
109+
<th>SAMM</th>
110+
<th>ISO</th>
111+
</tr>
112+
<tr *ngFor="let item of performedMappingDataSortedByISO">
113+
<td>{{item.dimension}}</td>
114+
<td>{{item.subDimension}}</td>
115+
<td>{{item.taskName}}</td>
116+
<td>{{item.samm2}}</td>
117+
<td>{{item.ISO}}</td>
118+
</tr>
119+
</table>
97120
</div>
98121

0 commit comments

Comments
 (0)