feat: add view tax group (#810)
Fixes: #587 Co-authored-by: kajol <kajolkumarisingh222@gmail.com>
This commit is contained in:
co-authored by
kajol
parent
0dc0876a43
commit
f12ba5bfd5
@@ -24,7 +24,7 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [routerLink]="[row.id]" class="select-row"></tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
table {
|
table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
.select-row:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/** Angular Imports */
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||||
|
|
||||||
|
/** rxjs Imports */
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { ProductsService } from '../products.service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tax Group data resolver.
|
||||||
|
*/
|
||||||
|
@Injectable()
|
||||||
|
export class TaxGroupResolver implements Resolve<Object> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ProductsService} productsService Products service.
|
||||||
|
*/
|
||||||
|
constructor(private productsService: ProductsService) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the tax Group data.
|
||||||
|
* @returns {Observable<any>}
|
||||||
|
*/
|
||||||
|
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||||
|
const taxGroupId = route.paramMap.get('id');
|
||||||
|
return this.productsService.getTaxGroup(taxGroupId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<div class="container m-b-20" fxLayout="row" fxLayout.lt-md="column" fxLayoutAlign="end" fxLayoutGap="2%">
|
||||||
|
<button mat-raised-button color="primary">
|
||||||
|
<fa-icon icon="edit"></fa-icon>
|
||||||
|
Edit
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
<mat-card>
|
||||||
|
|
||||||
|
<mat-card-content>
|
||||||
|
|
||||||
|
<div fxLayout="row wrap" class="content">
|
||||||
|
|
||||||
|
<div fxFlex="33%" class="mat-body-strong">
|
||||||
|
Name
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div fxFlex="67%">
|
||||||
|
{{ taxGroupData.name }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div fxFlex="34%" class="mat-body-strong">
|
||||||
|
Tax-Component Name
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div fxFlex="33%" class="mat-body-strong">
|
||||||
|
Start Date
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div fxFlex="33%" class="mat-body-strong">
|
||||||
|
End Date
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div fxLayout="row wrap" class="content" *ngFor="let taxcomponent of taxGroupData.taxAssociations">
|
||||||
|
|
||||||
|
<div fxFlex="34%">
|
||||||
|
{{ taxcomponent.taxComponent.name }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div fxFlex="33%">
|
||||||
|
{{ taxcomponent.startDate | date }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div fxFlex="33%" *ngIf="taxcomponent.endDate !== undefined || taxcomponent.endDate !== null">
|
||||||
|
{{ taxcomponent.endDate | date }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</mat-card-content>
|
||||||
|
|
||||||
|
</mat-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
.container {
|
||||||
|
max-width: 37rem;
|
||||||
|
|
||||||
|
.content {
|
||||||
|
div {
|
||||||
|
margin: 0.8rem 0;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ViewTaxGroupComponent } from './view-tax-group.component';
|
||||||
|
|
||||||
|
describe('ViewTaxGroupComponent', () => {
|
||||||
|
let component: ViewTaxGroupComponent;
|
||||||
|
let fixture: ComponentFixture<ViewTaxGroupComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ ViewTaxGroupComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(ViewTaxGroupComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/** Angular Imports. */
|
||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* View Tax Group component.
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'mifosx-view-tax-group',
|
||||||
|
templateUrl: './view-tax-group.component.html',
|
||||||
|
styleUrls: ['./view-tax-group.component.scss']
|
||||||
|
})
|
||||||
|
export class ViewTaxGroupComponent {
|
||||||
|
|
||||||
|
/** tax Group Data. */
|
||||||
|
taxGroupData: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the tax Group data from `resolve`.
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
*/
|
||||||
|
constructor(private route: ActivatedRoute) {
|
||||||
|
this.route.data.subscribe((data: { taxGroup: any }) => {
|
||||||
|
this.taxGroupData = data.taxGroup;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -39,6 +39,7 @@ import { ManageTaxGroupsComponent } from './manage-tax-groups/manage-tax-groups.
|
|||||||
import { ViewTaxComponentComponent } from './manage-tax-components/view-tax-component/view-tax-component.component';
|
import { ViewTaxComponentComponent } from './manage-tax-components/view-tax-component/view-tax-component.component';
|
||||||
import { CreateTaxComponentComponent } from './manage-tax-components/create-tax-component/create-tax-component.component';
|
import { CreateTaxComponentComponent } from './manage-tax-components/create-tax-component/create-tax-component.component';
|
||||||
import { EditTaxComponentComponent } from './manage-tax-components/edit-tax-component/edit-tax-component.component';
|
import { EditTaxComponentComponent } from './manage-tax-components/edit-tax-component/edit-tax-component.component';
|
||||||
|
import { ViewTaxGroupComponent } from './manage-tax-groups/view-tax-group/view-tax-group.component';
|
||||||
|
|
||||||
/** Custom Resolvers */
|
/** Custom Resolvers */
|
||||||
import { LoanProductsResolver } from './loan-products/loan-products.resolver';
|
import { LoanProductsResolver } from './loan-products/loan-products.resolver';
|
||||||
@@ -68,6 +69,7 @@ import { TaxComponentResolver } from './manage-tax-components/tax-component.reso
|
|||||||
import { TaxComponentTemplateResolver } from './manage-tax-components/tax-component-template.resolver';
|
import { TaxComponentTemplateResolver } from './manage-tax-components/tax-component-template.resolver';
|
||||||
import { EditChargeComponent } from './charges/edit-charge/edit-charge.component';
|
import { EditChargeComponent } from './charges/edit-charge/edit-charge.component';
|
||||||
import { ChargesTemplateResolver } from './charges/charges-template.resolver';
|
import { ChargesTemplateResolver } from './charges/charges-template.resolver';
|
||||||
|
import { TaxGroupResolver } from './manage-tax-groups/tax-group.resolver';
|
||||||
|
|
||||||
/** Products Routes */
|
/** Products Routes */
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
@@ -258,11 +260,29 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'tax-groups',
|
path: 'tax-groups',
|
||||||
component: ManageTaxGroupsComponent,
|
|
||||||
resolve: {
|
|
||||||
taxGroups: ManageTaxGroupsResolver
|
|
||||||
},
|
|
||||||
data: { title: extract('Manage Tax Groups'), breadcrumb: 'Tax Groups'},
|
data: { title: extract('Manage Tax Groups'), breadcrumb: 'Tax Groups'},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: ManageTaxGroupsComponent,
|
||||||
|
resolve: {
|
||||||
|
taxGroups: ManageTaxGroupsResolver
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':id',
|
||||||
|
data: { title: extract('View Tax Group'), routeParamBreadcrumb: 'id' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: ViewTaxGroupComponent,
|
||||||
|
resolve: {
|
||||||
|
taxGroup: TaxGroupResolver
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -431,7 +451,8 @@ const routes: Routes = [
|
|||||||
FloatingRateResolver,
|
FloatingRateResolver,
|
||||||
FloatingRatesResolver,
|
FloatingRatesResolver,
|
||||||
TaxComponentTemplateResolver,
|
TaxComponentTemplateResolver,
|
||||||
EditTaxComponentComponent
|
EditTaxComponentComponent,
|
||||||
|
TaxGroupResolver
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ProductsRoutingModule { }
|
export class ProductsRoutingModule { }
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ import { EditTaxComponentComponent } from './manage-tax-components/edit-tax-comp
|
|||||||
import { EditChargeComponent } from './charges/edit-charge/edit-charge.component';
|
import { EditChargeComponent } from './charges/edit-charge/edit-charge.component';
|
||||||
import { MatFormFieldModule, MatSelectModule, MatOptionModule } from '@angular/material';
|
import { MatFormFieldModule, MatSelectModule, MatOptionModule } from '@angular/material';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { ViewTaxGroupComponent } from './manage-tax-groups/view-tax-group/view-tax-group.component';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Products Module
|
* Products Module
|
||||||
@@ -149,7 +150,8 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|||||||
ViewTaxComponentComponent,
|
ViewTaxComponentComponent,
|
||||||
CreateTaxComponentComponent,
|
CreateTaxComponentComponent,
|
||||||
EditTaxComponentComponent,
|
EditTaxComponentComponent,
|
||||||
EditChargeComponent
|
EditChargeComponent,
|
||||||
|
ViewTaxGroupComponent
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
FloatingRatePeriodDialogComponent
|
FloatingRatePeriodDialogComponent
|
||||||
|
|||||||
@@ -193,6 +193,14 @@ export class ProductsService {
|
|||||||
return this.http.get('/taxes/group');
|
return this.http.get('/taxes/group');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} taxGroupId Tax Component ID of Tax Component.
|
||||||
|
* @returns {Observable<any>} Tax Component.
|
||||||
|
*/
|
||||||
|
getTaxGroup(taxGroupId: string): Observable<any> {
|
||||||
|
return this.http.get(`/taxes/group/${taxGroupId}`);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Observable<any>} Product mixes data
|
* @returns {Observable<any>} Product mixes data
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user