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

[Lim Yee Kian] iP #154

Open
wants to merge 98 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
68c58c1
Add Gradle support
May 24, 2020
03523ec
Bump gradle and lib version
Eclipse-Dominator Aug 5, 2023
81a9c53
build.gradle: Prevent generating a second JAR file
aureliony Jul 16, 2024
c671da2
Restore reverse commit files
yeekian Aug 22, 2024
0e4f6ac
Chatbot: rename Duke to Mel
yeekian Aug 22, 2024
06ecd08
Chatbot: add echo
yeekian Aug 28, 2024
250b001
Chatbot: add indentation
yeekian Aug 28, 2024
a6b1399
List class: implement add item and print full list function
yeekian Aug 28, 2024
22b8ba2
Chatbot: store text and print list function
yeekian Aug 28, 2024
be71189
Task class: add class
yeekian Aug 28, 2024
0f5d58b
List class: mark and unmark tasks in list as done
yeekian Aug 28, 2024
86a1b52
Chatbot: use List class function to mark and unmark tasks as done
yeekian Aug 28, 2024
907e5a9
Chatbot: Follow coding standard
yeekian Aug 28, 2024
1839a79
Task class: rename getStatusIcon function to getDoneStatusIcon
yeekian Sep 2, 2024
ba587a8
Todo class: add class
yeekian Sep 2, 2024
e9a03bd
Deadline class: add class
yeekian Sep 2, 2024
d6e75cb
Event class: add class
yeekian Sep 2, 2024
4e31adb
List class: modify addItem method
yeekian Sep 2, 2024
100da0c
Mel: Refactor line prints
yeekian Sep 2, 2024
3a22ebe
Refactor List.java and Mel.java
yeekian Sep 3, 2024
27dd198
List: Handle error for non-integer input index for mark and unmark
yeekian Sep 3, 2024
217305f
Implement automated text UI testing
yeekian Sep 3, 2024
549b2e2
List class: remove trailing spaces
yeekian Sep 3, 2024
eede782
List: refactor addItem method for readability
yeekian Sep 5, 2024
4fb8933
List class: refactor code for readability
yeekian Sep 5, 2024
f4e2b51
Revert "List class: refactor code for readability"
yeekian Sep 5, 2024
0dfc0b9
List class: remove unused print functions
yeekian Sep 5, 2024
00ebd29
Chatbot: insert ASCII name art
yeekian Sep 5, 2024
c45aaea
Update expected test output
yeekian Sep 5, 2024
b00c2e1
Remove unused line variable
yeekian Sep 10, 2024
46f5cc7
Update test cases
yeekian Sep 10, 2024
9b2fbc5
Manage empty description and date field exceptions
yeekian Sep 10, 2024
fd7f8b8
Organize into packages
yeekian Sep 10, 2024
39e9e70
Revert "Organize into packages"
yeekian Sep 10, 2024
3beef46
Reapply "Organize into packages"
yeekian Sep 10, 2024
d412248
List: add invalid input message for delete
yeekian Sep 17, 2024
cf5bf1e
Update test case
yeekian Sep 17, 2024
2935e81
Add delete helper functions except for delete function
yeekian Sep 17, 2024
b839ee1
List: implement list as ArrayList
yeekian Sep 17, 2024
a5dfd42
Remove unused code
yeekian Sep 17, 2024
9c43b41
List: implement delete using ArrayList functions
yeekian Sep 17, 2024
d581a01
Add save function
yeekian Sep 17, 2024
9d2789c
Update test case
yeekian Sep 17, 2024
cb3bbb9
Merge branch 'branch-Level-6'
yeekian Sep 17, 2024
0496687
Merge branch 'branch-Level-7'
yeekian Sep 17, 2024
3c182c9
Change file path to be relative
yeekian Sep 18, 2024
f63d039
Update .gitignore to ignore data file
yeekian Sep 19, 2024
ac3870d
Extract out closely related Ui code as a class
yeekian Sep 28, 2024
a771dd7
Extract out closely related Storage code as a class
yeekian Sep 28, 2024
c6dac60
Extract out closely related Parser code as a class
yeekian Sep 28, 2024
8f85047
Remove unused import statements
yeekian Sep 28, 2024
e852f3e
Move printTaskUnmarkedMessage to Ui class
yeekian Sep 28, 2024
8ec7c4a
Refactor code to extract out closely related code as TaskList class
yeekian Sep 28, 2024
b8f0ca7
Merge branch 'branch-A-MoreOOP'
yeekian Sep 28, 2024
1e461c0
Store and print deadline date and times
yeekian Sep 28, 2024
dd88dd5
Add find task function
yeekian Sep 28, 2024
e243b9d
Fix task description extraction
yeekian Sep 28, 2024
3640c38
Update test case
yeekian Sep 28, 2024
1992924
Add JavaDoc comments to the code
yeekian Sep 28, 2024
22c7af4
Add JavaDoc comments to the code
yeekian Sep 28, 2024
64dc240
Merge pull request #1 from yeekian/branch-Level-8
yeekian Sep 28, 2024
0571f7b
Merge branch 'master' of https://github.com/yeekian/ip
yeekian Sep 28, 2024
515584b
Merge branch 'master' of https://github.com/yeekian/ip into branch-Le…
yeekian Sep 28, 2024
8aa6556
Merge pull request #2 from yeekian/branch-Level-9
yeekian Sep 28, 2024
5bdabce
Merge branch 'master' of https://github.com/yeekian/ip
yeekian Sep 28, 2024
5bc41e2
Merge branch 'master' of https://github.com/yeekian/ip into branch-A-…
yeekian Sep 28, 2024
513ffd1
Merge pull request #3 from yeekian/branch-A-JavaDoc
yeekian Sep 28, 2024
8711a86
Merge branch 'master' of https://github.com/yeekian/ip
yeekian Sep 28, 2024
ba46c30
Update expected result of test cases
yeekian Sep 30, 2024
cd2c10a
Merge branch 'master' of https://github.com/yeekian/ip into branch-A-…
yeekian Sep 30, 2024
efcc5d8
Modify code to use storage object instead of static
yeekian Sep 30, 2024
d3d4402
Modify code to use Ui as object instead of static
yeekian Sep 30, 2024
5360463
Refactor code to incorporate TaskList class
yeekian Sep 30, 2024
8da4dee
Merge branch 'branch-branch-A-MoreOOP' into branch-A-MoreOOP
yeekian Sep 30, 2024
624e13d
Merge branch 'branch-A-MoreOOP'
yeekian Sep 30, 2024
4837084
Allow different deadline date inputs with optional time
yeekian Oct 7, 2024
d18519e
Merge branch 'branch-Level-8'
yeekian Oct 7, 2024
8151868
Refactor code to coding standards
yeekian Oct 7, 2024
2b55f75
Handle error from list file
yeekian Oct 7, 2024
90e95e4
Update expected output from test
yeekian Oct 7, 2024
6807512
Use switch-case instead of if-else
yeekian Oct 7, 2024
8df1fc0
Merge branch 'branch-Refactor'
yeekian Oct 7, 2024
43a012a
Update expected output for test cases
yeekian Oct 8, 2024
3ff8f25
Add user guide
yeekian Oct 8, 2024
7079d20
Merge branch 'branch-A-UserGuide'
yeekian Oct 8, 2024
ef57610
Merge branch 'master' of https://github.com/yeekian/ip into branch-Le…
yeekian Oct 8, 2024
0d6e9fc
Allow find to be case-insensitive
yeekian Oct 8, 2024
1090e23
Update README
yeekian Oct 8, 2024
66e0871
Update expected test case output
yeekian Oct 8, 2024
649a07b
Merge branch 'branch-Level-9'
yeekian Oct 8, 2024
cc6885a
Add command summary in README
yeekian Oct 8, 2024
13b4d16
Update README
yeekian Oct 8, 2024
a66af8e
Merge branch 'master' of https://github.com/yeekian/ip into branch-A-…
yeekian Oct 8, 2024
2e6938d
Add quick start guide to UserGuide
yeekian Oct 8, 2024
7f17c31
Merge branch 'branch-A-UserGuide'
yeekian Oct 8, 2024
fac5ac2
Refactor UserGuide
yeekian Oct 8, 2024
fddd94f
Merge branch 'branch-A-UserGuide'
yeekian Oct 8, 2024
b8ecc8c
Modify Storage class to pass smoke test
yeekian Oct 13, 2024
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ src/main/resources/docs/
bin/

/text-ui-test/ACTUAL.TXT
text-ui-test/EXPECTED-UNIX.TXT
/text-ui-test/EXPECTED-UNIX.TXT
/data/Mel.txt
164 changes: 148 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,162 @@
# Duke User Guide
# Mel User Guide

// Update the title above to match the actual product name

// Product screenshot goes here
![img.png](img.png)

// Product intro goes here
Mel is a console-based chatbot designed to help you manage tasks efficiently, including todos, deadlines, and events. The chatbot understands a variety of commands to add, remove, and track your tasks, as well as search and manage them interactively. With Mel, you can keep track of your schedule, deadlines, and daily tasks seamlessly.

## Adding deadlines
## Key Features:

// Describe the action and its outcome.
- Supports **todo** tasks for general items.
- Adds **deadline** tasks with a specified date and optional time.
- Manages **event** tasks with both start and end dates/times.
- Allows marking/unmarking of task completion, and finding tasks by description.
- Keeps a running list of your tasks and saves them automatically.

// Give examples of usage
## Quick Start:

Example: `keyword (optional arguments)`
1. Ensure you have Java `17` or above installed in your Computer.
2. Download the latest `.jar` file from [here](https://github.com/yeekian/ip/releases/tag/A-Release).
3. Copy the file to the folder you want to use as the home folder for your Task Tracker.
4. Open a command terminal, `cd` into the folder you put the jar file in, and use the `java -jar Mel.jar` command to run the application.

// A description of the expected outcome goes here
Your command terminal similar to below should appear in a few seconds.
<br>![img_1.png](img_1.png)

```
expected output
```
## List tasks: `list`

## Feature ABC
Displays the current list of tasks, showing their index, type, description, and whether they are completed or not.

// Feature details
Format: `list`

## Adding a todo task: `todo`

## Feature XYZ
Adds tasks without any date/time attached to it e.g., explore the new garden

// Feature details
Format: `todo DESCRIPTION`
- Adds the todo task with the specified DESCRIPTION. The DESCRIPTION refers to the name of the task that will be shown in the task list.
- The DESCRIPTION is a string and must not be empty.

Examples:

todo read book


## Adding a deadline task: `deadline`

Adds tasks that need to be done before a specific date/time e.g., return book by 04/11/2024 8pm

Format: `deadline DESCRIPTION /by DATE`
- Adds the deadline task with the specified `DESCRIPTION`. The `DESCRIPTION` refers to the name of the task that will be shown in the task list.
- The `DESCRIPTION` is a string and must not be empty.
- Adds deadline date and/or time to the task with the specified `DATE`. The `DATE` is input as a string and must not be empty.
- The `DATE` has to be specified in one of the following formats:
- yyyy-MM-dd HH:mm
- yyyy-MM-dd
- dd/MM/yyyy HH:mm
- dd/MM/yyyy
- Adding deadline time to `DATE` is optional, if not given, it will be automatically filled with 23:59


Examples:

//Add a deadline task with a description and deadline of return book and Nov 04 2024, 08:00 pm, respectively
deadline return book /by 2024-11-04 20:00

//Add a deadline task with a description and deadline of submit quiz and Nov 05 2024, 11:59 pm, respectively
deadline submit quiz /by 2024-11-05

//Add a deadline task with a description and deadline of return book and Nov 07 2024, 09:00 pm, respectively
deadline order cake /by 07/11/2024 21:00

//Add a deadline task with a description and deadline of submit form and Nov 09 2024, 11:59 pm, respectively
deadline submit form /by 09/11/2024

## Adding a event task: `event`

Adds tasks that start at a specific date/time and ends at a specific date/time e.g., team project meeting on 2/10/2019 from 2pm to 4pm

Format: `event DESCRIPTION /from START_TIME /to END_TIME`
- Adds the event task with the specified `DESCRIPTION`. The `DESCRIPTION` refers to the name of the task that will be shown in the task list.
- The `DESCRIPTION` is a string and must not be empty.
- Adds event start and end date/time to the task with the specified `START_TIME` and `END_TIME`, respectively. The `START_TIME` and `END_TIME` are input as strings and must not be empty.
- The `START_TIME` and `END_TIME` can be specified as a string in any format.


Examples:

//Add an event task with a description, start time and end time of dinner with friends, 5pm and 6pm, respectively
event dinner with friends /from 5pm /to 6pm

## Deleting a task: `delete`

Deletes the specified task from the task list.

Format: `delete INDEX`
- Deletes the task at the specified `INDEX`.
- The index refers to the index number shown in the displayed task list.
- The index **must be a positive integer** 1, 2, 3, ...

Examples:

//Delete the 2nd task in the task list
delete 2

## Mark/Unmark Task Completion: `mark`/ `unmark`

Marks/unmarks the specified task from the task list.

Format: `mark INDEX`/ `unmark INDEX`
- Marks/unmarks the task at the specified `INDEX` to completed/uncompleted.
- The index refers to the index number shown in the displayed task list.
- The index **must be a positive integer** 1, 2, 3, ...

Examples:

//Mark the 2nd task in the task list as completed
mark 2

//Unmark the 2nd task in the task list so that is becomes uncompleted
unmark 2

## Finding tasks by description keywords: `find`

Finds persons whose names contain any of the given keywords.

Format: `find KEYWORD_STRING`
- The search is case-insensitive. e.g. book will match Book
- The entire keyword string must be found within the task description. e.g. read a large book will not match with read a small book
- Parts of words will be matched e.g. Pen will match Pencil
- Only the task description is searched.

Examples:

//Return submit quiz and submit form
find submit

//Return read magazine, book reservation
find read book

## End Chatbot: `bye`

Exits the program.

Format: `bye`

## Saving the data

The task list data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually.

## Command Summary

| Action | Format, Examples |
|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| **List tasks** | `list` |
| **Add a todo task** | `todo DESCRIPTION` <br/>e.g., `todo read book` |
| **Add a deadline task** | `deadline DESCRIPTION /by DATE` <br/>e.g., `deadline return book /by 2024-11-04 20:00` <br/>e.g., `deadline submit form /by 2024-11-05` |
| **Add an event task** | `event DESCRIPTION /from START_TIME /to END_TIME` <br/>e.g., `event dinner with friends /from 5pm /to 6pm` |
| **Delete a task** | `delete INDEX` <br/>e.g., `delete 2` |
| **Mark task as completed** | `mark INDEX` <br/>e.g., `mark 2` |
| **Unmark task as uncompleted** | `unmark INDEX` <br/>e.g., `unmark 2` |
| **Find tasks** | `find KEYWORD_STRING` <br/>e.g., `find read book` |
| **End the chatbot** | `bye` |
Binary file added docs/img.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 added docs/img_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

44 changes: 44 additions & 0 deletions src/main/java/Mel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import main.TaskList;
import main.Parser;
import main.Storage;
import main.Ui;

import java.util.Scanner;
import java.io.IOException;
import java.io.File;

public class Mel {

private static final String LIST_FILE_PATH = "data" + File.separator + "Mel.txt"; // Use File.separator for cross-platform compatibility

private Storage storage;
private TaskList userList;
private Ui ui;
private Scanner in;

public Mel(String filePath) {
ui = new Ui();
storage = new Storage(filePath);

// Set up scanner for user input
in = new Scanner(System.in);
userList = new TaskList(ui);
}

public void run() {
ui.printIntroMessage();

try {
storage.writerSetUp();
storage.loadDataFromFile(userList); // Load saved tasks
} catch (IOException e) {
System.out.println("An error occurred when setting up writer.");
}

Parser.getUserInput(in, storage, ui, userList);
}

public static void main(String[] args) throws IOException {
new Mel(LIST_FILE_PATH).run();
}
}
5 changes: 5 additions & 0 deletions src/main/java/exception/EmptyDateFieldException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package exception;

public class EmptyDateFieldException extends RuntimeException {
//no other code needed
}
5 changes: 5 additions & 0 deletions src/main/java/exception/EmptyDescriptionException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package exception;

public class EmptyDescriptionException extends Exception {
//no other code needed
}
Loading