diff --git a/src/AppLayout.tsx b/src/AppLayout.tsx index b0bb289e..8e5951d8 100644 --- a/src/AppLayout.tsx +++ b/src/AppLayout.tsx @@ -109,11 +109,6 @@ export const AppLayout = () => { Administration - {import.meta.env.VITE_PNC_OLD_UI_WEB && ( - - Old UI Version - - )} ); diff --git a/src/index.tsx b/src/index.tsx index 3536bdf0..fc471ee1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -34,10 +34,7 @@ const App = () => { if ( // https://example.com !pncUrl.startsWith(window.location.origin) && - !( - import.meta.env.VITE_WEB_UI_URL === window.location.origin || - import.meta.env.VITE_WEB_SECONDARY_UI_URL === window.location.origin - ) && + window.location.origin !== import.meta.env.VITE_WEB_SECONDARY_UI_URL && // example.com window.location.hostname !== 'localhost' ) { diff --git a/src/services/pncApiMocksClient.ts b/src/services/pncApiMocksClient.ts deleted file mode 100644 index eead9b54..00000000 --- a/src/services/pncApiMocksClient.ts +++ /dev/null @@ -1,33 +0,0 @@ -import axios, { AxiosInstance } from 'axios'; - -import * as webConfigService from './webConfigService'; - -/** - * Mocked backend client. Use for WIP features. - */ -class PncApiMocksClient { - private httpClient: AxiosInstance; - - constructor() { - this.httpClient = this.createHttpClient(); - } - - /** - * Creates Axios instance. - * - * @returns Axios instance - */ - private createHttpClient = (): AxiosInstance => - axios.create({ - baseURL: import.meta.env.VITE_PNC_API_MOCKS_URL || webConfigService.getPncApiMocksUrl(), - }); - - // PUBLIC - - /** - * @returns Axios instance - */ - public getHttpClient = (): AxiosInstance => this.httpClient; -} - -export const pncApiMocksClient = new PncApiMocksClient(); diff --git a/src/services/webConfigService.ts b/src/services/webConfigService.ts index 0e1f6aaf..d5712a5f 100644 --- a/src/services/webConfigService.ts +++ b/src/services/webConfigService.ts @@ -122,20 +122,6 @@ export const getUILoggerUrl = (): string => { return uiLoggerUrl; }; -/** - * Return PNC API mocks endpoint URL - */ -export const getPncApiMocksUrl = (): string => { - // TODO: extract URL from config once available - const pncApiMocksUrl = import.meta.env.VITE_PNC_API_MOCKS_URL; - - if (!pncApiMocksUrl) { - throw new Error(`PNC API MOCKS URL does not contain any data: #${pncApiMocksUrl}#`); - } - - return pncApiMocksUrl; -}; - /** * Return Kafka endpoint URL */ diff --git a/src/utils/urlParseHelper.ts b/src/utils/urlParseHelper.ts index 79bb7795..0f386e7e 100644 --- a/src/utils/urlParseHelper.ts +++ b/src/utils/urlParseHelper.ts @@ -3,8 +3,7 @@ interface IScmRepositoryUrl { } const preDefinedScmsPrefix: { [key: string]: string } = { - [import.meta.env.VITE_GERRIT_URL_BASE || 'code']: 'Gerrit', - [import.meta.env.VITE_GERRIT_STAGE_URL_BASE || 'code']: 'Gerrit', + ['code']: 'Gerrit', gitlab: 'GitLab', github: 'GitHub', };