feat: view financial activity mapping component

Add view financial activity mapping component.
This commit is contained in:
abhay_1806
2018-07-28 20:18:01 +05:30
committed by Abhay Chawla
parent 69161a3b62
commit 8ebfd61aa3
10 changed files with 130 additions and 6 deletions
@@ -0,0 +1,40 @@
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" class="container m-b-20">
<button mat-raised-button color="primary">
<mat-icon>edit</mat-icon>&nbsp;&nbsp;Edit
</button>
<button mat-raised-button color="warn">
<mat-icon>delete</mat-icon>&nbsp;&nbsp;Delete
</button>
</div>
<div class="container">
<mat-card>
<mat-card-content>
<div fxLayout="row wrap" class="content">
<div fxFlex="50%" class="header">
Financial Activity
</div>
<div fxFlex="50%">
{{ financialActivityAccountData?.financialActivityData.name }}
</div>
<div fxFlex="50%" class="header">
Account Name
</div>
<div fxFlex="50%">
{{ financialActivityAccountData?.glAccountData.name }}
</div>
</div>
</mat-card-content>
</mat-card>
</div>
@@ -0,0 +1,14 @@
.container {
max-width: 37rem;
}
.content {
div {
margin: 1rem 0;
word-wrap: break-word;
}
.header {
font-weight: 500;
}
}
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ViewFinancialActivityMappingComponent } from './view-financial-activity-mapping.component';
describe('ViewFinancialActivityMappingComponent', () => {
let component: ViewFinancialActivityMappingComponent;
let fixture: ComponentFixture<ViewFinancialActivityMappingComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewFinancialActivityMappingComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ViewFinancialActivityMappingComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,31 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { AccountingService } from '../../accounting.service';
@Component({
selector: 'mifosx-view-financial-activity-mapping',
templateUrl: './view-financial-activity-mapping.component.html',
styleUrls: ['./view-financial-activity-mapping.component.scss']
})
export class ViewFinancialActivityMappingComponent implements OnInit {
financialActivityAccountId: any;
financialActivityAccountData: any;
constructor(private route: ActivatedRoute,
private accountingService: AccountingService) { }
ngOnInit() {
this.financialActivityAccountId = this.route.snapshot.paramMap.get('id');
this.getFinancialActivityAccount();
}
getFinancialActivityAccount() {
this.accountingService.getFinancialActivityAccount(this.financialActivityAccountId)
.subscribe((financialActivityAccountData: any) => {
this.financialActivityAccountData = financialActivityAccountData;
console.log(financialActivityAccountData);
});
}
}