expand sub tasks

This commit is contained in:
chamiakJ
2025-07-03 01:31:05 +05:30
parent 3bef18901a
commit ecd4d29a38
435 changed files with 13150 additions and 11087 deletions

View File

@@ -44,9 +44,7 @@ const LabelsSelector = ({ taskId, labels }: LabelsSelectorProps) => {
// used useMemo hook for re-render the list when searching
const filteredLabelData = useMemo(() => {
return labels.filter(label =>
label.name?.toLowerCase().includes(searchQuery.toLowerCase())
);
return labels.filter(label => label.name?.toLowerCase().includes(searchQuery.toLowerCase()));
}, [labels, searchQuery]);
const handleCreateLabel = (name: string) => {
@@ -105,9 +103,7 @@ const LabelsSelector = ({ taskId, labels }: LabelsSelectorProps) => {
id={label.id}
checked={
selectedTask?.labels
? selectedTask?.labels.some(
existingLabel => existingLabel.id === label.id
)
? selectedTask?.labels.some(existingLabel => existingLabel.id === label.id)
: false
}
onChange={() => console.log(123)}

View File

@@ -36,48 +36,54 @@ const PriorityDropdown = ({ task, teamId }: PriorityDropdownProps) => {
// Helper function to get display name for raw priority values
const getPriorityDisplayName = (priority: string | undefined) => {
if (!priority) return 'Medium';
// Handle raw priority values from backend
const priorityDisplayMap: Record<string, string> = {
'critical': 'Critical',
'high': 'High',
'medium': 'Medium',
'low': 'Low',
critical: 'Critical',
high: 'High',
medium: 'Medium',
low: 'Low',
};
return priorityDisplayMap[priority.toLowerCase()] || priority;
};
// Helper function to get priority color for raw priority values
const getPriorityColor = (priority: string | undefined) => {
if (!priority) return themeMode === 'dark' ? '#434343' : '#f0f0f0';
// Default colors for raw priority values
const priorityColorMap: Record<string, { light: string; dark: string }> = {
'critical': { light: '#ff4d4f', dark: '#ff7875' },
'high': { light: '#fa8c16', dark: '#ffa940' },
'medium': { light: '#1890ff', dark: '#40a9ff' },
'low': { light: '#52c41a', dark: '#73d13d' },
critical: { light: '#ff4d4f', dark: '#ff7875' },
high: { light: '#fa8c16', dark: '#ffa940' },
medium: { light: '#1890ff', dark: '#40a9ff' },
low: { light: '#52c41a', dark: '#73d13d' },
};
const colorPair = priorityColorMap[priority.toLowerCase()];
return colorPair ? (themeMode === 'dark' ? colorPair.dark : colorPair.light) : (themeMode === 'dark' ? '#434343' : '#f0f0f0');
return colorPair
? themeMode === 'dark'
? colorPair.dark
: colorPair.light
: themeMode === 'dark'
? '#434343'
: '#f0f0f0';
};
// Find matching priority from the list, or use raw value
const currentPriority = useMemo(() => {
if (!task.priority) return null;
// First try to find by ID
const priorityById = priorityList.find(priority => priority.id === task.priority);
if (priorityById) return priorityById;
// Then try to find by name (case insensitive)
const priorityByName = priorityList.find(priority =>
priority.name.toLowerCase() === task.priority?.toLowerCase()
const priorityByName = priorityList.find(
priority => priority.name.toLowerCase() === task.priority?.toLowerCase()
);
if (priorityByName) return priorityByName;
// Return null if no match found (will use fallback rendering)
return null;
}, [task.priority, priorityList]);
@@ -152,7 +158,7 @@ const PriorityDropdown = ({ task, teamId }: PriorityDropdownProps) => {
// Fallback rendering for raw priority values or when priority list is not loaded
return (
<div
<div
className="px-2 py-1 text-xs rounded-sm"
style={{
backgroundColor: getPriorityColor(task.priority) + ALPHA_CHANNEL,

View File

@@ -39,52 +39,58 @@ const StatusDropdown = ({ task, teamId }: StatusDropdownProps) => {
// Helper function to get display name for raw status values
const getStatusDisplayName = (status: string | undefined) => {
if (!status) return 'To Do';
// Handle raw status values from backend
const statusDisplayMap: Record<string, string> = {
'to_do': 'To Do',
'todo': 'To Do',
'doing': 'Doing',
'in_progress': 'In Progress',
'done': 'Done',
'completed': 'Completed',
to_do: 'To Do',
todo: 'To Do',
doing: 'Doing',
in_progress: 'In Progress',
done: 'Done',
completed: 'Completed',
};
return statusDisplayMap[status.toLowerCase()] || status;
};
// Helper function to get status color for raw status values
const getStatusColor = (status: string | undefined) => {
if (!status) return themeMode === 'dark' ? '#434343' : '#f0f0f0';
// Default colors for raw status values
const statusColorMap: Record<string, { light: string; dark: string }> = {
'to_do': { light: '#f0f0f0', dark: '#434343' },
'todo': { light: '#f0f0f0', dark: '#434343' },
'doing': { light: '#1890ff', dark: '#177ddc' },
'in_progress': { light: '#1890ff', dark: '#177ddc' },
'done': { light: '#52c41a', dark: '#389e0d' },
'completed': { light: '#52c41a', dark: '#389e0d' },
to_do: { light: '#f0f0f0', dark: '#434343' },
todo: { light: '#f0f0f0', dark: '#434343' },
doing: { light: '#1890ff', dark: '#177ddc' },
in_progress: { light: '#1890ff', dark: '#177ddc' },
done: { light: '#52c41a', dark: '#389e0d' },
completed: { light: '#52c41a', dark: '#389e0d' },
};
const colorPair = statusColorMap[status.toLowerCase()];
return colorPair ? (themeMode === 'dark' ? colorPair.dark : colorPair.light) : (themeMode === 'dark' ? '#434343' : '#f0f0f0');
return colorPair
? themeMode === 'dark'
? colorPair.dark
: colorPair.light
: themeMode === 'dark'
? '#434343'
: '#f0f0f0';
};
// Find matching status from the list, or use raw value
const currentStatus = useMemo(() => {
if (!task.status) return null;
// First try to find by ID
const statusById = statusList.find(status => status.id === task.status);
if (statusById) return statusById;
// Then try to find by name (case insensitive)
const statusByName = statusList.find(status =>
status.name.toLowerCase() === task.status?.toLowerCase()
const statusByName = statusList.find(
status => status.name.toLowerCase() === task.status?.toLowerCase()
);
if (statusByName) return statusByName;
// Return null if no match found (will use fallback rendering)
return null;
}, [task.status, statusList]);
@@ -108,7 +114,8 @@ const StatusDropdown = ({ task, teamId }: StatusDropdownProps) => {
onChange={handleStatusChange}
dropdownStyle={{ borderRadius: 8, minWidth: 150, maxWidth: 200 }}
style={{
backgroundColor: themeMode === 'dark' ? currentStatus.color_code_dark : currentStatus.color_code,
backgroundColor:
themeMode === 'dark' ? currentStatus.color_code_dark : currentStatus.color_code,
borderRadius: 16,
height: 22,
}}
@@ -116,18 +123,14 @@ const StatusDropdown = ({ task, teamId }: StatusDropdownProps) => {
return <span style={{ fontSize: 13 }}>{currentStatus.name}</span>;
}}
options={options}
optionRender={(option) => (
<Flex align="center">
{option.label}
</Flex>
)}
optionRender={option => <Flex align="center">{option.label}</Flex>}
/>
);
}
// Fallback rendering for raw status values or when status list is not loaded
return (
<div
<div
className="px-2 py-1 text-xs rounded-sm"
style={{
backgroundColor: getStatusColor(task.status),