feat: add navigation component (#590)

Fixes: #256
This commit is contained in:
punwai
2020-05-24 22:28:47 +05:30
committed by GitHub
parent 7a5069e590
commit e2707a1d0a
43 changed files with 1713 additions and 9 deletions
@@ -0,0 +1,87 @@
<mat-card-header fxLayout="row" fxLayoutGap="5%">
<fa-icon class="main-icon" icon="users" size="3x"></fa-icon>
<mat-card-title-group>
<div class="mat-typography">
<mat-card-title>
<h2>
{{ groupData.name }}
<span [className]="groupData.status.code | statusLookup">
<fa-icon matTooltip="{{ groupData.status.value }}" matTooltipPosition="right" icon="circle" size="lg"></fa-icon>
</span>
</h2>
</mat-card-title>
<mat-card-subtitle>
<p>
Account No: {{ groupData.accountNo }} {{ groupData.externalId ? '| External ID: ' + groupData.externalId : '' }}
</p>
</mat-card-subtitle>
</div>
</mat-card-title-group>
</mat-card-header>
<mat-card-content>
<mat-tab-group>
<mat-tab label="Details">
<div fxLayout="row wrap" class="content">
<div fxFlex="50%" class="mat-body-strong">
Activation Date
</div>
<div fxFlex="50%">
{{ groupData.activationDate | date }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Associated Officer
</div>
<div fxFlex="50%">
{{ groupData.staffName }}
</div>
<div fxFlex="50%" class="mat-body-strong" *ngIf="groupData.centerName">
Associated Center
</div>
<div fxFlex="50%" *ngIf="groupData.centerName">
{{ groupData.centerName }}
</div>
<div fxFlex="50%" class="mat-body-strong" *ngIf="groupData.collectionMeetingCalendar && groupData.collectionMeetingCalendar.nextTenRecurringDates[0]">
Next Meeting Date
</div>
<div fxFlex="50%" *ngIf="groupData.collectionMeetingCalendar && groupData.collectionMeetingCalendar.nextTenRecurringDates[0]">
{{ groupData.collectionMeetingCalendar.nextTenRecurringDates[0] | date }}
</div>
<div fxFlex="50%" class="mat-body-strong" *ngIf="groupData.collectionMeetingCalendar && groupData.collectionMeetingCalendar.humanReadable">
Meeting Frequency
</div>
<div fxFlex="50%" *ngIf="groupData.collectionMeetingCalendar && groupData.collectionMeetingCalendar.humanReadable">
{{ groupData.collectionMeetingCalendar.humanReadable }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Number of Clients
</div>
<div fxFlex="50%">
{{ clientData ? clientData.length : '' }}
</div>
</div>
</mat-tab>
<mat-tab label="Loan Accounts" *ngIf="groupAccountsData && groupAccountsData.loanAccounts">
<mifosx-loan-account-table [loanAccountData]="groupAccountsData.loanAccounts"></mifosx-loan-account-table>
</mat-tab>
<mat-tab label="Savings Accounts" *ngIf="groupAccountsData && groupAccountsData.savingsAccounts">
<mifosx-savings-account-table [savingsAccountData]="groupAccountsData.savingsAccounts"></mifosx-savings-account-table>
</mat-tab>
</mat-tab-group>
</mat-card-content>
@@ -0,0 +1,14 @@
.main-icon {
margin: 7px 0 0 0;
}
h2 {
font-weight: 500;
}
.content {
div {
margin: 1rem 0;
word-wrap: break-word;
}
}
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { GroupNavigationComponent } from './group-navigation.component';
describe('GroupNavigationComponent', () => {
let component: GroupNavigationComponent;
let fixture: ComponentFixture<GroupNavigationComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ GroupNavigationComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(GroupNavigationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,28 @@
/** Angular Imports */
import { Component, OnInit, Input, ViewChild } from '@angular/core';
/** Custom Components */
import { LoanAccountTableComponent } from '../loan-account-table/loan-account-table.component';
import { SavingsAccountTableComponent } from '../savings-account-table/savings-account-table.component';
@Component({
selector: 'mifosx-group-navigation',
templateUrl: './group-navigation.component.html',
styleUrls: ['./group-navigation.component.scss']
})
export class GroupNavigationComponent implements OnInit {
@ViewChild(LoanAccountTableComponent) loanAccountTableComponent: LoanAccountTableComponent;
@ViewChild(SavingsAccountTableComponent) savingsAccountTableComponent: SavingsAccountTableComponent;
@Input() groupData: any;
@Input() groupAccountsData: any;
@Input() clientData: any;
constructor() { }
ngOnInit() {
}
}