fix: ui, locale, tests

This commit is contained in:
Nikolai Giman
2026-04-05 22:39:03 +02:00
parent 4ec6b143ca
commit d06266fb93
9 changed files with 25 additions and 18 deletions
@@ -748,7 +748,7 @@ describe('API Tokens', () => {
const user2Token = await $tvApiForSecondUser.apiTokens.create({ name: 'User2 token' });
const result = await $api.apiTokens.delete(user2Token!.item.id);
await $api.apiTokens.delete(user2Token!.item.id);
// should return false or not delete it
const user2Tokens = await $tvApiForSecondUser.apiTokens.fetch();
const stillExists = user2Tokens!.find(t => t.id === user2Token!.item.id);
@@ -827,7 +827,7 @@ describe('API Tokens', () => {
headers: { Authorization: `Bearer ${created!.token}` },
}));
const result = await tokenApi.collaboration.inviteUserToGoal({
await tokenApi.collaboration.inviteUserToGoal({
goalId,
email: `token-invite-${Date.now()}@test.com`,
}).catch((err) => err.status);
@@ -318,7 +318,7 @@ describe('Collaboration', () => {
throw new Error('Failed to add user to goal');
}
const addResult2 = await $api.collaboration.inviteUserToGoal({
await $api.collaboration.inviteUserToGoal({
goalId: collaborationGoal?.id!,
email: email,
}).catch(console.error);
@@ -7,7 +7,7 @@ import {
afterAll,
} from 'vitest'
import { initApi } from './init-api'
import { createServer, type Server, type IncomingMessage, type ServerResponse } from 'http'
import { createServer, type IncomingMessage, type ServerResponse } from 'http'
import { networkInterfaces } from 'os'
function getLocalIp(): string {
+12 -11
View File
@@ -2,7 +2,7 @@
<UDropdownMenu
:items="items"
:content="{ align: 'center', collisionPadding: 12 }"
:ui="{ content: collapsed ? 'w-48' : 'w-(--reka-dropdown-menu-trigger-width)' }"
:ui="{ content: collapsed ? 'w-48' : 'w-(--reka-dropdown-menu-trigger-width)', group: 'max-h-screen' }"
>
<UButton
v-bind="{
@@ -129,17 +129,18 @@ const items = computed<DropdownMenuItem[][]>(() => [
],
orgStore.organizations.length > 1 ? [
{
type: 'label' as const,
label: t('userMenu.switchOrganization'),
label: orgStore.currentOrg?.name || t('userMenu.switchOrganization'),
icon: 'i-lucide-building-2',
children: orgStore.organizations.map(org => ({
label: org.name,
icon: org.id === orgStore.currentOrg?.id ? 'i-lucide-check' : undefined,
onSelect(e: Event) {
e.preventDefault()
orgStore.setCurrentOrg(org)
},
})),
},
...orgStore.organizations.map(org => ({
label: org.name,
icon: org.id === orgStore.currentOrg?.id ? 'i-lucide-check' : 'i-lucide-building-2',
onSelect(e: Event) {
e.preventDefault()
orgStore.setCurrentOrg(org)
},
})),
] : [],
[
{
@@ -1,5 +1,5 @@
<template>
<nav class="fixed bottom-0 left-0 right-0 z-50 lg:hidden border-t border-default pb-safe">
<nav class="fixed bottom-0 left-0 right-0 z-50 lg:hidden border-t border-default pb-safe bg-default">
<div class="flex items-center justify-between min-h-14">
<UButton
v-for="item in navItems"
@@ -3,7 +3,7 @@
<div class="flex items-center justify-between">
<h2 class="text-lg font-semibold">{{ t('organizations.title') }}</h2>
<UButton
:label="t('organizations.create')"
:label="isMobile ? undefined : t('organizations.create')"
icon="i-lucide-plus"
@click="showCreateModal = true"
/>
@@ -46,10 +46,12 @@
import { ref, onMounted } from 'vue'
import { useI18n } from 'vue-i18n'
import { useOrganizationStore } from '@/stores/organization.store'
import { useTaskView } from '@/composables/useTaskView'
import OrgCreateModal from './parts/OrgCreateModal.vue'
import OrgDetailModal from './parts/OrgDetailModal.vue'
const { t } = useI18n()
const { isMobile } = useTaskView()
const orgStore = useOrganizationStore()
const showCreateModal = ref(false)
+2
View File
@@ -465,6 +465,8 @@ export default {
delete: 'Delete organization',
deleteConfirm: 'Are you sure you want to delete this organization and all its projects?',
empty: 'No organizations yet',
currentOrg: 'Current organization',
active: 'Active',
settings: 'Settings',
general: 'General',
save: 'Save',
+1 -1
View File
@@ -8,4 +8,4 @@ export const messages = {
export type Locale = keyof typeof messages
export const locales: Locale[] = ['en', 'ru']
export const defaultLocale: Locale = 'ru'
export const defaultLocale: Locale = 'en'
+2
View File
@@ -437,6 +437,8 @@ export default {
delete: 'Удалить организацию',
deleteConfirm: 'Вы уверены что хотите удалить эту организацию и все её проекты?',
empty: 'Нет организаций',
currentOrg: 'Текущая организация',
active: 'Активна',
settings: 'Настройки',
general: 'Основные',
save: 'Сохранить',