From cde8538473fba635738d0068343d6ba8338aca9b Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Fri, 4 Oct 2019 10:45:23 +0530 Subject: [PATCH] Fairoj : user-profile creation and filters modified --- ng8-seed/src/app/app.module.ts | 2 + ng8-seed/src/app/app.routing.ts | 6 + .../contribute/contribute.component.html | 67 +++--- .../contribute/contribute.component.scss | 7 + .../contribute/contribute.component.ts | 99 +++++++- .../app/components/login/login.component.ts | 2 + .../components/payment/payment.component.html | 4 +- .../components/payment/payment.component.ts | 2 +- .../project-detail.component.html | 103 ++++++++- .../project-detail.component.scss | 101 +++++++- .../project-detail.component.ts | 114 +++++++++- .../register/register-component.html | 33 ++- .../components/register/register.component.ts | 61 ++++- .../req-list/req-list.component.html | 35 +-- .../components/req-list/req-list.component.ts | 2 +- .../user-profile/user-profile.component.html | 215 ++++++++++++++++++ .../user-profile/user-profile.component.scss | 83 +++++++ .../user-profile.component.spec.ts | 25 ++ .../user-profile/user-profile.component.ts | 59 +++++ .../layouts/admin/admin-layout.component.html | 5 +- .../layouts/admin/admin-layout.component.ts | 46 +++- .../session/register/register-component.html | 17 +- .../session/register/register-component.scss | 4 + ng8-seed/src/app/session/session.module.ts | 6 +- ng8-seed/src/app/shared/api.service.ts | 23 +- .../app/shared/guards/auth-guard.service.ts | 7 +- ng8-seed/src/environments/environment.ts | 2 +- ng8-seed/src/main.ts | 1 + 28 files changed, 1031 insertions(+), 100 deletions(-) create mode 100644 ng8-seed/src/app/components/user-profile/user-profile.component.html create mode 100644 ng8-seed/src/app/components/user-profile/user-profile.component.scss create mode 100644 ng8-seed/src/app/components/user-profile/user-profile.component.spec.ts create mode 100644 ng8-seed/src/app/components/user-profile/user-profile.component.ts diff --git a/ng8-seed/src/app/app.module.ts b/ng8-seed/src/app/app.module.ts index 221c236..aa64f94 100644 --- a/ng8-seed/src/app/app.module.ts +++ b/ng8-seed/src/app/app.module.ts @@ -56,6 +56,7 @@ import {CookieService} from 'ngx-cookie-service' import { LoginComponent } from './components/login/login.component'; import { RegisterComponent } from './components/register/register.component'; import { ReqListComponent } from './components/req-list/req-list.component'; +import { UserProfileComponent } from './components/user-profile/user-profile.component'; export function HttpLoaderFactory(http: HttpClient) { @@ -85,6 +86,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { LoginComponent, RegisterComponent, ReqListComponent, + UserProfileComponent, // ProjectListComponent ], diff --git a/ng8-seed/src/app/app.routing.ts b/ng8-seed/src/app/app.routing.ts index 9b7f554..5661cae 100644 --- a/ng8-seed/src/app/app.routing.ts +++ b/ng8-seed/src/app/app.routing.ts @@ -11,6 +11,8 @@ import { MyAccountComponent } from './components/my-account/my-account.component import { AuthGuardService } from './shared/guards/auth-guard.service'; import { LoginComponent } from './components/login/login.component'; import { RegisterComponent } from './components/register/register.component'; +import { Component } from '@angular/core'; +import { UserProfileComponent } from './components/user-profile/user-profile.component'; export const AppRoutes: Routes = [{ path: '', redirectTo: 'home', @@ -54,6 +56,10 @@ export const AppRoutes: Routes = [{ { path:'register', component:RegisterComponent + }, + { + path:'user-profile', + component:UserProfileComponent } ] diff --git a/ng8-seed/src/app/components/contribute/contribute.component.html b/ng8-seed/src/app/components/contribute/contribute.component.html index a1af942..076e777 100644 --- a/ng8-seed/src/app/components/contribute/contribute.component.html +++ b/ng8-seed/src/app/components/contribute/contribute.component.html @@ -8,28 +8,28 @@
- + {{ item.district_name }} - + {{ item.school_name }} - + {{ item.cat_name }} - + {{ item.material_name }} @@ -50,15 +50,15 @@ - - + - - + + @@ -69,27 +69,36 @@ - - + + + + + + + + + + + - + - - + + - - + + @@ -134,22 +143,25 @@ - - -
Contribute to General Development Fund
-
-
+ + + + + + +

”Alone we can do so little, together we can do so much
- Hellen Keller”

+
Contribute to State School Development Fund
-
+
- + +
-
- State School Development Fund + - - + + +

”We make a living by what we get. But we make a life by what we give
- Winston Churchill”

diff --git a/ng8-seed/src/app/components/contribute/contribute.component.scss b/ng8-seed/src/app/components/contribute/contribute.component.scss index 394aaa7..24715e2 100644 --- a/ng8-seed/src/app/components/contribute/contribute.component.scss +++ b/ng8-seed/src/app/components/contribute/contribute.component.scss @@ -131,4 +131,11 @@ a { -moz-transform: translateX(-50%) translateY(-50%); -webkit-transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%); +} +.quote{ + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + font-size: 16px; + color:gray; + text-align: center; + font-style: italic; } \ No newline at end of file diff --git a/ng8-seed/src/app/components/contribute/contribute.component.ts b/ng8-seed/src/app/components/contribute/contribute.component.ts index 85694e4..2cded16 100644 --- a/ng8-seed/src/app/components/contribute/contribute.component.ts +++ b/ng8-seed/src/app/components/contribute/contribute.component.ts @@ -15,7 +15,7 @@ import { SchoolDetailsService } from 'app/shared/school-details.service'; }) export class ContributeComponent implements OnInit { - displayedColumns: string[] = ['Requirement', 'Item Need', 'School', 'Required Qty', 'Sponsor Qty', 'Cost Per Unit', 'Amount']; + displayedColumns: string[] = [ 'Item Need', 'School', 'Required Qty','Received Qty','balance Qty', 'Sponsor Qty', 'Cost Per Unit', 'Amount']; dataSource:any = new MatTableDataSource(); dataLength :number; @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator; @@ -34,6 +34,11 @@ export class ContributeComponent implements OnInit { gen_dev_fund_remarks:string general_devlop_amt:string=''; whole_contribute_list: any=[]; + all_filtered_list:any=[]; + all_category:any=[] + all_school:any=[]; + all_material_category:any=[] + all_district:any=[] constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router,private apiService:ApiService,public schInfo:SchoolDetailsService) { // Create 100 users @@ -59,17 +64,56 @@ export class ContributeComponent implements OnInit { sessionStorage.removeItem('contribute_final_total') this.initForm(); this.getSchoolReqList(); - this.getSchoolReqList2(); + // this.getSchoolReqList2(); this.schInfo.schReqId.subscribe(res=> { this.schRquId = res; - // console.log(res); + console.log("gfff",res); }) // window.localStorage.clear(); + this.filterValue() + } + filterValue(){ + this.apiService.getFilterMasters_get().subscribe(res=>{ + if(res['dataStatus']){ + this.all_filtered_list=res['records'] + this.district=this.all_filtered_list.map(val=>({district_name:val.district_name,district_id:val.district_id,school_id:val.school_id})) + // this.district = this.district.filter(function(elem, index, self) { + // console.log("dis",elem,index,self) + // return index === self.indexOf(elem.district_id); + // }) + this.district = this.district.filter((thing, index, self) => + index === self.findIndex((t) => ( + t.district_id === thing.district_id && t.district_name === thing.district_name + ))) + this.all_district=this.district + this.category=this.all_filtered_list.map(val=>({cat_name:val.cat_name,cad_id:val.cad_id,mat_id:val.mat_id})) + this.category=this.category.filter((thing,index,self)=> + index === self.findIndex((t)=>( + t.cat_name === thing.cat_name + ) + )) + this.all_category=this.category + this.school=this.all_filtered_list.map(val=>({school_name:val.school_name,school_id:val.school_id,district_id:val.district_id})) + this.school=this.school.filter((thing,index,self)=> + index === self.findIndex((t)=>( + t.school_name === thing.school_name && t.school_id === thing.school_id + ) + )) + this.all_school=this.school + this.school=[] + this.material_category=this.all_filtered_list.map(val=>({material_name:val.material_name,mat_id:val.mat_id,cad_id:val.cad_id})) + this.material_category=this.material_category.filter((thing,index,self)=> + index === self.findIndex((t)=>( + t.material_name === thing.material_name && t.mat_id === thing.mat_id + ) + )) + this.all_material_category=this.material_category + } + }) } - initForm() { @@ -81,6 +125,18 @@ export class ContributeComponent implements OnInit { mat_id: new FormControl('') }) } + changeFilterOption(value,option){ + console.log(value,option) + if(option == 'district'){ + // this.district=[]; + this.school=this.all_school.filter(val=>val.district_id == value ) + } + else{ + if(option == 'category'){ + this.material_category=this.all_material_category.filter(val=>val.cad_id == value) + } + } + } getSchoolReqList() { @@ -107,13 +163,13 @@ export class ContributeComponent implements OnInit { store=sessionStorage.getItem('contribute') store=JSON.parse(store) console.log(store) - if(store.records){ + // if(store.records){ // if(store.records.contributions){ // let indexes = Object.keys(store.records.contributions) // console.log(indexes) // // this.sponsor_qty[] // } - } + // } // console.log(this.material_category); // this.dataSource.data = schDet.records.map((val, i)=>{ @@ -125,14 +181,30 @@ export class ContributeComponent implements OnInit { }) } somethingChanged(e,i,item,mat_id,curr_data){ - console.log(curr_data.school_req_id) + + let bal_qty=curr_data.qty-curr_data.received_qty + if(e > bal_qty){ + alert("Given value is greater than Balance Qty") + if(this.finalData.length > 0){ + this.finalData=this.finalData.filter(val=>{ + return val.req_id!=curr_data.school_req_id + }) + this.whole_contribute_list=this.whole_contribute_list.filter(val=>val.school_req_id != curr_data.school_req_id) + // console.log(this.finalData); + } + this.sponsor_qty[i]='' + this.Total[i]='' + // console.log(this.finalData) + return + } + // console.log(this.finalData); // console.log(e,i,item); this.Total[i] = e*item; let data = { 'id':'', 'cont_id':'', 'qty': e, - 'amount' : item, + 'amount' : item*e, 'req_id': curr_data.school_req_id, 'school_id':curr_data.school_id, 'dist_id':curr_data.district_id @@ -158,7 +230,14 @@ export class ContributeComponent implements OnInit { } - + dev_fund_change(value){ + if(value != ''){ + if(value<=0){ + alert('Given value is Invalid'); + this.general_devlop_amt='' + } + } + } getSchoolReqList2() { @@ -207,6 +286,8 @@ export class ContributeComponent implements OnInit { reset(){ this.Contribute.reset(); + this.school=[] + this.material_category=this.all_material_category } ngAfterViewInit() { diff --git a/ng8-seed/src/app/components/login/login.component.ts b/ng8-seed/src/app/components/login/login.component.ts index e2bbe61..b6fff4e 100644 --- a/ng8-seed/src/app/components/login/login.component.ts +++ b/ng8-seed/src/app/components/login/login.component.ts @@ -6,6 +6,7 @@ import { ApiService } from 'app/shared/api.service'; import { Location } from "@angular/common"; import { MatDialog } from '@angular/material'; import { RegisterComponent } from '../register/register.component'; +import { AdminLayoutComponent } from 'app/layouts/admin/admin-layout.component'; @Component({ selector: 'ms-login-session', @@ -71,6 +72,7 @@ this.previousUrl = this.restApi.getPreviousUrl(); // this.router.navigate(['/home']); // this.matDialog.closeAll() this.matDialog.closeAll() + // this.adminLayout.ngOnInit(); }else{ // this.router.navigate([this.previousUrl]); // this.location.back(); diff --git a/ng8-seed/src/app/components/payment/payment.component.html b/ng8-seed/src/app/components/payment/payment.component.html index 0611f31..570ffc4 100644 --- a/ng8-seed/src/app/components/payment/payment.component.html +++ b/ng8-seed/src/app/components/payment/payment.component.html @@ -48,8 +48,8 @@

₹ {{grand_tot_value}}


- Online  - Offline + Online  + Offline diff --git a/ng8-seed/src/app/components/payment/payment.component.ts b/ng8-seed/src/app/components/payment/payment.component.ts index a3c7884..4dff566 100644 --- a/ng8-seed/src/app/components/payment/payment.component.ts +++ b/ng8-seed/src/app/components/payment/payment.component.ts @@ -47,7 +47,7 @@ export class PaymentComponent implements OnInit { contribute_type: any; contributeKind: FormGroup; contribute_params: any; - payment_mode:any='offline'; + payment_mode:any="2"; //1-online 2-offline maxDate=new Date() constructor(public restApi:ApiService,public fb:FormBuilder,public router:Router,private apiService:ApiService) { this.isToken(); diff --git a/ng8-seed/src/app/components/project-detail/project-detail.component.html b/ng8-seed/src/app/components/project-detail/project-detail.component.html index 1a1c65a..7795d61 100644 --- a/ng8-seed/src/app/components/project-detail/project-detail.component.html +++ b/ng8-seed/src/app/components/project-detail/project-detail.component.html @@ -162,24 +162,26 @@

Requirements

- - - Requirement Details + + +
- + + - + - + +
Requirement Item Need {{row.material_name}} Item Needed {{row.material_name}} Required Qty {{row.qty}} Required Qty {{row.qty}} Received Qty {{row.received_qty}} Balance Qty {{row.qty-row.received_qty <= 0 ? '' : row.qty-row.received_qty }} Sponsor Qty Sponsored Qty Cost Per Unit (in Rs) {{row.cost_per_unit === null?0:row.cost_per_unit}} Cost Per Unit (in Rs) {{row.cost_per_unit === null?0:row.cost_per_unit}} Amount (in Rs) {{Total[i]}} Amount
(in Rs)
{{Total[i]}} Material NameCost Per unit QtyDescription
{{item.material_name}}{{item.cost_per_unit}} {{item.qty}}{{item.desc}}
@@ -188,8 +190,89 @@
- - + --> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Item Needed{{row.material_name}} Description {{row.desc}} Required Qty {{row.qty}} Received Qty {{row.received_qty}} Balance Qty {{row.qty-row.received_qty <= 0 ? '' : row.qty-row.received_qty }} Sponsored Qty Cost Per Unit
(in Rs)
{{row.cost_per_unit === null?0:row.cost_per_unit}} Amount (in Rs) {{Total[i]}}
+
+
+ + + + + +
Total {{grandTotal}}
+
+
+ + +
+ + +
+
+ - + - + + + + + +
Password & Confirm Password does not match.


+ - - Requirement - School Img - + - Item Need - {{row.material_name}} - + Item Needed + {{row.material_name}} + @@ -24,23 +24,32 @@ {{row.qty}} + + Received Qty + {{row.received_qty}} + + + Balance Qty + {{row.qty-row.received_qty <= 0 ? '' : row.qty-row.received_qty }} + + - Sponsor Qty - {{row.sponsor_qty}} + Sponsor Qty + {{row.sponsor_qty}} - Cost Per Unit (in RS) - {{row.cost_per_unit === null ? 0 : row.cost_per_unit}} + Cost Per Unit
(in Rs) + {{row.cost_per_unit === null ? 0 : row.cost_per_unit}}
- Amount (in RS) - {{row.amount}} + Amount (in Rs) + {{row.amount}} diff --git a/ng8-seed/src/app/components/req-list/req-list.component.ts b/ng8-seed/src/app/components/req-list/req-list.component.ts index 2d4984a..a3e01ed 100644 --- a/ng8-seed/src/app/components/req-list/req-list.component.ts +++ b/ng8-seed/src/app/components/req-list/req-list.component.ts @@ -12,7 +12,7 @@ export class ReqListComponent implements OnInit { @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator; @ViewChild(MatSort, {static: true}) sort: MatSort; pageSize = 10; - displayedColumns: string[] = ['Requirement', 'Item Need', 'School', 'Required Qty', 'Sponsor Qty', 'Cost Per Unit', 'Amount']; + displayedColumns: string[] = [ 'Item Need', 'School', 'Required Qty', 'Received Qty', 'balance Qty','Sponsor Qty', 'Cost Per Unit', 'Amount']; constructor() { } diff --git a/ng8-seed/src/app/components/user-profile/user-profile.component.html b/ng8-seed/src/app/components/user-profile/user-profile.component.html new file mode 100644 index 0000000..1e0663c --- /dev/null +++ b/ng8-seed/src/app/components/user-profile/user-profile.component.html @@ -0,0 +1,215 @@ + + + + +
+ + + +
+ My Profile + +
+
+ + + +
+ +
+
+
+ +
+ \ No newline at end of file diff --git a/ng8-seed/src/app/components/user-profile/user-profile.component.scss b/ng8-seed/src/app/components/user-profile/user-profile.component.scss new file mode 100644 index 0000000..3252e77 --- /dev/null +++ b/ng8-seed/src/app/components/user-profile/user-profile.component.scss @@ -0,0 +1,83 @@ +.tab-group{ + color:white; + background-color: white +} +/* active tab */ +// ::ng-deep .mat-tab-list .mat-tab-labels .mat-tab-label-active { +// color:white; +// // background-color:; +// // background-color:white +// } +// ::ng-deep .mat-tab-list .mat-tab-labels .mat-tab-label-inactive { +// color:white; +// // background-color:; +// // background-color:white +// } +// .mat-tab-label{ +// color:white; +// } + + + /* ink bar */ + ::ng-deep .mat-ink-bar { + background-color: var(--primary-color,rgb(9, 184, 184)) !important; + } + .card_contribution{ + // border: 2px solid gray; + // color: bisque; + box-shadow: 10px solid gray; + } + // .cell{ + // display:inline !important; + // } + // .cellhide{ + // display: none !important; + // } + // .cell { + // padding: 20px 20px 20px 20; + // } + // .mat-table { + // overflow: auto; + // max-height: 500px; + // width: 100%; + // } + // .tab-group{ + // width: 100%; + // } + table { + width: 100%; + table-layout: fixed; + } + + + th, td { + overflow: hidden; + width: 200px; + text-overflow: ellipsis; + white-space: nowrap; + } + .element-row { + position: relative; + } + + .element-row:not(.expanded) { + cursor: pointer; + } + + .element-row:not(.expanded):hover { + background: #f5f5f5; + } + + .element-row.expanded { + border-bottom-color: transparent; + } + .child_card{ + color:black; + font-size: 16px; + // background-color: bisque; + padding-left: 55px; + margin: 15px; + } + .detail_row{ + background-color: blue; + } \ No newline at end of file diff --git a/ng8-seed/src/app/components/user-profile/user-profile.component.spec.ts b/ng8-seed/src/app/components/user-profile/user-profile.component.spec.ts new file mode 100644 index 0000000..e683b96 --- /dev/null +++ b/ng8-seed/src/app/components/user-profile/user-profile.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserProfileComponent } from './user-profile.component'; + +describe('UserProfileComponent', () => { + let component: UserProfileComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UserProfileComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UserProfileComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng8-seed/src/app/components/user-profile/user-profile.component.ts b/ng8-seed/src/app/components/user-profile/user-profile.component.ts new file mode 100644 index 0000000..cc7d8a7 --- /dev/null +++ b/ng8-seed/src/app/components/user-profile/user-profile.component.ts @@ -0,0 +1,59 @@ +import { Component, OnInit } from '@angular/core'; +import { ApiService } from 'app/shared/api.service'; +import { FormGroup, FormBuilder } from '@angular/forms'; +import {animate, state, style, transition, trigger} from '@angular/animations'; +import { MatTableDataSource } from '@angular/material'; + +@Component({ + selector: 'app-user-profile', + templateUrl: './user-profile.component.html', + styleUrls: ['./user-profile.component.scss'], + animations: [ + trigger('detailExpand', [ + state('collapsed', style({height: '0px', minHeight: '0', display: 'none'})), + state('expanded', style({height: '*'})), + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')), + ]), + ], +}) +export class UserProfileComponent implements OnInit { + profile_form:FormGroup; + user_data:any; + contribution_data:any=[]; + displayedColumns=['Date','contribute_type','payment_mode','payment_ref','tot_amount'] + public dataSource = new MatTableDataSource(); + isExpansionDetailRow = (i: number, row: Object) => row.hasOwnProperty('detailRow'); + expandedElement: any + + constructor(private apiService:ApiService,private _fb:FormBuilder) { } + + ngOnInit() { + this.getProfile() + this.profile_form=this._fb.group({ + name:['',{disabled:true}], + email:['',{disabled:true}], + mobile:['',{disabled:true}], + profile_share:['',{disabled:true}], + notify_pref:['',{disable:true}] + }) + } + getProfile(){ + this.apiService.getMyProfile().subscribe(res=>{ + if(res['dataStatus']){ + this.user_data=res['records'].user_data[0]; + this.profile_form.patchValue(this.user_data) + this.contribution_data=res['records'].contribution_data + this.contribution_data.forEach(element=>{ + element.detailRow=true; + }) + console.log("con",this.contribution_data,this.isExpansionDetailRow); + this.dataSource=this.contribution_data; + } + }) + } + changeFun(value,index){ + console.log(value); + + } + +} diff --git a/ng8-seed/src/app/layouts/admin/admin-layout.component.html b/ng8-seed/src/app/layouts/admin/admin-layout.component.html index bec633d..c14ddd7 100644 --- a/ng8-seed/src/app/layouts/admin/admin-layout.component.html +++ b/ng8-seed/src/app/layouts/admin/admin-layout.component.html @@ -97,7 +97,7 @@ diff --git a/ng8-seed/src/app/layouts/admin/admin-layout.component.ts b/ng8-seed/src/app/layouts/admin/admin-layout.component.ts index c6bb297..b909931 100644 --- a/ng8-seed/src/app/layouts/admin/admin-layout.component.ts +++ b/ng8-seed/src/app/layouts/admin/admin-layout.component.ts @@ -10,6 +10,8 @@ import PerfectScrollbar from 'perfect-scrollbar'; import { PerfectScrollbarConfigInterface, PerfectScrollbarComponent, PerfectScrollbarDirective } from 'ngx-perfect-scrollbar'; import { ApiService } from 'app/shared/api.service'; +import { MatDialogConfig, DialogRole, MatDialogRef, MatDialog } from '@angular/material'; +import { LoginComponent } from 'app/components/login/login.component'; @Component({ selector: 'app-layout-admin', @@ -39,7 +41,9 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { @ViewChild('sidemenu', { static: true }) sidemenu; public config: PerfectScrollbarConfigInterface = {}; user_name:any=''; - constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,private apiService:ApiService ) { + constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,private apiService:ApiService + ,private matDialog:MatDialog ) { + apiService.getLoggedInName.subscribe(name => this.changeName(name)); const browserLang: string = translate.getBrowserLang(); translate.use(browserLang.match(/en|fr/) ? browserLang : 'en'); } @@ -71,6 +75,10 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { } }); } + changeName(value){ + console.log("admin",value) + this.user_name=value + } @HostListener('click', ['$event']) onClick(e: any) { @@ -221,4 +229,40 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { }, 16); } // } + signOut(){ + this.apiService.signOut() + this.router.navigateByUrl('/') + } + + // [routerLink]="['/'+menuitem.state]" + navRedirection(menuitem){ + console.log(menuitem,this.user_name) + if(menuitem.state == 'authentication'){ + if(this.user_name != ''){ + // return + this.router.navigateByUrl('/user-profile') + } + else{ + // this.router.navigateByUrl('/'+menuitem.state) + this.loginScreen() + } + } + else{ + this.router.navigateByUrl('/'+menuitem.state) + } + } + loginScreen(){ + // this.dialog_ref.close(); + const dialogConfig = new MatDialogConfig(); + + dialogConfig.disableClose = true; + dialogConfig.autoFocus = true; + this.matDialog.open(LoginComponent,{ + height: '450px', + width: '400px', + panelClass: 'custom-modalbox', + + }) + + } } diff --git a/ng8-seed/src/app/session/register/register-component.html b/ng8-seed/src/app/session/register/register-component.html index 456fc1e..7989dd9 100644 --- a/ng8-seed/src/app/session/register/register-component.html +++ b/ng8-seed/src/app/session/register/register-component.html @@ -55,21 +55,24 @@
- +
- Conscent profile share to public - + I hereby give my consent to share my profile with public

+   + I hereby give my consent to receive updates on various requirements and progress, through email or other modes + +