Cleanup
This commit is contained in:
parent
e5c0825985
commit
0907b44f12
4 changed files with 8 additions and 7 deletions
|
|
@ -17,8 +17,6 @@ import { fetchProjectById, updateProject, deleteProject } from "../../utils/proj
|
|||
import { createTask, updateTask, deleteTask } from "../../utils/tasksService";
|
||||
import { fetchAreas } from "../../utils/areasService";
|
||||
|
||||
|
||||
|
||||
type PriorityStyles = Record<PriorityType, string> & { default: string };
|
||||
|
||||
const priorityStyles: PriorityStyles = {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,10 @@ const TaskModal: React.FC<TaskModalProps> = ({
|
|||
useEffect(() => {
|
||||
setFormData(task);
|
||||
setTags(task.tags?.map((tag) => tag.name) || []);
|
||||
}, [task]);
|
||||
|
||||
const currentProject = projects.find((project) => project.id === task.project_id);
|
||||
setNewProjectName(currentProject ? currentProject.name : '');
|
||||
}, [task, projects]);
|
||||
|
||||
useEffect(() => {
|
||||
const loadTags = async () => {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class Task < ActiveRecord::Base
|
|||
.where(status: statuses[:not_started], project_id: nil)
|
||||
.where.not(id: excluded_task_ids)
|
||||
.order(priority: :desc)
|
||||
.limit(3)
|
||||
.limit(5)
|
||||
|
||||
# Fetch suggested tasks in projects, ordered by task priority and project priority
|
||||
tasks_in_projects = user.tasks.incomplete
|
||||
|
|
@ -105,7 +105,7 @@ class Task < ActiveRecord::Base
|
|||
Arel.sql('tasks.priority DESC, projects.priority DESC')
|
||||
)
|
||||
.distinct
|
||||
.limit(3)
|
||||
.limit(5)
|
||||
|
||||
{
|
||||
total_open_tasks: total_open_tasks,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue