Fairoj : api url changed, trigger and view icon hidden for sales role

This commit is contained in:
venbatechnologies@gmail.com 2020-02-05 13:51:47 +05:30
parent 2d339ed2c4
commit 15976511bd
17 changed files with 80 additions and 15 deletions

View File

@ -3,8 +3,8 @@
"version": "0.0.0",
"license": "MIT",
"scripts": {
"production": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod --build-optimizer=true",
"staging": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod --configuration=staging",
"production": "node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build --prod --build-optimizer=true",
"staging": "node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build --prod --configuration=staging",
"ng": "ng",
"start": "ng serve",
"build": "ng build",

View File

@ -81,7 +81,7 @@
</mat-cell>
</ng-container>
<ng-container matColumnDef="Name">
<mat-cell class="cell" *matCellDef="let details;">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="22" fxFlex.lg="24" fxFlex.xl="16" class="cell" *matCellDef="let details;">
<span *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>
</span>
@ -134,9 +134,10 @@
matTooltip="View" matTooltipPosition="above">
<mat-icon>visibility</mat-icon>
</button>
</mat-cell>
</ng-container>
<mat-row style="align-items: normal !important;" *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>

View File

@ -48,6 +48,7 @@ export class AllPdComponent implements OnInit, OnChanges {
pageSize = 10;
pageEvent: PageEvent;
todaydate:Date = new Date();
user_role_name: string;
constructor(private _pd: PdTrigerService,private _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
this.notifier = notifier;
@ -70,10 +71,21 @@ export class AllPdComponent implements OnInit, OnChanges {
this.userService.getroles().subscribe(res=>{
let len_id=res['records'][0].fk_entity_id
this.searchForm.controls['pd_lender'].setValue(len_id)
let role_name = this.userService.takeDecisionRouting(res['records'][0])
localStorage.setItem('len_user_role',role_name);
this.user_role_name=role_name
if(this.user_role_name == 'sales'){
this.displayedColumns = this.displayedColumns.filter(val=>val != 'Action')
}
})
this.recordStatus=false;
// this.loadPDDetails();
//this.getcommonDropDown();
console.log(this.displayedColumns)
}
// get changes for filter from parent componnet filter
@ -81,6 +93,7 @@ export class AllPdComponent implements OnInit, OnChanges {
let filteredText = changes.bindFilterValue.currentValue ? changes.bindFilterValue.currentValue.trim() : changes.bindFilterValue.currentValue;
filteredText = filteredText ? filteredText.toLowerCase() : filteredText;
this.dataSourceTab1.filter = filteredText;
// console.log("changes",this.bindFilterValue)
}
@ -230,4 +243,5 @@ export class AllPdComponent implements OnInit, OnChanges {
this.dataSourceTab1.paginator = this.paginator;
this.dataSourceTab1.sort = this.sort;
}
}

View File

@ -81,7 +81,7 @@
</mat-cell>
</ng-container>
<ng-container matColumnDef="Name">
<mat-cell class="cell" *matCellDef="let details;">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="22" fxFlex.lg="24" fxFlex.xl="16" class="cell" *matCellDef="let details;">
<!-- <span *ngIf="details.applicant_name" mat-line><b>{{details.applicant_name}}</b></span><br> -->
<span *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>

View File

@ -47,6 +47,7 @@ export class CompletedPdComponent implements OnInit, OnChanges {
pageSize = 10;
pageEvent: PageEvent;
todaydate:Date = new Date();
user_role_name: string;
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
this.notifier = notifier;
@ -70,10 +71,16 @@ export class CompletedPdComponent implements OnInit, OnChanges {
this.userService.getroles().subscribe(res=>{
let len_id=res['records'][0].fk_entity_id
this.searchForm.controls['pd_lender'].setValue(len_id)
let role_name = this.userService.takeDecisionRouting(res['records'][0])
this.user_role_name=role_name
if(this.user_role_name == 'sales'){
this.displayedColumns = this.displayedColumns.filter(val=>val != 'Action')
}
})
this.recordStatus=false;
// this.loadPDDetails();
// this.getcommonDropDown();
}
@ -84,6 +91,7 @@ export class CompletedPdComponent implements OnInit, OnChanges {
// filteredText = filteredText ? filteredText.trim() : filteredText;
filteredText = filteredText ? filteredText.toLowerCase() : filteredText;
this.dataSourceTab4.filter = filteredText;
}
// load inprogress pd list

View File

@ -78,7 +78,7 @@
</mat-cell>
</ng-container>
<ng-container matColumnDef="Name">
<mat-cell class="cell" *matCellDef="let details;">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="22" fxFlex.lg="24" fxFlex.xl="16" class="cell" *matCellDef="let details;">
<!-- <span *ngIf="details.applicant_name" mat-line><b>{{details.applicant_name}}</b></span><br> -->
<span *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>

View File

@ -45,6 +45,7 @@ export class InprogressPdComponent implements OnInit, OnChanges {
pageSize = 10;
pageEvent: PageEvent;
searchForm:FormGroup;
user_role_name: string;
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
this.notifier = notifier;
@ -67,10 +68,16 @@ export class InprogressPdComponent implements OnInit, OnChanges {
this.userService.getroles().subscribe(res=>{
let len_id=res['records'][0].fk_entity_id
this.searchForm.controls['pd_lender'].setValue(len_id)
let role_name = this.userService.takeDecisionRouting(res['records'][0])
this.user_role_name=role_name
if(this.user_role_name == 'sales'){
this.displayedColumns = this.displayedColumns.filter(val=>val != 'Action')
}
})
this.recordStatus=false;
// this.loadPDDetails();
// this.getcommonDropDown();
}
// get changes for filter from parent componnet filter

View File

@ -6,7 +6,7 @@
<input matInput [(ngModel)]="filterValue" placeholder="Filter">
</mat-form-field>
</div>
<div fxFlex="50" class="pb-0 text-sm-right">
<div fxFlex="50" class="pb-0 text-sm-right" *ngIf="user_role_name != 'sales'">
<!-- <button mat-fab (click)="viewMapPdDetails()" class="mr-1 mb-1 hover-icon" matTooltip="Map view" matTooltipPosition="above"><mat-icon>map</mat-icon></button> -->
<button mat-fab (click)="addPdDetails()" class="mr-1 mb-1 hover-icon" matTooltip="Add PD" matTooltipPosition="above" *ngIf="roleAccessDetails.trigger"><mat-icon>add</mat-icon></button>
</div>

View File

@ -8,6 +8,7 @@ import { InprogressPdComponent } from './inprogress-pd/inprogress-pd.component';
import { ScheduledPdComponent } from './scheduled-pd/scheduled-pd.component';
import { CompletedPdComponent } from './completed-pd/completed-pd.component';
import { QcCompletedPdComponent } from './qc-completed-pd/qc-completed-pd.component';
import { UserService } from 'app/settings/service/user.service';
@Component({
@ -38,20 +39,28 @@ export class ListPdComponent implements OnInit, OnDestroy {
// roles checks for enables events
roleAccessDetails:any
public userRoleID = +localStorage.getItem('user_role') ;
public userRoleID;
public LenderRoleID : any = +localStorage.getItem('LenderRoleID');
user_role_name: string;
constructor( notifier: NotifierService, private route: ActivatedRoute,
private router: Router, private _pd: PdTrigerService) {
private router: Router, private _pd: PdTrigerService,private userService:UserService) {
this.notifier = notifier;
this.roleAccessDetails=this._pd.getRoleAccessDetails();
}
ngOnInit() {
this.viewPdList = true;
this.recordStatus=false;
this.allTab=true;
this.userService.getroles().subscribe(res=>{
let role_name = this.userService.takeDecisionRouting(res['records'][0])
localStorage.setItem('len_user_role',role_name);
this.user_role_name=role_name
})
}
// after view call all tabs component
ngAfterViewInit() {
this.allTabC.loadPDDetails();

View File

@ -80,7 +80,7 @@
</mat-cell>
</ng-container>
<ng-container matColumnDef="Name">
<mat-cell class="cell" *matCellDef="let details;">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="22" fxFlex.lg="24" fxFlex.xl="16" class="cell" *matCellDef="let details;">
<!-- <span *ngIf="details.applicant_name" mat-line><b>{{details.applicant_name}}</b></span><br> -->
<span *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD' }}</b>

View File

@ -46,6 +46,7 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
user_role_name: string;
constructor(private _pd: PdTrigerService, public _fb: FormBuilder,notifier: NotifierService,private userService:UserService) {
this.notifier = notifier;
@ -69,10 +70,17 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
this.userService.getroles().subscribe(res=>{
let len_id=res['records'][0].fk_entity_id
this.searchForm.controls['pd_lender'].setValue(len_id)
let role_name = this.userService.takeDecisionRouting(res['records'][0])
this.user_role_name=role_name
if(this.user_role_name == 'sales'){
this.displayedColumns = this.displayedColumns.filter(val=>val != 'Action')
}
})
this.recordStatus = false;
// this.loadPDDetails();
// this.getcommonDropDown();
}
ngAfterViewInit() {

View File

@ -78,7 +78,7 @@
</mat-cell>
</ng-container>
<ng-container matColumnDef="Name">
<mat-cell class="cell" *matCellDef="let details;">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="22" fxFlex.lg="24" fxFlex.xl="16" class="cell" *matCellDef="let details;">
<!-- <span *ngIf="details.applicant_name" mat-line><b>{{details.applicant_name}}</b></span><br> -->
<span *ngIf="details.is_child" mat-line>
<b>{{details.is_child == 0 ? details.applicant_name : 'Add On PD'}}</b>

View File

@ -45,6 +45,7 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
user_role_name: string;
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
this.notifier = notifier;
@ -68,10 +69,16 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
this.userService.getroles().subscribe(res=>{
let len_id=res['records'][0].fk_entity_id
this.searchForm.controls['pd_lender'].setValue(len_id)
let role_name = this.userService.takeDecisionRouting(res['records'][0])
this.user_role_name=role_name
if(this.user_role_name == 'sales'){
this.displayedColumns = this.displayedColumns.filter(val=>val != 'Action')
}
})
this.recordStatus=false;
// this.loadPDDetails();
//this.getcommonDropDown();
}
ngAfterViewInit() {
this.dataSourceTab3.paginator = this.paginator;

View File

@ -230,5 +230,16 @@ export class UserService {
getprofilepic(users){
return this.http.post(apiurl+'getSingedProfilePicURL',users);
}
takeDecisionRouting(userDetails){
let role_name=userDetails.role_name.toLowerCase()
console.log("e",role_name)
if(role_name.includes('sales')){
return 'sales'
}
else{
// this.navCtrl.setRoot(PdListPage,{'userDetails':this.userDetails});
return 'credit'
}
}
}

View File

@ -3,7 +3,7 @@ export const environment = {
environmentName: 'Production Environment',//Live Environment.
apiEndpoint: 'https://pdgenie.com/sparqprod/api/',
apiEndpoint: 'https://api.pdgenie.com/sparqprod/api/',
authorization: 'TnAwuc64pVpcB9xf',
login_string: "cognito-idp.ap-south-1.amazonaws.com/ap-south-1_MlTee1O5V",

View File

@ -9,7 +9,7 @@ export const environment = {
environmentName: 'Development Environment',//Localhost Environment.
// apiEndpoint: 'https://demo.pdgenie.com/sparqtest/api/',
apiEndpoint: 'https://demo.pdgenie.com/sparqtest/api/',
apiEndpoint: ' https://apitest.pdgenie.com/sparqtest/api/',
authorization: 'sparqvenba2018',

View File

@ -9,7 +9,7 @@ export const environment = {
environmentName: 'Development Environment',//Localhost Environment.
// apiEndpoint: 'https://demo.pdgenie.com/sparqtest/api/',
apiEndpoint: 'https://demo.pdgenie.com/sparqapi/api/',
apiEndpoint: ' https://apitest.pdgenie.com/sparqapi/api/',
authorization: 'sparqvenba2018',