individual user changes

This commit is contained in:
venbaSriram 2018-10-05 19:55:43 +05:30
parent 6156834e9c
commit 4468a2f28c
7 changed files with 84 additions and 30 deletions

View File

@ -4294,12 +4294,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -4314,17 +4316,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -4441,7 +4446,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -4453,6 +4459,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -4467,6 +4474,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -4474,12 +4482,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -4498,6 +4508,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -4578,7 +4589,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -4590,6 +4602,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -4711,6 +4724,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",

View File

@ -364,7 +364,7 @@ export class AwsService {
err,
data
) => {
if (err) { alert(err.stack); }
if (err) { alert(err.message); }
// an error occurred
@ -420,7 +420,7 @@ export class AwsService {
data
) {
if (err) {
alert(err.stack);
alert(err.message);
}//(err, err.stack);
// an error occurred
else {//(data);
@ -461,7 +461,7 @@ export class AwsService {
data
) {
if (err) {
alert(err.stack);
alert(err.message);
}//(err, err.stack);
// an error occurred
else {//(data);

View File

@ -50,8 +50,8 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
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);
this.fullName = this.currentUser.user_first_name +' '+this.currentUser.user_last_name;
//console.log(this.currentUser);
if(this.currentUser.fk_entity_id == 1 ){
this.userDep = "SINEEGDE";
}else if(this.currentUser.fk_entity_id ==2){

View File

@ -33,7 +33,7 @@
<input matInput placeholder="User Id" [formControl]="regForm.controls['userid']">
</mat-form-field>
<span dividerColor="primary" class="ml-xs mr-xs" *ngIf="profileaccess">
<img [src]="profileurl" style="width: 30%;height: 50%;"></span>
<img [src]="profileurl" style="width: 17%;height: 50%;border-radius: 50%;"></span>
</div>
<mat-card-title>Account Details</mat-card-title><hr/><br/>

View File

@ -4,7 +4,7 @@ import { AwsService } from '../../../AwsService/aws.service';
import { MatPaginator, MatTableDataSource,MatSort } from '@angular/material';
import { UserService } from '../../service/user.service';
import { DataSource } from '@angular/cdk/table';
import { CognitoService } from '../../../AwsService/cognito.service';
@Component({
selector: 'app-user-list',
templateUrl: './user-list.component.html',
@ -23,8 +23,20 @@ export class UserListComponent implements OnInit {
constructor(public aws: AwsService, public route: Router,public users:UserService) {
constructor(public aws: AwsService, public route: Router,public users:UserService,public shared:CognitoService) {
let session:any = this.shared.getAccessToken();
//console.log(session.idToken.payload["cognito:groups"]);
let userGroup = session.idToken.payload["cognito:groups"].filter(
usergroup => usergroup == "ADMIN"
)[0];
if(userGroup == "ADMIN" ){
}else{
alert('Admin Only Access Page');
this.route.navigate(['home']);
}
this.getusers();
}

View File

@ -22,11 +22,12 @@
</div> -->
<div fxLayout="row" fxLayoutWrap="wrap">
<div fxFlex.gt-sm="25" fxFlex.gt-xs="50" fxFlex="100" class="relative">
<div class="profile-avatar">
<img src="../../../assets/images/test3.jpg" width="200" height="200" alt="user">
<div class="profile-avatar" style="margin-left: 39%;margin-top:-12%;">
<img [src]="profileurl ||''" width="200" height="200" alt="user">
</div>
<div class="profile-info">
<h3 class="profile-name"><strong>{{userDetails.user_full_name}}</strong></h3>
<div class="profile-info">
<!-- <h3 class="profile-name"><strong>{{userDetails.user_full_name}}</strong></h3>
<span class="user-name">{{userDetails.email}}</span>
<span class="user-name">{{userDetails.mobile_no}}</span>
@ -35,17 +36,20 @@
</span>
<span><i class="fa fa-map-marker"></i> {{userDetails.addressline1}} {{userDetails.addressline2}}</span>
<span><i class="fa fa-calendar"></i>{{userDetails.addressline3}} {{userDetails.state_name}} - {{userDetails.pincode}}</span>
<span>{{userDetails.createdon | date:'dd MMM yyyy'}}</span>
</div>
<span>{{userDetails.createdon | date:'dd MMM yyyy'}}</span> -->
</div>
</div>
<div fxFlex.gt-sm="50" fxFlex.gt-xs="50" fxFlex="100" class="mt-1">
<div class="profile-content">
<div class="profile-head">
<h4>Tweets</h4>
<div fxFlex.gt-sm="25" fxFlex.gt-xs="25" fxFlexOffset="50" fxFlex="100" class="align-self-center">
<div fxFlex.gt-sm="25" fxFlex.gt-xs="25" fxFlexOffset="100" fxFlex="100" class="align-self-center">
<button type="button" class="UserActions-editButton edit-button EdgeButton EdgeButton--tertiary" data-scribe-element="profile_edit_button" (click)="changePassword()">
<span class="button-text">Edit profile</span>
<span class="button-text">Change Password</span>
</button>
<button type="button" class="UserActions-editButton edit-button EdgeButton EdgeButton--tertiary" data-scribe-element="profile_edit_button" (click)="editprofile()">
<span class="button-text">Edit profile</span>
</button>
</div>
<hr>
</div>
@ -53,12 +57,12 @@
<ul class="pl-0">
<li>
<div fxLayout="row">
<div fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="15" fxFlex.xl="15"> <img class="profile-thumb" src="../../../assets/images/test3.jpg" width="80" height="80" alt="user">
<div fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="15" fxFlex.xl="15"> <img class="profile-thumb" [src]="profileurl ||''" width="80" height="80" alt="user">
</div>
<div class="pl-1 pr-1 profile-i" fxFlex.xs="85" fxFlex.sm="85" fxFlex.md="85" fxFlex.lg="85" fxFlex.xl="85">
<div>
<span class="post-profile-head">{{userDetails.user_full_name}}</span>
<span class="twitter-uname"><i class="fa fa-email"></i> {{userDetails.email}}</span>
<span class="twitter-uname"><i class="fa fa-email"></i> {{userDetails.email}}</span><br/>
<span class="time">{{userDetails.createdon | date:'dd MMM yyyy'}}</span>
<p><i class="fa fa-mobile"></i> {{userDetails.mobile_no}}</p>
<p>{{userDetails.addressline1}} {{userDetails.addressline2}} <br/>
@ -66,11 +70,11 @@
</p>
</div>
<div class="profile-action"><a href=""><i class="fa fa-retweet"></i></a><a href=""><i class="fa fa-comment-o"></i></a><a href=""><i class="fa fa-heart-o"></i></a></div>
<!-- <div class="profile-action"><a href=""><i class="fa fa-retweet"></i></a><a href=""><i class="fa fa-comment-o"></i></a><a href=""><i class="fa fa-heart-o"></i></a></div> -->
</div>
</div>
</li>
<li>
<!-- <li>
<div fxLayout="row">
<div fxFlex.xs="15" fxFlex.sm="15" fxFlex.md="15" fxFlex.lg="15" fxFlex.xl="15"> <img class="profile-thumb" src="../../../assets/images/test3.jpg" width="80" height="80" alt="user">
</div>
@ -113,7 +117,7 @@
<div class="profile-action"><a href=""><i class="fa fa-retweet"></i></a><a href=""><i class="fa fa-comment-o"></i></a><a href=""><i class="fa fa-heart-o"></i></a></div>
</div>
</div>
</li>
</li> -->
</ul>
</div>
</div>

View File

@ -4,6 +4,7 @@ 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';
import { Router} from '@angular/router';
@Component({
selector: 'ms-user-profile',
templateUrl:'./user-profile-component.html',
@ -11,6 +12,7 @@ import { UserService } from '../../service/user.service';
encapsulation: ViewEncapsulation.None
})
export class UserProfileComponent implements OnInit {
profileurl: any;
config: MatDialogConfig = {
disableClose: false,
width: '',
@ -23,8 +25,9 @@ export class UserProfileComponent implements OnInit {
}
};
userDetails:any=[];
constructor(public AWS:AwsService,public dialog: MatDialog,public users:UserService ) {
constructor(public AWS:AwsService,public dialog: MatDialog,public users:UserService,public router:Router ) {
this.getuser();
}
ngOnInit() {
@ -38,6 +41,7 @@ export class UserProfileComponent implements OnInit {
this.users.getroles().subscribe(res=>{
this.userDetails = res;
this.userDetails = this.userDetails.records[0];
this.getprofilepic();
});
}
changePassword(){
@ -52,10 +56,30 @@ export class UserProfileComponent implements OnInit {
})
}
}
//console.log(ChangePasswordDialog.prototype.pass);
});
}
editprofile(){
this.users.adminGetUsers(this.userDetails);
this.router.navigate(['setting/users/register']);
}
getprofilepic(){
let users= {
'userid':this.userDetails.userid,
'entityid':this.userDetails.fk_entity_id,
'profilepic':this.userDetails.profilepic
}
this.users.getprofilepic(users).subscribe(res=>{
this.profileurl = res;
if(this.profileurl.dataStatus == true){
this.profileurl = this.profileurl.records;
}
})
}
}
@Component({