From 375af650ec45a4e5608b1e98dd655733f4080d1a Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Mon, 22 Oct 2018 17:12:33 +0530 Subject: [PATCH] entity master pages created - kdk --- .../entity-edit-billing-info.component.html | 6 ++ .../entity-edit-billing-info.component.scss | 0 ...entity-edit-billing-info.component.spec.ts | 25 ++++++ .../entity-edit-billing-info.component.ts | 16 ++++ .../entity-edit-price.component.html | 3 + .../entity-edit-price.component.scss | 0 .../entity-edit-price.component.spec.ts | 25 ++++++ .../entity-edit-price.component.ts | 15 ++++ .../entity-edit-region.component.html | 3 + .../entity-edit-region.component.scss | 0 .../entity-edit-region.component.spec.ts | 25 ++++++ .../entity-edit-region.component.ts | 15 ++++ .../entity-edit-tat.component.html | 3 + .../entity-edit-tat.component.scss | 0 .../entity-edit-tat.component.spec.ts | 25 ++++++ .../entity-edit-tat.component.ts | 15 ++++ .../entity-edit/entity.edit.component.html | 83 ++++++++++++++----- .../entity-edit/entity.edit.component.ts | 19 ++++- .../entity-list/entity.list.component.html | 51 ++++-------- .../entity-list/entity.list.component.ts | 11 +++ .../src/app/settings/entity/entity.module.ts | 15 +++- .../src/app/settings/entity/entity.routing.ts | 20 +++-- 22 files changed, 305 insertions(+), 70 deletions(-) create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.html create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.scss create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.spec.ts create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.ts create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.html create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.scss create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.spec.ts create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.ts create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.scss create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.spec.ts create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.ts create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.html create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.scss create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.spec.ts create mode 100644 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.ts diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.html new file mode 100644 index 000000000..16157a9cb --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.html @@ -0,0 +1,6 @@ +

+ entity-edit-billing-info works! + +

+ +

{{ entityId }}

diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.scss b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.spec.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.spec.ts new file mode 100644 index 000000000..11034b792 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EntityEditBillingInfoComponent } from './entity-edit-billing-info.component'; + +describe('EntityEditBillingInfoComponent', () => { + let component: EntityEditBillingInfoComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EntityEditBillingInfoComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EntityEditBillingInfoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.ts new file mode 100644 index 000000000..79c7bedc9 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-billing-info/entity-edit-billing-info.component.ts @@ -0,0 +1,16 @@ +import { Component, OnInit, Input } from '@angular/core'; + +@Component({ + selector: 'app-entity-edit-billing-info', + templateUrl: './entity-edit-billing-info.component.html', + styleUrls: ['./entity-edit-billing-info.component.scss'] +}) +export class EntityEditBillingInfoComponent implements OnInit { + + @Input() entityId: number; + constructor() { } + + ngOnInit() { + } + +} diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.html new file mode 100644 index 000000000..47e0d6690 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.html @@ -0,0 +1,3 @@ +

+ entity-edit-price works! +

diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.scss b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.spec.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.spec.ts new file mode 100644 index 000000000..dc32d5d17 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EntityEditPriceComponent } from './entity-edit-price.component'; + +describe('EntityEditPriceComponent', () => { + let component: EntityEditPriceComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EntityEditPriceComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EntityEditPriceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.ts new file mode 100644 index 000000000..68b8670ae --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-price/entity-edit-price.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-entity-edit-price', + templateUrl: './entity-edit-price.component.html', + styleUrls: ['./entity-edit-price.component.scss'] +}) +export class EntityEditPriceComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html new file mode 100644 index 000000000..5b1bea794 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.html @@ -0,0 +1,3 @@ +

+ entity-edit-region works! +

diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.scss b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.spec.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.spec.ts new file mode 100644 index 000000000..2b244003a --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EntityEditRegionComponent } from './entity-edit-region.component'; + +describe('EntityEditRegionComponent', () => { + let component: EntityEditRegionComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EntityEditRegionComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EntityEditRegionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.ts new file mode 100644 index 000000000..689d0f944 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-region/entity-edit-region.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-entity-edit-region', + templateUrl: './entity-edit-region.component.html', + styleUrls: ['./entity-edit-region.component.scss'] +}) +export class EntityEditRegionComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.html new file mode 100644 index 000000000..1db862867 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.html @@ -0,0 +1,3 @@ +

+ entity-edit-tat works! +

diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.scss b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.spec.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.spec.ts new file mode 100644 index 000000000..f769725ae --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EntityEditTatComponent } from './entity-edit-tat.component'; + +describe('EntityEditTatComponent', () => { + let component: EntityEditTatComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EntityEditTatComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EntityEditTatComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.ts new file mode 100644 index 000000000..a685b4348 --- /dev/null +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-tat.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-entity-edit-tat', + templateUrl: './entity-edit-tat.component.html', + styleUrls: ['./entity-edit-tat.component.scss'] +}) +export class EntityEditTatComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html index fa3cb8bf2..394b8c23e 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html @@ -1,4 +1,4 @@ -
+ -
+
@@ -70,12 +69,10 @@ - - + - - + You must Include Pincode. @@ -91,8 +88,7 @@ - - + @@ -101,7 +97,6 @@ -
@@ -148,17 +143,14 @@
- - - + - - +
@@ -177,18 +169,63 @@
- -
- - +--> + + + +
+ +
+ +
Template Name
+
+ +
+
+
+ + + You must Include Template Name. + +
+ + +
+
+
+
+
No Template Name Found.
+
+ + + + + + + + + + + + +
+ diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.ts b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.ts index 750cd6fbe..d7ae61195 100644 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.ts +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit, + OnDestroy, Inject, ViewChild, Input @@ -13,6 +14,7 @@ import { Validators, FormArray, } from '@angular/forms'; +import { ActivatedRoute, Router } from '@angular/router'; import { NotifierService } from 'angular-notifier'; @@ -29,10 +31,11 @@ import { EntityListComponent } from './../entity-list/entity.list.component'; templateUrl: './entity.edit.component.html', // styleUrls: ['./edit.component.scss'] }) -export class EntityEditComponent implements OnInit{ +export class EntityEditComponent implements OnInit, OnDestroy{ @Input() public childMessage: any; +public entity_id: number; public pageTitle: string = "Entity"; public subTitle1: string = "Tax Info"; public subTitle2: string = "Contacts"; @@ -51,11 +54,14 @@ public pageTitle: string = "Entity"; constructor( notifier: NotifierService, + private route: ActivatedRoute, + private router: Router, private _formBuilder: FormBuilder, private masterService: MastersService, private entityService: EntityService, private entityListComponent: EntityListComponent) { this.notifier = notifier; + this.entity_id = this.route.snapshot.params['entity-id']; } @@ -212,6 +218,11 @@ public pageTitle: string = "Entity"; // this.dialogRef.close(); } + backToList(){ + this.entityListComponent.showListView(true); + this.router.navigate([ '../../' ], { relativeTo: this.route }); + } + /** To Save/Edited Popup Data */ onSubmit() { this.submitted = true; @@ -250,4 +261,10 @@ public pageTitle: string = "Entity"; this.loadFormData(); this.loadAnsData(); } + + ngOnDestroy(): void { + //Called once, before the instance is destroyed. + //Add 'implements OnDestroy' to the class. + this.entityListComponent.showListView(true); + } } diff --git a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html index ade078062..1c62c2af2 100644 --- a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html +++ b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.html @@ -1,42 +1,16 @@
- - -
-
Entity Master
- -
-
-
-
- -
-
- - - - - -
-
- - - +
+ +
+
@@ -80,5 +54,10 @@
+ + +
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts index e34f12324..fd02b8785 100644 --- a/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts +++ b/ng6-seed/src/app/settings/entity/entity-list/entity.list.component.ts @@ -51,6 +51,7 @@ export class EntityListComponent implements OnInit { constructor(private dialog: MatDialog, private masterService: MastersService, private _formBuilder: FormBuilder, + private route: ActivatedRoute, private router: Router, private entityService: EntityService) { // this.filterFormGroupCtrl = this._formBuilder.group({ @@ -135,6 +136,16 @@ export class EntityListComponent implements OnInit { this.listView = false; } + goToEdit(template_id : number){ + this.router.navigate([ '../list/edit', template_id ], { relativeTo: this.route }); + this.listView = false; + } + + showListView(status: boolean){ + // alert(2); + this.listView = status; + } + changeListView(){ this.getEntityListMasters(); this.listView = true; diff --git a/ng6-seed/src/app/settings/entity/entity.module.ts b/ng6-seed/src/app/settings/entity/entity.module.ts index 3f69b4893..1a6e67afe 100644 --- a/ng6-seed/src/app/settings/entity/entity.module.ts +++ b/ng6-seed/src/app/settings/entity/entity.module.ts @@ -12,7 +12,8 @@ import { MatProgressBarModule,MatDialogModule, MatSortModule, MatToolbarModule,MatSelectModule, MatListModule, MatMenuModule, - MatCheckboxModule + MatCheckboxModule,MatTabsModule, + MatExpansionModule } from '@angular/material'; import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @@ -26,6 +27,10 @@ import { EntityAddComponent } from './entity-add/entity.add.component'; import { EntityEditComponent } from './entity-edit/entity.edit.component'; import { EntityService } from './../service/entity/entity.service'; +import { EntityEditRegionComponent } from './entity-edit/entity-edit-region/entity-edit-region.component'; +import { EntityEditTatComponent } from './entity-edit/entity-edit-tat/entity-edit-tat.component'; +import { EntityEditPriceComponent } from './entity-edit/entity-edit-price/entity-edit-price.component'; +import { EntityEditBillingInfoComponent } from './entity-edit/entity-edit-billing-info/entity-edit-billing-info.component'; /** * Custom angular notifier options */ @@ -83,6 +88,8 @@ const customNotifierOptions: NotifierOptions = { MatProgressBarModule,MatDialogModule, MatSortModule, MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule, MatCheckboxModule, + MatTabsModule, + MatExpansionModule, MatSlideToggleModule, FormsModule, ReactiveFormsModule @@ -91,7 +98,11 @@ const customNotifierOptions: NotifierOptions = { EntityComponent, EntityListComponent, EntityEditComponent, - EntityAddComponent + EntityAddComponent, + EntityEditRegionComponent, + EntityEditTatComponent, + EntityEditPriceComponent, + EntityEditBillingInfoComponent ], entryComponents: [ // EntityEditComponent diff --git a/ng6-seed/src/app/settings/entity/entity.routing.ts b/ng6-seed/src/app/settings/entity/entity.routing.ts index 6d7435820..dd088e903 100644 --- a/ng6-seed/src/app/settings/entity/entity.routing.ts +++ b/ng6-seed/src/app/settings/entity/entity.routing.ts @@ -19,15 +19,19 @@ const routes: Routes = [ { path: 'list', component: EntityListComponent, + children: [{ + path: 'edit/:entity-id', + component: EntityEditComponent, + }] }, - { - path: 'add', - component: EntityAddComponent, - }, - { - path: 'edit', - component: EntityEditComponent, - } + // { + // path: 'add', + // component: EntityAddComponent, + // }, + // { + // path: 'edit', + // component: EntityEditComponent, + // } ] } ];