-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TSK-843 designed report table and made single row collapsable
- Loading branch information
1 parent
b75be88
commit d8b1829
Showing
10 changed files
with
101 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ export class ReportInfoDataIterable { | |
key: string; | ||
val: ReportInfoData; | ||
depth: number; | ||
display = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
<div *ngIf="reportData" class="report table table-body-striped"> | ||
<div class="table-header"> | ||
<div class="table-row"> | ||
<div class="table-cell table-cell--bold table-cell--justify">{{reportData.meta.rowDesc}}</div> | ||
<div | ||
[ngClass]="{'table-cell--border-right': currentExpHeaders === 0}" | ||
class="table-cell table-cell--bold table-cell--justify">{{reportData.meta.rowDesc}}</div> | ||
<ng-container *ngFor="let header of reportData.meta.expHeader; let i = index"> | ||
<ng-container *ngIf="i < currentExpHeaders"> | ||
<div class="table-cell table-cell--bold table-cell--justify">{{header}}</div> | ||
<div [ngClass]="{'table-cell--border-right': currentExpHeaders - 1 === i}" | ||
class="table-cell table-cell--bold table-cell--justify">{{header}}</div> | ||
</ng-container> | ||
</ng-container> | ||
<div *ngFor="let header of reportData.meta.header" class="table-cell table-cell--bold">{{header}}</div> | ||
<div class="table-cell table-cell--bold">{{reportData.meta.totalDesc}}</div> | ||
<div *ngFor="let header of reportData.meta.header" | ||
class="table-cell table-cell--bold">{{header}}</div> | ||
<div class="table-cell table-cell--bold table-cell--border-left">{{reportData.meta.totalDesc}}</div> | ||
</div> | ||
</div> | ||
<monitor-report-row (expandedDepth)="expandHeader($event, i)" | ||
<taskana-report-row (expandedDepth)="expandHeader($event, i)" | ||
*ngFor="let row of reportData.rows | mapToIterable | orderBy:['key']; let i = index" | ||
[headers]="reportData.meta.header" | ||
[maxTableDepth]="currentExpHeaders" | ||
[row]="row" | ||
class="table-body"></monitor-report-row> | ||
<monitor-report-row (expandedDepth)="expandHeader($event, expHeaders.length - 1)" | ||
class="table-body"></taskana-report-row> | ||
<taskana-report-row (expandedDepth)="expandHeader($event, expHeaders.length - 1)" | ||
[headers]="reportData.meta.header" | ||
[maxTableDepth]="currentExpHeaders" | ||
[row]="_sumRow" | ||
bold="true" | ||
class="table-footer"></monitor-report-row> | ||
class="table-footer"></taskana-report-row> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
<ng-container *ngIf="headers && flatRows"> | ||
<ng-container *ngFor="let row of flatRows; let i = index"> | ||
<div *ngIf="currentDepth >= row.depth" class="table-row"> | ||
<div *ngIf="row.display" | ||
[ngClass]="{'table-row--highlight': row.depth === 0 && currentDepth > 0, | ||
'table-row--hover': row.depth > 0 && currentDepth > 0, | ||
'table-row--white': row.depth > 0 && currentDepth > 0}" | ||
class="table-row"> | ||
<div *ngFor="let _ of range(row.depth)" class="table-cell"></div> | ||
<div (click)="toggleFold(row.depth)" | ||
[ngClass]="{'table-cell--clickable': maxDepth > row.depth, 'table-cell--bold' : bold}" | ||
<div (click)="toggleFold(i)" | ||
[ngClass]="{'table-cell--clickable': maxDepth > row.depth, | ||
'table-cell--bold' : bold || row.depth === 0 && currentDepth > 0, | ||
'table-cell--border-right': row.depth === maxTableDepth}" | ||
class="table-cell table-cell--justify"> | ||
{{row.key}} | ||
<span *ngIf="maxDepth > row.depth" | ||
class="material-icons md-18">{{ canRowCollapse(i) ? "expand_more" : "expand_less"}}</span>{{row.key}} | ||
</div> | ||
<div *ngFor="let _ of range(maxTableDepth - row.depth)" class="table-cell"></div> | ||
<div *ngFor="let header of headers" [ngClass]="{'table-cell--bold' : bold}" class="table-cell"> | ||
<div *ngFor="let _ of range(maxTableDepth - row.depth); let i = index" | ||
[ngClass]="{'table-cell--border-right': i === maxTableDepth - row.depth - 1}" class="table-cell"></div> | ||
<div *ngFor="let header of headers" | ||
[ngClass]="{'table-cell--bold' : bold || row.depth === 0 && currentDepth > 0}" class="table-cell"> | ||
{{row.val.cells[header]}} | ||
</div> | ||
<div class="table-cell table-cell--bold"> | ||
<div class="table-cell table-cell--bold table-cell--border-left"> | ||
{{row.val.total}} | ||
</div> | ||
</div> | ||
</ng-container> | ||
</ng-container> | ||
</ng-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
@import './src/assets/_colors'; | ||
|
||
|
||
.table-cell--clickable { | ||
cursor: pointer; | ||
} | ||
|
||
.table-row--highlight, | ||
.table-row--hover:hover { | ||
background-color: #f9f9f9; | ||
} | ||
|
||
.table-row--highlight > .table-cell { | ||
border-bottom: 2px solid #ddd; | ||
} | ||
|
||
.table-row--white { | ||
background-color: white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters