Skip to content
Closed
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,4 @@ Licensed under the **MIT License** — see the [LICENSE](LICENSE) file for detai
🔝 [Back to Top](#table-of-contents)

</div>

Binary file modified assets/01_home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/01_home_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/01_landing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/02_home_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/02_landing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/03_home_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/03_landing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/04_home_mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/04_landing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/05_landing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion backend/utils/tw/edit_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func EditTaskInTaskwarrior(uuid, description, email, encryptionSecret, taskID st

// Escape the double quotes in the description and format it
if err := utils.ExecCommand("task", taskID, "modify", description); err != nil {
fmt.Println("task " + taskID + " modify " + description)
return fmt.Errorf("failed to edit task: %v", err)
}

Expand Down
9 changes: 0 additions & 9 deletions backend/utils/tw/modify_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,41 @@ import (

func ModifyTaskInTaskwarrior(uuid, description, project, priority, status, due, email, encryptionSecret, taskID string, tags []string, depends []string) error {
if err := utils.ExecCommand("rm", "-rf", "/root/.task"); err != nil {
fmt.Println("1")
return fmt.Errorf("error deleting Taskwarrior data: %v", err)
}
tempDir, err := os.MkdirTemp("", "taskwarrior-"+email)
if err != nil {
fmt.Println("2")
return fmt.Errorf("failed to create temporary directory: %v", err)
}
defer os.RemoveAll(tempDir)

origin := os.Getenv("CONTAINER_ORIGIN")
if err := SetTaskwarriorConfig(tempDir, encryptionSecret, origin, uuid); err != nil {
fmt.Println("4")
return err
}

if err := SyncTaskwarrior(tempDir); err != nil {
fmt.Println("5")
return err
}

escapedDescription := fmt.Sprintf(`description:"%s"`, strings.ReplaceAll(description, `"`, `\"`))

if err := utils.ExecCommand("task", taskID, "modify", escapedDescription); err != nil {
fmt.Println("6")
return fmt.Errorf("failed to edit task: %v", err)
}

escapedProject := fmt.Sprintf(`project:%s`, strings.ReplaceAll(project, `"`, `\"`))
if err := utils.ExecCommand("task", taskID, "modify", escapedProject); err != nil {
fmt.Println("7")
return fmt.Errorf("failed to edit task project: %v", err)
}

escapedPriority := fmt.Sprintf(`priority:%s`, strings.ReplaceAll(priority, `"`, `\"`))
if err := utils.ExecCommand("task", taskID, "modify", escapedPriority); err != nil {
fmt.Println("8")
return fmt.Errorf("failed to edit task priority: %v", err)
}

escapedDue := fmt.Sprintf(`due:%s`, strings.ReplaceAll(due, `"`, `\"`))
if err := utils.ExecCommand("task", taskID, "modify", escapedDue); err != nil {
fmt.Println("8")
return fmt.Errorf("failed to edit task due: %v", err)
}

Expand Down Expand Up @@ -93,7 +85,6 @@ func ModifyTaskInTaskwarrior(uuid, description, project, priority, status, due,
}

if err := SyncTaskwarrior(tempDir); err != nil {
fmt.Println("11")
return err
}

Expand Down
10 changes: 9 additions & 1 deletion frontend/src/components/HomeComponents/Navbar/navbar-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ export const deleteAllTasks = async (props: Props) => {
draggable: true,
});

console.log(`Deleted ${taskCount} tasks for email: ${props.email}`);
toast.update(loadingToastId, {
render: `All ${taskCount} tasks for ${props.email} deleted successfully!`,
type: 'success',
autoClose: 3000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
});
} catch (error) {
toast.update(loadingToastId, {
render: `Error deleting tasks for ${props.email}: ${error}`,
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/components/HomeComponents/Tasks/Tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ export const Tasks = (
UUID,
backendURL: url.backendURL,
});
console.log(taskwarriorTasks);

await db.transaction('rw', db.tasks, async () => {
await db.tasks.where('email').equals(user_email).delete();
Expand Down Expand Up @@ -339,7 +338,6 @@ export const Tasks = (
backendURL: url.backendURL,
});

console.log('Task added successfully!');
setNewTask({
description: '',
priority: '',
Expand Down Expand Up @@ -397,7 +395,6 @@ export const Tasks = (
annotations,
});

console.log('Task edited successfully!');
setIsAddTaskOpen(false);
} catch (error) {
console.error('Failed to edit task:', error);
Expand Down Expand Up @@ -820,7 +817,6 @@ export const Tasks = (
const updatedTags = editedTags.filter((tag) => tag.trim() !== '');
const tagsToRemove = removedTags.map((tag) => `${tag}`);
const finalTags = [...updatedTags, ...tagsToRemove];
console.log(finalTags);

setUnsyncedTaskUuids((prev) => new Set([...prev, task.uuid]));

Expand Down Expand Up @@ -884,7 +880,6 @@ export const Tasks = (
backendURL: url.backendURL,
});

console.log('Priority updated successfully!');
toast.success('Priority updated successfully!');
} catch (error) {
console.error('Failed to update priority:', error);
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/components/HomeComponents/Tasks/tasks-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const markTaskAsCompleted = async (
});

if (response) {
console.log('Task marked as completed successfully!');
// Task marked as completed successfully
} else {
console.error('Failed to mark task as completed');
}
Expand Down Expand Up @@ -70,7 +70,6 @@ export const bulkMarkTasksAsCompleted = async (
});

if (response.ok) {
console.log('Bulk completion successful!');
toast.success(
`${taskUUIDs.length} ${taskUUIDs.length === 1 ? 'task' : 'tasks'} marked as completed.`
);
Expand Down Expand Up @@ -110,7 +109,6 @@ export const bulkMarkTasksAsDeleted = async (
});

if (response.ok) {
console.log('Bulk deletion successful!');
toast.success(
`${taskUUIDs.length} ${taskUUIDs.length === 1 ? 'task' : 'tasks'} deleted.`
);
Expand Down Expand Up @@ -147,7 +145,7 @@ export const markTaskAsDeleted = async (
});

if (response) {
console.log('Task marked as deleted successfully!');
// Task marked as deleted successfully
} else {
console.error('Failed to mark task as deleted');
}
Expand Down
14 changes: 3 additions & 11 deletions frontend/src/components/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,21 @@ export const HomePage: React.FC = () => {

useEffect(() => {
if (!userInfo || !userInfo.uuid) {
console.log(
'User info or UUID is not available yet, skipping WebSocket setup.'
);
return;
}

if (userInfo.email && userInfo.encryption_secret && userInfo.uuid) {
getTasks(userInfo.email, userInfo.encryption_secret, userInfo.uuid);
}

console.log('Setting up WebSocket with clientID:', userInfo.uuid);
const socketURL = `${url.backendURL.replace(/^http/, 'ws')}ws?clientID=${
userInfo.uuid
}`;
const socket = new WebSocket(socketURL);

socket.onopen = () => console.log('WebSocket connected!');
socket.onopen = () => {};

socket.onmessage = (event) => {
// console.log("Message received:", event.data);
try {
const data = JSON.parse(event.data);
if (data.status === 'success') {
Expand All @@ -84,7 +79,6 @@ export const HomePage: React.FC = () => {
}

if (data.job === 'Add Task') {
console.log('Task added successfully');
toast.success('Task added successfully!', {
position: 'bottom-left',
autoClose: 3000,
Expand All @@ -95,7 +89,6 @@ export const HomePage: React.FC = () => {
progress: undefined,
});
} else if (data.job === 'Edit Task') {
console.log('Task edited successfully');
toast.success('Task edited successfully!', {
position: 'bottom-left',
autoClose: 3000,
Expand Down Expand Up @@ -127,7 +120,6 @@ export const HomePage: React.FC = () => {
});
}
} else if (data.status == 'failure') {
console.log(`Failed to ${data.job || 'perform action'}`);
toast.error(`Failed to ${data.job || 'perform action'}`, {
position: 'bottom-left',
autoClose: 3000,
Expand All @@ -143,11 +135,10 @@ export const HomePage: React.FC = () => {
}
};

socket.onclose = () => console.log('WebSocket disconnected.');
socket.onclose = () => {};
socket.onerror = (error) => console.error('WebSocket error:', error);

return () => {
console.log('Cleaning up WebSocket...');
socket.close();
};
}, [userInfo]);
Expand Down Expand Up @@ -366,3 +357,4 @@ export const HomePage: React.FC = () => {
</div>
);
};
// cleanup
2 changes: 0 additions & 2 deletions frontend/src/components/utils/TaskAutoSync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const useTaskAutoSync = (props: AutoSyncProps) => {
const { isLoading, setIsLoading, isAutoSyncEnabled, syncInterval } = props;
const handleSync = useCallback(async () => {
if (isLoading) {
console.log('Auto-sync: Sync already in progress, skipping.');
return;
}
setIsLoading(true);
Expand All @@ -23,7 +22,6 @@ export const useTaskAutoSync = (props: AutoSyncProps) => {
let intervalId: NodeJS.Timeout | undefined = undefined;
if (isAutoSyncEnabled) {
intervalId = setInterval(() => {
console.log('Auto-sync: Triggering periodic sync...');
handleSync();
}, syncInterval);
}
Expand Down