Dynamic PD List count is implemented

This commit is contained in:
sriram-at-840620226347 2020-03-14 13:04:11 +05:30
parent 573814d34b
commit 7a0a05f609
15 changed files with 72 additions and 15 deletions

View File

@ -13,6 +13,7 @@ import { PushNotifyService } from './shared/push-notify.service';
})
export class AppComponent {
message;
commonDetails: any;
// alertTAT;
// public timer
constructor(translate: TranslateService,
@ -32,8 +33,17 @@ export class AppComponent {
this.message = this.messagingService.currentMessage
// this.alertForTAT()
this.pushNotify.requestPermission();
this.getCommonSettings();
}
getCommonSettings(){
this.dashBoardService.getCommonSettingsConfig().subscribe(res=>{
this.commonDetails = res;
if(this.commonDetails.dataStatus == true){
localStorage.setItem("commonSettings",JSON.stringify(this.commonDetails.records));
}
})
}
// alertForTAT(){
// this.alertTAT=Observable.interval(100000).subscribe(timer=>{
// this.timer=timer

View File

@ -81,6 +81,10 @@ getLenderDetail(): Observable<any> {
}
getCommonSettingsConfig(){
return this._http.post(this.apiUrl+'getCommonConfig', '');
}
getAlertDetail(): Observable<any> {
return this._http.get(this.apiUrl+'getDashBoardAlertDetails')
.pipe(

View File

@ -78,7 +78,7 @@
</mat-list>
</mat-expansion-panel>
<p class="note" *ngIf="dataSourceTab1.data.length > 0">Showing data for last 10 days. To see older records, please use advanced filter</p>
<p class="note" *ngIf="dataSourceTab1.data.length > 0">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<mat-table [dataSource]="dataSourceTab1" matSort *ngIf="PdListData.length > 0">
<ng-container matColumnDef="PDType">
@ -163,6 +163,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>

View File

@ -47,6 +47,7 @@ export class AllPdComponent implements OnInit, OnChanges {
pageSize = 10;
pageEvent: PageEvent;
todaydate:Date = new Date();
common: any;
constructor(private _pd: PdTrigerService,private _fb:FormBuilder,notifier: NotifierService,) {
this.notifier = notifier;
this.searchForm = this._fb.group(
@ -63,7 +64,12 @@ export class AllPdComponent implements OnInit, OnChanges {
pd_officer:[null],
is_include_archived: [false]
});
this.getcommonDropDown();
this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
ngOnInit() {
@ -80,6 +86,8 @@ export class AllPdComponent implements OnInit, OnChanges {
}
// load inprogress pd list
loadPDDetails() {

View File

@ -73,7 +73,7 @@
</mat-list>
</mat-expansion-panel>
<p class="note" *ngIf="!recordStatus">Showing data for last 10 days. To see older records, please use advanced filter</p>
<p class="note" *ngIf="!recordStatus">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="completedPdListData.length > 0" >
@ -134,5 +134,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>

View File

@ -47,6 +47,7 @@ export class CompletedPdComponent implements OnInit, OnChanges {
pageSize = 10;
pageEvent: PageEvent;
todaydate:Date = new Date();
common: any;
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,) {
this.notifier = notifier;
@ -65,6 +66,9 @@ export class CompletedPdComponent implements OnInit, OnChanges {
pd_officer:['']
});
this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
ngOnInit() {

View File

@ -72,7 +72,7 @@
</mat-list>
</mat-expansion-panel>
<p class="note" *ngIf="!recordStatus">Showing data for last 10 days. To see older records, please use advanced filter</p>
<p class="note" *ngIf="!recordStatus">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<mat-table [dataSource]="dataSourceTab2" matSort *ngIf="progressPdListData.length > 0" >
<ng-container matColumnDef="PDType">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
@ -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>

View File

@ -44,6 +44,7 @@ export class InprogressPdComponent implements OnInit, OnChanges {
pageSize = 10;
pageEvent: PageEvent;
searchForm:FormGroup;
common: any;
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService) {
this.notifier = notifier;
@ -61,6 +62,9 @@ export class InprogressPdComponent implements OnInit, OnChanges {
pd_officer:[null]
});
this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
ngOnInit() {

View File

@ -74,7 +74,7 @@
</mat-list>
</mat-expansion-panel>
<p class="note" *ngIf="!recordStatus">Showing data for last 10 days. To see older records, please use advanced filter</p>
<p class="note" *ngIf="!recordStatus">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<mat-table [dataSource]="dataSourceTab5" matSort *ngIf="qcCompletedPdListData.length > 0" >
<ng-container matColumnDef="PDType">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
@ -131,5 +131,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>

View File

@ -45,6 +45,7 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
common: any;
constructor(private _pd: PdTrigerService, public _fb: FormBuilder,notifier: NotifierService,) {
this.notifier = notifier;
@ -63,6 +64,9 @@ export class QcCompletedPdComponent implements OnInit, OnChanges {
pd_officer:[null]
});
this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
ngOnInit() {

View File

@ -72,7 +72,7 @@
</mat-list>
</mat-expansion-panel>
<p class="note" *ngIf="!recordStatus">Showing data for last 10 days. To see older records, please use advanced filter</p>
<p class="note" *ngIf="!recordStatus">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<mat-table [dataSource]="dataSourceTab3" matSort *ngIf="scheduledPdListData.length > 0" >
<ng-container matColumnDef="PDType">
<mat-cell fxFlex.xs="20" fxFlex.sm="15" fxFlex.md="13" fxFlex.lg="16" fxFlex.xl="13" class="cell" *matCellDef="let details;" style="justify-content:flex-end">
@ -132,5 +132,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>

View File

@ -44,6 +44,7 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
pageIndex = 0;
pageSize = 10;
pageEvent: PageEvent;
common: any;
constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,) {
this.notifier = notifier;
@ -62,6 +63,9 @@ export class ScheduledPdComponent implements OnInit, OnChanges {
pd_officer:[null]
});
this.getcommonDropDown();
this.common = JSON.parse(localStorage.getItem('commonSettings')).default_pd_list_count;
this.common = this.common.count+' '+this.common.factor
}
ngOnInit() {

View File

@ -20,7 +20,7 @@
<!-- <ng-template mat-tab-label>Sales PD</ng-template> -->
<mat-card-content [hidden]="salesPdData.length == 0" >
<p class="note" *ngIf="salesPdData.length > 0">Showing data for last 10 days. To see older records, please use advanced filter</p>
<p class="note" *ngIf="salesPdData.length > 0">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<mat-table [dataSource]="dataSourceTab4" matSort *ngIf="salesPdData.length > 0" >
<ng-container matColumnDef="SalesPdId">
@ -90,7 +90,7 @@
</mat-card-content>
<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>

View File

@ -34,8 +34,12 @@ export class SalesPdComponent implements OnInit {
pageEvent: PageEvent;
todaydate:Date = new Date();
filter_drop_down_data: any;
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();

View File

@ -14,6 +14,7 @@ import { CustomValidators } from 'ng2-validation';
import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material';
import { CognitoService } from '../../AwsService/cognito.service';
import { MessagingService } from 'app/shared/messaging.service';
import { DashboardService } from 'app/dashboard/dashboard.service';
@Component({
selector: 'ms-login-session',
@ -40,15 +41,26 @@ export class LoginComponent implements OnInit{
right: ''
}
};
commonDetails: any;
constructor(
private router: Router, public aws: AwsService, public dialog: MatDialog,
public shared:CognitoService,private messagingService:MessagingService) {
public shared:CognitoService,private messagingService:MessagingService,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 +70,7 @@ export class LoginComponent implements OnInit{
let auth = { 'Username': this.email, 'Password': this.password };
this.aws.dologin(auth).subscribe(res => {
if (res !== undefined) {
this.getCommonSettings();
// local storage for validate user access
localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]);
this.initializeNotification()
@ -65,6 +78,7 @@ export class LoginComponent implements OnInit{
}
}, err => {
if (err.message == "New password is required.") {
this.newpassopen();
} else {
@ -84,6 +98,7 @@ export class LoginComponent implements OnInit{
let auth = { 'Username': this.email, 'Password': this.password, 'newpassword': result };
this.aws.dologin(auth).subscribe(res => {
localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]);
this.getCommonSettings();
this.initializeNotification()
this.router.navigate(['/home']);
}, err => {