refactor: move version/copyright notice to own component
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Settel 2023-01-29 17:50:20 +01:00
parent 7cd0639708
commit 0d2ae30b24
3 changed files with 37 additions and 47 deletions

View File

@ -0,0 +1,33 @@
<template>
<div class="copyright-notice__version" @click="openInfoModal">
v{{ config.version }}, © 2021-2023, Settel
</div>
<InfoModal v-if="showInfoModal" @close="closeInfoModal" />
</template>
<script setup lang="ts">
import { useRuntimeConfig } from '#app'
import { ref } from 'vue'
const config = useRuntimeConfig()
const showInfoModal = ref(false)
const openInfoModal = () => { showInfoModal.value = true }
const closeInfoModal = () => { showInfoModal.value = false }
</script>
<style lang="scss">
.copyright-notice {
&__version {
position: absolute;
right: 1em;
bottom: 0;
color: #606060;
cursor: pointer;
&:hover {
color: #c0c0c0;
}
}
}
</style>

View File

@ -12,34 +12,26 @@
</div> </div>
<div class="page-index__space" /> <div class="page-index__space" />
</div> </div>
<div class="page-index__copyright-notice" @click="openInfoModal"> <CopyrightNotice />
v{{ config.version }}, © 2021-2023, Settel
</div>
<InfoModal v-if="showInfoModal" @close="closeInfoModal" />
<CreateTeamDialog v-if="showCreateTeamDialog" @close="closeCreateTeamDialog" /> <CreateTeamDialog v-if="showCreateTeamDialog" @close="closeCreateTeamDialog" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useRuntimeConfig } from '#app'
import { ref } from 'vue' import { ref } from 'vue'
import useAuth from '@/composables/useAuth' import useAuth from '@/composables/useAuth'
import useI18n from '@/composables/useI18n' import useI18n from '@/composables/useI18n'
import CopyrightNotice from '../components/CopyrightNotice.vue';
const { $t } = useI18n({ const { $t } = useI18n({
'create-team': { en: 'Create Team ...', de: 'Team erstellen ...' }, 'create-team': { en: 'Create Team ...', de: 'Team erstellen ...' },
}) })
const config = useRuntimeConfig()
await useAuth().authenticateAndLoadUserInfo(['']) await useAuth().authenticateAndLoadUserInfo([''])
const showCreateTeamDialog = ref(false) const showCreateTeamDialog = ref(false)
const showInfoModal = ref(false)
const createTeam = () => { showCreateTeamDialog.value = true } const createTeam = () => { showCreateTeamDialog.value = true }
const closeCreateTeamDialog = () => { showCreateTeamDialog.value = false } const closeCreateTeamDialog = () => { showCreateTeamDialog.value = false }
const openInfoModal = () => { showInfoModal.value = true }
const closeInfoModal = () => { showInfoModal.value = false }
</script> </script>
<style lang="scss"> <style lang="scss">
@ -92,17 +84,5 @@ body {
&__space { &__space {
flex-grow: 1; flex-grow: 1;
} }
&__copyright-notice {
position: absolute;
right: 1em;
bottom: 0;
color: #606060;
cursor: pointer;
&:hover {
color: #c0c0c0;
}
}
} }
</style> </style>

View File

@ -10,16 +10,11 @@
<Button @click="createAdminAccount">{{ $t('create admin user') }}</Button> <Button @click="createAdminAccount">{{ $t('create admin user') }}</Button>
</div> </div>
</div> </div>
<div class="page-setup__copyright-notice" @click="openInfoModal"> <CopyrightNotice />
v{{ config.version }}, © 2021-2023, Settel
</div>
<InfoModal v-if="showInfoModal" @close="closeInfoModal" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useRuntimeConfig } from '#app'
import { ref } from 'vue'
import useAuth from '@/composables/useAuth' import useAuth from '@/composables/useAuth'
import useI18n from '@/composables/useI18n' import useI18n from '@/composables/useI18n'
@ -35,16 +30,10 @@ const { $t } = useI18n({
}, },
}) })
const config = useRuntimeConfig()
await useAuth().authenticateAndLoadUserInfo(['setup']) await useAuth().authenticateAndLoadUserInfo(['setup'])
const showInfoModal = ref(false) const createAdminAccount = () => {}
const openInfoModal = () => { showInfoModal.value = true }
const closeInfoModal = () => { showInfoModal.value = false }
const createAdminAccount = () => {
}
</script> </script>
<style lang="scss"> <style lang="scss">
@ -72,17 +61,5 @@ const createAdminAccount = () => {
display: flex; display: flex;
margin: 32px auto; margin: 32px auto;
} }
&__copyright-notice {
position: absolute;
right: 1em;
bottom: 0;
color: #606060;
cursor: pointer;
&:hover {
color: #c0c0c0;
}
}
} }
</style> </style>