Skip to content

Commit

Permalink
Merge 8650ced into 584da7e
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaty committed Nov 3, 2016
2 parents 584da7e + 8650ced commit b4d9abe
Show file tree
Hide file tree
Showing 29 changed files with 716 additions and 292 deletions.
6 changes: 3 additions & 3 deletions docs/AboutUs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ We are a team of students studying CS2103 based in the [School of Computing, Nat
* Features implemented:
* [Support for non floating task and integration of Date Time Model](https://github.com/CS2103AUG2016-T14-C4/main/pull/45)
* [Ability to Change Storage](https://github.com/CS2103AUG2016-T14-C4/main/pull/64)
* [More natural commands]()
* [Google Calendar Integration(IP)]()
* Code written: [[functional code]()][[test code]()][[docs]()]
* [More natural commands](https://github.com/CS2103AUG2016-T14-C4/main/pull/69)
* [Alias Commands](https://github.com/CS2103AUG2016-T14-C4/main/pull/82)
* Code written: [[functional code](https://github.com/CS2103AUG2016-T14-C4/main/blob/master/collated/main/A0144939R.md)][[test code](https://github.com/CS2103AUG2016-T14-C4/main/blob/master/collated/test/A0144939R.md)][[docs](https://github.com/CS2103AUG2016-T14-C4/main/blob/master/collated/docs/A0144939R.md)]
* Other major contributions:
* Did the initial refactoring from AddressBook to ToDoList [[#39](https://github.com/CS2103AUG2016-T14-C4/main/pull/39) ]
* Set up Codacy
Expand Down
27 changes: 26 additions & 1 deletion docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,17 @@ Priority | As a ... | I want to ... | So that I can...
`* * *` | user | add a task without start time and deadline| keep track of general, non-time based tasks
`* * *` | user | add an event with start time and close time|
`* * *` | user | add an event/task with tag|
`* * *` | user | add recurring tasks
`* * *` | user | delete a task| remove tasks that I do not have to take any further action on
`* * *` |user | undo my previous action | recover from commands entered by mistake
`* * *` | user | find a task from to-do list| find details of tasks without having to go through the entire list
`* * *` | user | update a task | change the specifications of a specific task
`* * *` | user | see the entire to-do list | know the number of task/ event that I have
`* * *` | user | specify the file location of the task list | store the list in a more convenient location (such as Dropbox)
`* *` | user | mark a task as completed | distinguish between completed and pending tasks
`* *` | user | sync events and tasks with due dates with Google Calendar| collate my tasks
`* *` |user | be able to mark certain tasks as important | easily distinguish tasks that require attention/action to be taken
`* *` | user | alias commands to symbols
`* *` | user | do a live search for commands

## Appendix B : Use Cases

Expand All @@ -283,7 +285,30 @@ Use case ends.
1b. The task name already exists on the list.
> MESS shows a message to inform user that task already exists
Use case ends.

<!-- @@author A0144939R -->
#### Use case: Alias command

**MSS**

1. User requests to alias a command
2. MESS aliases the command to the given symbol<br>
Use case ends.

**Extensions**

1a. The symbol is already aliased to another command
> MESS changes the mapping to the new command.
Use case ends.

1b. The symbol is a standard command name(Eg: add, edit)
> MESS shows an error message.
Use case ends.

1c. The command already has an alias
> MESS maps the given symbol to the command, as a command can have multiple aliases
Use case ends.
<!- @@author -->

#### Use case: Delete task by task name

Expand Down
83 changes: 53 additions & 30 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
e.g. typing **`help`** and pressing <kbd>Enter</kbd> will open the help window.
5. Some example commands you can try:
* **`list`** : lists all tasks
* **`add`**`meeting`: adds a task named CS2103 Tutorial
* **`find`**`meeting `: searches the task named tutorial
* **`add`**`CS2103 Tutorial`: adds a task named CS2103 Tutorial
* **`alias`**`add a`: aliases the add command to the 'a' key
* **`find`**`tutorial `: searches the task named tutorial
* **`delete`**`1`: delete the first task in the list
* **`complete`** `1`: mark the first task as completed
* **`uncomplete`** `1`: mark the completed first task on the list as not completed
* **`update`**`1 presentation c/10/10/2016:1200` : updates first task on the list to presentation having a deadline on 10/10/2016 on 12:00 while the number '1' is the index of task on the list
* **`update`**`1 name presentation ends tomorrow` : updates first task on the list to presentation having a deadline tomorrow while the number '1' is the index of task on the list
* **`undo`** : undo previous one action
* **`pin`**`1` : pin the first task in the list
* **'change-to'**`1`: change the storage location
* **'change-to'**`data/taskmanager.xml`: change the storage location
* **`unpin`**`1` : unpin the pinned first task in the list
* **`exit`** :exit the program
6. Refer to the [Features](#features) section below for details of each command.<br>
Expand All @@ -41,32 +42,45 @@
* The order of parameters is fixed.
* Words in `UPPER_CASE` are the parameters.
* Words in `SQUARE_BRACKET` are optional.
<!--@@author A0144939R -->

#### Adding a task or event: `add`
Adds a task to the to-do list<br>
Format: `add TASK_NAME [s/START_DATE:START_TIME c/CLOSE_DATE:CLOSE_TIME t/TAG r/NUMBER_OF_WEEKLY_RECURRING_TASK]`
Format: `add TASK_NAME [starts START_DATETIME ends CLOSE_DATETIME tag TAG recurs NUMBER_OF_WEEKLY_RECURRING_TASK]`

> Date format of START_DATE and CLOSE_DATE includes words like today, tomorrow, 3 days from now, day after tomorrow, noon, 12pm, 6am
* `TASK_NAME` need not be unique.
* If there is no argument, the task will become floating.
* `START_DATE` refer to the starting date and time of an event. For a task, the timestamp will be automatically saved as start date and time when the task is created. User can input start date and time for events.
* `TAG` is for users to write tags for different tasks. Mulitple tags are available by typing `t/TAG t/TAG`.
* `TAG` is for users to write tags for different tasks. Mulitple tags are available by typing `tag TAG tag TAG`.
* `NUMBER_OF_RECURRING TASK` is for users to create weekly recurring task. For example, when NUMBER_OF_WEEKLY_RECURRING_TASK is 1 which means one more tasks will be created with the openTime and endTime one weekly later.


Examples:
* `add proposal c/10-10-2016:2100` <br> Adds a proposal task with a deadline on 10-10-2016 at 21:00
* `add meeting s/01-10-2016:1300 c/01-10-2016:2200`<br> Adds a meeting event which start on 1-10-2016 at 1 p.m. and ends at 10 p.m.
* `add proposal ends tomorrow` <br> Adds a proposal task with a deadline 24 hours from now
* `add meeting starts tomorrow 1pm ends tomorrow 3pm`<br> Adds a meeting event which start tomorrow at 1pm and ends tomorrow at 3pm
* `add shopping` <br> Adds a floating task named revision test which has not specify the start and end date
* `add tutorial t/cs2103` <br> Adds a flaoting task named tutorial with a tag CS2013
* `add quiz t/cs2102 t/easy` <br> Adds a flaoting task named tutorial with a tag CS2012 and easy
* `add test s/today r/1` <br> Adds a task start today and recur for one more week.
* `add tutorial tag cs2103` <br> Adds a floating task named tutorial with a tag CS2013
* `add quiz tag cs2102 tag easy` <br> Adds a floating task named tutorial with a tag CS2012 and easy
* `add test starts today recurs 1` <br> Adds a task start today and recur for one more week.

Examples on date time flexibility:
* `add project c/3 days from now` <br> Adds a project task three days later from the time you input this command

<!-- @@author A0153467Y-->
#### Aliasing a command: `alias`
Aliases a command to a symbol <br>
Format: `alias COMMAND_NAME SYMBOL`

> Once aliased, the original command will still continue to work. Hence, symbols cannot be command names.
> One symbol can map to at most one command
* `COMMAND_NAME` Must be a valid command
* `SYMBOL` refers to the symbol you wish to alias to. SYMBOL cannot be a command name.

Examples:
* `alias add +` <br> Aliases the add command to the symbol +
* `alias alias q`<br> Aliases the alias command to the symbol q

<!--@@author -->

#### Deleting a task : `delete`
Deletes a specific task by task name or index from the to-do list.<br>
Format: `delete TASK_NAME` or `delete INDEX`
Expand All @@ -78,7 +92,7 @@ Examples:
Deletes `meeting` task.
* `delete 1`<br>
Deletes the first task in the to-do list.

<!-- @@author A0153467Y-->
#### Marking a task as completed: `complete`
Marks a specific task by index from the to-do list.<br>
FormatL `complete INDEX`
Expand Down Expand Up @@ -118,7 +132,7 @@ Format: `unpin INDEX`
Example:
* `unpin 1`<br>
unpin the pinned and first task on the list.

<!-- @@author -->
#### Listing all persons : `list`
Shows a list of tasks and events in the todo list.<br>
Format: `list`
Expand All @@ -136,7 +150,7 @@ Format: `find KEYWORD` or `find t/TAG`
Examples:
* `find meeting`<br>
Returns tasks having name `meeting`
* `find t/cs2103`<br>
* `find tag cs2103`<br>
Returns tasks having tag `cs2103`

<!-- @@author A0141052Y -->
Expand All @@ -149,35 +163,42 @@ Format: `searchbox`
<!-- @@author -->


<!-- @@author A0144939R-->


#### Update entries : `update`
Update a specific task.<br>
Format: `update INDEX [TASKNAME s/START_DATE:START_TIME c/CLOSE_DATE:CLOSE_TIME t/TAG rt/TO_REMOVE_TAG]`
Format: `update INDEX [name TASKNAME starts STARTDATETIME ends ENDDATETIME tag TAG remove-tag TO_REMOVE_TAG]`

> * INDEX refers to the number appears on the list in front the task name.
> * The TAG here will be added to the referred task and the orginial tag remains. If you want to delete a tag, use `rt/TO_REMOVE_TAG` to delete tag by name.
> * THE task name is optional, but needs to be preceeded by name
> * The TAG here will be added to the referred task and the orginial tag remains. If you want to delete a tag, use `remove-tag TO_REMOVE_TAG` to delete tag by name.
> * TO_REMOVE_TAG refers to the tag (or tags) that you want to be removed by typing the tags' name that you want to delete.
> * You can choose what to update. It depends on you whether you want to update only one information or update multiple information.
Examples:
* `update 2 shopping c/03/10/2016:2100`<br>
update the taks name of the second task on the list to shopping and the start time to 3/10/2016 9 p.m.
* `update 2 name shopping ends 9pm`<br>
update the task name of the second task on the list to shopping and the start time to 3/10/2016 9 p.m.

* `update 1 t/cs2103`<br>
* `update 1 tag cs2103`<br>
add the tag of the first task on to-do list to cs2103

* `update 3 c/three hours later` <br>
update the taks name of the third task on the list to a deadline three hours after you type this command
* `update 3 ends three hours later` <br>
update the task name of the third task on the list to a deadline three hours after you type this command

* `update 2 t/family rt/friends` <br>
* `update 2 tag family remove-tag friends` <br>
add a tag family to the second task and remove the tag named friends

<!-- @@author -->

<!-- @@author A0153467Y-->
#### Undo action : `undo`
Undo the previous action.<br>
Format: `undo`

> * Will only undo `add`, `delete` and `update` actions.
<!-- @@author -->
#### Viewing help : `help`
Show the help menu. Format: `help`
> Help is also shown if you enter an incorrect command e.g. `123abc`
Expand All @@ -202,7 +223,7 @@ Example: 'change-to data/taskmanager.xml'
## FAQ
**Q**: Can I add event which have a start date and time to my to-do list ?<br>

**A**: Yes, you can create an event by typing command with a start and end date. For example, you have a trip from 10/10/2016 8:00 to 13/10/2016 21:00. You can type command like this: `add trip s/8am 10th October c/9pm 13th October`.
**A**: Yes, you can create an event by typing command with a start and end date. For example, you have a trip from 10/10/2016 8:00 to 13/10/2016 21:00. You can type command like this: `add trip starts 8am 10th October ends 9pm 13th October`.

**Q**: If I don't know the deadline of my task yet, can I still add my task?<br>

Expand All @@ -215,16 +236,18 @@ In this example, you can see shopping is a floating task without a start time an

Command | Format
-------- | :--------
Add | `add TASK_NAME [s/START_DATE:START_TIME c/CLOSE_DATE:CLOSE_TIME t/TAG]`
Add | `add TASK_NAME [starts START_DATE_TIME ends CLOSE_DATE_TIME tag TAG]`
Alias | `alias add a`
Delete | `delete TASK_NAME` or `delete INDEX`
Complete | `complete INDEX`
Uncomplete | `uncomplete INDEX`
List | `list`
Find | `find KEYWORD` or `find t/TAG`
Update | `update INDEX [TASKNAME s/START_DATE:START_TIME c/CLOSE_DATE:CLOSE_TIME t/TAG rt/TO_REMOVE_TAG]`
Update | `update INDEX [name NAME starts START_DATE_TIME ends CLOSE_DATE_TIME tag TAG remove-tag TAG]`
Undo | `undo`
Pin | `pin`
Unpin | `unpin`
Live Search | `searchbox`
Change Storage | `change-to`
Help | `help`
Exit | `exit`
44 changes: 44 additions & 0 deletions src/main/java/seedu/task/commons/logic/CommandKeys.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//@@author A0144939R
package seedu.task.commons.logic;

import java.util.Arrays;
import java.util.HashMap;
import java.util.stream.Collectors;

/**
* Represents all commands in the TaskManager
* @author advaypal
*
*/
public class CommandKeys {

public enum Commands {
ADD("add"),
ALIAS("alias"),
CLEAR("clear"),
COMPLETE("complete"),
CHANGE_TO("change-to"),
DELETE("delete"),
EXIT("exit"),
FIND("find"),
HELP("help"),
LIST("list"),
PIN("pin"),
SEARCH_BOX("searchbox"),
SELECT("select"),
UNDO("undo"),
UPDATE("update"),
UNCOMPLETE("uncomplete"),
UNPIN("unpin");

private String value;

Commands(String command) {
this.value = command;
}

}
//create hashmap from command names to ENUM values
public static final HashMap<String, Commands> commandKeyMap = (HashMap<String, Commands>) Arrays.stream(Commands.values()).collect(Collectors.toMap(command -> command.value, command -> command));

}
3 changes: 2 additions & 1 deletion src/main/java/seedu/task/logic/LogicManager.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package seedu.task.logic;

import javafx.collections.ObservableList;

import seedu.task.commons.core.ComponentManager;
import seedu.task.commons.core.LogsCenter;
import seedu.task.logic.commands.Command;
Expand All @@ -27,7 +28,7 @@ public class LogicManager extends ComponentManager implements Logic {

public LogicManager(Model model, Storage storage) {
this.model = model;
this.parser = new ParseSwitcher();
this.parser = new ParseSwitcher(model.getAliasMap());
this.previousCommand = null;
}

Expand Down

0 comments on commit b4d9abe

Please sign in to comment.