diff --git a/ng6-seed/src/app/AwsService/aws.service.ts b/ng6-seed/src/app/AwsService/aws.service.ts index 7dc62d00e..2c4e60386 100755 --- a/ng6-seed/src/app/AwsService/aws.service.ts +++ b/ng6-seed/src/app/AwsService/aws.service.ts @@ -393,14 +393,14 @@ export class AwsService { if (userData.type.entity_type_id == 1) { params = { - GroupName: role.value /* required */, + GroupName: role.GroupName /* required */, UserPoolId: sineedgedev_poolData.UserPoolId,//"ap-south-1_y7dt3iEaX" /* required */, Username: cognitodata.User.Username //'539bfefa-ae42-4bee-bf79-4b15d1a2af7f' /* required */ }; } else if (userData.type.entity_type_id == 2) { params = { - GroupName: role.value /* required */, + GroupName: role.GroupName /* required */, UserPoolId: lender_poolData.UserPoolId,//"ap-south-1_y7dt3iEaX" /* required */, Username: cognitodata.User.Username //'539bfefa-ae42-4bee-bf79-4b15d1a2af7f' /* required */ }; @@ -435,14 +435,14 @@ export class AwsService { if (userData.fk_entity_id == 1) { params = { - GroupName: cognitodata.value /* required */, + GroupName: cognitodata.GroupName /* required */, UserPoolId: sineedgedev_poolData.UserPoolId,//"ap-south-1_y7dt3iEaX" /* required */, Username: userData.aws_name //'539bfefa-ae42-4bee-bf79-4b15d1a2af7f' /* required */ }; } else if (userData.fk_entity_id == 2) { params = { - GroupName: cognitodata.value /* required */, + GroupName: cognitodata.GroupName /* required */, UserPoolId: lender_poolData.UserPoolId,//"ap-south-1_y7dt3iEaX" /* required */, Username: userData.aws_name //'539bfefa-ae42-4bee-bf79-4b15d1a2af7f' /* required */ }; @@ -494,7 +494,13 @@ export class AwsService { { Name: 'locale', /* required */ Value: cognitosdata.toString() - }, + },{ + Name:"email_verified", + Value:"true" + },{ + Name:"phone_number_verified", + Value:"true" + } /* more items */ ], UserPoolId: sineedgedev_poolData.UserPoolId, /* required */ @@ -506,7 +512,13 @@ export class AwsService { { Name: 'locale', /* required */ Value: cognitosdata.toString() - }, + },{ + Name:"email_verified", + Value:"true" + },{ + Name:"phone_number_verified", + Value:"true" + } /* more items */ ], UserPoolId: lender_poolData.UserPoolId, /* required */ @@ -598,11 +610,20 @@ adminremoveGroup(roles,users){ let session:any = this.shared.getAccessToken() ||""; this.getconfig(); - var params = { - GroupName: roles.value, /* required */ + let params:any; + if(users.fk_entity_id ==1){ + params = { + GroupName: roles.GroupName, /* required */ UserPoolId: sineedgedev_poolData.UserPoolId, /* required */ Username: users.aws_name//'2c64866e-e96f-453b-903f-2b6f831688af' /* required */ }; +}else if(users.fk_entity_id ==2){ + params = { + GroupName: roles.GroupName, /* required */ + UserPoolId: lender_poolData.UserPoolId, /* required */ + Username: users.aws_name//'2c64866e-e96f-453b-903f-2b6f831688af' /* required */ + }; +} let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider(); cognitoidentityserviceprovider.adminRemoveUserFromGroup(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred @@ -610,4 +631,104 @@ adminremoveGroup(roles,users){ }); } } + +adminresetpassword(awsuser){ + this.getconfig(); + let params:any; + if(awsuser.fk_entity_id ==1){ + params= { + UserPoolId: sineedgedev_poolData.UserPoolId, /* required */ + Username: awsuser.email /* required */ + }; +}else if(awsuser.fk_entity_id ==2){ + params= { + UserPoolId: lender_poolData.UserPoolId, /* required */ + Username: awsuser.email /* required */ + }; +} + return Observable.create(observe=>{ + let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider(); + cognitoidentityserviceprovider.changePassword(params, function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else { console.log(data); + observe.next(data); + } // successful response + }); +}); +} + +changepassword(passData) { + let session:any = this.shared.getAccessToken() || ""; + console.log(session); + this.getconfig(); + var params = { + AccessToken: session.accessToken.jwtToken, /* required */ + PreviousPassword: passData.oldPassword, /* required */ + ProposedPassword: passData.newPassword /* required */ + }; + return Observable.create(observe => { + let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider(); + cognitoidentityserviceprovider.changePassword(params, function (err, data) { + if (err) console.log(err, err.stack); // an error occurred + console.log(data); + observe.next(data); + // successful response + }); + }) +} + +admindelete(aws){ + this.getconfig(); + let params:any; + if(aws.fk_entity_id ==1){ + params= { + UserPoolId: sineedgedev_poolData.UserPoolId, /* required */ + Username: aws.email /* required */ + }; +}else if(aws.fk_entity_id ==2){ + params= { + UserPoolId: lender_poolData.UserPoolId, /* required */ + Username: aws.email /* required */ + }; +} + return Observable.create(observe=>{ + let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider(); + cognitoidentityserviceprovider.adminDeleteUser(params, function(err, data) { + if (err) console.log(err, err.stack); // an error occurred + else { console.log(data); + observe.next(data); + } // successful response + }); +}); +} + +adminlistgroup(enitiy){ + // console.log(enitiy); + this.getconfig(); + let params:any; + if(enitiy ==1){ + params = { + UserPoolId:sineedgedev_poolData.UserPoolId, + } + }else if(enitiy ==2){ + params = { + UserPoolId:lender_poolData.UserPoolId + } + } + //console.log(enitiy); + return Observable.create(observe=>{ + + let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider(); + cognitoidentityserviceprovider.listGroups(params,function(err,data){ + if(err) alert(err.stack); + else {console.log(data);observe.next(data.Groups);} + }) +}); + +} +// waiting for image api +getpicurl(userid){ + let users = {'userid':userid} + return this.http.post(apiurl+'getSingedProfilePicURL',users); +} } diff --git a/ng6-seed/src/app/app.module.ts b/ng6-seed/src/app/app.module.ts index d57b29fcc..2bd1fbecb 100644 --- a/ng6-seed/src/app/app.module.ts +++ b/ng6-seed/src/app/app.module.ts @@ -30,6 +30,7 @@ import {MatCheckboxModule} from '@angular/material/checkbox'; import {MatProgressBarModule} from '@angular/material/progress-bar'; import {MatSelectModule} from '@angular/material/select'; import {MatCardModule} from '@angular/material/card'; +import { ChangePasswordDialog } from './settings/users/' import { AppRoutes } from './app.routing'; import { AppComponent } from './app.component'; @@ -56,7 +57,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { AppComponent, AdminLayoutComponent, AuthLayoutComponent, - NewPasswordDialog,ForgotPass + NewPasswordDialog,ForgotPass,ChangePasswordDialog ], imports: [ BrowserModule, @@ -104,7 +105,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { multi: true } ], - entryComponents: [NewPasswordDialog,ForgotPass], + entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/ng6-seed/src/app/layouts/admin/admin-layout.component.html b/ng6-seed/src/app/layouts/admin/admin-layout.component.html index 476f1b3b9..a68a4595b 100644 --- a/ng6-seed/src/app/layouts/admin/admin-layout.component.html +++ b/ng6-seed/src/app/layouts/admin/admin-layout.component.html @@ -1,528 +1,529 @@
- - - -
-
- -
-
- -
-
- -
-
- + + + -
- - - - - - -
- Message Menu -
- - - - -
- - -
- User Menu -
- - - -
- - - -
- Settings -
- - - - -
-
- - -
- -
- - - - Today -
- - -
-

{{ today | date:'EEEE' }}

-
{{ today | date:'dd' }} {{ today | date:'MMMM' }}
-
-
-
- - -

Projects Stats

- -

Project A

- -
- -

Project B

- -
- -

Project C

- -
- -

Todo

- - Consectetur adipisicing elit. Nemo omnis. -

2:45PM

-
- - Temporibus cumque cupiditate -

3:20PM

-
- - Libero voluptatibus harum quis accusamus -

16:00PM

-
-
-
-
- - Notifications -
- - - people -

Social

-

5 new members joined today

-
- - local_offer -

Promotions

-

Updated your email -

-
- - info -

Updates

-

15 new product added

-
- - delete_sweep -

2 order cancelled

- {{ 1427207139000 | date: 'fullDate' }} -
- - check_circle -

System Scan completed

- {{ 1427412725000 | date: 'fullDate' }} -
- - person_add -

4 Users connected

- {{ 1428275520000 | date: 'fullDate' }} -
-
-
-
-
-
-
- - - - - Options - - - - Sidebar Image -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
-
-
- Sidebar Image -
- Sidebar Color - - -
- - Red -
- -
- - Pink -
-
- - Blue -
- - - -
-
- Header Color - - -
- - Red -
- -
- - Pink -
-
- - Blue -
- - - -
-
- Horizontal Menu
-
- Collapsed Sidebar -
-
- Compact Sidebar -
-
- Boxed Layout -
-
- Dark Mode -
-
- RTL -
-
- - - {{ lang }} - - -
-
-
- -
- +
+ + +
+
+ +
+
+ +
+
+ +
+
+
+ + + + + + +
+ Message Menu +
+ + + + +
+ + +
+ User Menu +
+ + + +
+ + + +
+ Settings +
+ + + + +
+
+
+ +
+ +
+ + + + Today +
+ + +
+

{{ today | date:'EEEE' }}

+
{{ today | date:'dd' }} {{ today | date:'MMMM' }}
+
+
+
+ + +

Projects Stats

+ +

Project A

+ +
+ +

Project B

+ +
+ +

Project C

+ +
+ +

Todo

+ + Consectetur adipisicing elit. Nemo omnis. +

2:45PM

+
+ + Temporibus cumque cupiditate +

3:20PM

+
+ + Libero voluptatibus harum quis accusamus +

16:00PM

+
+
+
+
+ + Notifications +
+ + + people +

Social

+

5 new members joined today

+
+ + local_offer +

Promotions

+

Updated your email +

+
+ + info +

Updates

+

15 new product added

+
+ + delete_sweep +

2 order cancelled

+ {{ 1427207139000 | date: 'fullDate' }} +
+ + check_circle +

System Scan completed

+ {{ 1427412725000 | date: 'fullDate' }} +
+ + person_add +

4 Users connected

+ {{ 1428275520000 | date: 'fullDate' }} +
+
+
+
+
+
+ + + + + + Options + + + + Sidebar Image +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+ Sidebar Image +
+ Sidebar Color + + +
+ + Red +
+ +
+ + Pink +
+
+ + Blue +
+ + + +
+
+ Header Color + + +
+ + Red +
+ +
+ + Pink +
+
+ + Blue +
+ + + +
+
+ Horizontal Menu +
+
+ Collapsed Sidebar +
+
+ Compact Sidebar +
+
+ Boxed Layout +
+
+ Dark Mode +
+
+ RTL +
+
+ + + {{ lang }} + + +
+
+
+ +
+ + \ No newline at end of file diff --git a/ng6-seed/src/app/layouts/admin/admin-layout.component.ts b/ng6-seed/src/app/layouts/admin/admin-layout.component.ts index 8ed29e126..a04c747f6 100644 --- a/ng6-seed/src/app/layouts/admin/admin-layout.component.ts +++ b/ng6-seed/src/app/layouts/admin/admin-layout.component.ts @@ -9,6 +9,7 @@ import {TranslateService} from '@ngx-translate/core'; import PerfectScrollbar from 'perfect-scrollbar'; import { PerfectScrollbarConfigInterface, PerfectScrollbarComponent, PerfectScrollbarDirective } from 'ngx-perfect-scrollbar'; +import { UserService } from '../../settings/service/user.service'; import { AwsService } from '../../AwsService/aws.service'; @@ -18,6 +19,9 @@ import { AwsService } from '../../AwsService/aws.service'; }) export class AdminLayoutComponent implements OnInit, OnDestroy { + userDep: string; + fullName: any; + currentUser: any; private _router: Subscription; today: number = Date.now(); @@ -39,9 +43,26 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { @ViewChild('sidemenu') sidemenu; public config: PerfectScrollbarConfigInterface = {}; - constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService ) { + constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService ) { const browserLang: string = translate.getBrowserLang(); translate.use(browserLang.match(/en|fr/) ? browserLang : 'en'); + this.users.getroles().subscribe(res=>{ + this.currentUser = res; + if(this.currentUser.dataStatus == true){ + this.currentUser = this.currentUser.records[0]; + this.fullName = this.currentUser.user_full_name; + console.log(this.currentUser); + if(this.currentUser.fk_entity_id == 1 ){ + this.userDep = "SINEEGDE"; + }else if(this.currentUser.fk_entity_id ==2){ + this.userDep = "LENDOR"; + + }else{ + this.userDep = "VENDOR"; + } + + } + }); } ngOnInit(): void { @@ -201,6 +222,9 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { ] }); } + userprofile(){ + this.router.navigate(['setting/users/userprofile']); + } logout(){ //alert(); this.aws.logout().subscribe(res=>{ diff --git a/ng6-seed/src/app/settings/service/user.service.ts b/ng6-seed/src/app/settings/service/user.service.ts index e5a032804..cdbe12f5e 100644 --- a/ng6-seed/src/app/settings/service/user.service.ts +++ b/ng6-seed/src/app/settings/service/user.service.ts @@ -107,7 +107,7 @@ export class UserService { let roles:any=[]; for(var role of users.role){ - roles.push({ "user_role": role.value }); + roles.push({ "user_role": role.GroupName }); } let designation:any; if(users.type.entity_type_id ==2){ @@ -125,8 +125,8 @@ export class UserService { "last_name": users.lastName, "mobile_no": users.phone, "email": users.email, - "alt_email":users.alt_email, - "alt_mobile_no":users.alt_mobile_no, + "alt_email":users.altemail, + "alt_mobile_no":users.altphone, "addressline1":users.address1, "addressline2":users.address2, "addressline3":users.address3, @@ -146,7 +146,7 @@ export class UserService { formData.append('records',JSON.stringify(records)); formData.append('roles',JSON.stringify(roles)); formData.append('profilepic',users.userpic); - + console.log(records); //new Response(formData).text().then(console.log); //let headers = this.shared.headercofig(''); @@ -173,6 +173,13 @@ export class UserService { observe.next(this.localUserId); }) } - + getroles(){ + // alert(); + let cogusers:any = this.aws.getlocale(); + //console.log(cogusers.idToken.payload.locale); + let roles = {'userid':cogusers}; + + return this.http.post(apiurl+'getUsersDetails',roles); + } } diff --git a/ng6-seed/src/app/settings/users/register/register.component.html b/ng6-seed/src/app/settings/users/register/register.component.html index 40bdbd460..f827bbff1 100755 --- a/ng6-seed/src/app/settings/users/register/register.component.html +++ b/ng6-seed/src/app/settings/users/register/register.component.html @@ -1,30 +1,35 @@ - - - - User Registration + + + User Registrations +
- - You must include a first name. - Your first name must be at least 5 characters long. - Your first name cannot exceed 10 characters. - - + + You must include a first name. + Your first name must be at least 5 characters long. + Your first name cannot exceed 10 characters. + - - - - You must include a last name. - - - - - + + +
@@ -32,14 +37,14 @@ You must include an email address. - You must include a valid email address. + You must include a valid email address. - + + - You must include a valid email address.
@@ -51,19 +56,19 @@ You must include phone number. You must include a valid phone number. - + - + You must include a valid phone number. - + - - + +
@@ -82,36 +87,51 @@
- - - - - {{role.name}} - - - - Select User Role - Select User Role - - - - + + -- - - {{types.name}} + + {{types.name}} Select User Role Select User Role - - + + + -- + + {{types.name}} + + + + + + + + + + + {{role.GroupName}} + + + + Select User Role + Select User Role + + + + +
- + -- - + {{s.name}} @@ -124,7 +144,7 @@ {{c.name}} - + @@ -143,32 +163,32 @@ - +
- UserProfile - - - {{img}} -
- + UserProfile + - - Isactive - + {{img}} + + + + + Isactive +
- - - - + + + +
- - + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/users/register/register.component.ts b/ng6-seed/src/app/settings/users/register/register.component.ts index 8c8856d88..fe996650e 100755 --- a/ng6-seed/src/app/settings/users/register/register.component.ts +++ b/ng6-seed/src/app/settings/users/register/register.component.ts @@ -17,7 +17,7 @@ import { ifStmt } from '@angular/compiler/src/output/output_ast'; export class RegisterComponent implements OnInit { img: any; roles: any; - types: any; + types: any = []; loader:boolean = false; public regForm: FormGroup; @@ -26,7 +26,7 @@ export class RegisterComponent implements OnInit { // password: string; // passwordConfirm: string; entityType: any; - City: any; + City: any = []; State: any; designation: any; hierarchy:any=[]; @@ -46,14 +46,11 @@ export class RegisterComponent implements OnInit { } else { this.regdata(); } - this.roles = [ - { name: 'Admin', value: 'ADMIN' }, - { name: 'Audit', value: 'AUDIT' } - ]; + this.regForm = this.fb.group({ userid: [null], - firstName: [null, Validators.compose([Validators.required, Validators.minLength(2), Validators.maxLength(10)])], + firstName: [null, Validators.compose([Validators.required, Validators.minLength(2)])], lastName: [null, Validators.compose([Validators.required])], phone: [null, Validators.compose([Validators.required, Validators.minLength(10), Validators.maxLength(12)])], altphone: [null, Validators.compose([Validators.minLength(10), Validators.maxLength(12)])], @@ -127,6 +124,7 @@ export class RegisterComponent implements OnInit { //console.log(this.files); } register(userData) { + // console.log(userData); let data:any; console.log(this.usersData); // console.log(this.files); @@ -197,19 +195,25 @@ this.loader = true; } } + getcity(e){ + // console.log(e) + // this.City =[]= this.City.filter(city=>city.fk_state == e.state_id)[0]; + } userupdate() { if (this.users.localUserId != '' && this.users.localUserId != null && this.users.localUserId !== undefined) { this.usersData = this.users.localUserId; - console.log(this.usersData); - console.log(this.usersData); + this.users.entityType().subscribe(res => { this.types = res; if (this.types.status == 200) { - this.types = this.types.records; - let type = this.types.filter(type => type.entity_type_id == this.usersData.fk_entity_id)[0]; - this.regForm.controls['type'].setValue(type); - this.checktype(type); + let type = this.types.records; + this.types= type.filter(type => type.entity_type_id == this.usersData.fk_entity_id); + this.checktype(this.types[0]); + + this.regForm.controls['type'].setValue(this.types[0]); + + } }); this.users.City().subscribe(res => { @@ -248,13 +252,8 @@ this.loader = true; } }) - let userRole: any = []; - //console.log(this.usersData.profilepic); - for (let role of this.usersData[0]) { - //console.log(role); - userRole.push(this.roles.filter(roles => roles.value == role.user_role)[0]); - //console.log(userRole); - } + + //console.log(userRole); // this.regForm.controls['firstName'].setValue({'firstName':'sriram'}); @@ -273,18 +272,32 @@ this.loader = true; } else { this.regForm.controls['isactive'].setValue(false); } - this.regForm.controls['role'].setValue(userRole); + // this.regForm.controls['userpic'].setValue(this.usersData.profilepic); this.regForm.controls['pincode'].setValue(this.usersData.pincode); this.img = this.usersData.profilepic; } } checktype(e){ - console.log(e); + //console.log(e); + let userRole:any = []; if(e !== undefined){ + this.AWS.adminlistgroup(e.entity_type_id).subscribe(res=>{ + this.roles = res; + if(this.usersData !==undefined){ + for (let role of this.usersData[0]) { + //console.log(role); + userRole.push(this.roles.filter(roles => roles.GroupName == role.user_role)[0]); + //console.log(userRole); + this.regForm.controls['role'].setValue(userRole); + } + } + + }) switch (e.entity_type_id) { case "1": this.typeValue =1; + break; case "2": this.typeValue =2; @@ -296,7 +309,10 @@ this.loader = true; this.typeValue = -1; break; } + } + + } back(){ delete this.users.localUserId; diff --git a/ng6-seed/src/app/settings/users/user-list/user-list.component.html b/ng6-seed/src/app/settings/users/user-list/user-list.component.html index 81c10b973..c6c6e98b7 100644 --- a/ng6-seed/src/app/settings/users/user-list/user-list.component.html +++ b/ng6-seed/src/app/settings/users/user-list/user-list.component.html @@ -40,66 +40,67 @@ --> -
- -
-
-
- -
+
+ +
+
+
+ +
-
- - - -
- -
- - - - - Sl - {{i+1}} - - - - Full Name - {{us.user_first_name}} {{us.user_last_name}} - - - - Email Id - {{us.email}} - - - Mobile No - {{us.mobile_no}} +
+ + + +
+ +
+ + + + + Sl + {{i+1}} - - - Is Active - - done - close - - - - Actions - - edit - delete_forever - - - - - - - + + Full Name + {{us.user_first_name}} {{us.user_last_name}} + + + + Email Id + {{us.email}} + + + Mobile No + {{us.mobile_no}} + + + + Is Active + + done + close + + - - - -
+ + Actions + + edit + + + + + + + +
+ + + + +
diff --git a/ng6-seed/src/app/settings/users/user-list/user-list.component.ts b/ng6-seed/src/app/settings/users/user-list/user-list.component.ts index 1de040ae0..89f858604 100644 --- a/ng6-seed/src/app/settings/users/user-list/user-list.component.ts +++ b/ng6-seed/src/app/settings/users/user-list/user-list.component.ts @@ -26,6 +26,7 @@ export class UserListComponent implements OnInit { constructor(public aws: AwsService, public route: Router,public users:UserService) { this.getusers(); + } @@ -116,9 +117,15 @@ export class UserListComponent implements OnInit { add(){ this.route.navigate(['setting/users/register']); } - // deleteuser(user){ - // this.aws.deleteAws(user).subscribe(res=>{ - // this.getusers(); - // }); - // } + deleteuser(user){ + this.aws.admindelete(user).subscribe(res=>{ + this.getusers(); + }); + } + adminedituser(user){ + this.aws.adminresetpassword(user).subscribe(res=>{ + this.getusers(); + }) + } + } diff --git a/ng6-seed/src/app/settings/users/user-profile/changePassword.html b/ng6-seed/src/app/settings/users/user-profile/changePassword.html new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/users/user-profile/user-profile-component.html b/ng6-seed/src/app/settings/users/user-profile/user-profile-component.html new file mode 100755 index 000000000..0d1c48bad --- /dev/null +++ b/ng6-seed/src/app/settings/users/user-profile/user-profile-component.html @@ -0,0 +1,126 @@ +
+
+
+
+ +
+
+
+ user +
+
+

{{userDetails.user_full_name}}

+ {{userDetails.email}} + {{userDetails.mobile_no}} + + + + + {{userDetails.addressline1}} {{userDetails.addressline2}} + {{userDetails.addressline3}} {{userDetails.state_name}} - {{userDetails.pincode}} + {{userDetails.createdon | date:'dd MMM yyyy'}} +
+
+
+
+
+

Tweets

+
+ +
+
+
+
+
    +
  • +
    +
    user +
    +
    +
    + {{userDetails.user_full_name}} + + {{userDetails.createdon | date:'dd MMM yyyy'}} +

    {{userDetails.mobile_no}}

    +

    {{userDetails.addressline1}} {{userDetails.addressline2}}
    + {{userDetails.addressline3}} - {{userDetails.pincode}} {{userDetails.state_name}} +

    + +
    +
    +
    +
    +
  • +
  • +
    +
    user +
    +
    +
    + Jane Doe + + Sep 11, 2017 +

    + “Tomorrow belongs to those who can hear it coming.” - David Bowie +

    +
    +
    +
    +
    +
  • +
  • +
    +
    user +
    +
    +
    + Jane Doe + + Sep 13, 2017 +

    our recent work

    +
    +
    +
    +
    + user +
    +
    +
    +
    + user +
    +
    +
    +
    +
    +
    +
  • +
+
+
+
+
+
+
+
+
+ diff --git a/ng6-seed/src/app/settings/users/user-profile/user-profile-component.scss b/ng6-seed/src/app/settings/users/user-profile/user-profile-component.scss new file mode 100755 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/users/user-profile/user-profile.component.ts b/ng6-seed/src/app/settings/users/user-profile/user-profile.component.ts new file mode 100755 index 000000000..4e68a0823 --- /dev/null +++ b/ng6-seed/src/app/settings/users/user-profile/user-profile.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit,ViewEncapsulation } from '@angular/core'; +import { AwsService } from '../../../AwsService/aws.service'; +import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { CustomValidators } from 'ng2-validation'; +import { UserService } from '../../service/user.service'; +@Component({ + selector: 'ms-user-profile', + templateUrl:'./user-profile-component.html', + styleUrls: ['./user-profile-component.scss'], + encapsulation: ViewEncapsulation.None +}) +export class UserProfileComponent implements OnInit { + config: MatDialogConfig = { + disableClose: false, + width: '', + height: '', + position: { + top: '', + bottom: '', + left: '', + right: '' + } + }; + userDetails:any=[]; + constructor(public AWS:AwsService,public dialog: MatDialog,public users:UserService ) { + this.getuser(); + } + + ngOnInit() { + + + + } + + getuser(){ + //console.log(this.AWS.getUser()); + this.users.getroles().subscribe(res=>{ + this.userDetails = res; + this.userDetails = this.userDetails.records[0]; + }); + } + changePassword(){ + let dialogRef = this.dialog.open(ChangePasswordDialog,this.config); + dialogRef.afterClosed().subscribe(result => { + + if(result !==undefined){ + if(result.confirmPassword !== undefined && result.confirmPassword !="" && result.newPassword !="" && result.oldPassword !=""){ + this.AWS.changepassword(result) + .subscribe(res=>{ + alert('Change Password'); + }) + } + } + //console.log(ChangePasswordDialog.prototype.pass); + }); + + } +} + +@Component({ + selector: 'app-jazz-dialog', + template: ` +
New Password Change.
+ + + + +
+ + + + + + +
+ + + + + Passwords do not math. + +
+ + + + + ` +}) +export class ChangePasswordDialog{ + + pass = { + oldPassword:'', + newPassword:'', + confirmPassword:'', + + } + + jazzMessage = 'Jazzy jazz jazz'; + + constructor(public dialogRef: MatDialogRef ,public aws:AwsService) { + + } + + +} + + + diff --git a/ng6-seed/src/app/settings/users/users.module.ts b/ng6-seed/src/app/settings/users/users.module.ts index 57437c1ea..c079b54bc 100644 --- a/ng6-seed/src/app/settings/users/users.module.ts +++ b/ng6-seed/src/app/settings/users/users.module.ts @@ -18,6 +18,7 @@ import { RouterModule } from '@angular/router'; import { UserRoutes} from './users.routing'; import { RegisterComponent } from './register/register.component'; import { UserListComponent} from './user-list/user-list.component'; +import { UserProfileComponent, ChangePasswordDialog } from './user-profile/user-profile.component'; import { NewPasswordDialog, ForgotPass } from '../../session/login/login.component'; // import { HttpClientModule } from '@angular/common/http'; @@ -36,7 +37,7 @@ import { NewPasswordDialog, ForgotPass } from '../../session/login/login.compone FormsModule, ReactiveFormsModule, // HttpClientModule, ], - declarations: [UserListComponent, RegisterComponent], + declarations: [UserListComponent, RegisterComponent,UserProfileComponent], }) diff --git a/ng6-seed/src/app/settings/users/users.routing.ts b/ng6-seed/src/app/settings/users/users.routing.ts index 3b0d2b9ab..80667544d 100644 --- a/ng6-seed/src/app/settings/users/users.routing.ts +++ b/ng6-seed/src/app/settings/users/users.routing.ts @@ -2,6 +2,7 @@ import { Routes } from '@angular/router'; import { UserListComponent } from './user-list/user-list.component'; import { RegisterComponent } from './register/register.component'; +import { UserProfileComponent } from './user-profile/user-profile.component'; export const UserRoutes: Routes = [{ path: '', redirectTo: 'userlist', @@ -14,5 +15,8 @@ export const UserRoutes: Routes = [{ },{ path: 'register', component: RegisterComponent + },{ + path:'userprofile', + component:UserProfileComponent }] }];