Skip to content

Commit

Permalink
Merge 54d8ba4 into 9b6df8a
Browse files Browse the repository at this point in the history
  • Loading branch information
kewde committed Jul 3, 2017
2 parents 9b6df8a + 54d8ba4 commit fee22ea
Show file tree
Hide file tree
Showing 8 changed files with 406 additions and 128 deletions.
1 change: 1 addition & 0 deletions src/app/overview/overview.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
</ul>
</app-header>
<transaction-table
amountOfTxsToDisplay=5
[displayHeader]="false"
[displayInternalHeader]="true"
[displayPagination]="false"
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { TableComponent } from './table/table.component';
@NgModule({
imports: [
CommonModule,
AccordionModule
AccordionModule,
PaginationModule.forRoot()
],
declarations: [
HeaderComponent,
Expand Down
2 changes: 1 addition & 1 deletion src/app/wallet/history/history.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<transaction-table
[displayHeader]="false"
[displayInternalHeader]="true"
[displayPagination]="false"
[displayPagination]="true"
[displayCategory]="true"
[displaySenderAddress]="true"
[displayDate]="true"
Expand Down
9 changes: 9 additions & 0 deletions src/app/wallet/history/history.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { HistoryComponent } from './history.component';
import { SharedModule } from '../../shared/shared.module';
import { WalletModule } from '../../wallet/wallet.module';

import { ElectronService } from 'ngx-electron';
import { AppService } from '../../app.service';
import { RPCService } from '../../core/rpc/rpc.service';

describe('HistoryComponent', () => {
let component: HistoryComponent;
let fixture: ComponentFixture<HistoryComponent>;
Expand All @@ -15,6 +19,11 @@ describe('HistoryComponent', () => {
SharedModule,
WalletModule.forRoot()
],
providers: [
AppService,
ElectronService,
RPCService
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
Send
<span class="icon fa fa-arrow-right color-red"></span>
</span>
<span *ngSwitchCase="'received'" class="inline-tag text-uppercase">
<span *ngSwitchCase="'receive'" class="inline-tag text-uppercase">
Received
<span class="icon fa fa-arrow-left color-green"></span>
</span>
</td>
<td *ngIf="displaySenderAddress">
<span class="inline-header">Address</span>
<span>{{ tx.address }}</span>
<span>{{ tx.getAddress() }}</span>
</td>
<td *ngIf="displayDate">
<span class="inline-header"><span class="icon fa fa-clock-o"></span></span>
Expand All @@ -50,7 +50,7 @@
</td>
<td *ngIf="displayAmount">
<span class="inline-header">Amount</span>
<span>{{ tx.amount }} PART</span>
<span>{{ tx.getAmount() }} PART</span>
</td>
</tr>
</app-table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import { TransactionService } from '../transaction.service';
@Component({
selector: 'transaction-table',
templateUrl: './transaction-table.component.html',
styleUrls: ['./transaction-table.component.scss']
styleUrls: ['./transaction-table.component.scss'],
providers: [TransactionService]
})
export class TransactionsTableComponent implements OnInit {
/* Determines what fields are displayed in the Transaction Table. */
/* header and utils */
@Input() displayHeader: boolean = true;
@Input() displayInternalHeader: boolean = false;
@Input() displayPagination: boolean = false;
@Input() amountOfTxsToDisplay: number = 10;

/* actual fields */
@Input() displayCategory: boolean = true;
Expand All @@ -27,11 +29,12 @@ export class TransactionsTableComponent implements OnInit {
@Input() displayBlockHash: boolean = false;
@Input() displayBlockIndex: boolean = false;


constructor(public txService: TransactionService) {
// make life easy in component html
}

ngOnInit() {
this.txService.postConstructor(this.amountOfTxsToDisplay);
}

public pageChanged(event: any): void {
Expand Down
Loading

0 comments on commit fee22ea

Please sign in to comment.