feat: add logo change toggle setting (#1031)

This commit is contained in:
kolaente
2025-06-26 17:59:34 +02:00
committed by GitHub
parent 06d5791568
commit bddba8646d
7 changed files with 24 additions and 1 deletions

View File

@@ -23,6 +23,7 @@
// It has to be the full url, including the last /api/v1 part and port.
// You can change this if your api is not reachable on the same port as the frontend.
window.API_URL = '/api/v1'
window.ALLOW_ICON_CHANGES = true
</script>
</body>
</html>

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useNow } from '@vueuse/core'
import { useAuthStore } from '@/stores/auth'
import LogoFull from '@/assets/logo-full.svg?component'
import LogoFullPride from '@/assets/logo-full-pride.svg?component'
@@ -9,7 +10,13 @@ import {MILLISECONDS_A_HOUR} from '@/constants/date'
const now = useNow({
interval: MILLISECONDS_A_HOUR,
})
const Logo = computed(() => window.ALLOW_ICON_CHANGES && now.value.getMonth() === 5 ? LogoFullPride : LogoFull)
const authStore = useAuthStore()
const Logo = computed(() => window.ALLOW_ICON_CHANGES
&& authStore.settings.frontendSettings.allowIconChanges
&& now.value.getMonth() === 5
? LogoFullPride
: LogoFull)
const CustomLogo = computed(() => window.CUSTOM_LOGO_URL)
</script>

View File

@@ -92,6 +92,7 @@
"discoverableByName": "Allow other users to add me as a member to teams or projects when they search for my name",
"discoverableByEmail": "Allow other users to add me as a member to teams or projects when they search for my full email",
"playSoundWhenDone": "Play a sound when marking tasks as done",
"allowIconChanges": "Show special logos during certain times",
"weekStart": "Week starts on",
"weekStartSunday": "Sunday",
"weekStartMonday": "Monday",

View File

@@ -11,6 +11,7 @@ export interface IFrontendSettings {
playSoundWhenDone: boolean
quickAddMagicMode: PrefixMode
colorSchema: BasicColorSchema
allowIconChanges: boolean
filterIdUsedOnOverview: IProject['id'] | null
defaultView?: DefaultProjectViewKind
minimumPriority: Priority

View File

@@ -21,6 +21,7 @@ export default class UserSettingsModel extends AbstractModel<IUserSettings> impl
playSoundWhenDone: true,
quickAddMagicMode: PrefixMode.Default,
colorSchema: 'auto',
allowIconChanges: true,
defaultView: DEFAULT_PROJECT_VIEW_SETTINGS.FIRST,
minimumPriority: PRIORITIES.MEDIUM,
}

View File

@@ -129,6 +129,7 @@ export const useAuthStore = defineStore('auth', () => {
playSoundWhenDone: true,
quickAddMagicMode: PrefixMode.Default,
colorSchema: 'auto',
allowIconChanges: true,
...newSettings.frontendSettings,
},
})

View File

@@ -123,6 +123,15 @@
{{ $t('user.settings.general.playSoundWhenDone') }}
</label>
</div>
<div class="field">
<label class="checkbox">
<input
v-model="settings.frontendSettings.allowIconChanges"
type="checkbox"
>
{{ $t('user.settings.general.allowIconChanges') }}
</label>
</div>
<div class="field">
<label class="checkbox">
<input
@@ -295,6 +304,8 @@ const settings = ref<IUserSettings>({
defaultView: authStore.settings.frontendSettings.defaultView ?? DEFAULT_PROJECT_VIEW_SETTINGS.FIRST,
// Add fallback for old settings that don't have the minimum priority set
minimumPriority: authStore.settings.frontendSettings.minimumPriority ?? PRIORITIES.MEDIUM,
// Add fallback for old settings that don't have the logo change setting set
allowIconChanges: authStore.settings.frontendSettings.allowIconChanges ?? true,
},
})