Skip to content

Commit 27bbf9b

Browse files
committed
Swap gene-allele table columns and add wrapping
The descriptions now wrap on commas to prevent the page being too width. Refs #2550
1 parent 5861e3c commit 27bbf9b

3 files changed

Lines changed: 21 additions & 12 deletions

File tree

‎src/app/gene-allele-list/gene-allele-list.component.css‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,14 @@ tr {
2828

2929
td {
3030
height: inherit;
31+
padding-top: 0.2em;
3132
}
3233

3334
.genotype {
3435
padding-left: 0.5em;
3536
border-left: 2px solid black;
3637
}
38+
39+
.show-genotype-button {
40+
white-space: nowrap;
41+
}

‎src/app/gene-allele-list/gene-allele-list.component.html‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@
2727
Name <img title="Sorted by name" src="assets/sort_up.svg">
2828
</span>
2929
</th>
30-
<th>
31-
<a *ngIf="sortByColumnName != 'description'" (click)="sortBy('description')"title="Click to sort by description">
32-
Description <img title="Click to sort by description" src="assets/sort_both.svg">
33-
</a>
34-
<span *ngIf="sortByColumnName == 'description'" title="Sorted by description">
35-
Description <img title="Sorted by description" src="assets/sort_up.svg">
36-
</span>
37-
</th>
3830

3931
<th>
4032
<a *ngIf="sortByColumnName != 'type'" (click)="sortBy('type')" title="Click to sort by type">
@@ -44,6 +36,16 @@
4436
Type <img title="Sorted by type" src="assets/sort_up.svg">
4537
</span>
4638
</th>
39+
40+
<th>
41+
<a *ngIf="sortByColumnName != 'description'" (click)="sortBy('description')"title="Click to sort by description">
42+
Description <img title="Click to sort by description" src="assets/sort_both.svg">
43+
</a>
44+
<span *ngIf="sortByColumnName == 'description'" title="Sorted by description">
45+
Description <img title="Sorted by description" src="assets/sort_up.svg">
46+
</span>
47+
</th>
48+
4749
<th *ngIf="anyVisibleGenotypes()">Expression</th>
4850
<th *ngIf="anyVisibleGenotypes()">Genotype</th>
4951
</tr>
@@ -57,16 +59,17 @@
5759
<span *ngIf="deployConfigService.productionMode()">{{allele.alleleName}}</span>
5860
</td>
5961
<td *ngIf="expressedAlleleIndex == 0 && genotypeIndex == 0" [attr.rowspan]="alleleRowspan(allele)">
60-
{{allele.alleleDescription}}
62+
{{allele.alleleType}}
6163
</td>
6264
<td *ngIf="expressedAlleleIndex == 0 && genotypeIndex == 0" [attr.rowspan]="alleleRowspan(allele)">
63-
{{allele.alleleType}}
65+
<span [innerHTML]="allele.alleleDescription"></span>
6466
</td>
6567
<td *ngIf="!genotypesVisible(allele) && anyVisibleGenotypes()">
6668

6769
</td>
6870
<td *ngIf="!genotypesVisible(allele)">
69-
<a (click)="showGenotypes(allele)">Show genotypes..</a>
71+
<a class="show-genotype-button" (click)="showGenotypes(allele)"
72+
title="Show genotypes of {{allele.alleleName}}">Show genotypes..</a>
7073
</td>
7174
</ng-container>
7275

‎src/app/gene-allele-list/gene-allele-list.component.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ export class GeneAlleleListComponent implements OnInit {
216216
const alleleShort = alleleMap[alleleUniquename];
217217

218218
const alleleName = alleleShort.name;
219-
const alleleDescription = alleleShort.description;
219+
const alleleDescription = alleleShort.description.replace(/,/g, ',&#8203;');
220+
220221
const alleleType = alleleShort.allele_type;
221222

222223
const alleleSection =

0 commit comments

Comments
 (0)