Skip to content

Commit 3849c4f

Browse files
authored
Add support for URLs as logo image source (#904)
* add support for URLs as logo image source * update Rene + add Roche as contributor * add Logo path changes to readme * add missing type
1 parent 90e60f4 commit 3849c4f

File tree

3 files changed

+64
-5
lines changed

3 files changed

+64
-5
lines changed
Lines changed: 35 additions & 0 deletions
Loading

aas-web-ui/src/components/AppNavigation/AppNavigation.vue

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,13 @@
336336
}
337337
338338
if (isDark.value && envStore.getEnvLogoDarkPath.trim().length > 0) {
339-
return logoFolder + envStore.getEnvLogoDarkPath;
339+
return validURL(envStore.getEnvLogoDarkPath)
340+
? envStore.getEnvLogoDarkPath
341+
: logoFolder + envStore.getEnvLogoDarkPath;
340342
} else {
341-
return logoFolder + envStore.getEnvLogoLightPath;
343+
return validURL(envStore.getEnvLogoLightPath)
344+
? envStore.getEnvLogoLightPath
345+
: logoFolder + envStore.getEnvLogoLightPath;
342346
}
343347
});
344348
const showMobileMenu = computed(() => isMobile.value && !mainMenu.value);
@@ -416,4 +420,17 @@
416420
infrastructureMenu.value = false;
417421
infrastructureManagementDialog.value = true;
418422
}
423+
424+
function validURL(str: string) {
425+
var pattern = new RegExp(
426+
'^(https?:\\/\\/)?' + // protocol
427+
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
428+
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
429+
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
430+
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
431+
'(\\#[-a-z\\d_]*)?$',
432+
'i'
433+
); // fragment locator
434+
return !!pattern.test(str);
435+
}
419436
</script>

aas-web-ui/src/pages/About.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
import IDTALogo from '@/assets/Companies/IDTA_Logo.png';
165165
import IESELogoDark from '@/assets/Companies/IESE_Logo_dark.svg';
166166
import IESELogoLight from '@/assets/Companies/IESE_Logo_light.svg';
167+
import RocheLogo from '@/assets/Companies/Roche_Logo.svg'; // Logo only for AAS UI permitted
167168
// Import contributor images
168169
import Buettner from '@/assets/Contributors/Buettner.jpg';
169170
import Eicke from '@/assets/Contributors/Eicke.jpg';
@@ -236,6 +237,12 @@
236237
srcLight: ARENA2036LogoLight,
237238
altText: 'ARENA2036 Logo',
238239
},
240+
{
241+
href: 'https://www.roche.com/',
242+
isDynamic: false,
243+
srcStatic: RocheLogo,
244+
altText: 'Roche Logo',
245+
},
239246
]);
240247
241248
// Array of contributor objects with imported images
@@ -265,9 +272,9 @@
265272
linkedin_link: 'https://www.linkedin.com/in/fiona-helena-buettner',
266273
},
267274
{
268-
name: 'Rene Pascal Fischer',
269-
company: 'Fraunhofer IESE',
270-
email: 'Rene-Pascal.Fischer@iese.fraunhofer.de',
275+
name: 'Rene-Pascal Fischer',
276+
company: 'F. Hoffmann-La Roche AG',
277+
email: 'Rene-Pascal.Fischer@roche.com',
271278
image: Fischer,
272279
github_link: 'https://github.com/FischerRene',
273280
linkedin_link: 'https://www.linkedin.com/in/fischer-rene',

0 commit comments

Comments
 (0)