Dynamic PD List count is implemented
This commit is contained in:
parent
c937e346ff
commit
2ec973dddc
@ -19,6 +19,10 @@ export class DashboardService {
|
||||
private apiUrl = environment.apiEndpoint;
|
||||
|
||||
constructor(private _http: HttpClient,
|
||||
private _aws:AwsService) { }
|
||||
private _aws:AwsService) { }
|
||||
|
||||
getCommonSettingsConfig(){
|
||||
return this._http.post(this.apiUrl+'getCommonConfig', '');
|
||||
}
|
||||
|
||||
}
|
||||
@ -22,7 +22,8 @@ import { RoleMenuItemsPipe } from './../role-menu-items.pipe';
|
||||
|
||||
export class AdminLayoutComponent implements OnInit, OnDestroy {
|
||||
|
||||
profileurl: any;;
|
||||
profileurl: any;
|
||||
commonDetails: any;
|
||||
userDep: string;
|
||||
fullName: any;
|
||||
roleName:any;
|
||||
@ -135,6 +136,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
||||
// Ps.update(elemContent);
|
||||
}
|
||||
});
|
||||
this.getCommonSettings();
|
||||
}
|
||||
|
||||
@HostListener('click', ['$event'])
|
||||
@ -295,4 +297,13 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
getCommonSettings(){
|
||||
this._dashboardService.getCommonSettingsConfig().subscribe(res=>{
|
||||
this.commonDetails = res;
|
||||
if(this.commonDetails.dataStatus == true){
|
||||
localStorage.setItem("commonSettings",JSON.stringify(this.commonDetails.records));
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
|
||||
</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/>
|
||||
<mat-table [dataSource]="dataSourceTab1" matSort *ngIf="PdListData.length > 0">
|
||||
|
||||
@ -156,6 +156,6 @@
|
||||
</div>
|
||||
<mat-card-content *ngIf="recordStatus">
|
||||
<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>
|
||||
<notifier-container></notifier-container>
|
||||
@ -50,6 +50,7 @@ export class AllPdComponent implements OnInit, OnChanges {
|
||||
todaydate:Date = new Date();
|
||||
user_role_name: string;
|
||||
limitMsg: boolean = false;
|
||||
common: any;
|
||||
constructor(private _pd: PdTrigerService,private _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
|
||||
this.notifier = notifier;
|
||||
|
||||
@ -66,6 +67,9 @@ export class AllPdComponent implements OnInit, OnChanges {
|
||||
pd_applicant_id:[null],
|
||||
});
|
||||
this.getcommonDropDown();
|
||||
|
||||
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
|
||||
this.common = this.common.count+' '+this.common.factor
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
</mat-list>
|
||||
|
||||
</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/>
|
||||
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="completedPdListData.length > 0" >
|
||||
|
||||
@ -127,5 +127,5 @@
|
||||
</div>
|
||||
<mat-card-content *ngIf="recordStatus">
|
||||
<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>
|
||||
@ -49,6 +49,7 @@ export class CompletedPdComponent implements OnInit, OnChanges {
|
||||
todaydate:Date = new Date();
|
||||
user_role_name: string;
|
||||
limitMsg: boolean = false;
|
||||
common: any;
|
||||
|
||||
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
|
||||
this.notifier = notifier;
|
||||
@ -66,6 +67,9 @@ export class CompletedPdComponent implements OnInit, OnChanges {
|
||||
pd_applicant_id:[null],
|
||||
});
|
||||
this.getcommonDropDown();
|
||||
|
||||
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
|
||||
this.common = this.common.count+' '+this.common.factor
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
</mat-list>
|
||||
|
||||
</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/>
|
||||
<mat-table [dataSource]="dataSourceTab2" matSort *ngIf="progressPdListData.length > 0" >
|
||||
<ng-container matColumnDef="PDType">
|
||||
@ -124,5 +124,5 @@
|
||||
</div>
|
||||
<mat-card-content *ngIf="recordStatus">
|
||||
<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>
|
||||
@ -47,6 +47,7 @@ export class InprogressPdComponent implements OnInit, OnChanges {
|
||||
searchForm:FormGroup;
|
||||
user_role_name: string;
|
||||
limitMsg: boolean = false;
|
||||
common: any;
|
||||
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
|
||||
this.notifier = notifier;
|
||||
|
||||
@ -63,6 +64,9 @@ export class InprogressPdComponent implements OnInit, OnChanges {
|
||||
pd_applicant_id:[null],
|
||||
});
|
||||
this.getcommonDropDown();
|
||||
|
||||
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
|
||||
this.common = this.common.count+' '+this.common.factor
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
</mat-list>
|
||||
|
||||
</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/>
|
||||
<mat-table [dataSource]="dataSourceTab5" matSort *ngIf="qcCompletedPdListData.length > 0" >
|
||||
<ng-container matColumnDef="PDType">
|
||||
@ -126,5 +126,5 @@
|
||||
</div>
|
||||
<mat-card-content *ngIf="recordStatus">
|
||||
<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>
|
||||
@ -48,6 +48,7 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
|
||||
pageEvent: PageEvent;
|
||||
user_role_name: string;
|
||||
limitMsg: boolean = false;
|
||||
common: any;
|
||||
|
||||
constructor(private _pd: PdTrigerService, public _fb: FormBuilder,notifier: NotifierService,private userService:UserService) {
|
||||
this.notifier = notifier;
|
||||
@ -65,6 +66,9 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
|
||||
pd_applicant_id: [null],
|
||||
});
|
||||
this.getcommonDropDown();
|
||||
|
||||
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
|
||||
this.common = this.common.count+' '+this.common.factor
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
</mat-list>
|
||||
|
||||
</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/>
|
||||
<mat-table [dataSource]="dataSourceTab3" matSort *ngIf="scheduledPdListData.length > 0" >
|
||||
<ng-container matColumnDef="PDType">
|
||||
@ -128,5 +128,5 @@
|
||||
</div>
|
||||
<mat-card-content *ngIf="recordStatus">
|
||||
<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>
|
||||
@ -47,6 +47,7 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
|
||||
pageEvent: PageEvent;
|
||||
user_role_name: string;
|
||||
limitMsg: boolean = false;
|
||||
common: any;
|
||||
|
||||
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService) {
|
||||
this.notifier = notifier;
|
||||
@ -64,6 +65,9 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
|
||||
pd_applicant_id:[null],
|
||||
});
|
||||
this.getcommonDropDown();
|
||||
|
||||
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
|
||||
this.common = this.common.count+' '+this.common.factor
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<mat-card-content>
|
||||
<app-advance-filter [drop_down_datas]="filter_drop_down_data" (filteredlistData)="filteredDataSource($event)"
|
||||
(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/>
|
||||
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="salesPdData.length > 0" >
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
</mat-paginator>
|
||||
<mat-card-content *ngIf="recordStatus">
|
||||
<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-tab>
|
||||
</mat-tab-group>
|
||||
|
||||
@ -34,8 +34,14 @@ export class SalesPdComponent implements OnInit {
|
||||
todaydate:Date = new Date();
|
||||
filter_drop_down_data:any;
|
||||
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() {
|
||||
this.loadSalesPDDetails();
|
||||
|
||||
@ -13,6 +13,7 @@ import { CustomValidators } from 'ng2-validation';
|
||||
|
||||
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material';
|
||||
import { CognitoService } from '../../AwsService/cognito.service';
|
||||
import { DashboardService } from 'app/dashboard/dashboard.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ms-login-session',
|
||||
@ -39,15 +40,25 @@ export class LoginComponent implements OnInit{
|
||||
right: ''
|
||||
}
|
||||
};
|
||||
commonDetails: any;
|
||||
constructor(
|
||||
private router: Router, public aws: AwsService, public dialog: MatDialog,
|
||||
public shared:CognitoService,) {
|
||||
public shared:CognitoService,private dashBoardService:DashboardService) {
|
||||
|
||||
}
|
||||
ngOnInit(){
|
||||
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 password
|
||||
@ -58,6 +69,7 @@ export class LoginComponent implements OnInit{
|
||||
this.aws.dologin(auth).subscribe(res => {
|
||||
// console.log("do login",res);
|
||||
if (res !== undefined) {
|
||||
this.getCommonSettings();
|
||||
// local storage for validate user access
|
||||
localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]);
|
||||
this.router.navigate(['/']);
|
||||
@ -82,6 +94,7 @@ export class LoginComponent implements OnInit{
|
||||
if (result !== undefined) {
|
||||
let auth = { 'Username': this.email, 'Password': this.password, 'newpassword': result };
|
||||
this.aws.dologin(auth).subscribe(res => {
|
||||
this.getCommonSettings();
|
||||
this.router.navigate(['/']);
|
||||
}, err => {
|
||||
// alert(err.message);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user