From 8ec8d29d0f40c829c1b8ac83c2f38e368518d2d0 Mon Sep 17 00:00:00 2001 From: Martin Rohrmeier Date: Tue, 6 Feb 2024 14:39:31 +0700 Subject: [PATCH] fix(test): remove dev env from image urls (#478) --- DEPENDENCIES | 2 +- src/components/pages/Test/index.image.tsx | 24 ++++++----------------- src/services/EnvironmentService.ts | 7 ++----- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index 3610e64c5..75e4d18b6 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -358,7 +358,7 @@ npm/npmjs/-/has-flag/4.0.0, MIT, approved, clearlydefined npm/npmjs/-/has-property-descriptors/1.0.0, MIT, approved, #11098 npm/npmjs/-/has-proto/1.0.1, MIT, approved, #6175 npm/npmjs/-/has-symbols/1.0.3, MIT, approved, clearlydefined -npm/npmjs/-/has-tostringtag/1.0.0, MIT, approved, clearlydefined +npm/npmjs/-/has-tostringtag/1.0.0, MIT, approved, #13161 npm/npmjs/-/has/1.0.4, MIT, approved, #10930 npm/npmjs/-/he/1.2.0, MIT, approved, clearlydefined npm/npmjs/-/hoist-non-react-statics/3.3.2, BSD-3-Clause, approved, clearlydefined diff --git a/src/components/pages/Test/index.image.tsx b/src/components/pages/Test/index.image.tsx index 86277fc79..3f236ab95 100644 --- a/src/components/pages/Test/index.image.tsx +++ b/src/components/pages/Test/index.image.tsx @@ -1,6 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021, 2023 BMW Group AG - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -24,7 +23,7 @@ import { TransparentPixel, } from '@catena-x/portal-shared-components' import { useEffect, useState } from 'react' -import { getApiBase } from 'services/EnvironmentService' +import { getApiBase, getAssetBase } from 'services/EnvironmentService' import { fetchImageWithToken } from 'services/ImageService' export default function ImageTest() { @@ -33,9 +32,7 @@ export default function ImageTest() { const [data, setData] = useState(TransparentPixel) useEffect(() => { - fetchImageWithToken( - 'https://portal.dev.demo.catena-x.net/assets/images/frame/Home.png' - ) + fetchImageWithToken(`${getAssetBase()}/images/frame/Home.png`) .then((buffer) => { setData(URL.createObjectURL(new Blob([buffer], { type: 'image/png' }))) }) @@ -61,16 +58,9 @@ export default function ImageTest() { } style={style} /> + - @@ -92,9 +82,7 @@ export default function ImageTest() { /> export const getApiBase = () => typeof ENV === 'undefined' ? '' : ENV.PORTAL_BACKEND_URL