Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: percentage pipe #567

Merged
merged 3 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2 class="card-title">Validators</h2>
{{ validator.val.tokens | unitConversion }}
</td>
<td>
{{ validator.val.commission?.commission_rates?.rate | percent : '1.0-0' }}
{{ validator.val.commission?.commission_rates?.rate | percent : '1.2-2' }}
</td>
</tr>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ <h2 class="mb-0">
<tr>
<th>Commission</th>
<td>
{{ validator?.val?.commission?.commission_rates?.rate | percent : '1.0-0' }}
{{ validator?.val?.commission?.commission_rates?.rate | percent : '1.2-2' }}
</td>
</tr>
<tr>
<th>Max Commission</th>
<td>
{{ validator?.val?.commission?.commission_rates?.max_rate | percent : '1.0-0' }}
{{ validator?.val?.commission?.commission_rates?.max_rate | percent : '1.2-2' }}
</td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h2>Validators</h2>
{{ validator.val.tokens | coinAmount }}
</td>
<td>
{{ validator.val.commission?.commission_rates?.rate | percent : '1.0-0' }}
{{ validator.val.commission?.commission_rates?.rate | percent : '1.2-2' }}
</td>
</tr>
</ng-container>
Expand Down
23 changes: 0 additions & 23 deletions projects/portal/src/app/pipes/percentage.pipe.spec.ts

This file was deleted.

18 changes: 0 additions & 18 deletions projects/portal/src/app/pipes/percentage.pipe.ts

This file was deleted.

3 changes: 0 additions & 3 deletions projects/portal/src/app/pipes/pipes.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { CoinDenomPipe } from './coin-denom.pipe';
import { CoinPipe } from './coin.pipe';
import { DecimalsPipe } from './decimals.pipe';
import { FloorPipe } from './floor.pipe';
import { PercentagePipe } from './percentage.pipe';
import { SecondToDatePipe } from './seconds-to-date.pipe';
import { UnitConversionPipe } from './unit-conversion.pipe';
import { CommonModule } from '@angular/common';
Expand All @@ -15,7 +14,6 @@ import { NgModule } from '@angular/core';
DecimalsPipe,
FloorPipe,
UnitConversionPipe,
PercentagePipe,
CoinPipe,
CoinDenomPipe,
CoinAmountPipe,
Expand All @@ -27,7 +25,6 @@ import { NgModule } from '@angular/core';
DecimalsPipe,
FloorPipe,
UnitConversionPipe,
PercentagePipe,
CoinPipe,
CoinDenomPipe,
CoinAmountPipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ <h2 class="card-title break-all flex flex-col md:flex-row">
</tr>
<tr>
<td>Commission</td>
<td>{{ validator?.val?.commission?.commission_rates?.rate | percent : '1.0-0' }}</td>
<td>{{ validator?.val?.commission?.commission_rates?.rate | percent : '1.2-2' }}</td>
</tr>
<tr>
<td>Max Commission</td>
<td>
{{ validator?.val?.commission?.commission_rates?.max_rate | percent : '1.0-0' }}
{{ validator?.val?.commission?.commission_rates?.max_rate | percent : '1.2-2' }}
</td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ <h2>Validators</h2>
{{ validator.val.tokens | coinAmount }}
</td>
<td>
{{ validator.val.commission?.commission_rates?.rate | percent : '1.0-0' }}
{{ validator.val.commission?.commission_rates?.rate | percent : '1.2-2' }}
</td>
</tr>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h3 class="font-bold text-lg">What is Perpetual Futures?</h3>
<div class="stat">
<div class="stat-title">Borrow Fee</div>
<div class="stat-value text-secondary">
{{ params?.pool_params?.borrowing_fee_rate_per_hour | percentage }}
{{ params?.pool_params?.borrowing_fee_rate_per_hour | percent : '1.0-2' }}
</div>
<div class="stat-desc"></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2 class="card-title">
<div class="stat">
<div class="stat-title">Margin Maintenance Rate</div>
<div class="stat-value">
{{ position?.margin_maintenance_rate | percentage }}
{{ position?.margin_maintenance_rate | percent : '1.0-2' }}
</div>
<div class="stat-desc">Under 50% will initiate liquidation</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<img class="w-12 h-12" src="assets/favicon.png" alt="UnUniFi logo" />
<div class="font-bold text-xl m-3">Delegate Menu</div>
<div class="form-control w-full">
<label class="label">
<span class="label-text">Validator</span>
</label>
<ul class="menu bg-base-100">
<li class="disabled">
<a class="text-base-content items-center">
Expand All @@ -24,19 +21,19 @@
{{ selectedValidator?.description?.moniker }}
</a>
</li>
<li class="disabled">
<li class="disabled mt-4">
<a class="text-base-content">
<span class="column-name">Address</span>
<span class="flex-auto w-1/4"></span>
<span class="column-value truncate">{{ selectedValidator?.operator_address }}</span>
</a>
</li>
<li class="disabled">
<li class="disabled mt-4">
<a class="text-base-content">
<span class="column-name">Commission</span>
<span class="flex-auto"></span>
<span class="column-value">{{
selectedValidator?.commission?.commission_rates?.rate | percent
selectedValidator?.commission?.commission_rates?.rate | percent : '1.2-2'
}}</span>
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2 class="card-title break-all">
</tr>
<tr>
<td>Minimum deposit rate</td>
<td>{{ listingInfo?.minimum_deposit_rate | percentage }}</td>
<td>{{ listingInfo?.minimum_deposit_rate | percent : '1.0-4' }}</td>
</tr>
<tr>
<td>Minimum bid Expiry date</td>
Expand Down Expand Up @@ -169,7 +169,7 @@ <h3 class="font-bold text-lg">What is the borrow amount?</h3>
<div class="stats stats-vertical md:stats-horizontal justify-end my-4">
<div class="stat flex flex-col items-end">
<div class="stat-title">Average interest rate</div>
<div class="stat-value">{{ averageInterestRate | percentage }}</div>
<div class="stat-value">{{ averageInterestRate | percent : '1.0-4' }}</div>
<div class="stat-desc"></div>
</div>
<div class="stat flex flex-col items-end">
Expand Down Expand Up @@ -275,7 +275,7 @@ <h3 class="font-bold text-lg">What is the borrow amount?</h3>
<tbody>
<tr *ngFor="let bid of bids; let i = index">
<th>#{{ i + 1 }}</th>
<td>{{ bid.interest_rate | percentage }}</td>
<td>{{ bid.interest_rate | percent : '1.0-4' }}</td>
<td>{{ bid.deposit | coin | async }}</td>
<td>{{ bid.price | coin | async }}</td>
<td>{{ bid.expiry | date : 'yyyy-MM-dd a hh:mm z' }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h2 class="card-title break-all">
</tr>
<tr>
<td>Minimum deposit rate</td>
<td>{{ listingInfo?.minimum_deposit_rate | percentage }}</td>
<td>{{ listingInfo?.minimum_deposit_rate | percent : '1.0-4' }}</td>
</tr>
<tr>
<td>Minimum bid Expiry date</td>
Expand Down Expand Up @@ -256,7 +256,7 @@ <h3 class="font-bold text-lg">What is the repay amount?</h3>
<tbody>
<tr *ngFor="let bid of bids; let i = index">
<th>#{{ i + 1 }}</th>
<td>{{ bid.interest_rate | percentage }}</td>
<td>{{ bid.interest_rate | percent : '1.0-4' }}</td>
<td>{{ bid.borrow?.amount | coin | async }}</td>
<td>{{ bid.price | coin | async }}</td>
<td>{{ bid.expiry | date : 'yyyy-MM-dd a hh:mm z' }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h2 class="card-title break-all">
</tr>
<tr>
<td>Minimum deposit rate</td>
<td>{{ listingInfo?.minimum_deposit_rate | percentage }}</td>
<td>{{ listingInfo?.minimum_deposit_rate | percent : '1.0-4' }}</td>
</tr>
<tr>
<td>Minimum bid Expiry date</td>
Expand Down Expand Up @@ -402,7 +402,7 @@ <h3 class="font-bold text-lg">What is auto pay?</h3>
></ng-container>
<ng-template #color>
<th class="text-secondary">#{{ i + 1 }}</th>
<td class="text-secondary">{{ bid.interest_rate | percentage }}</td>
<td class="text-secondary">{{ bid.interest_rate | percent : '1.0-4' }}</td>
<td class="text-secondary">{{ bid.deposit | coin | async }}</td>
<td class="text-secondary">{{ bid.price | coin | async }}</td>
<td class="text-secondary">
Expand All @@ -412,7 +412,7 @@ <h3 class="font-bold text-lg">What is auto pay?</h3>
</ng-template>
<ng-template #normal>
<th>#{{ i + 1 }}</th>
<td>{{ bid.interest_rate | percentage }}</td>
<td>{{ bid.interest_rate | percent : '1.0-4' }}</td>
<td>{{ bid.deposit | coin | async }}</td>
<td>{{ bid.price | coin | async }}</td>
<td>{{ bid.expiry | date : 'yyyy-MM-dd a hh:mm z' }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h2 class="card-title break-all">
</tr>
<tr>
<td>Minimum deposit rate</td>
<td>{{ listingInfo?.minimum_deposit_rate | percentage }}</td>
<td>{{ listingInfo?.minimum_deposit_rate | percent : '1.0-4' }}</td>
</tr>
<tr>
<td>Minimum bid Expiry date</td>
Expand Down Expand Up @@ -140,7 +140,7 @@ <h2 class="card-title break-all">
></ng-container>
<ng-template #color>
<th class="text-secondary">#{{ i + 1 }}</th>
<td class="text-secondary">{{ bid.interest_rate | percentage }}</td>
<td class="text-secondary">{{ bid.interest_rate | percent : '1.0-4' }}</td>
<td class="text-secondary">{{ bid.deposit | coin | async }}</td>
<td class="text-secondary">{{ bid.price | coin | async }}</td>
<td class="text-secondary">
Expand All @@ -150,7 +150,7 @@ <h2 class="card-title break-all">
</ng-template>
<ng-template #normal>
<th>#{{ i + 1 }}</th>
<td>{{ bid.interest_rate | percentage }}</td>
<td>{{ bid.interest_rate | percent : '1.0-4' }}</td>
<td>{{ bid.deposit | coin | async }}</td>
<td>{{ bid.price | coin | async }}</td>
<td>{{ bid.expiry | date : 'yyyy-MM-dd a hh:mm z' }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ <h2 class="card-title break-all">{{ nftMetadata?.name }}</h2>
<tbody>
<tr *ngFor="let bid of bids; let i = index">
<th>#{{ i + 1 }}</th>
<td>{{ bid.interest_rate | percentage }}</td>
<td>{{ bid.interest_rate | percent : '1.0-4' }}</td>
<td>{{ bid.deposit | coin | async }}</td>
<td>{{ bid.price | coin | async }}</td>
<td>{{ bid.expiry | date : 'yyyy-MM-dd a hh:mm z' }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h2 class="card-title break-all">
<div class="stats">
<div class="stat" *ngIf="weights">
<div class="stat-title">Weight</div>
<div class="stat-value">{{ weights[i] | percentage }}</div>
<div class="stat-value">{{ weights[i] | percent : '1.0-2' }}</div>
<div class="stat-desc"></div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ <h2 class="card-title">{{ vault.id }}</h2>
</tr>
<tr>
<th>Withdraw Commission Rate</th>
<td>{{ vault?.withdraw_commission_rate | percentage }}</td>
<td>{{ vault?.withdraw_commission_rate | percent : '1.0-4' }}</td>
</tr>
<tr>
<th>Withdraw Reserve Rate</th>
<td>{{ vault?.withdraw_reserve_rate | percentage }}</td>
<td>{{ vault?.withdraw_reserve_rate | percent : '1.0-4' }}</td>
</tr>
</tbody>
</table>
Expand All @@ -121,7 +121,7 @@ <h3>Strategies</h3>
>
<th>#{{ strategy.strategy_id }}</th>
<td>{{ 'Coming Soon' }}</td>
<td>{{ strategy.weight | percentage }}</td>
<td>{{ strategy.weight | percent : '1.0-2' }}</td>
</tr>
</ng-container>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ <h2 class="card-title">
</tr>
<tr>
<td>Withdraw Commission Rate</td>
<td>{{ vault?.vault?.withdraw_commission_rate | percentage }}</td>
<td>{{ vault?.vault?.withdraw_commission_rate | percent : '1.0-4' }}</td>
</tr>
<tr>
<td>Withdraw Reserve Rate</td>
<td>{{ vault?.vault?.withdraw_reserve_rate | percentage }}</td>
<td>{{ vault?.vault?.withdraw_reserve_rate | percent : '1.0-4' }}</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -254,7 +254,7 @@ <h2 class="card-title break-all">
<div class="stats">
<div class="stat">
<div class="stat-title">Allocation weight</div>
<div class="stat-value">{{ strategy.weight | percentage }}</div>
<div class="stat-value">{{ strategy.weight | percent : '1.0-2' }}</div>
<div class="stat-desc"></div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ <h3>Select the Vault to deposit</h3>
{{ symbols[i].name }}
</div>
</td>
<td>{{ vault.withdraw_reserve_rate | percentage }}</td>
<td>{{ vault.withdraw_commission_rate | percentage }}</td>
<td>{{ vault.withdraw_reserve_rate | percent : '1.0-4' }}</td>
<td>{{ vault.withdraw_commission_rate | percent : '1.0-4' }}</td>
<!-- <td>{{ vault.name }}</td> -->
<td>{{ vault.owner }}</td>
</tr>
Expand Down