refactor : rename TaskType to TaskTag across the stack

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-13 08:20:21 +01:00
parent dbae1f7536
commit 56275a9ebe
16 changed files with 216 additions and 117 deletions

View File

@@ -23,7 +23,7 @@
<AdminStatusTab v-if="activeTab === 'statuses'" />
<AdminEffortTab v-if="activeTab === 'efforts'" />
<AdminPriorityTab v-if="activeTab === 'priorities'" />
<AdminTypeTab v-if="activeTab === 'types'" />
<AdminTagTab v-if="activeTab === 'tags'" />
<AdminUserTab v-if="activeTab === 'users'" />
</div>
</div>
@@ -37,7 +37,7 @@ const tabs = [
{ key: 'statuses', label: 'Statuts' },
{ key: 'efforts', label: 'Efforts' },
{ key: 'priorities', label: 'Priorités' },
{ key: 'types', label: 'Types' },
{ key: 'tags', label: 'Tags' },
{ key: 'users', label: 'Utilisateurs' },
] as const

View File

@@ -55,10 +55,10 @@
/>
<MalioSelect
v-model="selectedTypeId"
:options="typeOptions"
v-model="selectedTagId"
:options="tagOptions"
empty-option-label="Tous"
label="Type"
label="Tag"
min-width="!w-40"
text-field="text-sm"
text-value="text-sm"
@@ -93,7 +93,7 @@
:prefill-started-at="prefillStartedAt"
:users="users"
:projects="projects"
:types="types"
:tags="tags"
@saved="loadEntries"
/>
@@ -115,7 +115,7 @@
import type { TimeEntry } from '~/services/dto/time-entry'
import type { UserData } from '~/services/dto/user-data'
import type { Project } from '~/services/dto/project'
import type { TaskType } from '~/services/dto/task-type'
import type { TaskTag } from '~/services/dto/task-tag'
import { useTimeEntryService } from '~/services/time-entries'
import { extractHydraMembers } from '~/utils/api'
@@ -127,13 +127,13 @@ const timeEntryService = useTimeEntryService()
const viewMode = ref<'week' | 'day' | 'list'>('week')
const startDate = ref(getMonday(new Date()))
const selectedUserId = ref<number | null>(authStore.user?.id ?? null)
const selectedTypeId = ref<number | null>(null)
const selectedTagId = ref<number | null>(null)
const selectedProjectId = ref<number | null>(null)
const entries = ref<TimeEntry[]>([])
const users = ref<UserData[]>([])
const projects = ref<Project[]>([])
const types = ref<TaskType[]>([])
const tags = ref<TaskTag[]>([])
const drawerOpen = ref(false)
const editingEntry = ref<TimeEntry | null>(null)
@@ -164,8 +164,8 @@ const projectOptions = computed(() =>
projects.value.map(p => ({ label: p.name, value: p.id }))
)
const typeOptions = computed(() =>
types.value.map(t => ({ label: t.label, value: t.id }))
const tagOptions = computed(() =>
tags.value.map(t => ({ label: t.label, value: t.id }))
)
let pageHeaderResizeObserver: ResizeObserver | null = null
@@ -179,8 +179,8 @@ const filteredEntries = computed(() => {
if (selectedProjectId.value) {
result = result.filter((e) => e.project?.id === selectedProjectId.value)
}
if (selectedTypeId.value) {
result = result.filter((e) => e.types.some((t) => t.id === selectedTypeId.value))
if (selectedTagId.value) {
result = result.filter((e) => e.tags.some((t) => t.id === selectedTagId.value))
}
return result
})
@@ -269,7 +269,7 @@ async function onPaste() {
stoppedAt: clipboard.value.stoppedAt ?? undefined,
user: `/api/users/${selectedUserId.value}`,
project: clipboard.value.project ? `/api/projects/${clipboard.value.project.id}` : null,
types: clipboard.value.types.map((t) => `/api/task_types/${t.id}`),
tags: clipboard.value.tags.map((t) => `/api/task_tags/${t.id}`),
})
await loadEntries()
}
@@ -314,12 +314,12 @@ async function loadReferenceData() {
const [usersData, projectsData, typesData] = await Promise.all([
api.get<any>('/users'),
api.get<any>('/projects'),
api.get<any>('/task_types'),
api.get<any>('/task_tags'),
])
users.value = extractHydraMembers(usersData)
projects.value = extractHydraMembers(projectsData)
types.value = extractHydraMembers(typesData)
tags.value = extractHydraMembers(typesData)
}
onMounted(async () => {