Skip to content

Commit

Permalink
Merge pull request #465 from MORE-Platform/revert-464-463-show-curren…
Browse files Browse the repository at this point in the history
…t-version-build-id-in-the-footer

Revert "#463: Show build-info in the footer"
  • Loading branch information
ja-fra authored Jun 5, 2024
2 parents 0be1cab + 96dc94f commit 3b8a816
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 109 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/test-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ jobs:

- name: Run build
run: npm run package
env:
VITE_GIT_BRANCH: '${{ github.ref_name }}'
VITE_GIT_REVISION: '${{ github.sha }}'

build-and-push-image:
name: Build and Push Docker Image
Expand Down
30 changes: 1 addition & 29 deletions openapi/StudyManagerAPI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1283,19 +1283,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/FrontendConfiguration'
/config/buildInfo:
get:
tags:
- configuration
description: retrieve the build info
operationId: getBuildInfo
responses:
200:
description: the build-info
content:
application/json:
schema:
$ref: '#/components/schemas/BuildInfo'


components:
schemas:
Expand Down Expand Up @@ -1992,22 +1980,6 @@ components:
required:
- auth
readOnly: true
BuildInfo:
type: object
properties:
version:
type: string
default: '0.0.0'
date:
type: string
format: date-time
branch:
type: string
rev:
type: string
required:
- version
- date

parameters:
StudyId:
Expand Down
43 changes: 2 additions & 41 deletions src/components/shared/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,16 @@ Prevention -- A research institute of the Ludwig Boltzmann Gesellschaft,
Oesterreichische Vereinigung zur Foerderung der wissenschaftlichen Forschung).
Licensed under the Elastic License 2.0. */
<script setup lang="ts">
import { inject, ref } from 'vue';
import {
BuildInfo,
FrontendConfiguration,
} from '../../generated-sources/openapi';
import OverlayPanel from 'primevue/overlaypanel';
import { inject } from 'vue';
import { FrontendConfiguration } from '../../generated-sources/openapi';
const uiConfig = inject('uiConfig') as FrontendConfiguration;
const buildInfo = inject('buildInfo') as {
frontend: BuildInfo;
backend: BuildInfo;
};
const buildInfoPanel = ref();
</script>

<template>
<footer class="footer w-full">
<div class="content-block mx-24 my-6 flex justify-between">
<div>
<OverlayPanel ref="buildInfoPanel">
<div class="w-25rem flex flex-col gap-3">
<div
v-for="(info, tier) in buildInfo"
:key="tier"
class="build-info"
>
<div class="build-info_tier">{{ tier }}:</div>
<div class="build-info">
<span class="build-info_git">
{{ info.branch || '' }}@{{ info.rev || '?' }}
</span>
<span class="build-info_date">
({{ new Date(info.date).toISOString() }})
</span>
</div>
</div>
</div>
</OverlayPanel>
<i class="pi pi-info-circle link" @click="buildInfoPanel.toggle"></i>
{{ uiConfig.title }}
</div>
<a
Expand Down Expand Up @@ -82,14 +53,4 @@ Licensed under the Elastic License 2.0. */
z-index: 100;
}
}
.p-overlaypanel-content {
.build-info_tier {
text-transform: capitalize;
font-weight: bold;
}
.build-info_git {
font-family: monospace;
}
}
</style>
4 changes: 0 additions & 4 deletions src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
*/
/// <reference types="vite/client" />

declare const __APP_VERSION__: string;
declare const __BUILD_DATE__: string;
declare const __BUILD_BRANCH__: string;
declare const __BUILD_REVISION__: string;
declare module '*.vue' {
import { DefineComponent } from 'vue';
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
Expand Down
27 changes: 1 addition & 26 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,10 @@ import i18n from './i18n/i18n';
import { useErrorHandling } from './composable/useErrorHandling';
import useLoader from './composable/useLoader';
import { useUiConfigApi } from './composable/useApi';
import { BuildInfo, FrontendConfiguration } from './generated-sources/openapi';
import { FrontendConfiguration } from './generated-sources/openapi';

const { uiConfigApi } = useUiConfigApi();

const buildInfo = await uiConfigApi
.getBuildInfo()
.then((r) => r.data)
.catch((err: AxiosError) => {
console.info('Could not retrieve Build-Info from the backend', err.message);
return {
version: '0.0.0',
date: new Date(0).toISOString(),
branch: undefined,
rev: undefined,
} as BuildInfo;
})
.then((backend) => {
return {
frontend: {
version: __APP_VERSION__,
date: new Date(__BUILD_DATE__).toISOString(),
branch: __BUILD_BRANCH__,
rev: __BUILD_REVISION__,
} as BuildInfo,
backend,
};
});

const uiConfig = await uiConfigApi
.getFrontendConfig()
.then((r) => r.data)
Expand Down Expand Up @@ -97,7 +73,6 @@ useLoader().activateLoadingInterceptor();
const pinia = createPinia();

const app = createApp(App);
app.provide('buildInfo', buildInfo);
app.provide('uiConfig', uiConfig);
app.provide('authService', authService);

Expand Down
6 changes: 0 additions & 6 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ export default defineConfig({
//TODO maybe remove on cleanup session
target: 'esnext',
},
define: {
__APP_VERSION__: JSON.stringify(process.env.npm_package_version),
__BUILD_DATE__: JSON.stringify(new Date().toISOString()),
__BUILD_BRANCH__: 'import.meta.env.VITE_GIT_BRANCH',
__BUILD_REVISION__: 'import.meta.env.VITE_GIT_REVISION',
},
server: {
port: 3000,
proxy: {
Expand Down

0 comments on commit 3b8a816

Please sign in to comment.