Skip to content

Commit

Permalink
Merge pull request #686 from ripio/release/0.4.1
Browse files Browse the repository at this point in the history
Release/0.4.1
  • Loading branch information
NicolasMenendez authored May 18, 2021
2 parents 4ff9b88 + 360c751 commit 31da27b
Show file tree
Hide file tree
Showing 72 changed files with 2,079 additions and 173 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ config.js
# Visal studio code
/.vscode/

# Prettier
.prettierrc.json
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## **0.4.1** Boggart 👻

### Feature:
- New dashboard component
- New navrail bullets component

### Enhancement:
- New animations
- Upgrade dependencies
- Shows more decimal when creating ETH collateral
- Improves performance in the loan detail view

### Fix:
- Fix USDC decimals on Ethereum chains
- Fix penalty rate display
- Fix Etherscan/BSC scan links in the loan history component
- Fix Withdraw Collateral TX tracking
- Fix the verification of whether a loan was created

## **0.4.0** Boggart 👻

### Feature:
Expand Down
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rcn-angular-dapp",
"version": "0.4.0",
"version": "0.4.1",
"version_name": "Boggart",
"license": "MIT",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const routes: Routes = [
path: 'activity',
loadChildren: () => import('./views/active-loans/active-loans.module').then(m => m.ActiveLoansModule)
},
{
path: 'dashboard',
loadChildren: () => import('./views/dashboard/dashboard.module').then(m => m.DashboardModule)
},
{
path: 'address/:address',
loadChildren: () => import('./views/address/address.module').then(m => m.AddressModule)
Expand Down
4 changes: 3 additions & 1 deletion src/app/config/chain/1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ export const chain = {
address: '0x0000000000000000000000000000000000000000'
}
],
currencyDecimals: {},
currencyDecimals: {
'USDC': 6
},
createLoanCurrencies: ['RCN', 'USDC', 'ARS'],
createCollateralCurrencies: ['RCN', 'USDC']
},
Expand Down
4 changes: 3 additions & 1 deletion src/app/config/chain/3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ export const chain = {
address: '0x0000000000000000000000000000000000000000'
}
],
currencyDecimals: {},
currencyDecimals: {
'USDC': 6
},
createLoanCurrencies: ['RCN', 'USDC', 'ARS'],
createCollateralCurrencies: ['RCN', 'USDC']
},
Expand Down
11 changes: 11 additions & 0 deletions src/app/core/content-wrapper/content-wrapper.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ProxyApiService } from 'app/services/proxy-api.service';
import { ApplicationAdsService, Ad } from 'app/services/application-ads.service';
import { Web3Service } from 'app/services/web3.service';
import { ChainService } from 'app/services/chain.service';
import { NavrailService } from 'app/services/navrail.service';
import { CountriesService } from 'app/services/countries.service';

@Component({
Expand Down Expand Up @@ -39,6 +40,7 @@ export class ContentWrapperComponent implements OnInit {
private applicationAdsService: ApplicationAdsService,
private web3Service: Web3Service,
private chainService: ChainService,
private navrailService: NavrailService,
private countriesService: CountriesService
) {}

Expand All @@ -50,11 +52,13 @@ export class ContentWrapperComponent implements OnInit {
if (isLogged) {
await this.loadAccount();
this.checkPendingWithdraw();
this.loadNavrailBullets();
}
}
);
await this.loadAccount();
this.checkPendingWithdraw();
this.loadNavrailBullets();
this.canLend();
this.checkIfIsHome();
this.loadBscAd();
Expand Down Expand Up @@ -156,4 +160,11 @@ export class ContentWrapperComponent implements OnInit {
image: 'assets/bnb-big.png'
});
}

/**
* Check for Navrail bullets
*/
private async loadNavrailBullets() {
await this.navrailService.refreshNavrail();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class IconGroupHeaderComponent implements OnInit, OnChanges, OnDestroy {

ngOnChanges() {
const { account } = this;
this.shortAccount = Utils.shortAddress(account);
if (account) this.shortAccount = Utils.shortAddress(account);
}

ngOnDestroy() {
Expand Down
8 changes: 8 additions & 0 deletions src/app/core/header/notifications/notifications.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ export class NotificationsComponent implements OnInit {
case 'withdrawCollateral':
message = `Withdrawing the ${ tx.data.collateralId } collateral`;
break;
case 'redeemCollateral':
message = `Withdrawing the ${ tx.data.id } collateral`;
break;
default:
break;
}
Expand Down Expand Up @@ -204,6 +207,7 @@ export class NotificationsComponent implements OnInit {
return 'Deposited';

case 'withdrawCollateral':
case 'redeemCollateral':
return 'Withdrawn';

default:
Expand Down Expand Up @@ -264,6 +268,9 @@ export class NotificationsComponent implements OnInit {
case 'withdrawCollateral':
message = `You've withdrawn the ${ tx.data.collateralId } collateral`;
break;
case 'redeemCollateral':
message = `You've withdrawn the ${ tx.data.id } collateral`;
break;
default:
break;
}
Expand Down Expand Up @@ -324,6 +331,7 @@ export class NotificationsComponent implements OnInit {
txObject = new TxObject(id, 'Depositing', message, 'material-icons', 'add', '', 'violet');
break;
case 'withdrawCollateral':
case 'redeemCollateral':
txObject = new TxObject(id, 'Withdrawing', message, 'material-icons', 'remove_circle_outline', '', 'violet');
break;
default:
Expand Down
7 changes: 4 additions & 3 deletions src/app/core/navrail/navrail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@
</a>
<ng-container *ngIf="hasAccount; else connectButtonTemplate">
<a
routerLink='/address/{{ account }}/'
routerLink='/dashboard'
class="menu__item"
routerLinkActive="menu__item--active"
>
<span class="menu__item-icon">
<i class="fas fa-hand-holding-usd"></i>
</span>
<span class="menu__item-label">
My loans
Dashboard
</span>
<span *ngIf="isBulletMyLoans" class="menu__item-bullet"></span>
</a>
</ng-container>
<ng-template #connectButtonTemplate>
Expand All @@ -63,7 +64,7 @@
<i class="fas fa-hand-holding-usd"></i>
</span>
<span class="menu__item-label">
My loans
Dashboard
</span>
</a>
</ng-template>
Expand Down
9 changes: 9 additions & 0 deletions src/app/core/navrail/navrail.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ $navrailWidth: 169px;
&-label {
transition: .15s;
}
&-bullet {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--app-color-red);
position: absolute;
top: 13px;
left: 45px;
}
&::before {
content: '';
position: absolute;
Expand Down
3 changes: 2 additions & 1 deletion src/app/core/navrail/navrail.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule } from '@angular/router';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { SharedModule } from 'app/shared/shared.module';
Expand All @@ -10,7 +11,7 @@ describe('NavrailComponent', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ RouterModule.forRoot([]), SharedModule ],
imports: [ RouterModule.forRoot([]), HttpClientModule, SharedModule ],
declarations: [ NavrailComponent ],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
Expand Down
39 changes: 37 additions & 2 deletions src/app/core/navrail/navrail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { Router, Event, NavigationEnd } from '@angular/router';
import { Subscription } from 'rxjs';
import { environment } from 'environments/environment';
import { Engine } from 'app/models/loan.model';
import { WalletConnectService } from 'app/services/wallet-connect.service';
import { Web3Service } from 'app/services/web3.service';
import { ChainService } from 'app/services/chain.service';
import { NavrailService } from 'app/services/navrail.service';
import { WalletConnectService } from 'app/services/wallet-connect.service';

interface FooterButton {
url: string;
Expand All @@ -27,13 +28,16 @@ export class NavrailComponent implements OnInit, OnDestroy {
private navrailOpened: boolean;
private navrailHidden: boolean;
private socialNetworksOpened: boolean;
private bulletMyLoans: boolean;
private subscriptionAccount: Subscription;
private subscribtionRouter: Subscription;
private subscriptionRefreshNavrail: Subscription;

constructor(
private router: Router,
private web3Service: Web3Service,
private chainService: ChainService,
private navrailService: NavrailService,
private walletConnectService: WalletConnectService
) {
this.navrailHidden = true;
Expand All @@ -42,13 +46,16 @@ export class NavrailComponent implements OnInit, OnDestroy {
ngOnInit() {
this.loadAccount();
this.loadFooterButtons();
this.loadNavrailBullets();
this.handleLoginEvents();
this.listenRouter();
this.listenRefreshNavrail();
}

ngOnDestroy() {
this.subscriptionAccount.unsubscribe();
this.subscribtionRouter.unsubscribe();
this.subscriptionRefreshNavrail.unsubscribe();
}

/**
Expand Down Expand Up @@ -94,16 +101,26 @@ export class NavrailComponent implements OnInit, OnDestroy {
}

/**
* Navrail is opened
* Is Navrail opened
*/
get isNavrailOpened() {
return this.navrailOpened;
}

/**
* Is Navrail hidden
*/
get isNavrailHidden() {
return this.navrailHidden;
}

/**
* Show bullet on 'My Loans' button
*/
get isBulletMyLoans() {
return this.bulletMyLoans;
}

/**
* User is logged in
*/
Expand Down Expand Up @@ -138,6 +155,16 @@ export class NavrailComponent implements OnInit, OnDestroy {
});
}

/**
* Listen navrail refresh event
*/
private listenRefreshNavrail() {
this.subscriptionRefreshNavrail = this
.navrailService
.refreshNavrailEvent
.subscribe(() => this.loadNavrailBullets());
}

/**
* Load user account
*/
Expand All @@ -146,6 +173,14 @@ export class NavrailComponent implements OnInit, OnDestroy {
this.account = account;
}

/**
* Load navrail bullets
*/
private loadNavrailBullets() {
const { showBulletMyLoans } = this.navrailService;
this.bulletMyLoans = showBulletMyLoans;
}

/**
* Load social network and dApp version icons
*/
Expand Down
Loading

0 comments on commit 31da27b

Please sign in to comment.