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 @@
+
\ 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 @@