diff --git a/Auth0Templates/LogIn.html b/Auth0Templates/LogIn.html index 02ef445df..eabc4db96 100644 --- a/Auth0Templates/LogIn.html +++ b/Auth0Templates/LogIn.html @@ -4,7 +4,7 @@ - + Sign In - CCS @@ -963,7 +963,7 @@

Guides

function forgotPassword(){ let lastUserEmail = document.getElementById("email").value localStorage.setItem('lastUserEmail', lastUserEmail); - window.location.href = "https://dev.identify.crowncommercial.gov.uk/forgot-password?email="+lastUserEmail; + window.location.href = "https://dev.identify.crowncommercial.gov.uk/forgot-password?email="+encodeURIComponent(lastUserEmail); } let emailInput = document.getElementById("email"); @@ -972,7 +972,7 @@

Guides

email.addEventListener('input', function () { lastUserEmail = emailInput.value; - forgotPwdLink.href = "https://dev.identify.crowncommercial.gov.uk/forgot-password?email="+lastUserEmail; + forgotPwdLink.href = "https://dev.identify.crowncommercial.gov.uk/forgot-password?email="+encodeURIComponent(lastUserEmail); }); window.addEventListener('load', function () { diff --git a/Auth0Templates/Mfa.html b/Auth0Templates/Mfa.html index 3e4f22ab5..3c62d872f 100644 --- a/Auth0Templates/Mfa.html +++ b/Auth0Templates/Mfa.html @@ -6,7 +6,7 @@ + href="https://crown-commercial-service.github.io/conclave-ssso-ui/faviconnew.ico"> Sign In - CCS diff --git a/Auth0Templates/ResetPassword.html b/Auth0Templates/ResetPassword.html index b8663d3db..caefceb47 100644 --- a/Auth0Templates/ResetPassword.html +++ b/Auth0Templates/ResetPassword.html @@ -5,7 +5,7 @@ + href="https://crown-commercial-service.github.io/conclave-ssso-ui/faviconnew.ico"> Set Password - CCS diff --git a/angular.json b/angular.json index 85b5f35c0..a78f975ca 100644 --- a/angular.json +++ b/angular.json @@ -26,7 +26,7 @@ "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", "assets": [ - "src/favicon.ico", + "src/faviconnew.ico", "src/assets", { "glob": "**/*", @@ -216,7 +216,7 @@ "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", "assets": [ - "src/favicon.ico", + "src/faviconnew.ico", "src/assets" ], "styles": [ diff --git a/package-lock.json b/package-lock.json index 6a5d0b8ae..feac321ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5383,9 +5383,9 @@ } }, "node_modules/dns-packet/node_modules/ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz", + "integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==", "dev": true }, "node_modules/dns-txt": { @@ -6425,9 +6425,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "dev": true, "funding": [ { @@ -7254,9 +7254,9 @@ "integrity": "sha512-+jPgPKUcgbhSSRN0BZLJOdntTaMv8tqowLrVQ3CGCNGpMKb4B9PRyzOZQpwo1FeA+LTOzvErOlBhbCuQog7R3g==" }, "node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", "dev": true }, "node_modules/ipaddr.js": { @@ -16997,9 +16997,9 @@ }, "dependencies": { "ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz", + "integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==", "dev": true } } @@ -17715,9 +17715,9 @@ "dev": true }, "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "dev": true }, "forwarded": { @@ -18337,9 +18337,9 @@ "integrity": "sha512-+jPgPKUcgbhSSRN0BZLJOdntTaMv8tqowLrVQ3CGCNGpMKb4B9PRyzOZQpwo1FeA+LTOzvErOlBhbCuQog7R3g==" }, "ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", "dev": true }, "ipaddr.js": { diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index f91bb60c4..c860c2d54 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -54,7 +54,7 @@ import { ManageUserDeleteConfirmComponent } from './pages/manage-user/manage-use import { ManageOrganisationErrorComponent } from './pages/manage-organisation/manage-organisation-error/manage-organisation-error.component'; import { ContactUsComponent } from './pages/contactus/contactus.component'; import { BuyerSearchComponent } from './pages/buyer/search/search.component'; -import { BuyerConfirmComponent } from './pages/buyer/confirm/confirm.component'; +// import { BuyerConfirmComponent } from './pages/buyer/confirm/confirm.component'; import { BuyerDetailsComponent } from './pages/buyer/details/details.component'; import { BuyerSuccessComponent } from './pages/buyer/success/success.component'; import { OrgSupportSuccessComponent } from './pages/org-support/success/success.component'; @@ -823,13 +823,13 @@ const routes: Routes = [ canActivate: [MaintenanceCheck, AuthGuard, RoleGuard,DormancyGuard], component: BuyerDetailsComponent, }, - { - path: 'buyer/confirm/:id', - data: { title: 'Review - Manage Buyers', roles: ['MANAGE_SUBSCRIPTIONS'] }, - pathMatch: 'full', - canActivate: [MaintenanceCheck, AuthGuard, RoleGuard,DormancyGuard], - component: BuyerConfirmComponent, - }, + // { + // path: 'buyer/confirm/:id', + // data: { title: 'Review - Manage Buyers', roles: ['MANAGE_SUBSCRIPTIONS'] }, + // pathMatch: 'full', + // canActivate: [MaintenanceCheck, AuthGuard, RoleGuard,DormancyGuard], + // component: BuyerConfirmComponent, + // }, { path: 'update-org-type/confirm', data: { title: 'Review - Manage Buyers', roles: ['MANAGE_SUBSCRIPTIONS'] }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 625679893..670e162ef 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -90,7 +90,7 @@ import { ManageUserDeleteConfirmComponent } from './pages/manage-user/manage-use import { ManageOrganisationErrorComponent } from './pages/manage-organisation/manage-organisation-error/manage-organisation-error.component'; import { ContactUsComponent } from './pages/contactus/contactus.component'; import { BuyerSearchComponent } from './pages/buyer/search/search.component'; -import { BuyerConfirmComponent } from './pages/buyer/confirm/confirm.component'; +// import { BuyerConfirmComponent } from './pages/buyer/confirm/confirm.component'; import { BuyerDetailsComponent } from './pages/buyer/details/details.component'; import { BuyerSuccessComponent } from './pages/buyer/success/success.component'; import { OrgSupportSearchComponent } from './pages/org-support/search/search.component'; @@ -304,7 +304,7 @@ export function createTranslateLoader(http: HttpClient) { ManageOrganisationErrorComponent, BuyerSearchComponent, BuyerDetailsComponent, - BuyerConfirmComponent, + // BuyerConfirmComponent, BuyerSuccessComponent, OrgSupportSearchComponent, OrgSupportDetailsComponent, diff --git a/src/app/pages/buyer/confirm-changes/confirm.component.spec.ts b/src/app/pages/buyer/confirm-changes/confirm.component.spec.ts index 52c5e4de1..c6f678204 100644 --- a/src/app/pages/buyer/confirm-changes/confirm.component.spec.ts +++ b/src/app/pages/buyer/confirm-changes/confirm.component.spec.ts @@ -71,13 +71,13 @@ describe('BuyerConfirmChangesComponent', () => { expect(component.org$).toBeInstanceOf(Observable); }); - it('should navigate to the confirm page with the correct ID when onBackClick is called', () => { - const routerSpy = spyOn(component.router, 'navigateByUrl'); + // it('should navigate to the confirm page with the correct ID when onBackClick is called', () => { + // const routerSpy = spyOn(component.router, 'navigateByUrl'); - component.org = { ciiOrganisationId: 1 }; + // component.org = { ciiOrganisationId: 1 }; - component.onBackClick(); + // component.onBackClick(); - expect(routerSpy).toHaveBeenCalledWith('buyer/confirm/1'); - }); + // expect(routerSpy).toHaveBeenCalledWith('buyer/confirm/1'); + // }); }); diff --git a/src/app/pages/buyer/confirm-changes/confirm.component.ts b/src/app/pages/buyer/confirm-changes/confirm.component.ts index 07662a3dc..e7973b0c7 100644 --- a/src/app/pages/buyer/confirm-changes/confirm.component.ts +++ b/src/app/pages/buyer/confirm-changes/confirm.component.ts @@ -105,7 +105,7 @@ export class BuyerConfirmChangesComponent extends BaseComponent { public onBackClick(buttonText:string) { localStorage.removeItem(`mse_org_${this.org.ciiOrganisationId}`); - this.router.navigateByUrl('buyer/confirm/' + this.org.ciiOrganisationId); + // this.router.navigateByUrl('buyer/confirm/' + this.org.ciiOrganisationId); this.pushDataLayerEvent(buttonText); } } diff --git a/src/app/pages/buyer/confirm/confirm.component.html b/src/app/pages/buyer/confirm/confirm.component.html index 31aad0db9..1f2d3acbb 100644 --- a/src/app/pages/buyer/confirm/confirm.component.html +++ b/src/app/pages/buyer/confirm/confirm.component.html @@ -1,5 +1,8 @@ + + -
+ \ No newline at end of file diff --git a/src/app/pages/buyer/confirm/confirm.component.scss b/src/app/pages/buyer/confirm/confirm.component.scss index d56fc8291..44d1eef36 100644 --- a/src/app/pages/buyer/confirm/confirm.component.scss +++ b/src/app/pages/buyer/confirm/confirm.component.scss @@ -1,11 +1,14 @@ -app-buyer-confirm { - input[type=radio] { - width: 150px; - height: 50px; - margin-right: 10px; - top: 3px; - } - // input[type='radio']:checked:after { - // background-color: #ffa500; - // } -} \ No newline at end of file +// Task 7271: Code Climate - Complex Logical Expression +// Not in use will be removed in some time + +// app-buyer-confirm { +// input[type=radio] { +// width: 150px; +// height: 50px; +// margin-right: 10px; +// top: 3px; +// } +// // input[type='radio']:checked:after { +// // background-color: #ffa500; +// // } +// } \ No newline at end of file diff --git a/src/app/pages/buyer/confirm/confirm.component.spec.ts b/src/app/pages/buyer/confirm/confirm.component.spec.ts index a7db52853..141b25c8b 100644 --- a/src/app/pages/buyer/confirm/confirm.component.spec.ts +++ b/src/app/pages/buyer/confirm/confirm.component.spec.ts @@ -1,71 +1,74 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ReactiveFormsModule, FormGroup } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Store } from '@ngrx/store'; -import { Observable, of } from 'rxjs'; -import { BuyerConfirmComponent } from './confirm.component'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { TranslateModule } from '@ngx-translate/core'; +// Task 7271: Code Climate - Complex Logical Expression +// Not in use will be removed in some time -describe('BuyerConfirmComponent', () => { - let component: BuyerConfirmComponent; - let fixture: ComponentFixture; - let mockRouter: any; - let mockStore: any; +// import { ComponentFixture, TestBed } from '@angular/core/testing'; +// import { ReactiveFormsModule, FormGroup } from '@angular/forms'; +// import { ActivatedRoute, Router } from '@angular/router'; +// import { Store } from '@ngrx/store'; +// import { Observable, of } from 'rxjs'; +// import { BuyerConfirmComponent } from './confirm.component'; +// import { HttpClientTestingModule } from '@angular/common/http/testing'; +// import { TranslateModule } from '@ngx-translate/core'; - beforeEach(async () => { - mockRouter = jasmine.createSpyObj('Router', ['navigateByUrl']); - const activatedRouteStub = () => ({ - params: { subscribe: (f: any) => f({ id: '123' }) }, - }); - mockStore = jasmine.createSpyObj('Store', ['dispatch']); +// describe('BuyerConfirmComponent', () => { +// let component: BuyerConfirmComponent; +// let fixture: ComponentFixture; +// let mockRouter: any; +// let mockStore: any; - await TestBed.configureTestingModule({ - imports: [ - ReactiveFormsModule, - HttpClientTestingModule, - TranslateModule.forRoot(), - ], - declarations: [BuyerConfirmComponent], - providers: [ - { provide: Router, useValue: mockRouter }, - { provide: ActivatedRoute, useFactory: activatedRouteStub }, - { provide: Store, useValue: mockStore }, - ], - }).compileComponents(); - }); +// beforeEach(async () => { +// mockRouter = jasmine.createSpyObj('Router', ['navigateByUrl']); +// const activatedRouteStub = () => ({ +// params: { subscribe: (f: any) => f({ id: '123' }) }, +// }); +// mockStore = jasmine.createSpyObj('Store', ['dispatch']); - beforeEach(() => { - fixture = TestBed.createComponent(BuyerConfirmComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); +// await TestBed.configureTestingModule({ +// imports: [ +// ReactiveFormsModule, +// HttpClientTestingModule, +// TranslateModule.forRoot(), +// ], +// declarations: [BuyerConfirmComponent], +// providers: [ +// { provide: Router, useValue: mockRouter }, +// { provide: ActivatedRoute, useFactory: activatedRouteStub }, +// { provide: Store, useValue: mockStore }, +// ], +// }).compileComponents(); +// }); - it('should create the component', () => { - expect(component).toBeTruthy(); - }); +// beforeEach(() => { +// fixture = TestBed.createComponent(BuyerConfirmComponent); +// component = fixture.componentInstance; +// fixture.detectChanges(); +// }); - it('should initialize the form correctly', () => { - expect(component.userProfileForm).toBeTruthy(); - expect(component.userProfileForm instanceof FormGroup).toBeTrue(); - expect(component.rolesToAdd).toEqual([]); - expect(component.rolesToDelete).toEqual([]); - }); +// it('should create the component', () => { +// expect(component).toBeTruthy(); +// }); - it('should handle the "onChange" method correctly', () => { - const event = { target: { checked: true } }; - let defaultValue = true; - const role = { roleId: 1, enabled: true, roleKey: '1', roleName: '1' }; +// it('should initialize the form correctly', () => { +// expect(component.userProfileForm).toBeTruthy(); +// expect(component.userProfileForm instanceof FormGroup).toBeTrue(); +// expect(component.rolesToAdd).toEqual([]); +// expect(component.rolesToDelete).toEqual([]); +// }); - component.onChange(event, defaultValue, role); +// it('should handle the "onChange" method correctly', () => { +// const event = { target: { checked: true } }; +// let defaultValue = true; +// const role = { roleId: 1, enabled: true, roleKey: '1', roleName: '1' }; - expect(component.rolesToDelete).toEqual([]); +// component.onChange(event, defaultValue, role); - event.target.checked = false; - defaultValue = false; +// expect(component.rolesToDelete).toEqual([]); - component.onChange(event, defaultValue, role); +// event.target.checked = false; +// defaultValue = false; - expect(component.rolesToAdd).toEqual([]); - }); -}); +// component.onChange(event, defaultValue, role); + +// expect(component.rolesToAdd).toEqual([]); +// }); +// }); diff --git a/src/app/pages/buyer/confirm/confirm.component.ts b/src/app/pages/buyer/confirm/confirm.component.ts index be17866fc..c30f2a21b 100644 --- a/src/app/pages/buyer/confirm/confirm.component.ts +++ b/src/app/pages/buyer/confirm/confirm.component.ts @@ -1,305 +1,308 @@ -import { - Component, - ElementRef, - OnInit, - ViewChild, - ViewEncapsulation, -} from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; -import { Store } from '@ngrx/store'; -import { ActivatedRoute, Router } from '@angular/router'; +// Task 7271: Code Climate - Complex Logical Expression +// Not in use will be removed in some time -import { BaseComponent } from 'src/app/components/base/base.component'; -import { slideAnimation } from 'src/app/animations/slide.animation'; -import { UIState } from 'src/app/store/ui.states'; -import { OrganisationService } from 'src/app/services/postgres/organisation.service'; -import { Observable } from 'rxjs'; -import { share } from 'rxjs/operators'; -import { Role } from 'src/app/models/organisationGroup'; -import { WrapperOrganisationGroupService } from 'src/app/services/wrapper/wrapper-org--group-service'; -import { WrapperConfigurationService } from 'src/app/services/wrapper/wrapper-configuration.service'; -import { ScrollHelper } from 'src/app/services/helper/scroll-helper.services'; -import { ViewportScroller } from '@angular/common'; -import { DataLayerService } from 'src/app/shared/data-layer.service'; +// import { +// Component, +// ElementRef, +// OnInit, +// ViewChild, +// ViewEncapsulation, +// } from '@angular/core'; +// import { FormBuilder, FormGroup } from '@angular/forms'; +// import { Store } from '@ngrx/store'; +// import { ActivatedRoute, Router } from '@angular/router'; -@Component({ - selector: 'app-buyer-confirm', - templateUrl: './confirm.component.html', - styleUrls: ['./confirm.component.scss'], - animations: [ - slideAnimation({ - close: { transform: 'translateX(12.5rem)' }, - open: { left: '-12.5rem' }, - }), - ], - encapsulation: ViewEncapsulation.None, -}) -export class BuyerConfirmComponent extends BaseComponent implements OnInit { - public organisation: any; - public org$!: Observable; - public verified: boolean = false; - private id!: string; - userProfileForm: FormGroup; - orgRoles: Role[]; - roles: Role[]; - public orgEligableRoles$!: Observable; - public orgRoles$!: Observable; - eRoles: Role[]; - rolesToAdd: Role[]; - rolesToDelete: Role[]; +// import { BaseComponent } from 'src/app/components/base/base.component'; +// import { slideAnimation } from 'src/app/animations/slide.animation'; +// import { UIState } from 'src/app/store/ui.states'; +// import { OrganisationService } from 'src/app/services/postgres/organisation.service'; +// import { Observable } from 'rxjs'; +// import { share } from 'rxjs/operators'; +// import { Role } from 'src/app/models/organisationGroup'; +// import { WrapperOrganisationGroupService } from 'src/app/services/wrapper/wrapper-org--group-service'; +// import { WrapperConfigurationService } from 'src/app/services/wrapper/wrapper-configuration.service'; +// import { ScrollHelper } from 'src/app/services/helper/scroll-helper.services'; +// import { ViewportScroller } from '@angular/common'; +// import { DataLayerService } from 'src/app/shared/data-layer.service'; - @ViewChild('isBuyerTrue') isBuyerTrue!: ElementRef; - @ViewChild('isBuyerFalse') isBuyerFalse!: ElementRef; +// @Component({ +// selector: 'app-buyer-confirm', +// templateUrl: './confirm.component.html', +// styleUrls: ['./confirm.component.scss'], +// animations: [ +// slideAnimation({ +// close: { transform: 'translateX(12.5rem)' }, +// open: { left: '-12.5rem' }, +// }), +// ], +// encapsulation: ViewEncapsulation.None, +// }) +// export class BuyerConfirmComponent extends BaseComponent implements OnInit { +// public organisation: any; +// public org$!: Observable; +// public verified: boolean = false; +// private id!: string; +// userProfileForm: FormGroup; +// orgRoles: Role[]; +// roles: Role[]; +// public orgEligableRoles$!: Observable; +// public orgRoles$!: Observable; +// eRoles: Role[]; +// rolesToAdd: Role[]; +// rolesToDelete: Role[]; - constructor( - private formBuilder: FormBuilder, - private organisationService: OrganisationService, - private wrapperConfigService: WrapperConfigurationService, - public router: Router, - private route: ActivatedRoute, - protected uiStore: Store, - private organisationGroupService: WrapperOrganisationGroupService, - protected viewportScroller: ViewportScroller, - protected scrollHelper: ScrollHelper, - private dataLayerService: DataLayerService - ) { - super(uiStore, viewportScroller, scrollHelper); - this.orgRoles = []; - this.eRoles = []; - this.roles = []; - this.userProfileForm = this.formBuilder.group({ - userTitle: ['', null], - }); - this.rolesToAdd = []; - this.rolesToDelete = []; - } +// @ViewChild('isBuyerTrue') isBuyerTrue!: ElementRef; +// @ViewChild('isBuyerFalse') isBuyerFalse!: ElementRef; - ngOnInit() { - this.route.params.subscribe((params) => { - if (params.id) { - this.id = params.id; - this.org$ = this.organisationService.getById(params.id).pipe(share()); - this.org$.subscribe({ - next: (data) => { - this.organisation = data; - this.verified = data.rightToBuy; - this.getOrgRoles(); - }, - }); - } - }); - this.dataLayerService.pushPageViewEvent({id: this.id}); - } +// constructor( +// private formBuilder: FormBuilder, +// private organisationService: OrganisationService, +// private wrapperConfigService: WrapperConfigurationService, +// public router: Router, +// private route: ActivatedRoute, +// protected uiStore: Store, +// private organisationGroupService: WrapperOrganisationGroupService, +// protected viewportScroller: ViewportScroller, +// protected scrollHelper: ScrollHelper, +// private dataLayerService: DataLayerService +// ) { +// super(uiStore, viewportScroller, scrollHelper); +// this.orgRoles = []; +// this.eRoles = []; +// this.roles = []; +// this.userProfileForm = this.formBuilder.group({ +// userTitle: ['', null], +// }); +// this.rolesToAdd = []; +// this.rolesToDelete = []; +// } - public onSelect(verified: boolean) { - this.verified = verified; - this.rolesToAdd = []; - this.rolesToDelete = []; +// ngOnInit() { +// this.route.params.subscribe((params) => { +// if (params.id) { +// this.id = params.id; +// this.org$ = this.organisationService.getById(params.id).pipe(share()); +// this.org$.subscribe({ +// next: (data) => { +// this.organisation = data; +// this.verified = data.rightToBuy; +// this.getOrgRoles(); +// }, +// }); +// } +// }); +// this.dataLayerService.pushPageViewEvent({id: this.id}); +// } - if (verified) { - this.isBuyerTrue.nativeElement.checked = true; - this.isBuyerFalse.nativeElement.checked = false; - } else { - this.isBuyerTrue.nativeElement.checked = false; - this.isBuyerFalse.nativeElement.checked = true; - } +// public onSelect(verified: boolean) { +// this.verified = verified; +// this.rolesToAdd = []; +// this.rolesToDelete = []; - if (verified && !this.organisation.rightToBuy) { - const currentRoles = this.roles.filter( - (x) => - x.enabled && - x.subscriptionTypeEligibility === 0 && - x.tradeEligibility !== 0 && - x.orgTypeEligibility !== 0 - ); - const previousRoles = this.roles.filter( - (x) => - x.enabled && - x.subscriptionTypeEligibility === 0 && - x.tradeEligibility !== 1 && - x.orgTypeEligibility !== 0 - ); - previousRoles.forEach((r) => { - const match = currentRoles.includes(r); - if (!match) { - this.rolesToDelete.push(r); - } - }); - currentRoles.forEach((r) => { - const match = previousRoles.includes(r); - if (!match) { - this.rolesToAdd.push(r); - } - }); - const currentRoles2 = this.roles.filter( - (x) => - x.enabled && - x.subscriptionTypeEligibility === 1 && - x.tradeEligibility !== 0 && - x.orgTypeEligibility !== 0 - ); - const previousRoles2 = this.roles.filter( - (x) => - x.enabled && - x.subscriptionTypeEligibility === 1 && - x.tradeEligibility !== 1 && - x.orgTypeEligibility !== 0 - ); - previousRoles2.forEach((r) => { - const match = currentRoles2.includes(r); - if (!match) { - this.rolesToDelete.push(r); - } - }); - currentRoles2.forEach((r) => { - const match = previousRoles2.includes(r); - if (!match) { - this.rolesToAdd.push(r); - } - }); - console.log('to insert:'); - console.log(this.rolesToAdd); - console.log('to remove:'); - console.log(this.rolesToDelete); - } else if (!verified && this.organisation.rightToBuy) { - const currentRoles = this.roles.filter( - (x) => - x.enabled && - x.subscriptionTypeEligibility === 0 && - x.tradeEligibility !== 1 && - x.orgTypeEligibility !== 0 - ); - const previousRoles = this.roles.filter( - (x) => - x.enabled && - x.subscriptionTypeEligibility === 0 && - x.tradeEligibility !== 0 && - x.orgTypeEligibility !== 0 - ); - currentRoles.forEach((r) => { - const match = previousRoles.includes(r); - if (!match) { - this.rolesToAdd.push(r); - } - }); - previousRoles.forEach((r) => { - const match = currentRoles.includes(r); - if (!match) { - this.rolesToDelete.push(r); - } - }); - const currentRoles2 = this.roles.filter( - (x) => - x.enabled && - x.subscriptionTypeEligibility === 1 && - x.tradeEligibility !== 1 && - x.orgTypeEligibility !== 0 - ); - const previousRoles2 = this.roles.filter( - (x) => - x.enabled && - x.subscriptionTypeEligibility === 1 && - x.tradeEligibility !== 0 && - x.orgTypeEligibility !== 0 - ); - currentRoles2.forEach((r) => { - const match = previousRoles2.includes(r); - if (!match) { - this.rolesToAdd.push(r); - } - }); - previousRoles2.forEach((r) => { - const match = currentRoles2.includes(r); - if (!match) { - this.rolesToDelete.push(r); - } - }); - console.log('to insert:'); - console.log(this.rolesToAdd); - console.log('to remove:'); - console.log(this.rolesToDelete); - } - } +// if (verified) { +// this.isBuyerTrue.nativeElement.checked = true; +// this.isBuyerFalse.nativeElement.checked = false; +// } else { +// this.isBuyerTrue.nativeElement.checked = false; +// this.isBuyerFalse.nativeElement.checked = true; +// } - onChange(event: any, defaultValue: any, role: any) { - if (defaultValue === true && !event.target.checked) { - this.rolesToDelete.push(role); - } else if (defaultValue == true && event.target.checked) { - const index = this.rolesToDelete.indexOf(role); - if (index > -1) { - this.rolesToDelete.splice(index, 1); - } - } - if (defaultValue === false && event.target.checked) { - this.rolesToAdd.push(role); - } else if (defaultValue == false && !event.target.checked) { - const index = this.rolesToAdd.indexOf(role); - if (index > -1) { - this.rolesToAdd.splice(index, 1); - } - } - } +// if (verified && !this.organisation.rightToBuy) { +// const currentRoles = this.roles.filter( +// (x) => +// x.enabled && +// x.subscriptionTypeEligibility === 0 && +// x.tradeEligibility !== 0 && +// x.orgTypeEligibility !== 0 +// ); +// const previousRoles = this.roles.filter( +// (x) => +// x.enabled && +// x.subscriptionTypeEligibility === 0 && +// x.tradeEligibility !== 1 && +// x.orgTypeEligibility !== 0 +// ); +// previousRoles.forEach((r) => { +// const match = currentRoles.includes(r); +// if (!match) { +// this.rolesToDelete.push(r); +// } +// }); +// currentRoles.forEach((r) => { +// const match = previousRoles.includes(r); +// if (!match) { +// this.rolesToAdd.push(r); +// } +// }); +// const currentRoles2 = this.roles.filter( +// (x) => +// x.enabled && +// x.subscriptionTypeEligibility === 1 && +// x.tradeEligibility !== 0 && +// x.orgTypeEligibility !== 0 +// ); +// const previousRoles2 = this.roles.filter( +// (x) => +// x.enabled && +// x.subscriptionTypeEligibility === 1 && +// x.tradeEligibility !== 1 && +// x.orgTypeEligibility !== 0 +// ); +// previousRoles2.forEach((r) => { +// const match = currentRoles2.includes(r); +// if (!match) { +// this.rolesToDelete.push(r); +// } +// }); +// currentRoles2.forEach((r) => { +// const match = previousRoles2.includes(r); +// if (!match) { +// this.rolesToAdd.push(r); +// } +// }); +// console.log('to insert:'); +// console.log(this.rolesToAdd); +// console.log('to remove:'); +// console.log(this.rolesToDelete); +// } else if (!verified && this.organisation.rightToBuy) { +// const currentRoles = this.roles.filter( +// (x) => +// x.enabled && +// x.subscriptionTypeEligibility === 0 && +// x.tradeEligibility !== 1 && +// x.orgTypeEligibility !== 0 +// ); +// const previousRoles = this.roles.filter( +// (x) => +// x.enabled && +// x.subscriptionTypeEligibility === 0 && +// x.tradeEligibility !== 0 && +// x.orgTypeEligibility !== 0 +// ); +// currentRoles.forEach((r) => { +// const match = previousRoles.includes(r); +// if (!match) { +// this.rolesToAdd.push(r); +// } +// }); +// previousRoles.forEach((r) => { +// const match = currentRoles.includes(r); +// if (!match) { +// this.rolesToDelete.push(r); +// } +// }); +// const currentRoles2 = this.roles.filter( +// (x) => +// x.enabled && +// x.subscriptionTypeEligibility === 1 && +// x.tradeEligibility !== 1 && +// x.orgTypeEligibility !== 0 +// ); +// const previousRoles2 = this.roles.filter( +// (x) => +// x.enabled && +// x.subscriptionTypeEligibility === 1 && +// x.tradeEligibility !== 0 && +// x.orgTypeEligibility !== 0 +// ); +// currentRoles2.forEach((r) => { +// const match = previousRoles2.includes(r); +// if (!match) { +// this.rolesToAdd.push(r); +// } +// }); +// previousRoles2.forEach((r) => { +// const match = currentRoles2.includes(r); +// if (!match) { +// this.rolesToDelete.push(r); +// } +// }); +// console.log('to insert:'); +// console.log(this.rolesToAdd); +// console.log('to remove:'); +// console.log(this.rolesToDelete); +// } +// } - pushDataLayerEvent(buttonText:string) { - this.dataLayerService.pushClickEvent(buttonText); - } +// onChange(event: any, defaultValue: any, role: any) { +// if (defaultValue === true && !event.target.checked) { +// this.rolesToDelete.push(role); +// } else if (defaultValue == true && event.target.checked) { +// const index = this.rolesToDelete.indexOf(role); +// if (index > -1) { +// this.rolesToDelete.splice(index, 1); +// } +// } +// if (defaultValue === false && event.target.checked) { +// this.rolesToAdd.push(role); +// } else if (defaultValue == false && !event.target.checked) { +// const index = this.rolesToAdd.indexOf(role); +// if (index > -1) { +// this.rolesToAdd.splice(index, 1); +// } +// } +// } - public onSubmitClick(buttonText:string) { - let selection = { - org: this.organisation, - toDelete: this.rolesToDelete, - toAdd: this.rolesToAdd, - rightToBuy: this.verified, - hasChanges: - this.organisation.rightToBuy === this.verified && - this.rolesToAdd.length === 0 && - this.rolesToDelete.length === 0 - ? false - : true, - }; - localStorage.setItem( - `mse_org_${this.organisation.ciiOrganisationId}`, - JSON.stringify(selection) - ); - this.router.navigateByUrl( - `buyer/confirm-changes/${this.organisation.ciiOrganisationId}` - ); - this.pushDataLayerEvent(buttonText); - } +// pushDataLayerEvent(buttonText:string) { +// this.dataLayerService.pushClickEvent(buttonText); +// } - public onCancelClick(buttonText:string) { - localStorage.removeItem(`mse_org_${this.organisation.ciiOrganisationId}`); - this.router.navigateByUrl('buyer-supplier/search'); - this.pushDataLayerEvent(buttonText); - } +// public onSubmitClick(buttonText:string) { +// let selection = { +// org: this.organisation, +// toDelete: this.rolesToDelete, +// toAdd: this.rolesToAdd, +// rightToBuy: this.verified, +// hasChanges: +// this.organisation.rightToBuy === this.verified && +// this.rolesToAdd.length === 0 && +// this.rolesToDelete.length === 0 +// ? false +// : true, +// }; +// localStorage.setItem( +// `mse_org_${this.organisation.ciiOrganisationId}`, +// JSON.stringify(selection) +// ); +// this.router.navigateByUrl( +// `buyer/confirm-changes/${this.organisation.ciiOrganisationId}` +// ); +// this.pushDataLayerEvent(buttonText); +// } - getOrgRoles() { - this.orgRoles$ = this.wrapperConfigService.getRoles().pipe(share()); - this.orgRoles$.subscribe({ - next: (orgRoles: Role[]) => { - this.roles = orgRoles; - this.orgEligableRoles$ = this.organisationGroupService - .getGroupOrganisationRoles(this.organisation.ciiOrganisationId) - .pipe(share()); - this.orgEligableRoles$.subscribe({ - next: (eRoles: Role[]) => { - this.roles.forEach((r) => { - r.enabled = eRoles.some( - (x) => - x.roleName == r.roleName && x.serviceName == r.serviceName - ); - }); - this.eRoles = eRoles; - setTimeout(() => {}, 100); - }, - error: (err: any) => { - console.log(err); - }, - }); - }, - error: (err: any) => { - console.log(err); - }, - }); - } -} +// public onCancelClick(buttonText:string) { +// localStorage.removeItem(`mse_org_${this.organisation.ciiOrganisationId}`); +// this.router.navigateByUrl('buyer-supplier/search'); +// this.pushDataLayerEvent(buttonText); +// } + +// getOrgRoles() { +// this.orgRoles$ = this.wrapperConfigService.getRoles().pipe(share()); +// this.orgRoles$.subscribe({ +// next: (orgRoles: Role[]) => { +// this.roles = orgRoles; +// this.orgEligableRoles$ = this.organisationGroupService +// .getGroupOrganisationRoles(this.organisation.ciiOrganisationId) +// .pipe(share()); +// this.orgEligableRoles$.subscribe({ +// next: (eRoles: Role[]) => { +// this.roles.forEach((r) => { +// r.enabled = eRoles.some( +// (x) => +// x.roleName == r.roleName && x.serviceName == r.serviceName +// ); +// }); +// this.eRoles = eRoles; +// setTimeout(() => {}, 100); +// }, +// error: (err: any) => { +// console.log(err); +// }, +// }); +// }, +// error: (err: any) => { +// console.log(err); +// }, +// }); +// } +// } diff --git a/src/app/pages/buyer/details/details.component.ts b/src/app/pages/buyer/details/details.component.ts index 23397bbb4..399c341df 100644 --- a/src/app/pages/buyer/details/details.component.ts +++ b/src/app/pages/buyer/details/details.component.ts @@ -57,7 +57,7 @@ export class BuyerDetailsComponent extends BaseComponent implements OnInit { public onContinueClick(buttonText:string) { if(environment.appSetting.hideAutoValidation){ - this.router.navigateByUrl(`buyer/confirm/${this.selectedOrgId}`); + // this.router.navigateByUrl(`buyer/confirm/${this.selectedOrgId}`); } else if (environment.appSetting.hideSimplifyRole) { let data = { diff --git a/src/app/pages/manage-buyer-and-both-requests/buyer-both-requests-success/buyer-both-requests-success.component.ts b/src/app/pages/manage-buyer-and-both-requests/buyer-both-requests-success/buyer-both-requests-success.component.ts index c85581943..eeaf8e05e 100644 --- a/src/app/pages/manage-buyer-and-both-requests/buyer-both-requests-success/buyer-both-requests-success.component.ts +++ b/src/app/pages/manage-buyer-and-both-requests/buyer-both-requests-success/buyer-both-requests-success.component.ts @@ -19,7 +19,7 @@ export class BuyerBothRequestsSuccessComponent implements OnInit { private sessionService:SessionService ) { this.route.queryParams.subscribe((para: any) => { - this.routeDetails = JSON.parse(atob(para.data)); + this.routeDetails = JSON.parse(decodeURIComponent(atob(para.data))); switch (this.routeDetails.status) { case 'accept': { this.titleService.setTitle( diff --git a/src/app/pages/manage-buyer-and-both-requests/buyer-both-requests/buyer-both-requests.component.ts b/src/app/pages/manage-buyer-and-both-requests/buyer-both-requests/buyer-both-requests.component.ts index e1fd7bdba..aa08463d8 100644 --- a/src/app/pages/manage-buyer-and-both-requests/buyer-both-requests/buyer-both-requests.component.ts +++ b/src/app/pages/manage-buyer-and-both-requests/buyer-both-requests/buyer-both-requests.component.ts @@ -111,7 +111,7 @@ export class BuyerBothRequestsComponent implements OnInit { ); } else { this.router.navigateByUrl( - 'pending-verification?data=' + btoa(JSON.stringify(data)) + 'pending-verification?data=' + btoa(encodeURIComponent(JSON.stringify(data))) ); } } @@ -125,7 +125,7 @@ export class BuyerBothRequestsComponent implements OnInit { event: event, }; this.router.navigateByUrl( - 'verified-organisations?data=' + btoa(JSON.stringify(data)) + 'verified-organisations?data=' + btoa(encodeURIComponent(JSON.stringify(data))) ); } @@ -152,7 +152,7 @@ export class BuyerBothRequestsComponent implements OnInit { this.pendingVerificationBuyerAndBoth.pageCount = orgListResponse.pageCount; this.assignOrgTypeName(orgListResponse); Array.from(this.pendingVerificationBuyerAndBoth.organisationAuditList.organisationAuditList).forEach((f: any)=>{ - let queryParams = {data: btoa(JSON.stringify(f)),isNewTab: true} + let queryParams = {data: btoa(encodeURIComponent(JSON.stringify(f))),isNewTab: true} f.routeLink= `/pending-verification`, f.routeData = queryParams }) @@ -185,7 +185,7 @@ export class BuyerBothRequestsComponent implements OnInit { status: '003', event: f, }; - let queryParams = {data: btoa(JSON.stringify(data)),isNewTab: true} + let queryParams = {data: btoa(encodeURIComponent(JSON.stringify(data))),isNewTab: true} f.routeLink= `/verified-organisations`, f.routeData = queryParams }) diff --git a/src/app/pages/manage-buyer-and-both-requests/confirm-accept/confirm-accept.component.ts b/src/app/pages/manage-buyer-and-both-requests/confirm-accept/confirm-accept.component.ts index 63f9c7773..28f078be3 100644 --- a/src/app/pages/manage-buyer-and-both-requests/confirm-accept/confirm-accept.component.ts +++ b/src/app/pages/manage-buyer-and-both-requests/confirm-accept/confirm-accept.component.ts @@ -22,7 +22,7 @@ export class ConfirmAcceptComponent implements OnInit { ngOnInit(): void { this.route.queryParams.subscribe((para: any) => { - this.routeDetails = JSON.parse(atob(para.data)); + this.routeDetails = JSON.parse(decodeURIComponent(atob(para.data))); }); this.dataLayerService.pushPageViewEvent(); } @@ -42,7 +42,7 @@ export class ConfirmAcceptComponent implements OnInit { organisationName: this.routeDetails.organisationName }; this.router.navigateByUrl( - 'buyer-and-both-success?data=' + btoa(JSON.stringify(data)) + 'buyer-and-both-success?data=' + btoa(encodeURIComponent(JSON.stringify(data))) ); this.pushDataLayerEvent(buttonText); } diff --git a/src/app/pages/manage-buyer-and-both-requests/confirm-decline/confirm-decline.component.ts b/src/app/pages/manage-buyer-and-both-requests/confirm-decline/confirm-decline.component.ts index f9d924a5f..3d3437687 100644 --- a/src/app/pages/manage-buyer-and-both-requests/confirm-decline/confirm-decline.component.ts +++ b/src/app/pages/manage-buyer-and-both-requests/confirm-decline/confirm-decline.component.ts @@ -26,7 +26,7 @@ export class ConfirmDeclineComponent implements OnInit { ngOnInit(): void { this.route.queryParams.subscribe((para: any) => { - this.routeDetails = JSON.parse(atob(para.data)); + this.routeDetails = JSON.parse(decodeURIComponent(atob(para.data))); }); this.dataLayerService.pushPageViewEvent(); } @@ -46,7 +46,7 @@ export class ConfirmDeclineComponent implements OnInit { organisationName: this.routeDetails.organisationName }; this.router.navigateByUrl( - 'decline-success?data=' + btoa(JSON.stringify(data)) + 'decline-success?data=' + btoa(encodeURIComponent(JSON.stringify(data))) ); this.pushDataLayerEvent(buttonText); } diff --git a/src/app/pages/manage-buyer-and-both-requests/remove-right-to-buy/remove-right-to-buy.component.ts b/src/app/pages/manage-buyer-and-both-requests/remove-right-to-buy/remove-right-to-buy.component.ts index ec76b9960..273119a7a 100644 --- a/src/app/pages/manage-buyer-and-both-requests/remove-right-to-buy/remove-right-to-buy.component.ts +++ b/src/app/pages/manage-buyer-and-both-requests/remove-right-to-buy/remove-right-to-buy.component.ts @@ -17,7 +17,7 @@ export class RemoveRightToBuyComponent implements OnInit { ngOnInit(): void { this.route.queryParams.subscribe(async (para: any) => { - this.routeDetails = JSON.parse(atob(para.data)); + this.routeDetails = JSON.parse(decodeURIComponent(atob(para.data))); }) this.dataLayerService.pushPageViewEvent(); } @@ -35,7 +35,7 @@ export class RemoveRightToBuyComponent implements OnInit { this.wrapperBuyerAndBothService.manualValidation(this.routeDetails.id, ManualValidationStatus.remove).subscribe({ next: (response: any) => { this.router.navigateByUrl( - 'remove-right-to-buy-success?data=' + btoa(JSON.stringify(data)) + 'remove-right-to-buy-success?data=' + btoa(encodeURIComponent(JSON.stringify(data))) ); }, error: (error: any) => { diff --git a/src/app/pages/manage-buyer-and-both-requests/success-right-to-buy/success-right-to-buy.component.ts b/src/app/pages/manage-buyer-and-both-requests/success-right-to-buy/success-right-to-buy.component.ts index fc1126fe0..203cceba5 100644 --- a/src/app/pages/manage-buyer-and-both-requests/success-right-to-buy/success-right-to-buy.component.ts +++ b/src/app/pages/manage-buyer-and-both-requests/success-right-to-buy/success-right-to-buy.component.ts @@ -15,7 +15,7 @@ export class SuccessRightToBuyComponent implements OnInit { public routeDetails:any = {} ngOnInit(): void { this.route.queryParams.subscribe(async (para: any) => { - this.routeDetails = JSON.parse(atob(para.data)); + this.routeDetails = JSON.parse(decodeURIComponent(atob(para.data))); }) this.dataLayerService.pushPageViewEvent(); } diff --git a/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.ts b/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.ts index aa3a07457..6a5db2ff3 100644 --- a/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.ts +++ b/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.ts @@ -96,7 +96,7 @@ export class ViewPendingVerificationComponent implements OnInit { this.loadingIndicatorService.isCustomLoading.next(true); this.route.queryParams.subscribe(async (para: any) => { - this.routeDetails = JSON.parse(atob(para.data)); + this.routeDetails = JSON.parse(decodeURIComponent(atob(para.data))); this.lastRoute = this.routeDetails.lastRoute setTimeout(() => { this.getPendingVerificationOrg() @@ -256,7 +256,7 @@ export class ViewPendingVerificationComponent implements OnInit { organisationName: this.routeDetails.organisationName, }; this.router.navigateByUrl( - 'confirm-accept?data=' + btoa(JSON.stringify(data)) + 'confirm-accept?data=' + btoa(encodeURIComponent(JSON.stringify(data))) ); this.pushDataLayerEvent(buttonText); } @@ -266,7 +266,7 @@ export class ViewPendingVerificationComponent implements OnInit { organisationName: this.routeDetails.organisationName, }; this.router.navigateByUrl( - 'confirm-decline?data=' + btoa(JSON.stringify(data)) + 'confirm-decline?data=' + btoa(encodeURIComponent(JSON.stringify(data))) ); this.pushDataLayerEvent(buttonText); } diff --git a/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.ts b/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.ts index 2628bfd91..c37e1dbcc 100644 --- a/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.ts +++ b/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.ts @@ -99,7 +99,7 @@ export class ViewVerifiedOrgComponent implements OnInit { this.loadingIndicatorService.isCustomLoading.next(true); this.route.queryParams.subscribe(async (para: any) => { - this.routeDetails = JSON.parse(atob(para.data)); + this.routeDetails = JSON.parse(decodeURIComponent(atob(para.data))); setTimeout(() => { this.getPendingVerificationOrg() }, 500); @@ -265,7 +265,7 @@ export class ViewVerifiedOrgComponent implements OnInit { orgName: this.routeDetails.event.organisationName }; this.router.navigateByUrl( - 'remove-right-to-buy?data=' + btoa(JSON.stringify(data)) + 'remove-right-to-buy?data=' + btoa(encodeURIComponent(JSON.stringify(data))) ); this.pushDataLayerEvent(buttonText); } diff --git a/src/app/pages/manage-delegated/delegated-access-user/delegated-access-user.component.ts b/src/app/pages/manage-delegated/delegated-access-user/delegated-access-user.component.ts index fc0716e56..c000a5ec4 100644 --- a/src/app/pages/manage-delegated/delegated-access-user/delegated-access-user.component.ts +++ b/src/app/pages/manage-delegated/delegated-access-user/delegated-access-user.component.ts @@ -97,8 +97,8 @@ export class DelegatedAccessUserComponent implements OnInit { this.loadingIndicatorService.isLoading.next(true); this.loadingIndicatorService.isCustomLoading.next(true); - this.userDetails = JSON.parse(atob(para.data)); - this.userDetails.userName = decodeURIComponent(unescape(this.userDetails.userName)); + this.userDetails = JSON.parse(decodeURIComponent(atob(para.data))); + // this.userDetails.userName = decodeURIComponent(unescape(this.userDetails.userName)); this.userId = this.userDetails.id this.pageAccessMode = this.userDetails.pageaccessmode if (this.userSelectedFormData) { @@ -333,9 +333,9 @@ export class DelegatedAccessUserComponent implements OnInit { public RemoveAccess(buttonText:string): void { this.userDetails.pageaccessmode = 'remove' sessionStorage.removeItem('deleagted_user_details'); - this.userDetails.userName = escape(encodeURIComponent(this.userDetails.userName)); + //this.userDetails.userName = escape(encodeURIComponent(this.userDetails.userName)); this.route.navigateByUrl( - 'delegated-remove-confirm?data=' + btoa(JSON.stringify(this.userDetails)) + 'delegated-remove-confirm?data=' + btoa(encodeURIComponent(JSON.stringify(this.userDetails))) ); this.pushDataLayerEvent(buttonText); } @@ -346,16 +346,16 @@ export class DelegatedAccessUserComponent implements OnInit { public Resentactivation(): void { this.userDetails.pageaccessmode = 'resent' sessionStorage.removeItem('deleagted_user_details'); - this.userDetails.userName = escape(encodeURIComponent(this.userDetails.userName)); + //this.userDetails.userName = escape(encodeURIComponent(this.userDetails.userName)); this.route.navigateByUrl( - 'delegated-remove-confirm?data=' + btoa(JSON.stringify(this.userDetails)) + 'delegated-remove-confirm?data=' + btoa(encodeURIComponent(JSON.stringify(this.userDetails))) ); } getQueryData(): string { this.userDetails.pageaccessmode = 'resent' sessionStorage.removeItem('deleagted_user_details'); - return btoa(JSON.stringify(this.userDetails)); + return btoa(encodeURIComponent(JSON.stringify(this.userDetails))); } /** @@ -403,13 +403,13 @@ export class DelegatedAccessUserComponent implements OnInit { userDetails: this.userDetails, }; this.userDetails.pageaccessmode = this.pageAccessMode; - data.userName = escape(encodeURIComponent(data.userName)); - data.userDetails.userName = escape(encodeURIComponent(data.userDetails.userName)); + // data.userName = escape(encodeURIComponent(data.userName)); + // data.userDetails.userName = escape(encodeURIComponent(data.userDetails.userName)); let stringifyData = JSON.stringify(data); this.dataLayerService.pushFormSubmitEvent(this.formId); sessionStorage.setItem('deleagted_user_details', JSON.stringify(stringifyData)); this.route.navigateByUrl( - 'delegate-user-confirm?data=' + btoa(JSON.stringify(data)) + 'delegate-user-confirm?data=' + btoa(encodeURIComponent(JSON.stringify(data))) ); } else { this.scrollHelper.scrollToFirst('error-summary'); @@ -441,13 +441,13 @@ export class DelegatedAccessUserComponent implements OnInit { userDetails: this.userDetails, }; this.userDetails.pageaccessmode = this.pageAccessMode; - data.userDetails.userName = escape(encodeURIComponent(data.userDetails.userName)); - data.userName = escape(encodeURIComponent(data.userName)); + // data.userDetails.userName = escape(encodeURIComponent(data.userDetails.userName)); + // data.userName = escape(encodeURIComponent(data.userName)); let stringifyData = JSON.stringify(data); this.dataLayerService.pushFormSubmitEvent(this.formId); sessionStorage.setItem('deleagted_user_details', JSON.stringify(stringifyData)); this.route.navigateByUrl( - 'delegate-user-confirm?data=' + btoa(JSON.stringify(data)) + 'delegate-user-confirm?data=' + btoa(encodeURIComponent(JSON.stringify(data))) ); } else { diff --git a/src/app/pages/manage-delegated/delegated-remove-confirm/delegated-remove-confirm.component.ts b/src/app/pages/manage-delegated/delegated-remove-confirm/delegated-remove-confirm.component.ts index 3c95fad78..70687fb50 100644 --- a/src/app/pages/manage-delegated/delegated-remove-confirm/delegated-remove-confirm.component.ts +++ b/src/app/pages/manage-delegated/delegated-remove-confirm/delegated-remove-confirm.component.ts @@ -18,8 +18,8 @@ export class DelegatedRemoveConfirmComponent implements OnInit { ngOnInit(): void { this.route.queryParams.subscribe((para: any) => { - this.RouteData = JSON.parse(atob(para.data)); - this.RouteData.userName = decodeURIComponent(unescape(this.RouteData.userName)); + this.RouteData = JSON.parse(decodeURIComponent(atob(para.data))); + //this.RouteData.userName = decodeURIComponent(unescape(this.RouteData.userName)); }); this.dataLayerService.pushPageViewEvent(); this.route.queryParams.subscribe(params => { @@ -38,8 +38,8 @@ export class DelegatedRemoveConfirmComponent implements OnInit { } this.DelegatedService.deleteDelegatedUser(this.RouteData.userName,this.organisationId).subscribe({ next: (responce: any) => { - data.userName = escape(encodeURIComponent(data.userName)); - this.router.navigateByUrl('delegated-success?data=' +btoa(JSON.stringify(data))) + //data.userName = escape(encodeURIComponent(data.userName)); + this.router.navigateByUrl('delegated-success?data=' +btoa(encodeURIComponent(JSON.stringify(data)))) }, error: (error: any) => { this.router.navigateByUrl('delegated-error') @@ -56,8 +56,8 @@ export class DelegatedRemoveConfirmComponent implements OnInit { } this.DelegatedService.resentActivationLink(this.RouteData.userName,this.organisationId).subscribe({ next: (responce: any) => { - data.userName = escape(encodeURIComponent(data.userName)); - this.router.navigateByUrl('delegated-success?data=' +btoa(JSON.stringify(data))); + //data.userName = escape(encodeURIComponent(data.userName)); + this.router.navigateByUrl('delegated-success?data=' +btoa(encodeURIComponent(JSON.stringify(data)))); }, error: (error: any) => { this.router.navigateByUrl('delegated-error') diff --git a/src/app/pages/manage-delegated/delegated-success/delegated-success.component.ts b/src/app/pages/manage-delegated/delegated-success/delegated-success.component.ts index 4b4e80bb2..a85fceea7 100644 --- a/src/app/pages/manage-delegated/delegated-success/delegated-success.component.ts +++ b/src/app/pages/manage-delegated/delegated-success/delegated-success.component.ts @@ -23,10 +23,10 @@ export class DelegatedSuccessComponent implements OnInit { ngOnInit(): void { this.dataLayerService.pushPageViewEvent(); this.ActivatedRoute.queryParams.subscribe((para: any) => { - this.userInfo = JSON.parse(atob(para.data)); - this.userInfo.userName = decodeURIComponent( - unescape(this.userInfo.userName) - ); + this.userInfo = JSON.parse(decodeURIComponent(atob(para.data))); + // this.userInfo.userName = decodeURIComponent( + // unescape(this.userInfo.userName) + // ); switch (this.userInfo.status) { case 'create': { this.titleService.setTitle(`Delegated user successfully added - CCS`); diff --git a/src/app/pages/manage-delegated/delegated-user-confirm/delegated-user-confirm.component.ts b/src/app/pages/manage-delegated/delegated-user-confirm/delegated-user-confirm.component.ts index 16b2161f2..78017db7e 100644 --- a/src/app/pages/manage-delegated/delegated-user-confirm/delegated-user-confirm.component.ts +++ b/src/app/pages/manage-delegated/delegated-user-confirm/delegated-user-confirm.component.ts @@ -40,10 +40,10 @@ export class DelegatedUserConfirmComponent implements OnInit { ngOnInit(): void { this.dataLayerService.pushPageViewEvent(); this.ActivatedRoute.queryParams.subscribe((para: any) => { - this.userInfo = JSON.parse(atob(para.data)).userDetails; - this.userInfo.userName = decodeURIComponent(unescape(this.userInfo.userName)); - this.UserSelectedinfo = JSON.parse(atob(para.data)); - this.UserSelectedinfo.userName = decodeURIComponent(unescape(this.UserSelectedinfo.userName)); + this.userInfo = JSON.parse(decodeURIComponent(atob(para.data))).userDetails; + //this.userInfo.userName = decodeURIComponent(unescape(this.userInfo.userName)); + this.UserSelectedinfo = JSON.parse(decodeURIComponent(atob(para.data))); + //this.UserSelectedinfo.userName = decodeURIComponent(unescape(this.UserSelectedinfo.userName)); this.pageAccessMode = this.UserSelectedinfo.userDetails.pageaccessmode }); if (this.pageAccessMode === "edit") { @@ -116,8 +116,8 @@ export class DelegatedUserConfirmComponent implements OnInit { status: 'create', userName: this.UserSelectedinfo.userName } - data.userName = escape(encodeURIComponent(data.userName)); - this.route.navigateByUrl('delegated-success?data=' + btoa(JSON.stringify(data))) + //data.userName = escape(encodeURIComponent(data.userName)); + this.route.navigateByUrl('delegated-success?data=' + btoa(encodeURIComponent(JSON.stringify(data)))) }, error: (error: any) => { this.route.navigateByUrl('delegated-error') @@ -152,8 +152,8 @@ export class DelegatedUserConfirmComponent implements OnInit { status: 'update', userName: this.UserSelectedinfo.userName } - data.userName = escape(encodeURIComponent(data.userName)); - this.route.navigateByUrl('delegated-success?data=' + btoa(JSON.stringify(data))) + //data.userName = escape(encodeURIComponent(data.userName)); + this.route.navigateByUrl('delegated-success?data=' + btoa(encodeURIComponent(JSON.stringify(data)))) }, error: (error: any) => { this.route.navigateByUrl('delegated-error') diff --git a/src/app/pages/manage-delegated/delegated-user-list/delegated-user-list.component.ts b/src/app/pages/manage-delegated/delegated-user-list/delegated-user-list.component.ts index fdf13b994..12eb91d64 100644 --- a/src/app/pages/manage-delegated/delegated-user-list/delegated-user-list.component.ts +++ b/src/app/pages/manage-delegated/delegated-user-list/delegated-user-list.component.ts @@ -96,12 +96,12 @@ export class DelegatedUserListComponent implements OnInit ,OnDestroy { public onLinkClick(data: any): void { if (data.event.target.innerText === "Remove") { data.pageaccessmode = 'remove' - data.userName = escape(encodeURIComponent(data.userName)); - this.router.navigateByUrl('delegated-remove-confirm?data=' + btoa(JSON.stringify(data))); + //data.userName = escape(encodeURIComponent(data.userName)); + this.router.navigateByUrl('delegated-remove-confirm?data=' + btoa(encodeURIComponent(JSON.stringify(data)))); } else { data.pageaccessmode = 'edit' - data.userName = escape(encodeURIComponent(data.userName)); - this.router.navigateByUrl('delegate-access-user?data=' + btoa(JSON.stringify(data))); + //data.userName = escape(encodeURIComponent(data.userName)); + this.router.navigateByUrl('delegate-access-user?data=' + btoa(encodeURIComponent(JSON.stringify(data)))); } } @@ -113,8 +113,8 @@ export class DelegatedUserListComponent implements OnInit ,OnDestroy { status: '003', event: event } - data.event.userName = escape(encodeURIComponent(data.event.userName)); - this.router.navigateByUrl('delegated-user-status?data=' + btoa(JSON.stringify(data))) + //data.event.userName = escape(encodeURIComponent(data.event.userName)); + this.router.navigateByUrl('delegated-user-status?data=' + btoa(encodeURIComponent(JSON.stringify(data)))) } setPagecurrentUsers(pageNumber: any) { @@ -141,7 +141,7 @@ export class DelegatedUserListComponent implements OnInit ,OnDestroy { console.log(this.currentUserstableConfig); Array.from(this.currentUserstableConfig.userList.userList).forEach((f: any) => { f.pageaccessmode = 'edit'; - let queryParams = { data: btoa(JSON.stringify(f)),isNewTab:true }; + let queryParams = { data: btoa(encodeURIComponent(JSON.stringify(f))),isNewTab:true }; f.routeLink = `/delegate-access-user`; f.routeData = queryParams; @@ -165,7 +165,7 @@ export class DelegatedUserListComponent implements OnInit ,OnDestroy { "pageaccessmode":"remove" } - let queryDeclineParams = { data: btoa(JSON.stringify(datas)),isNewTab: true }; + let queryDeclineParams = { data: btoa(encodeURIComponent(JSON.stringify(datas))),isNewTab: true }; console.log("datas",datas); f.pageaccessmode = 'remove'; f.declineRouteLink = `/delegated-remove-confirm`; @@ -200,7 +200,7 @@ export class DelegatedUserListComponent implements OnInit ,OnDestroy { event: f } //data.event.userName = escape(encodeURIComponent(data.event.userName)); - let queryParams = {data: btoa(JSON.stringify(data)),isNewTab: true} + let queryParams = {data: btoa(encodeURIComponent(JSON.stringify(data))),isNewTab: true} f.routeLink= `/delegated-user-status`, f.routeData = queryParams }) diff --git a/src/app/pages/manage-delegated/delegated-user-status/delegated-user-status.component.ts b/src/app/pages/manage-delegated/delegated-user-status/delegated-user-status.component.ts index bafa7f270..cdfbec09b 100644 --- a/src/app/pages/manage-delegated/delegated-user-status/delegated-user-status.component.ts +++ b/src/app/pages/manage-delegated/delegated-user-status/delegated-user-status.component.ts @@ -68,12 +68,12 @@ export class DelegatedUserStatusComponent implements OnInit { ngOnInit(): void { this.dataLayerService.pushPageViewEvent(); this.route.queryParams.subscribe((para: any) => { - let RouteData: any = JSON.parse(atob(para.data)); + let RouteData: any = JSON.parse(decodeURIComponent(atob(para.data))); if (RouteData.event) { console.log('RouteData.event', RouteData.event); - RouteData.event.userName = decodeURIComponent( - unescape(RouteData.event.userName) - ); + // RouteData.event.userName = decodeURIComponent( + // unescape(RouteData.event.userName) + // ); } this.route.queryParams.subscribe(params => { if (params['isNewTab'] === 'true') { diff --git a/src/app/pages/manage-delegated/find-delegated-user/find-delegated-user.component.ts b/src/app/pages/manage-delegated/find-delegated-user/find-delegated-user.component.ts index ca5ad7262..843dffdb6 100644 --- a/src/app/pages/manage-delegated/find-delegated-user/find-delegated-user.component.ts +++ b/src/app/pages/manage-delegated/find-delegated-user/find-delegated-user.component.ts @@ -95,8 +95,8 @@ export class FindDelegatedUserComponent implements OnInit { } else { userResponse.pageaccessmode = "add"; - userResponse.userName = escape(encodeURIComponent(userResponse.userName)); - this.route.navigateByUrl('delegate-access-user?data=' + btoa(JSON.stringify(userResponse))) + // userResponse.userName = escape(encodeURIComponent(userResponse.userName)); + this.route.navigateByUrl('delegate-access-user?data=' + btoa(encodeURIComponent(JSON.stringify(userResponse)))) } }, error: (error: any) => { diff --git a/src/app/pages/manage-delegated/user/delegated-organisation/delegated-organisation.component.ts b/src/app/pages/manage-delegated/user/delegated-organisation/delegated-organisation.component.ts index caf19aaf8..74ea09b0f 100644 --- a/src/app/pages/manage-delegated/user/delegated-organisation/delegated-organisation.component.ts +++ b/src/app/pages/manage-delegated/user/delegated-organisation/delegated-organisation.component.ts @@ -5,6 +5,7 @@ import { environment } from 'src/environments/environment'; import { ManageDelegateService } from '../../service/manage-delegate.service'; import { DataLayerService } from 'src/app/shared/data-layer.service'; import { SessionService } from 'src/app/shared/session.service'; +import { LoadingIndicatorService } from 'src/app/services/helper/loading-indicator.service'; @Component({ selector: 'app-delegated-organisation', @@ -29,6 +30,7 @@ export class DelegatedOrganisationComponent implements OnInit { private router: Router, private dataLayerService: DataLayerService, private sessionService:SessionService, + private loadingIndicatorService: LoadingIndicatorService ) { this.isOrgAdmin = JSON.parse(localStorage.getItem('isOrgAdmin') || 'false'); if(this.isDeleagation === true){ @@ -95,8 +97,16 @@ export class DelegatedOrganisationComponent implements OnInit { this.roleInfo = orgDetails.delegatedOrgId; } onSubmit(buttonText:string) { - this.DelegateService.setDelegatedOrg(this.roleInfo,'home'); - this.pushDataLayerEvent(buttonText); + try { + this.loadingIndicatorService.isLoading.next(true); + this.loadingIndicatorService.isCustomLoading.next(true); + this.DelegateService.setDelegatedOrg(this.roleInfo,'home'); + this.pushDataLayerEvent(buttonText); + } + catch (err) { + this.loadingIndicatorService.isLoading.next(false); + this.loadingIndicatorService.isCustomLoading.next(false); + } } public Cancel(buttonText:string) { window.history.back(); diff --git a/src/app/pages/manage-organisation/manage-organisation-profile-registry-delete/manage-organisation-profile-registry-delete.component.html b/src/app/pages/manage-organisation/manage-organisation-profile-registry-delete/manage-organisation-profile-registry-delete.component.html index 1e37f8316..10f942ab2 100644 --- a/src/app/pages/manage-organisation/manage-organisation-profile-registry-delete/manage-organisation-profile-registry-delete.component.html +++ b/src/app/pages/manage-organisation/manage-organisation-profile-registry-delete/manage-organisation-profile-registry-delete.component.html @@ -15,7 +15,7 @@

Confirm you want to remove the below from your registries?

- {{ i?.identifier?.scheme }} + {{schemeDetail.schemeName}}
{{ i?.identifier?.id }} - {{ i?.identifier?.legalName }}

This cannot be undone

diff --git a/src/app/pages/manage-organisation/manage-organisation-profile-registry-delete/manage-organisation-profile-registry-delete.component.ts b/src/app/pages/manage-organisation/manage-organisation-profile-registry-delete/manage-organisation-profile-registry-delete.component.ts index 75a0de6c6..0ddad1b83 100644 --- a/src/app/pages/manage-organisation/manage-organisation-profile-registry-delete/manage-organisation-profile-registry-delete.component.ts +++ b/src/app/pages/manage-organisation/manage-organisation-profile-registry-delete/manage-organisation-profile-registry-delete.component.ts @@ -34,6 +34,8 @@ export class ManageOrganisationRegistryDeleteComponent extends BaseComponent imp public item$!: Observable; public organisationId: string; public routeParams!: any; + public schemeData:any[]=[]; + public schemeDetail:any; constructor(private ciiService: ciiService, private wrapperService: WrapperUserService, private router: Router,private sessionService:SessionService, private route: ActivatedRoute, protected uiStore: Store, private readonly tokenService: TokenService, @@ -43,10 +45,19 @@ export class ManageOrganisationRegistryDeleteComponent extends BaseComponent imp } ngOnInit() { - this.route.params.subscribe(params => { + this.route.params.subscribe(async(params) => { this.routeParams = params; if (params.id && params.scheme) { - this.item$ = this.ciiService.getOrganisationIdentifierDetails(this.tokenService.getCiiOrgId(), params.scheme, params.id).pipe(share()); + try { + this.item$ = this.ciiService.getOrganisationIdentifierDetails(this.tokenService.getCiiOrgId(), params.scheme, params.id).pipe(share()); + const result= await this.item$.toPromise(); + if (result) { + this.schemeData = await this.ciiService.getSchemes().toPromise(); + this.schemeDetail = this.schemeData.find(x => x.scheme === params.scheme); + } + } catch (error) { + throw error; + } } }); this.route.queryParams.subscribe(params => { diff --git a/src/app/pages/manage-organisation/manage-organisation-registration-additional-identifiers/manage-organisation-registration-additional-identifiers.component.html b/src/app/pages/manage-organisation/manage-organisation-registration-additional-identifiers/manage-organisation-registration-additional-identifiers.component.html index f73147c5e..824bdcbdb 100644 --- a/src/app/pages/manage-organisation/manage-organisation-registration-additional-identifiers/manage-organisation-registration-additional-identifiers.component.html +++ b/src/app/pages/manage-organisation/manage-organisation-registration-additional-identifiers/manage-organisation-registration-additional-identifiers.component.html @@ -61,8 +61,8 @@

We found matching records for your organisation fro
- +
diff --git a/src/app/pages/manage-organisation/manage-organisation-registration-step-3/manage-organisation-registration-step-3.component.html b/src/app/pages/manage-organisation/manage-organisation-registration-step-3/manage-organisation-registration-step-3.component.html index ab54d4adf..421914581 100644 --- a/src/app/pages/manage-organisation/manage-organisation-registration-step-3/manage-organisation-registration-step-3.component.html +++ b/src/app/pages/manage-organisation/manage-organisation-registration-step-3/manage-organisation-registration-step-3.component.html @@ -120,7 +120,7 @@

There is a prob
-