Skip to content

Commit

Permalink
feat: added Testing page in header trough VITE_APP_ENV_BADGE env conf…
Browse files Browse the repository at this point in the history
…ig variable; optimized header appearance
  • Loading branch information
Matteo Biasi committed Aug 22, 2023
1 parent 22d0e0e commit a18d0ab
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
3 changes: 2 additions & 1 deletion databrowser/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ VITE_APP_KEYCLOAK_REDIRECT_URI=http://localhost:3000/silent-check-sso.html
VITE_APP_IMAGE_UPLOAD_URL=https://api.tourism.testingmachine.eu/v1/FileUpload/Image
VITE_APP_FILE_UPLOAD_URL=https://api.tourism.testingmachine.eu/v1/FileUpload
VITE_APP_ODH_LOOKUP_BASE_URL=https://api.tourism.testingmachine.eu
VITE_APP_HOTJAR_ID=123456
VITE_APP_HOTJAR_ID=123456
VITE_APP_ENV_BADGE=TESTING
5 changes: 5 additions & 0 deletions databrowser/src/components/tag/TagCustom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ const types: Record<TagType, Color> = {
text: 'text-black',
dot: 'bg-black',
},
pink: {
background: 'bg-pink-400',
text: 'text-black',
dot: 'bg-black',
},
};
const props = withDefaults(
Expand Down
3 changes: 2 additions & 1 deletion databrowser/src/components/tag/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type TagType =
| 'green'
| 'red'
| 'yellow'
| 'info';
| 'info'
| 'pink';

export type TagSize = 'xs' | 'md';
1 change: 1 addition & 0 deletions databrowser/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface ImportMetaEnv
readonly VITE_APP_FILE_UPLOAD_URL: string;
readonly VITE_APP_ODH_LOOKUP_BASE_URL: string;
readonly VITE_APP_HOTJAR_ID: string;
readonly VITE_APP_ENV_BADGE: string;
}

interface ImportMeta {
Expand Down
15 changes: 11 additions & 4 deletions databrowser/src/layouts/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ SPDX-License-Identifier: AGPL-3.0-or-later
<template>
<div class="sticky top-0 z-10 w-full">
<div class="bg-gray-50">
<ContentAlignmentX
class="m-auto flex justify-between px-4 py-1 xl:w-default 2xl:px-0"
>
<ContentAlignmentX class="m-auto flex w-full gap-2 px-4 py-2 2xl:px-0">
<TagCustom class="text-sm" type="info" text="BETA" />
<TagCustom
v-if="envBadge"
class="text-sm"
type="pink"
:text="envBadge"
/>
<div class="flex grow" />
<ExternalLink
href="https://opendatahub.com"
variant="no-underline"
Expand All @@ -29,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
</div>
<div class="bg-white">
<ContentAlignmentX
class="m-auto flex flex-col gap-x-20 gap-y-2 px-4 py-1 lg:flex-row xl:w-default 2xl:px-0"
class="m-auto flex flex-col gap-x-20 gap-y-2 px-4 py-2 lg:flex-row 2xl:px-0"
>
<div class="flex items-center">
<router-link
Expand Down Expand Up @@ -86,6 +91,8 @@ const emit = defineEmits<{
toggleMenu: [boolean];
}>();
const envBadge = import.meta.env.VITE_APP_ENV_BADGE;
function toggleMenu() {
emit('toggleMenu', !props.isMenuOpen);
}
Expand Down
3 changes: 3 additions & 0 deletions databrowser/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ module.exports = {
700: '#494d50',
900: '#3c4043',
},
pink: {
400: '#FA00FF',
},
},
spacing: {
default: '80rem',
Expand Down

0 comments on commit a18d0ab

Please sign in to comment.