Autologin Fixes : ps

This commit is contained in:
VE10-Sanjeev 2023-07-20 19:07:15 +05:30
parent 4e9138e61f
commit 71f48b4593
9 changed files with 32 additions and 11 deletions

View File

@ -210,10 +210,12 @@
<mat-icon>settings</mat-icon>
Setting
</button>
<span *ngIf="login_type_id == 0">
<button mat-menu-item (click)="userprofile()">
<mat-icon>account_box</mat-icon>
Profile
</button>
</span>
<!-- <button mat-menu-item>
<mat-icon>notifications_off</mat-icon>
Disable notifications

View File

@ -56,9 +56,11 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
userRoleType: any;
userDetails: any;
role_id: any;
login_type_id: number;
constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService) {
const browserLang: string = translate.getBrowserLang();
this.role_id = localStorage.getItem('user_role_nav')
this.login_type_id = parseInt(localStorage.getItem('login_type_id'));
translate.use(browserLang.match(/en|fr/) ? browserLang : 'en');
this.users.getroles().subscribe(res=>{
console.log(res)
@ -293,6 +295,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
}
logout(){
//alert();
this.login_type_id == 1 ? localStorage.removeItem('sales_pd_id_PRIMARYKEY') : localStorage.removeItem('sales_pd_id_PRIMARYKEY');
this.aws.logout().subscribe(res=>{
//alert("res");
this.router.navigate(['/authentication/login']);

View File

@ -2291,17 +2291,19 @@ this.proceedonChangeProperty(modified)
}
redirectSMC(applicant_id){
console.log("calling SMC redirect",environment.authorization);
// window.location.href=data.records;
let email = localStorage.getItem('officer_mail_id');
console.log("calling SMC redirect email = ",email);
// http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid=4231&email=aniltiwari@smcfinance.com
if(environment.authorization == 'TnAwuc64pVpcB9xf'){
let salesapp_link ="http://salesapp.smcfinance.com/app/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email=aniltiwari@smcfinance.com";
let salesapp_link ="http://salesapp.smcfinance.com/app/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email="+email;
console.log('2p salesapp_link = ',salesapp_link);
window.open(salesapp_link, '_blank');
}else if(environment.authorization == 'sparqvenba2018'){
let salesapp_link ="http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email=aniltiwari@smcfinance.com";
let salesapp_link ="http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid="+applicant_id+"&email="+email;
console.log('2t salesapp_link = ',salesapp_link);
window.open(salesapp_link, '_blank');
// this.router.navigate([salesapp_link]);

View File

@ -101,7 +101,7 @@ export class HomePage{
localStorage.removeItem('sales_pd_type');
// this.salesPDService.clearLocalData()
// this.salesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
localStorage.removeItem('sales_pd_id_PRIMARYKEY');
parseInt(localStorage.getItem('login_type_id')) == 0 ? localStorage.removeItem('sales_pd_id_PRIMARYKEY') : '';
}
});
@ -858,13 +858,13 @@ checkTheUploadingProgress(sec_value){
console.log("else part")
// this.sendDatatoApi()
// this.SalesPDService.clearLocalData()
localStorage.removeItem('sales_pd_id_PRIMARYKEY')
parseInt(localStorage.getItem('login_type_id')) == 0 ? localStorage.removeItem('sales_pd_id_PRIMARYKEY') : '';
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
let msg=event.hasOwnProperty('is_completed') && event.is_completed == true ? "Completed Successfully" : 'Saved Successfully..!'
this.notifier.notify('success', msg);
// this.toastProvider.lenderappmessage(msg);
// this.SalesPDService.clearLocalData()
localStorage.removeItem('sales_pd_id_PRIMARYKEY')
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
localStorage.removeItem('product_id_salesPD')
this.dialogRef.close(event);

View File

@ -1,4 +1,5 @@
<mat-card class="p-2" style="box-shadow: 0 0 1px rgba(0,0,0,.18), 0 0 1px rgba(0,0,0,.15) !important">
<span *ngIf="loginTypeId == 0">
<div fxLayout="row">
<div fxFlex="50" class="pb-0 text-sm-left">
<mat-form-field dividerColor="primary" style="width: 50%;">
@ -14,6 +15,7 @@
</div>
</div>
</span>
<mat-tab-group class="mt-1">
<mat-tab>
<ng-template mat-tab-label>Sales PD</ng-template>
@ -21,8 +23,9 @@
<span *ngIf="loginTypeId == 0">
<app-advance-filter [drop_down_datas]="filter_drop_down_data" (filteredlistData)="filteredDataSource($event)"
></app-advance-filter>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
</span>
<p class="note" *ngIf="!recordStatus && limitMsg">Showing data for last {{common}}. To see older records, please use advanced filter</p>
<br/>
<div class="example-container">
<!--Start Mobile View Code-->

View File

@ -297,15 +297,16 @@ export class SalesPdComponent implements OnInit {
// window.location.href=data.records;
let email = localStorage.getItem('officer_mail_id');
console.log("redirected email = "+email);
let applicant_id = value_obj.applicant_id;
console.log(value_obj.applicant_id);
if (environment.authorization == 'TnAwuc64pVpcB9xf') {
let salesapp_link = "https://salesapp.smcfinance.com/app/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid=" + applicant_id + "&email=aniltiwari@smcfinance.com";
let salesapp_link = "https://salesapp.smcfinance.com/app/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid=" + applicant_id + "&email="+email;
console.log('in list salesapp_link = ', salesapp_link);
let salesapp_url = salesapp_link;
window.open(salesapp_url);
} else if (environment.authorization == 'sparqvenba2018') {
let salesapp_link = "http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid=" + applicant_id + "&email=aniltiwari@smcfinance.com";
let salesapp_link = "http://salesapp.devopsmcfinance.com/secure?saltkey=$2y$10$H4vSrWl15syQHO.tsT0DdOF7pYSTKZBT85sOFCJerttTdObBRsB36&applicantid=" + applicant_id + "&email="+email;
console.log('in list salesapp_link = ', salesapp_link);
let salesapp_url = salesapp_link;
window.open(salesapp_url);
@ -465,7 +466,7 @@ export class SalesPdComponent implements OnInit {
// });
// this.SalesPDService.clearLocalData()
// this.SalesPDService.clear_local_key('sales_pd_id_PRIMARYKEY');
localStorage.removeItem('sales_pd_id_PRIMARYKEY')
parseInt(localStorage.getItem('login_type_id')) == 0 ? localStorage.removeItem('sales_pd_id_PRIMARYKEY') : '';
localStorage.removeItem('product_id_salesPD')
localStorage.removeItem('sales_pd_type')
// this.navCtrl.push(HomePage)

View File

@ -37,6 +37,8 @@ export class SectionListComponent implements OnInit {
flyHiUserId: any;
sales_pd_id_PRIMARYKEY: string;
rand_string: string;
login_type_id: number;
constructor(public dialogRef: MatDialogRef<SectionListComponent>,private constantProvider:ConstantsProvider,notifier: NotifierService,private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute,private SalesPDService:SalesPdService,
private router: Router,private loaderService:LoaderService ) {
@ -48,6 +50,7 @@ export class SectionListComponent implements OnInit {
this.sales_pd_type = localStorage.getItem('sales_pd_type')
console.log( this.sales_pd_type)
this.sales_pd_id_PRIMARYKEY = localStorage.getItem('sales_pd_id_PRIMARYKEY')
this.login_type_id = parseInt(localStorage.getItem('login_type_id'));
}
if(this.route.snapshot.params['product_id']){
@ -297,8 +300,9 @@ export class SectionListComponent implements OnInit {
merge_saved_status(res){
let saved_sections=res['records'].map(val=>{return {'section_id':val.section_id , 'status':val.status,'is_synced':val.is_synced}});
console.log("saved",saved_sections);
console.log("B4 saved",saved_sections);
saved_sections = saved_sections.filter(val=>parseInt(val.status) == 1);
console.log("After saved",saved_sections);
const mergeById = (a1, a2) =>
a1.map(itm => ({
...a2.find((item) => (item.section_id === itm.section_id) && item),

View File

@ -108,6 +108,9 @@ export class HorizontalMenuItems {
salesgetAll(): Menu[] {
let filtered_sales_menu = salesmenu
let user_type= localStorage.getItem('len_user_role')
if(parseInt(localStorage.getItem('login_type_id')) == 1){
filtered_sales_menu = salesmenu.filter(vv=>vv.icon != 'work')
}
// if(user_type != 'credit'){
// filtered_sales_menu = salesmenu.filter(vv=>vv.state != 'credit_pd')
// }

View File

@ -193,6 +193,9 @@ export class MenuItems {
// if(user_type != 'credit'){
// filtered_sales_menu = salesMenus.filter(vv=>vv.state != 'credit_pd')
// }
if(parseInt(localStorage.getItem('login_type_id')) == 1){
filtered_sales_menu = salesMenus.filter(vv=>vv.icon != 'work')
}
return filtered_sales_menu;
}