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

Add edittask command #89

Merged

Conversation

w-yeehong
Copy link
Collaborator

  1. Add edittask command. It takes a room number and a task number. Optionally, it takes in values corresponding to any of the task attributes such as Description and DateTimeDue to replace the original. E.g. edit r/2 t/1 d/Hello World dd/- would modify the first task from room number 2 to have the description "Hello World" and an empty due date.

  2. Update UG with instructions on how to use edittask.

@w-yeehong w-yeehong added this to the v1.2 milestone Oct 14, 2020
@w-yeehong w-yeehong linked an issue Oct 14, 2020 that may be closed by this pull request
@codecov-io
Copy link

codecov-io commented Oct 14, 2020

Codecov Report

Merging #89 into master will increase coverage by 0.09%.
The diff coverage is 60.43%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #89      +/-   ##
============================================
+ Coverage     67.75%   67.85%   +0.09%     
- Complexity      635      654      +19     
============================================
  Files           110      112       +2     
  Lines          2199     2274      +75     
  Branches        274      291      +17     
============================================
+ Hits           1490     1543      +53     
- Misses          619      635      +16     
- Partials         90       96       +6     
Impacted Files Coverage Δ Complexity Δ
...main/java/seedu/address/commons/core/Messages.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...du/address/logic/commands/task/AddTaskCommand.java 52.94% <ø> (ø) 7.00 <0.00> (ø)
...address/logic/commands/task/DeleteTaskCommand.java 37.50% <0.00%> (ø) 7.00 <0.00> (ø)
...ddress/logic/parser/task/AddTaskCommandParser.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
...ess/logic/parser/task/DeleteTaskCommandParser.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
...seedu/address/logic/parser/task/TaskCliSyntax.java 75.00% <ø> (-5.00%) 1.00 <0.00> (ø)
src/main/java/seedu/address/model/Model.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...rc/main/java/seedu/address/model/ModelManager.java 61.70% <0.00%> (-2.04%) 29.00 <0.00> (ø)
...c/main/java/seedu/address/model/task/TaskList.java 90.00% <ø> (+16.53%) 14.00 <0.00> (ø)
...u/address/logic/commands/task/EditTaskCommand.java 45.83% <45.83%> (ø) 7.00 <7.00> (?)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44aa6e2...89e0d26. Read the comment docs.

@w-yeehong w-yeehong added Priority.High Type.Feature New feature or request Type.Story A user story labels Oct 15, 2020
Copy link
Collaborator

@LeeMingDe LeeMingDe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! very comprehensive testcase. good QA!

@@ -65,6 +67,19 @@ public void parseCommand_editPatient() throws Exception {
assertEquals(new EditPatientCommand(patient.getName().toString(), descriptor), command);
}

@Test
public void parseCommand_editTask() throws Exception {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be better to name the test parseCommand_editTask_failure() or parseCommand_editTask_throwExceptions() instead? Same for the tests at the bottom too!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. We should change the names of the tests here!

Copy link
Collaborator

@itssodium itssodium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines 282 to 287
**Edit Room** | `editroom ROOM_NUMBER [r/NEW_ROOM_NUMBER] [p/PATIENT_NAME]` <br> e.g., `editroom 1 r/2 p/alex`
**Add Task to Room** | `addtask d/DESCRIPTION r/ROOM_NUMBER [dd/DUE_DATE]` <br>
**Delete Task from Room** | `deletetask r/ROOM_NUMBER t/TASK_NUMBER` <br>
**Edit Task in Room** | `edittask r/ROOM_NUMBER t/TASK_NUMBER [d/DESCRIPTION] [dd/DUE_DATE]` <br>
**Search Task** | `searchtask dd/DUE_DATE` <br>
**Help** | `help`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We rearrange later in alphabetical order

Copy link
Collaborator Author

@w-yeehong w-yeehong Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... Should it be in alphabetical order? I was thinking maybe it should be sorted by the type. We can have Patient, followed by Room, then Task.

3.2 Patient
    3.2.1 Add Patient
    3.2.2 Delete Patient
      ...
3.3 Room
    3.3.1 Initialize Rooms
      ...
3.4 Task
    3.4.1 Add Task
    3.4.2 Delete Task

PREFIX_ROOM_NUMBER is used for both rooms and tasks. As such, it can
be found in both TaskCliSyntax#PREFIX_ROOM_NUMBER and
RoomCliSyntax#PREFIX_ROOM_NUMBER.

Since PREFIX_ROOM_NUMBER is an attribute of room, it should be organized
as such.

Let's replace all usages of TaskCliSyntax#PREFIX_ROOM_NUMBER to
RoomCliSyntax#PREFIX_ROOM_NUMBER.
@w-yeehong w-yeehong merged commit 6d51276 into AY2021S1-CS2103T-W12-1:master Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority.High Type.Feature New feature or request Type.Story A user story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit A Task: editTask
4 participants