Add per-project Department management
Departments are now a customizable per-project list (standard + custom), matching the existing custom task type/status pattern, instead of a fixed 7-value enum. They're usable directly on tasks (new field, independent of assignee) and continue to drive team member department roles.
This commit is contained in:
@@ -235,6 +235,7 @@ import { useAvatarUrl } from '@/composables/useAvatarUrl'
|
||||
import { useToast } from '@/components/ui/toast/use-toast'
|
||||
import { projectService, type ProjectMember } from '@/services/project'
|
||||
import { userService } from '@/services/user'
|
||||
import { useDepartmentsStore } from '@/stores/departments'
|
||||
import type { User } from '@/types/auth'
|
||||
|
||||
interface Props {
|
||||
@@ -248,16 +249,14 @@ const emit = defineEmits<{
|
||||
|
||||
const { toast } = useToast()
|
||||
const { getAvatarUrl } = useAvatarUrl()
|
||||
const departmentsStore = useDepartmentsStore()
|
||||
|
||||
const departmentRoles = [
|
||||
{ value: 'layout', label: 'Layout' },
|
||||
{ value: 'animation', label: 'Animation' },
|
||||
{ value: 'lighting', label: 'Lighting' },
|
||||
{ value: 'composite', label: 'Composite' },
|
||||
{ value: 'modeling', label: 'Modeling' },
|
||||
{ value: 'rigging', label: 'Rigging' },
|
||||
{ value: 'surfacing', label: 'Surfacing' },
|
||||
]
|
||||
const departmentRoles = computed(() => {
|
||||
return departmentsStore.getAllDepartmentOptions(props.projectId).map(department => ({
|
||||
value: department,
|
||||
label: department.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase())
|
||||
}))
|
||||
})
|
||||
|
||||
// State
|
||||
const members = ref<ProjectMember[]>([])
|
||||
@@ -425,5 +424,6 @@ const closeAddDialog = () => {
|
||||
// Lifecycle
|
||||
onMounted(() => {
|
||||
loadMembers()
|
||||
departmentsStore.fetchProjectDepartments(props.projectId)
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user