Compare commits

...

27 Commits

Author SHA1 Message Date
419c0b2d96 fix(deps): update sentry-javascript monorepo to v7.16.0 (#2560)
Reviewed-on: vikunja/frontend#2560
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-19 07:39:55 +00:00
449b11c1ff chore(deps): update dependency @types/node to v16.11.68 (#2558)
Reviewed-on: vikunja/frontend#2558
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-19 05:07:29 +00:00
f818c207c2 [skip ci] Updated translations via Crowdin 2022-10-19 00:13:00 +00:00
4ee8f600a3 chore(deps): update typescript-eslint monorepo to v5.40.1 (#2557)
Reviewed-on: vikunja/frontend#2557
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-18 09:22:00 +00:00
29f68747bb feat: make salutation i18n static (#2546)
Reviewed-on: vikunja/frontend#2546
Reviewed-by: konrad <k@knt.li>
2022-10-18 08:35:52 +00:00
ce201e0880 chore(deps): update dependency rollup to v3.2.3 (#2556)
Reviewed-on: vikunja/frontend#2556
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-18 08:19:53 +00:00
bd26b81318 chore(deps): pin dependency @types/postcss-preset-env to 7.7.0 (#2555)
Reviewed-on: vikunja/frontend#2555
Reviewed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-18 08:07:53 +00:00
Dominik Pschenitschni
b80f82c411 fix: postcss-preset-env configuration (#2554)
Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: vikunja/frontend#2554
Reviewed-by: konrad <k@knt.li>
Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
2022-10-17 11:52:27 +00:00
5afafb7c82
fix: move hourToDaytime to separate file in order to pass tests 2022-10-17 12:35:47 +02:00
9de20b4c54
feat: use getter and helper in other components as well 2022-10-17 12:35:47 +02:00
c9b18232c9 chore(deps): update dependency happy-dom to v7.5.12 (#2553)
Reviewed-on: vikunja/frontend#2553
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-17 09:02:37 +00:00
8e460f9856 chore(deps): update dependency caniuse-lite to v1.0.30001420 (#2550)
Reviewed-on: vikunja/frontend#2550
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-17 07:39:54 +00:00
2db263f2d2 fix(deps): update vueuse to v9.3.1 (#2552)
Reviewed-on: vikunja/frontend#2552
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-17 07:39:00 +00:00
79872c96de chore(deps): update dependency netlify-cli to v12.0.9 (#2551)
Reviewed-on: vikunja/frontend#2551
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-17 07:37:52 +00:00
2c881b3126 chore(deps): update dependency rollup to v3.2.2 (#2549)
Reviewed-on: vikunja/frontend#2549
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-17 07:37:24 +00:00
8093ce9441 chore(deps): update pnpm to v7.13.5 2022-10-16 19:03:19 +00:00
c4d7f6fdfa
feat: get username from store getter 2022-10-16 19:36:04 +02:00
c20de51a3c
feat: make salutation i18n static 2022-10-16 15:28:58 +02:00
ed56176f2d chore(deps): update dependency rollup-plugin-visualizer to v5.8.3 (#2543)
Reviewed-on: vikunja/frontend#2543
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-16 10:21:04 +00:00
ab7d889650 fix(deps): update dependency ufo to v0.8.6 (#2542)
Reviewed-on: vikunja/frontend#2542
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-16 09:19:27 +00:00
b334712dfe chore(deps): update dependency @types/node to v16.11.66 (#2544)
Reviewed-on: vikunja/frontend#2544
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-16 09:18:50 +00:00
454b680117 chore(deps): update dependency rollup to v3.2.1 (#2545)
Reviewed-on: vikunja/frontend#2545
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-16 09:18:07 +00:00
830ecc2c03 chore(deps): update dependency vue-tsc to v1.0.8 (#2540)
Reviewed-on: vikunja/frontend#2540
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-15 07:56:39 +00:00
0e448a123e chore(deps): update dependency rollup to v3.2.0 (#2541)
Reviewed-on: vikunja/frontend#2541
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-15 07:13:52 +00:00
1c01fcbb84 chore(deps): update dependency esbuild to v0.15.11 (#2539)
Reviewed-on: vikunja/frontend#2539
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-14 15:12:14 +00:00
e8fb4ce1fa chore(deps): update dependency @cypress/vue to v4.2.1 (#2535)
Reviewed-on: vikunja/frontend#2535
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-14 14:16:41 +00:00
37cbbdbec8 chore(deps): update dependency vitest to v0.24.3 (#2536)
Reviewed-on: vikunja/frontend#2536
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-10-14 14:16:00 +00:00
31 changed files with 514 additions and 519 deletions

View File

@ -24,13 +24,13 @@
"@fortawesome/vue-fontawesome": "3.0.1",
"@github/hotkey": "2.0.1",
"@kyvg/vue3-notification": "2.4.1",
"@sentry/tracing": "7.15.0",
"@sentry/vue": "7.15.0",
"@sentry/tracing": "7.16.0",
"@sentry/vue": "7.16.0",
"@types/is-touch-device": "1.0.0",
"@types/lodash.clonedeep": "4.5.7",
"@types/sortablejs": "1.15.0",
"@vueuse/core": "9.3.0",
"@vueuse/router": "9.3.0",
"@vueuse/core": "9.3.1",
"@vueuse/router": "9.3.1",
"axios": "0.27.2",
"blurhash": "2.0.3",
"bulma-css-variables": "0.9.33",
@ -52,7 +52,7 @@
"register-service-worker": "1.7.2",
"snake-case": "3.0.4",
"sortablejs": "1.15.0",
"ufo": "0.8.5",
"ufo": "0.8.6",
"vue": "3.2.41",
"vue-advanced-cropper": "2.8.6",
"vue-drag-resize": "2.0.3",
@ -65,16 +65,17 @@
"devDependencies": {
"@4tw/cypress-drag-drop": "2.2.1",
"@cypress/vite-dev-server": "3.3.1",
"@cypress/vue": "4.2.0",
"@cypress/vue": "4.2.1",
"@faker-js/faker": "7.6.0",
"@rushstack/eslint-patch": "1.2.0",
"@types/dompurify": "2.3.4",
"@types/flexsearch": "0.7.3",
"@types/lodash.debounce": "4.0.7",
"@types/marked": "4.0.7",
"@types/node": "16.11.65",
"@typescript-eslint/eslint-plugin": "5.40.0",
"@typescript-eslint/parser": "5.40.0",
"@types/node": "16.11.68",
"@types/postcss-preset-env": "7.7.0",
"@typescript-eslint/eslint-plugin": "5.40.1",
"@typescript-eslint/parser": "5.40.1",
"@vitejs/plugin-legacy": "2.2.0",
"@vitejs/plugin-vue": "3.1.2",
"@vue/eslint-config-typescript": "11.0.2",
@ -82,33 +83,28 @@
"@vue/tsconfig": "0.1.3",
"autoprefixer": "10.4.12",
"browserslist": "4.21.4",
"caniuse-lite": "1.0.30001418",
"caniuse-lite": "1.0.30001420",
"cypress": "10.10.0",
"esbuild": "0.15.10",
"esbuild": "0.15.11",
"eslint": "8.25.0",
"eslint-plugin-vue": "9.6.0",
"express": "4.18.2",
"happy-dom": "7.4.0",
"netlify-cli": "12.0.7",
"happy-dom": "7.5.12",
"netlify-cli": "12.0.9",
"postcss": "8.4.18",
"postcss-preset-env": "7.8.2",
"rollup": "3.1.0",
"rollup-plugin-visualizer": "5.8.2",
"rollup": "3.2.3",
"rollup-plugin-visualizer": "5.8.3",
"sass": "1.55.0",
"typescript": "4.8.4",
"vite": "3.1.8",
"vite-plugin-pwa": "0.13.1",
"vite-svg-loader": "3.6.0",
"vitest": "0.24.1",
"vue-tsc": "1.0.7",
"vitest": "0.24.3",
"vue-tsc": "1.0.8",
"wait-on": "6.0.1",
"workbox-cli": "6.5.4"
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"license": "AGPL-3.0-or-later",
"packageManager": "pnpm@7.13.4"
"packageManager": "pnpm@7.13.5"
}

File diff suppressed because it is too large Load Diff

View File

@ -44,8 +44,8 @@
variant="secondary"
:shadow="false"
>
<img :src="userAvatar" alt="" class="avatar" width="40" height="40"/>
<span class="username">{{ userInfo.name !== '' ? userInfo.name : userInfo.username }}</span>
<img :src="authStore.avatarUrl" alt="" class="avatar" width="40" height="40"/>
<span class="username">{{ authStore.userDisplayName }}</span>
<span class="icon is-small">
<icon icon="chevron-down"/>
</span>
@ -80,7 +80,7 @@
{{ $t('about.title') }}
</dropdown-item>
<dropdown-item
@click="logout()"
@click="authStore.logout()"
>
{{ $t('user.auth.logout') }}
</dropdown-item>
@ -117,8 +117,6 @@ const canWriteCurrentList = computed(() => baseStore.currentList.maxRight > Righ
const menuActive = computed(() => baseStore.menuActive)
const authStore = useAuthStore()
const userInfo = computed(() => authStore.info)
const userAvatar = computed(() => authStore.avatarUrl)
const configStore = useConfigStore()
const imprintUrl = computed(() => configStore.legal.imprintUrl)
@ -136,10 +134,6 @@ onMounted(async () => {
listTitle.value.style.setProperty('--nav-username-width', `${usernameWidth}px`)
})
function logout() {
authStore.logout()
}
function openQuickActions() {
baseStore.setQuickActionsActive(true)
}

View File

@ -41,6 +41,7 @@ import {success} from '@/message'
import {useTaskStore} from '@/stores/tasks'
import type {IUser} from '@/modelTypes/IUser'
import { getDisplayName } from '@/models/user'
const props = defineProps({
taskId: {
@ -65,7 +66,7 @@ const taskStore = useTaskStore()
const {t} = useI18n({useScope: 'global'})
const listUserService = shallowReactive(new ListUserService())
const foundUsers = ref([])
const foundUsers = ref<IUser[]>([])
const assignees = ref<IUser[]>([])
let isAdding = false
@ -114,13 +115,14 @@ async function findUser(query: string) {
return
}
const response = await listUserService.getAll({listId: props.listId}, {s: query})
const response = await listUserService.getAll({listId: props.listId}, {s: query}) as IUser[]
// Filter the results to not include users who are already assigned
foundUsers.value = response.filter(({id}) => !includesById(assignees.value, id))
foundUsers.value = response
.filter(({id}) => !includesById(assignees.value, id))
.map(u => {
// Users may not have a display name set, so we fall back on the username in that case
u.name = u.name === '' ? u.username : u.name
u.name = getDisplayName(u)
return u
})
}

View File

@ -1,31 +0,0 @@
import {describe, it, expect} from 'vitest'
import {hourToSalutation} from './useDateTimeSalutation'
const dateWithHour = (hours: number): Date => {
const date = new Date()
date.setHours(hours)
return date
}
describe('Salutation', () => {
it('shows the right salutation in the night', () => {
const salutation = hourToSalutation(dateWithHour(4))
expect(salutation).toBe('home.welcomeNight')
})
it('shows the right salutation in the morning', () => {
const salutation = hourToSalutation(dateWithHour(8))
expect(salutation).toBe('home.welcomeMorning')
})
it('shows the right salutation in the day', () => {
const salutation = hourToSalutation(dateWithHour(13))
expect(salutation).toBe('home.welcomeDay')
})
it('shows the right salutation in the night', () => {
const salutation = hourToSalutation(dateWithHour(20))
expect(salutation).toBe('home.welcomeEvening')
})
it('shows the right salutation in the night again', () => {
const salutation = hourToSalutation(dateWithHour(23))
expect(salutation).toBe('home.welcomeNight')
})
})

View File

@ -1,31 +0,0 @@
import {computed} from 'vue'
import {useNow} from '@vueuse/core'
const TRANSLATION_KEY_PREFIX = 'home.welcome'
export function hourToSalutation(now: Date) {
const hours = now.getHours()
if (hours < 5) {
return `${TRANSLATION_KEY_PREFIX}Night`
}
if (hours < 11) {
return `${TRANSLATION_KEY_PREFIX}Morning`
}
if (hours < 18) {
return `${TRANSLATION_KEY_PREFIX}Day`
}
if (hours < 23) {
return `${TRANSLATION_KEY_PREFIX}Evening`
}
return `${TRANSLATION_KEY_PREFIX}Night`
}
export function useDateTimeSalutation() {
const now = useNow()
return computed(() => hourToSalutation(now.value))
}

View File

@ -0,0 +1,26 @@
import {computed} from 'vue'
import {useI18n} from 'vue-i18n'
import {useNow} from '@vueuse/core'
import {useAuthStore} from '@/stores/auth'
import {hourToDaytime} from '@/helpers/hourToDaytime'
export type Daytime = 'night' | 'morning' | 'day' | 'evening'
export function useDaytimeSalutation() {
const {t} = useI18n({useScope: 'global'})
const now = useNow()
const authStore = useAuthStore()
const name = computed(() => authStore.userDisplayName)
const daytime = computed(() => hourToDaytime(now.value))
const salutations = {
'night': () => t('home.welcomeNight', {username: name.value}),
'morning': () => t('home.welcomeMorning', {username: name.value}),
'day': () => t('home.welcomeDay', {username: name.value}),
'evening': () => t('home.welcomeEvening', {username: name.value}),
} as Record<Daytime, () => string>
return computed(() => name.value ? salutations[daytime.value]() : undefined)
}

View File

@ -0,0 +1,31 @@
import {describe, it, expect} from 'vitest'
import {hourToDaytime} from "./hourToDaytime"
function dateWithHour(hours: number): Date {
const newDate = new Date()
newDate.setHours(hours, 0, 0,0 )
return newDate
}
describe('Salutation', () => {
it('shows the right salutation in the night', () => {
const salutation = hourToDaytime(dateWithHour(4))
expect(salutation).toBe('night')
})
it('shows the right salutation in the morning', () => {
const salutation = hourToDaytime(dateWithHour(8))
expect(salutation).toBe('morning')
})
it('shows the right salutation in the day', () => {
const salutation = hourToDaytime(dateWithHour(13))
expect(salutation).toBe('day')
})
it('shows the right salutation in the night', () => {
const salutation = hourToDaytime(dateWithHour(20))
expect(salutation).toBe('evening')
})
it('shows the right salutation in the night again', () => {
const salutation = hourToDaytime(dateWithHour(23))
expect(salutation).toBe('night')
})
})

View File

@ -0,0 +1,14 @@
import type { Daytime } from '@/composables/useDaytimeSalutation'
export function hourToDaytime(now: Date): Daytime {
const hours = now.getHours()
const daytimeMap = {
night: hours < 5 || hours > 23,
morning: hours < 11,
day: hours < 18,
evening: hours < 23,
} as Record<Daytime, boolean>
return (Object.keys(daytimeMap) as Daytime[]).find((daytime) => daytimeMap[daytime]) || 'night'
}

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Good Night {username}",
"welcomeMorning": "Good Morning {username}",
"welcomeDay": "Hi {username}",
"welcomeEvening": "Good Evening {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Last viewed",
"list": {
"newText": "You can create a new list for your new tasks:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Dobrou noc {username}",
"welcomeMorning": "Dobré ráno {username}",
"welcomeDay": "Ahoj {username}",
"welcomeEvening": "Dobrý večer {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Naposledy zobrazeno",
"list": {
"newText": "Můžete vytvořit nový seznam pro své nové úkoly:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Gute Nacht, {username}",
"welcomeMorning": "Guten Morgen, {username}",
"welcomeDay": "Hallo, {username}",
"welcomeEvening": "Guten Abend, {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Zuletzt angesehen",
"list": {
"newText": "Du kannst eine neue Liste für deine neuen Aufgaben erstellen:",
@ -335,7 +335,7 @@
"create": {
"title": "Neuer Namespace",
"titleRequired": "Bitte gebe einen Titel an.",
"explanation": "Ein Namespace ist eine Sammlung von Listen, die du teilen und zur Organisation verwenden kannst. Jede Liste zu einem Namespace.",
"explanation": "Ein Namespace ist eine Sammlung von Listen, die du teilen und zur Organisation verwenden kannst. Jede Liste gehört zu einem Namespace.",
"tooltip": "Was ist ein Namespace?",
"success": "Der Namespace wurde erfolgreich erstellt."
},

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Guet Nacht, {username}",
"welcomeMorning": "Guete Morgä, {username}",
"welcomeDay": "Hoi {username}",
"welcomeEvening": "Guete Abig, {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Zletscht ahglueget",
"list": {
"newText": "Du chasch e Liste für dini neue Uufgabe erstelle:",
@ -335,7 +335,7 @@
"create": {
"title": "Neuer Namespace",
"titleRequired": "Bitte gib en Titl ah.",
"explanation": "Ein Namespace ist eine Sammlung von Listen, die du teilen und zur Organisation verwenden kannst. Jede Liste zu einem Namespace.",
"explanation": "Ein Namespace ist eine Sammlung von Listen, die du teilen und zur Organisation verwenden kannst. Jede Liste gehört zu einem Namespace.",
"tooltip": "Was isch en Namensruum?",
"success": "Namensruum erstellt."
},

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Good Night {username}",
"welcomeMorning": "Good Morning {username}",
"welcomeDay": "Hi {username}",
"welcomeEvening": "Good Evening {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Last viewed",
"list": {
"newText": "You can create a new list for your new tasks:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Good Night {username}",
"welcomeMorning": "Good Morning {username}",
"welcomeDay": "Hi {username}",
"welcomeEvening": "Good Evening {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Last viewed",
"list": {
"newText": "You can create a new list for your new tasks:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Bonne nuit {username}",
"welcomeMorning": "Bonjour {username}",
"welcomeDay": "Salut {username}",
"welcomeEvening": "Bonsoir {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Dernière consultation",
"list": {
"newText": "Tu peux créer une nouvelle liste pour tes nouvelles tâches :",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Buonanotte {username}",
"welcomeMorning": "Buongiorno {username}",
"welcomeDay": "Ciao {username}",
"welcomeEvening": "Buonasera {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Ultima visualizzazione",
"list": {
"newText": "È possibile creare una nuova lista per le nuove attività:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Goede nacht {username}",
"welcomeMorning": "Goedemorgen {username}",
"welcomeDay": "Hallo {username}",
"welcomeEvening": "Goedenavond {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Laatst bekeken",
"list": {
"newText": "Je kan een nieuwe lijst maken voor je nieuwe taken:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Dobrej nocy {username}",
"welcomeMorning": "Dzień dobry {username}",
"welcomeDay": "Cześć {username}",
"welcomeEvening": "Dobry wieczór {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Ostatnio oglądane",
"list": {
"newText": "Możesz stworzyć nową listę dla swoich nowych zadań:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Good Night {username}",
"welcomeMorning": "Good Morning {username}",
"welcomeDay": "Hi {username}",
"welcomeEvening": "Good Evening {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Last viewed",
"list": {
"newText": "You can create a new list for your new tasks:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Boa Noite {username}",
"welcomeMorning": "Bom Dia {username}",
"welcomeDay": "Olá {username}",
"welcomeEvening": "Boa Tarde {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Visto recentemente",
"list": {
"newText": "Podes criar uma nova lista para as tuas novas tarefas:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Доброй ночи, {username}",
"welcomeMorning": "Доброе утро, {username}",
"welcomeDay": "Привет, {username}",
"welcomeEvening": "Добрый вечер, {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Последние просмотренные",
"list": {
"newText": "Ты можешь создать новый список для своих задач:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Good Night {username}",
"welcomeMorning": "Good Morning {username}",
"welcomeDay": "Hi {username}",
"welcomeEvening": "Good Evening {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Last viewed",
"list": {
"newText": "You can create a new list for your new tasks:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Good Night {username}",
"welcomeMorning": "Good Morning {username}",
"welcomeDay": "Hi {username}",
"welcomeEvening": "Good Evening {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Last viewed",
"list": {
"newText": "You can create a new list for your new tasks:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Good Night {username}",
"welcomeMorning": "Good Morning {username}",
"welcomeDay": "Hi {username}",
"welcomeEvening": "Good Evening {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Last viewed",
"list": {
"newText": "You can create a new list for your new tasks:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Ngủ ngon nhé, {username}",
"welcomeMorning": "Chào buổi sáng, {username}",
"welcomeDay": "Hi {username}",
"welcomeEvening": "Chào buổi tối, {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Xem gần đây",
"list": {
"newText": "Bạn có thể tạo một danh sách công việc mới cho mình:",

View File

@ -1,9 +1,9 @@
{
"home": {
"welcomeNight": "Good Night {username}",
"welcomeMorning": "Good Morning {username}",
"welcomeDay": "Hi {username}",
"welcomeEvening": "Good Evening {username}",
"welcomeNight": "Good Night {username}!",
"welcomeMorning": "Good Morning {username}!",
"welcomeDay": "Hi {username}!",
"welcomeEvening": "Good Evening {username}!",
"lastViewed": "Last viewed",
"list": {
"newText": "You can create a new list for your new tasks:",

View File

@ -7,7 +7,7 @@ export const AUTH_TYPES = {
'LINK_SHARE': 2,
} as const
type AuthType = typeof AUTH_TYPES[keyof typeof AUTH_TYPES]
export type AuthType = typeof AUTH_TYPES[keyof typeof AUTH_TYPES]
export interface IUser extends IAbstract {
id: number

View File

@ -3,7 +3,7 @@ import {defineStore, acceptHMRUpdate} from 'pinia'
import {HTTPFactory, AuthenticatedHTTPFactory} from '@/http-common'
import {i18n, getCurrentLanguage, saveLanguage} from '@/i18n'
import {objectToSnakeCase} from '@/helpers/case'
import UserModel, { getAvatarUrl } from '@/models/user'
import UserModel, { getAvatarUrl, getDisplayName } from '@/models/user'
import UserSettingsService from '@/services/userSettings'
import {getToken, refreshToken, removeToken, saveToken} from '@/helpers/auth'
import {setModuleLoading} from '@/stores/helper'
@ -54,6 +54,9 @@ export const useAuthStore = defineStore('auth', {
state.info.type === AUTH_TYPES.LINK_SHARE
)
},
userDisplayName(state) {
return state.info ? getDisplayName(state.info) : undefined
},
},
actions: {
setIsLoading(isLoading: boolean) {

View File

@ -1,8 +1,7 @@
<template>
<div class="content has-text-centered">
<h2 v-if="userInfo">
{{ $t(welcome, {username: userInfo.name !== '' ? userInfo.name : userInfo.username}) }}!
</h2>
<h2 v-if="salutation">{{ salutation }}</h2>
<message variant="danger" v-if="deletionScheduledAt !== null" class="mb-4">
{{
$t('user.deletion.scheduled', {
@ -69,7 +68,7 @@ import AddTask from '@/components/tasks/add-task.vue'
import {getHistory} from '@/modules/listHistory'
import {parseDateOrNull} from '@/helpers/parseDateOrNull'
import {formatDateShort, formatDateSince} from '@/helpers/time/formatDate'
import {useDateTimeSalutation} from '@/composables/useDateTimeSalutation'
import {useDaytimeSalutation} from '@/composables/useDaytimeSalutation'
import {useBaseStore} from '@/stores/base'
import {useListStore} from '@/stores/lists'
@ -78,7 +77,7 @@ import {useNamespaceStore} from '@/stores/namespaces'
import {useAuthStore} from '@/stores/auth'
import {useTaskStore} from '@/stores/tasks'
const welcome = useDateTimeSalutation()
const salutation = useDaytimeSalutation()
const baseStore = useBaseStore()
const authStore = useAuthStore()
@ -99,7 +98,6 @@ const listHistory = computed(() => {
})
const migratorsEnabled = computed(() => configStore.availableMigrators?.length > 0)
const userInfo = computed(() => authStore.info)
const hasTasks = computed(() => baseStore.hasTasks)
const defaultListId = computed(() => authStore.settings.defaultListId)
const defaultNamespaceId = computed(() => namespaceStore.namespaces?.[0]?.id || 0)

View File

@ -6,6 +6,8 @@ import legacyFn from '@vitejs/plugin-legacy'
import {VitePWA} from 'vite-plugin-pwa'
import {visualizer} from 'rollup-plugin-visualizer'
import svgLoader from 'vite-svg-loader'
import postcssPresetEnv from "postcss-preset-env";
import { fileURLToPath, URL } from 'url'
const pathSrc = fileURLToPath(new URL('./src', import.meta.url))
@ -40,6 +42,11 @@ export default defineConfig({
charset: false, // fixes "@charset" must be the first rule in the file" warnings
},
},
postcss: {
plugins: [
postcssPresetEnv(),
],
},
},
plugins: [
vue({