Skip to content

Commit

Permalink
fix: don't try to access to /settings in user's pages
Browse files Browse the repository at this point in the history
APIM-6929
  • Loading branch information
michel-barret committed Sep 24, 2024
1 parent cae1d15 commit 00dab5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ import { filter, map, observeOn, startWith, take, takeUntil, tap } from 'rxjs/op
import { FocusMonitor } from '@angular/cdk/a11y';
import { asyncScheduler, Observable, of, Subject, zip } from 'rxjs';

import { PortalSettingsService } from '../../../../../services-ngx/portal-settings.service';
import { ApiService } from '../../../../../services-ngx/api.service';
import { PathV4 } from '../../../../../entities/management-api-v2';

const PATH_PATTERN_REGEX = new RegExp(/^\/[/.a-zA-Z0-9-_]*$/);
import { EnvironmentSettingsService } from '../../../../../services-ngx/environment-settings.service';

const DEFAULT_LISTENER: PathV4 = {
path: '/',
Expand Down Expand Up @@ -94,15 +94,15 @@ export class GioFormListenersContextPathComponent implements OnInit, OnDestroy,
private readonly fm: FocusMonitor,
private readonly elRef: ElementRef,
protected readonly apiService: ApiService,
private readonly portalSettingsService: PortalSettingsService,
private readonly environmentSettingsService: EnvironmentSettingsService,
) {
this.mainForm = new FormGroup({
listeners: this.listenerFormArray,
});
}

ngOnInit(): void {
this.portalSettingsService
this.environmentSettingsService
.get()
.pipe(takeUntil(this.unsubscribe$))
.subscribe((settings) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ describe('ApiProxyV4EntrypointsComponent', () => {
}

function expectGetPortalSettings(): void {
const settings: PortalSettings = { portal: { entrypoint: 'localhost' } };
httpTestingController.expectOne({ url: `${CONSTANTS_TESTING.env.baseURL}/settings`, method: 'GET' }).flush(settings);
const requests = httpTestingController.match({ url: `${CONSTANTS_TESTING.env.baseURL}/settings`, method: 'GET' });
expect(requests.length).toBeLessThanOrEqual(1);
}

function expectApiVerify(): void {
Expand Down

0 comments on commit 00dab5a

Please sign in to comment.