From efd5553f097f8aa06a98309b99aaf9cc24ab7092 Mon Sep 17 00:00:00 2001 From: birendra.kumar Date: Fri, 22 Nov 2019 09:40:53 +0530 Subject: [PATCH] bug fixes on prod with www url --- 400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts | 27 ++++++++++++++------------- 400-SOURCECODE/Admin/src/app/shared/global.ts | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------- 2 files changed, 71 insertions(+), 62 deletions(-) diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts index ad3e7c4..28eeccf 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/adduser.component.ts @@ -70,12 +70,12 @@ export class AddUser implements OnInit, AfterViewInit { UserTypeId: ['', Validators.required], ProductEditionId: ['', Validators.required] }); - debugger + this._loadingService.ShowLoading("global-loading"); this.bindUsers(); this.GetAccountNumber(); - this.GetUserTypeByLicenseId(); - this._loadingService.HideLoading("global-loading"); + //this.GetUserTypeByLicenseId(); + } ngAfterViewInit() { this.CheckDropDownOrUp(this.accountNodiv.nativeElement); @@ -84,7 +84,6 @@ export class AddUser implements OnInit, AfterViewInit { this.router.navigate(['/']); } GetUserTypeByLicenseId() { - debugger; var Accountnumber = this.adduserFrm.controls['AccountNumberId'].value; if (Accountnumber == "") { Accountnumber = 0 } this.userservice.GetUserTypeByLicenseType({ @@ -99,7 +98,6 @@ export class AddUser implements OnInit, AfterViewInit { this.loopIdx1 = 0; this.loopIdx2 = 0; this.lastScrollPos = 0; - this.tempLstAccountNumbers = []; if (this.commonService.UserType > 2) { this.accountDropDownText = this.commonService.AccountNumber; this.tempLstAccountNumbers.push(this.accountDropDownText); @@ -109,7 +107,10 @@ export class AddUser implements OnInit, AfterViewInit { for (var i = 0; i < 50; i++) { this.tempLstAccountNumbers.push(this.AccountNumberList[this.loopIdx2++]); } + + this._loadingService.HideLoading("global-loading"); } + }, error => this.error = error); } @@ -118,14 +119,15 @@ export class AddUser implements OnInit, AfterViewInit { this.userservice.GetProductEdition({ AccountNumberId: this.adduserFrm.controls['AccountNumberId'].value }) - .subscribe(x => { console.log(x); this.ProductEditionList = x }, error => this.error = error); + .subscribe(x => { + console.log(x); + this.ProductEditionList = x ; + this._loadingService.HideLoading("global-loading"); + }, error => this.error = error); } - //BindUserTypeAndProductEdition(deviceValue) { - //this.GetUserTypeByLicenseId(); - //this.GetProductEdition(); - //} + AccountNumberChanged(LicenseId: number, SelectText: string) { - + this._loadingService.ShowLoading("global-loading"); this.accountDropDownText = SelectText; this.adduserFrm.controls['AccountNumberId'].setValue(LicenseId); this.GetUserTypeByLicenseId(); @@ -135,7 +137,6 @@ export class AddUser implements OnInit, AfterViewInit { .subscribe(st => { this.license = st; this.LicenseTypeId=this.license.LicenseTypeId; - }, error => this.error = error); @@ -281,7 +282,7 @@ export class AddUser implements OnInit, AfterViewInit { @HostListener('window:scroll', ['$event']) onWindowScroll(event) { // console.debug("Scroll Event", document.body.scrollTop); - // see András Szepesházi's comment below + // see Andr�s Szepesh�zi's comment below //console.debug("Scroll Event", window.pageYOffset ); this.CheckDropDownOrUp(this.accountNodiv.nativeElement); } diff --git a/400-SOURCECODE/Admin/src/app/shared/global.ts b/400-SOURCECODE/Admin/src/app/shared/global.ts index 4333282..dc415aa 100644 --- a/400-SOURCECODE/Admin/src/app/shared/global.ts +++ b/400-SOURCECODE/Admin/src/app/shared/global.ts @@ -44,48 +44,34 @@ export class GlobalService { this.QAAPIURL = "http://qa.beta.interactiveanatomy.com/API/Adminapi/"; this.LocalURL = "http://localhost:4200"; - // get protocol type + // get protocol type this.ProtocolType = window.location.protocol+"//"; - if(window.location.hostname=="localhost") - { - //**** for localhost:4200 *****// - this.resourceBaseUrl = this.hostURL; - } - else - { - // get hosted url on uat and prod server - this.resourceBaseUrl = window.location.origin+"/API/Adminapi/"; - - } - - // local - if (this.resourceBaseUrl == this.ProtocolType+"192.168.81.63:92/API/Adminapi/") { - localStorage.setItem('loggedInUserDetails', JSON.stringify( - { - "Id": 1, "FirstName": "Maribel", "LastName": "sfsfsfsfsfsfs", "EmailId": "ravi.vishwakarma@ebix.com", "LoginId": "superadmin", "Password": "ebix@2016", "SecurityQuestionId": 1, "SecurityAnswer": "boxer", "CreatorId": 1, "CreationDate": "2009-03-02T00:00:00", "DeactivationDate": null, "ModifierId": 1, "ModifiedDate": "2017-01-24T02:03:19", "UserType": "Super Admin", "UserTypeId": 1, "IsActive": true, "IsCorrectPassword": false, "IncorrectLoginAttemptCount": 0, "IsBlocked": false, "LicenseId": 0, "EditionId": 0, "LoginFailureCauseId": 0, "Modules": [{ "slug": "da-view-list", "name": "Dissectible Anatomy", "id": 1 }, { "slug": "tile-view-list", "name": "Atlas Anatomy", "id": 2 }, { "slug": "3d-anatomy-list", "name": "3D Anatomy", "id": 3 }, { "slug": "clinical-illustrations", "name": "Clinical Illustrations", "id": 4 }, { "slug": "clinical-animations", "name": "Clinical Animations", "id": 5 }, { "slug": "Link/encyclopedia", "name": "Encyclopedia", "id": 6 }, { "slug": "curriculum-builder", "name": "Curriculum Builder", "id": 7 }, { "slug": "anatomy-test", "name": "Anatomy Test", "id": 8 }, { "slug": "Link/IP-10", "name": "IP 10", "id": 9 }, { "slug": "lab-exercises", "name": "Lab Exercises", "id": 10 }, { "slug": "Link/indepth-reports", "name": "In-Depth Reports", "id": 11 }, { "slug": "Link/complementary-and-alternate-medicine", "name": "CAM", "id": 12 }, { "slug": "ADAM-images", "name": "A.D.A.M. Images", "id": 13 }, { "slug": "Link/bodyguide", "name": "Body Guide", "id": 14 }, { "slug": "Link/health-navigator", "name": "Symptom Navigator", "id": 15 }, { "slug": "Link/wellness-tools", "name": "The Wellness Tools", "id": 16 }, { "slug": "Link/aod", "name": "A.D.A.M. OnDemand", "id": 1017 }], "LicenseInfo": [{ "Id": 0, "AccountNumber": "AIAS000319" }], "LicenseSubscriptions": null, "IsSubscriptionExpired": false, "SubscriptionExpirationDate": null, "TermsAndConditionsTitle": null, "TermsAndConditionsText": null - })); - this.loggedInUser = JSON.parse(localStorage.getItem("loggedInUserDetails")); - if (this.UserTypeName == "Client Admin" || this.UserTypeName == "District Admin") { - this.AccountNumber = this.loggedInUser.LicenseInfo[0].AccountNumber + if(window.location.hostname=="localhost") + { + //**** for localhost:4200 *****// + this.resourceBaseUrl = this.hostURL; } - if (this.loggedInUser.LicenseInfo == null) { - this.AccLicId = 0; - this.AccountNumber = ''; - - } - else { - this.AccLicId = this.loggedInUser.LicenseInfo[0].Id; - this.AccountNumber = this.loggedInUser.LicenseInfo[0].AccountNumber; + else + { + // get hosted url on uat and prod server + this.resourceBaseUrl = window.location.origin+"/API/Adminapi/"; + } - } - // Live - if (this.resourceBaseUrl == this.ProtocolType+"interactiveanatomy.com/API/Adminapi/") { - this.LiveURL = this.ProtocolType+"interactiveanatomy.com"; + if (this.resourceBaseUrl == this.ProtocolType+"192.168.81.63:92/API/Adminapi/") { + if(window.location.hostname=="localhost") + { + //**** for localhost:4200 *****// + localStorage.setItem('loggedInUserDetails', JSON.stringify( + { + "Id": 1, "FirstName": "Maribel", "LastName": "sfsfsfsfsfsfs", "EmailId": "ravi.vishwakarma@ebix.com", "LoginId": "superadmin", "Password": "ebix@2016", "SecurityQuestionId": 1, "SecurityAnswer": "boxer", "CreatorId": 1, "CreationDate": "2009-03-02T00:00:00", "DeactivationDate": null, "ModifierId": 1, "ModifiedDate": "2017-01-24T02:03:19", "UserType": "Super Admin", "UserTypeId": 1, "IsActive": true, "IsCorrectPassword": false, "IncorrectLoginAttemptCount": 0, "IsBlocked": false, "LicenseId": 0, "EditionId": 0, "LoginFailureCauseId": 0, "Modules": [{ "slug": "da-view-list", "name": "Dissectible Anatomy", "id": 1 }, { "slug": "tile-view-list", "name": "Atlas Anatomy", "id": 2 }, { "slug": "3d-anatomy-list", "name": "3D Anatomy", "id": 3 }, { "slug": "clinical-illustrations", "name": "Clinical Illustrations", "id": 4 }, { "slug": "clinical-animations", "name": "Clinical Animations", "id": 5 }, { "slug": "Link/encyclopedia", "name": "Encyclopedia", "id": 6 }, { "slug": "curriculum-builder", "name": "Curriculum Builder", "id": 7 }, { "slug": "anatomy-test", "name": "Anatomy Test", "id": 8 }, { "slug": "Link/IP-10", "name": "IP 10", "id": 9 }, { "slug": "lab-exercises", "name": "Lab Exercises", "id": 10 }, { "slug": "Link/indepth-reports", "name": "In-Depth Reports", "id": 11 }, { "slug": "Link/complementary-and-alternate-medicine", "name": "CAM", "id": 12 }, { "slug": "ADAM-images", "name": "A.D.A.M. Images", "id": 13 }, { "slug": "Link/bodyguide", "name": "Body Guide", "id": 14 }, { "slug": "Link/health-navigator", "name": "Symptom Navigator", "id": 15 }, { "slug": "Link/wellness-tools", "name": "The Wellness Tools", "id": 16 }, { "slug": "Link/aod", "name": "A.D.A.M. OnDemand", "id": 1017 }], "LicenseInfo": { "Id": 0, "AccountNumber": "AIAS000319" }, "LicenseSubscriptions": null, "IsSubscriptionExpired": false, "SubscriptionExpirationDate": null, "TermsAndConditionsTitle": null, "TermsAndConditionsText": null + })); + } + + this.loggedInUser = JSON.parse(localStorage.getItem("loggedInUserDetails")); if (this.UserTypeName == "Client Admin" || this.UserTypeName == "District Admin") { this.AccountNumber = this.loggedInUser.LicenseInfo.AccountNumber - this.AccLicId = this.loggedInUser.LicenseInfo.Id; } if (this.loggedInUser.LicenseInfo == null) { this.AccLicId = 0; @@ -96,25 +82,47 @@ export class GlobalService { this.AccLicId = this.loggedInUser.LicenseInfo.Id; this.AccountNumber = this.loggedInUser.LicenseInfo.AccountNumber; } + } + // Live + if ((this.resourceBaseUrl == this.ProtocolType+"interactiveanatomy.com/API/Adminapi/") + ||(this.resourceBaseUrl == this.ProtocolType+"www.interactiveanatomy.com/API/Adminapi/")) + { + this.LiveURL = this.ProtocolType+"interactiveanatomy.com"; + if (this.UserTypeName == "Client Admin" || this.UserTypeName == "District Admin") { + this.AccountNumber = this.loggedInUser.LicenseInfo.AccountNumber + this.AccLicId = this.loggedInUser.LicenseInfo.Id; + } + if (this.loggedInUser.LicenseInfo == null) { + this.AccLicId = 0; + this.AccountNumber = ''; + + } + else { + this.AccLicId = this.loggedInUser.LicenseInfo.Id; + this.AccountNumber = this.loggedInUser.LicenseInfo.AccountNumber; + } + } // QA - if (this.resourceBaseUrl == this.ProtocolType+"qa.beta.interactiveanatomy.com/API/Adminapi/") { - this.LiveURL = this.ProtocolType+"qa.beta.interactiveanatomy.com"; - if (this.UserTypeName == "Client Admin" || this.UserTypeName == "District Admin") { - this.AccountNumber = this.loggedInUser.LicenseInfo.AccountNumber - this.AccLicId = this.loggedInUser.LicenseInfo.Id; - } - if (this.loggedInUser.LicenseInfo == null) { - this.AccLicId = 0; - this.AccountNumber = ''; + if ((this.resourceBaseUrl == this.ProtocolType+"qa.beta.interactiveanatomy.com/API/Adminapi/") + || (this.resourceBaseUrl == this.ProtocolType+"www.qa.beta.interactiveanatomy.com/API/Adminapi/")) + { + this.LiveURL = this.ProtocolType+"qa.beta.interactiveanatomy.com"; + if (this.UserTypeName == "Client Admin" || this.UserTypeName == "District Admin") { + this.AccountNumber = this.loggedInUser.LicenseInfo.AccountNumber + this.AccLicId = this.loggedInUser.LicenseInfo.Id; + } + if (this.loggedInUser.LicenseInfo == null) { + this.AccLicId = 0; + this.AccountNumber = ''; + } + else { + this.AccLicId = this.loggedInUser.LicenseInfo.Id; + this.AccountNumber = this.loggedInUser.LicenseInfo.AccountNumber; + } } - else { - this.AccLicId = this.loggedInUser.LicenseInfo.Id; - this.AccountNumber = this.loggedInUser.LicenseInfo.AccountNumber; - } - } } -- libgit2 0.21.4