Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #200: collaborative projects #208

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions client/src/components/Modal Management/Layout/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,23 @@ const View = ({
Project
</span>
)}
{task.label && (
{task.label ? (
<span
className="inline-flex text-xs px-1.5 py-0.5 bg-blue-50 dark:bg-blue-500/10
text-blue-600 dark:text-blue-400 rounded-full border
border-blue-200 dark:border-blue-800 whitespace-nowrap"
className={`inline-flex text-xs px-1.5 py-0.5 ${
task.urgent ? 'bg-red-50 dark:bg-red-500/10 text-red-600 dark:text-red-400 border-red-200 dark:border-red-800'
: 'bg-blue-50 dark:bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800'
} rounded-full border whitespace-nowrap`}
>
{task.label}
</span>
) : task.urgent && (
<span
className="inline-flex text-xs px-1.5 py-0.5 bg-red-50 dark:bg-red-500/10
text-red-600 dark:text-red-400 rounded-full border
border-red-200 dark:border-red-800 whitespace-nowrap"
>
Urgent
</span>
)}
{!isCompleted && task.deadline && isOverdue(task.deadline) && (
<span
Expand Down
13 changes: 12 additions & 1 deletion client/src/components/Modal Management/Tasks/TaskForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,25 @@ const TaskForm = ({ addTask }) => {
return;
}

// Handle urgent label
let finalLabel = formState.label;
if (formState.urgent) {
if (!finalLabel) {
finalLabel = 'urgent';
} else if (!finalLabel.toLowerCase().includes('urgent')) {
const urgentSuffix = ' | urgent';
finalLabel = (finalLabel + urgentSuffix).slice(0, MAX_LABEL_LENGTH);
}
}

const newTask = {
name: formState.name,
desc: formState.description,
difficulty: formState.difficulty,
importance: formState.importance,
deadline: formState.deadline || null,
urgent: formState.urgent,
label: formState.label || null,
label: finalLabel,
experience: calculateBaseXP(
formState.difficulty,
formState.importance,
Expand Down
Loading