Skip to content

Commit

Permalink
Fix em patches
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-ptera committed Mar 11, 2023
1 parent 5e9edbd commit 8d5a6d1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## v2.4.1 (March 10, 2023)

### Fixed

- Fixed representative pie chart legend not being circles.
- Fixed monitored and large rep table sortation.

## v2.4.0 (March 7, 2023)

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yellow-spyglass-client",
"version": "2.4.0",
"version": "2.4.1",
"scripts": {
"ng": "ng",
"start": "ng serve -c development --open --host 0.0.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { APP_NAV_ITEMS } from '../../../../navigation/nav-items';
</ng-container>
<ng-container matColumnDef="address">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Representative</th>
<th mat-header-cell *matHeaderCellDef>Representative</th>
<td mat-cell *matCellDef="let element">
<div class="all-reps-table-alias-cell">
<div class="invisible-full-address">
Expand Down Expand Up @@ -105,7 +105,7 @@ import { APP_NAV_ITEMS } from '../../../../navigation/nav-items';
<td mat-cell *matCellDef="let element">{{ numberWithCommas(element.fundedDelegatorsCount) }}</td>
</ng-container>
<ng-container matColumnDef="uptimeStats.uptimePercentages.month">
<ng-container matColumnDef="uptime">
<th mat-header-cell *matHeaderCellDef mat-sort-header>
<div style="text-align: left">
Uptime
Expand Down Expand Up @@ -147,7 +147,7 @@ export class LargeRepTableComponent implements OnChanges {
'weight',
'percentWeight',
'fundedDelegatorsCount',
'uptimeStats.uptimePercentages.month',
'uptime',
];
largeRepsDisplayColumnsMd = ['position', 'address', 'online', 'score', 'weight', 'percentWeight'];

Expand All @@ -169,6 +169,16 @@ export class LargeRepTableComponent implements OnChanges {
this.largeRepsDataSource = new MatTableDataSource(this.shownReps);
this._ref.detectChanges();
this.largeRepsDataSource.sort = this.sortAll;
this.largeRepsDataSource.sortingDataAccessor = (item, property) => {
switch (property) {
case 'uptime': {
return item.uptimePercentages?.month;
}
default: {
return item[property];
}
}
};
}

formatBanWeight(weight: number): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import { APP_NAV_ITEMS } from '../../../../navigation/nav-items';
</ng-container>
<ng-container matColumnDef="weightPercent">
<th mat-header-cell *matHeaderCellDef mat-sort-header style="min-width: 70px">%</th>
<th mat-header-cell *matHeaderCellDef mat-sort-header style="min-width: 70px">Weight</th>
<td mat-cell *matCellDef="let element">
<ng-container *ngIf="element.weight">
{{ formatWeightPercent(element.weight) }}<span style="font-size: 10px">%</span>
Expand Down Expand Up @@ -193,17 +193,23 @@ export class MonitoredRepTableComponent implements OnChanges {
this.monitoredRepsDataSource.sort = this.sortMonitored;
this.monitoredRepsDataSource.sortingDataAccessor = (item, property) => {
switch (property) {
case 'name': {
return item.name?.toLowerCase();
}
case 'isPrincipal': {
return item['weight'];
return item.weight;
}
case 'weightBan': {
return item['weight'];
return item.weight;
}
case 'weightPercent': {
return item['weight'];
return item.weight;
}
case 'location': {
return item.location?.toLowerCase();
}
case 'uptime': {
return this.monitoredRepMap.get(item['address'])?.uptimePercentages.semiAnnual;
return item.uptimePercentages?.month;
}
default: {
return item[property];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@
align-items: center;
}
.representatives-legend-color {
width: 12px;
height: 12px;
$size: 12px;
min-width: $size;
width: $size;
height: $size;
min-height: $size;
border-radius: 100%;
margin-right: 16px;
}
Expand Down

0 comments on commit 8d5a6d1

Please sign in to comment.