Dynamic PD List count is implemented

This commit is contained in:
sriram-at-840620226347 2020-03-14 16:29:12 +05:30
parent c937e346ff
commit 2ec973dddc
15 changed files with 71 additions and 17 deletions

View File

@ -21,4 +21,8 @@ export class DashboardService {
constructor(private _http: HttpClient, constructor(private _http: HttpClient,
private _aws:AwsService) { } private _aws:AwsService) { }
getCommonSettingsConfig(){
return this._http.post(this.apiUrl+'getCommonConfig', '');
}
} }

View File

@ -22,7 +22,8 @@ import { RoleMenuItemsPipe } from './../role-menu-items.pipe';
export class AdminLayoutComponent implements OnInit, OnDestroy { export class AdminLayoutComponent implements OnInit, OnDestroy {
profileurl: any;; profileurl: any;
commonDetails: any;
userDep: string; userDep: string;
fullName: any; fullName: any;
roleName:any; roleName:any;
@ -135,6 +136,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
// Ps.update(elemContent); // Ps.update(elemContent);
} }
}); });
this.getCommonSettings();
} }
@HostListener('click', ['$event']) @HostListener('click', ['$event'])
@ -295,4 +297,13 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
break; break;
} }
} }
getCommonSettings(){
this._dashboardService.getCommonSettingsConfig().subscribe(res=>{
this.commonDetails = res;
if(this.commonDetails.dataStatus == true){
localStorage.setItem("commonSettings",JSON.stringify(this.commonDetails.records));
}
})
}
} }

View File

@ -71,7 +71,7 @@
</mat-expansion-panel> </mat-expansion-panel>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last 10 days. To see older records, please use advanced filter</p> <p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/> <br/>
<mat-table [dataSource]="dataSourceTab1" matSort *ngIf="PdListData.length > 0"> <mat-table [dataSource]="dataSourceTab1" matSort *ngIf="PdListData.length > 0">
@ -156,6 +156,6 @@
</div> </div>
<mat-card-content *ngIf="recordStatus"> <mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold; <h5 align="center" style="font-weight: bold;
color: brown;">Showing data for last 10 days. To see older records, please use advanced filter</h5> color: brown;">Showing data for last {{common}}. To see older records, please use advanced filter</h5>
</mat-card-content> </mat-card-content>
<notifier-container></notifier-container> <notifier-container></notifier-container>

View File

@ -50,6 +50,7 @@ export class AllPdComponent implements OnInit, OnChanges {
todaydate:Date = new Date(); todaydate:Date = new Date();
user_role_name: string; user_role_name: string;
limitMsg: boolean = false; limitMsg: boolean = false;
common: any;
constructor(private _pd: PdTrigerService,private _fb:FormBuilder,notifier: NotifierService,private userService:UserService) { constructor(private _pd: PdTrigerService,private _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
this.notifier = notifier; this.notifier = notifier;
@ -66,6 +67,9 @@ export class AllPdComponent implements OnInit, OnChanges {
pd_applicant_id:[null], pd_applicant_id:[null],
}); });
this.getcommonDropDown(); this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
} }
ngOnInit() { ngOnInit() {

View File

@ -70,7 +70,7 @@
</mat-list> </mat-list>
</mat-expansion-panel> </mat-expansion-panel>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last 10 days. To see older records, please use advanced filter</p> <p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/> <br/>
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="completedPdListData.length > 0" > <mat-table [dataSource]="dataSourceTab4" matSort *ngIf="completedPdListData.length > 0" >
@ -127,5 +127,5 @@
</div> </div>
<mat-card-content *ngIf="recordStatus"> <mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold; <h5 align="center" style="font-weight: bold;
color: brown;">Showing data for last 10 days. To see older records, please use advanced filter</h5> color: brown;">Showing data for last {{common}}. To see older records, please use advanced filter</h5>
</mat-card-content> </mat-card-content>

View File

@ -49,6 +49,7 @@ export class CompletedPdComponent implements OnInit, OnChanges {
todaydate:Date = new Date(); todaydate:Date = new Date();
user_role_name: string; user_role_name: string;
limitMsg: boolean = false; limitMsg: boolean = false;
common: any;
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) { constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
this.notifier = notifier; this.notifier = notifier;
@ -66,6 +67,9 @@ export class CompletedPdComponent implements OnInit, OnChanges {
pd_applicant_id:[null], pd_applicant_id:[null],
}); });
this.getcommonDropDown(); this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
} }
ngOnInit() { ngOnInit() {

View File

@ -69,7 +69,7 @@
</mat-list> </mat-list>
</mat-expansion-panel> </mat-expansion-panel>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last 10 days. To see older records, please use advanced filter</p> <p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/> <br/>
<mat-table [dataSource]="dataSourceTab2" matSort *ngIf="progressPdListData.length > 0" > <mat-table [dataSource]="dataSourceTab2" matSort *ngIf="progressPdListData.length > 0" >
<ng-container matColumnDef="PDType"> <ng-container matColumnDef="PDType">
@ -124,5 +124,5 @@
</div> </div>
<mat-card-content *ngIf="recordStatus"> <mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold; <h5 align="center" style="font-weight: bold;
color: brown;">Showing data for last 10 days. To see older records, please use advanced filter</h5> color: brown;">Showing data for last {{common}}. To see older records, please use advanced filter</h5>
</mat-card-content> </mat-card-content>

View File

@ -47,6 +47,7 @@ export class InprogressPdComponent implements OnInit, OnChanges {
searchForm:FormGroup; searchForm:FormGroup;
user_role_name: string; user_role_name: string;
limitMsg: boolean = false; limitMsg: boolean = false;
common: any;
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) { constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
this.notifier = notifier; this.notifier = notifier;
@ -63,6 +64,9 @@ export class InprogressPdComponent implements OnInit, OnChanges {
pd_applicant_id:[null], pd_applicant_id:[null],
}); });
this.getcommonDropDown(); this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
} }
ngOnInit() { ngOnInit() {

View File

@ -71,7 +71,7 @@
</mat-list> </mat-list>
</mat-expansion-panel> </mat-expansion-panel>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last 10 days. To see older records, please use advanced filter</p> <p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/> <br/>
<mat-table [dataSource]="dataSourceTab5" matSort *ngIf="qcCompletedPdListData.length > 0" > <mat-table [dataSource]="dataSourceTab5" matSort *ngIf="qcCompletedPdListData.length > 0" >
<ng-container matColumnDef="PDType"> <ng-container matColumnDef="PDType">
@ -126,5 +126,5 @@
</div> </div>
<mat-card-content *ngIf="recordStatus"> <mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold; <h5 align="center" style="font-weight: bold;
color: brown;">Showing data for last 10 days. To see older records, please use advanced filter</h5> color: brown;">Showing data for last {{common}}. To see older records, please use advanced filter</h5>
</mat-card-content> </mat-card-content>

View File

@ -48,6 +48,7 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
pageEvent: PageEvent; pageEvent: PageEvent;
user_role_name: string; user_role_name: string;
limitMsg: boolean = false; limitMsg: boolean = false;
common: any;
constructor(private _pd: PdTrigerService, public _fb: FormBuilder,notifier: NotifierService,private userService:UserService) { constructor(private _pd: PdTrigerService, public _fb: FormBuilder,notifier: NotifierService,private userService:UserService) {
this.notifier = notifier; this.notifier = notifier;
@ -65,6 +66,9 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
pd_applicant_id: [null], pd_applicant_id: [null],
}); });
this.getcommonDropDown(); this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
} }
ngOnInit() { ngOnInit() {

View File

@ -69,7 +69,7 @@
</mat-list> </mat-list>
</mat-expansion-panel> </mat-expansion-panel>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last 10 days. To see older records, please use advanced filter</p> <p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/> <br/>
<mat-table [dataSource]="dataSourceTab3" matSort *ngIf="scheduledPdListData.length > 0" > <mat-table [dataSource]="dataSourceTab3" matSort *ngIf="scheduledPdListData.length > 0" >
<ng-container matColumnDef="PDType"> <ng-container matColumnDef="PDType">
@ -128,5 +128,5 @@
</div> </div>
<mat-card-content *ngIf="recordStatus"> <mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold; <h5 align="center" style="font-weight: bold;
color: brown;">Showing data for last 10 days. To see older records, please use advanced filter</h5> color: brown;">Showing data for last {{common}}. To see older records, please use advanced filter</h5>
</mat-card-content> </mat-card-content>

View File

@ -47,6 +47,7 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
pageEvent: PageEvent; pageEvent: PageEvent;
user_role_name: string; user_role_name: string;
limitMsg: boolean = false; limitMsg: boolean = false;
common: any;
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) { constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
this.notifier = notifier; this.notifier = notifier;
@ -64,6 +65,9 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
pd_applicant_id:[null], pd_applicant_id:[null],
}); });
this.getcommonDropDown(); this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
} }
ngOnInit() { ngOnInit() {

View File

@ -12,7 +12,7 @@
<mat-card-content> <mat-card-content>
<app-advance-filter [drop_down_datas]="filter_drop_down_data" (filteredlistData)="filteredDataSource($event)" <app-advance-filter [drop_down_datas]="filter_drop_down_data" (filteredlistData)="filteredDataSource($event)"
(resetFilter)= "loadSalesPDDetails()"></app-advance-filter> (resetFilter)= "loadSalesPDDetails()"></app-advance-filter>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last 10 days. To see older records, please use advanced filter</p> <p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/> <br/>
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="salesPdData.length > 0" > <mat-table [dataSource]="dataSourceTab4" matSort *ngIf="salesPdData.length > 0" >
@ -85,7 +85,7 @@
</mat-paginator> </mat-paginator>
<mat-card-content *ngIf="recordStatus"> <mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold; <h5 align="center" style="font-weight: bold;
color: brown;">Showing data for last 10 days. To see older records, please use advanced filter</h5> color: brown;">Showing data for last {{common}}. To see older records, please use advanced filter</h5>
</mat-card-content> </mat-card-content>
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>

View File

@ -34,8 +34,14 @@ export class SalesPdComponent implements OnInit {
todaydate:Date = new Date(); todaydate:Date = new Date();
filter_drop_down_data:any; filter_drop_down_data:any;
limitMsg: boolean = false; limitMsg: boolean = false;
common: any;
constructor(private _pdSales: PdTrigerService,private userService:UserService) { } constructor(private _pdSales: PdTrigerService,private userService:UserService) {
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
ngOnInit() { ngOnInit() {
this.loadSalesPDDetails(); this.loadSalesPDDetails();

View File

@ -13,6 +13,7 @@ import { CustomValidators } from 'ng2-validation';
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material'; import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material';
import { CognitoService } from '../../AwsService/cognito.service'; import { CognitoService } from '../../AwsService/cognito.service';
import { DashboardService } from 'app/dashboard/dashboard.service';
@Component({ @Component({
selector: 'ms-login-session', selector: 'ms-login-session',
@ -39,15 +40,25 @@ export class LoginComponent implements OnInit{
right: '' right: ''
} }
}; };
commonDetails: any;
constructor( constructor(
private router: Router, public aws: AwsService, public dialog: MatDialog, private router: Router, public aws: AwsService, public dialog: MatDialog,
public shared:CognitoService,) { public shared:CognitoService,private dashBoardService:DashboardService) {
} }
ngOnInit(){ ngOnInit(){
this.loggedInCheck(); this.loggedInCheck();
} }
getCommonSettings(){
this.dashBoardService.getCommonSettingsConfig().subscribe(res=>{
this.commonDetails = res;
if(this.commonDetails.dataStatus == true){
localStorage.setItem("commonSettings",JSON.stringify(this.commonDetails.records));
}
})
}
/** /**
* @param email * @param email
* @param password * @param password
@ -58,6 +69,7 @@ export class LoginComponent implements OnInit{
this.aws.dologin(auth).subscribe(res => { this.aws.dologin(auth).subscribe(res => {
// console.log("do login",res); // console.log("do login",res);
if (res !== undefined) { if (res !== undefined) {
this.getCommonSettings();
// local storage for validate user access // local storage for validate user access
localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]); localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]);
this.router.navigate(['/']); this.router.navigate(['/']);
@ -82,6 +94,7 @@ export class LoginComponent implements OnInit{
if (result !== undefined) { if (result !== undefined) {
let auth = { 'Username': this.email, 'Password': this.password, 'newpassword': result }; let auth = { 'Username': this.email, 'Password': this.password, 'newpassword': result };
this.aws.dologin(auth).subscribe(res => { this.aws.dologin(auth).subscribe(res => {
this.getCommonSettings();
this.router.navigate(['/']); this.router.navigate(['/']);
}, err => { }, err => {
// alert(err.message); // alert(err.message);