From 90ede1982b35f830b2d17fa53489410366ec45e9 Mon Sep 17 00:00:00 2001 From: Nereus Ng Wei Bin Date: Mon, 13 Nov 2023 10:42:02 +0800 Subject: [PATCH 1/6] Fix wrong link --- docs/DeveloperGuide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 9b1378ca0c1..24fbd3d3590 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -68,8 +68,8 @@ Given below is a quick overview of main components and how they interact with ea **Main components of the architecture** **`Main`** (consisting of -classes [`Main`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/Main.java) -and [`MainApp`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java)) is +classes [`Main`](https://github.com/AY2324S1-CS2103T-W15-2/tp/blob/master/src/main/java/seedu/address/Main.java) +and [`MainApp`](https://github.com/AY2324S1-CS2103T-W15-2/tp/blob/master/src/main/java/seedu/address/MainApp.java)) is in charge of the app launch and shut down. * At app launch, it initializes the other components in the correct sequence, and connects them up with each other. From f5f0f7e3da6fe8ed54361bc530745a47a02850de Mon Sep 17 00:00:00 2001 From: Nereus Ng Wei Bin Date: Mon, 13 Nov 2023 10:48:13 +0800 Subject: [PATCH 2/6] Fix wrong method name --- docs/diagrams/ArchitectureSequenceDiagram.puml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/diagrams/ArchitectureSequenceDiagram.puml b/docs/diagrams/ArchitectureSequenceDiagram.puml index ab6c49bd054..2262ac60e1d 100644 --- a/docs/diagrams/ArchitectureSequenceDiagram.puml +++ b/docs/diagrams/ArchitectureSequenceDiagram.puml @@ -14,13 +14,13 @@ activate ui UI_COLOR ui -[UI_COLOR]> logic : execute("rm 0001Y") activate logic LOGIC_COLOR -logic -[LOGIC_COLOR]> model : deletePerson(p) +logic -[LOGIC_COLOR]> model : remove student with id 0001Y activate model MODEL_COLOR model -[MODEL_COLOR]-> logic deactivate model -logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook) +logic -[LOGIC_COLOR]> storage : saveProfBook(root) activate storage STORAGE_COLOR storage -[STORAGE_COLOR]> storage : Save to file From 1452ed648aff1398e5e1989e157813427a05dd1d Mon Sep 17 00:00:00 2001 From: Nereus Ng Wei Bin Date: Mon, 13 Nov 2023 10:51:02 +0800 Subject: [PATCH 3/6] Replace exact path with displayPath --- docs/diagrams/DeleteTaskSequenceModelDiagram.puml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/diagrams/DeleteTaskSequenceModelDiagram.puml b/docs/diagrams/DeleteTaskSequenceModelDiagram.puml index 40eb4319a71..201bc7910d4 100644 --- a/docs/diagrams/DeleteTaskSequenceModelDiagram.puml +++ b/docs/diagrams/DeleteTaskSequenceModelDiagram.puml @@ -16,7 +16,7 @@ mainframe **sd** Execution of DeleteTaskCommand activate DeleteTaskCommand -DeleteTaskCommand -> ModelManagerStatic : taskOperation(new Path("~/grp-001")) +DeleteTaskCommand -> ModelManagerStatic : taskOperation(displayPath) activate ModelManagerStatic create TaskOperation From 7635ec9a199127cea6f5e343c364b3ea4d3a4237 Mon Sep 17 00:00:00 2001 From: Nereus Ng Wei Bin Date: Mon, 13 Nov 2023 11:07:48 +0800 Subject: [PATCH 4/6] Fix wrong class name --- docs/DeveloperGuide.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 24fbd3d3590..3308f13afb7 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -241,8 +241,8 @@ we shall be narrowing our scope to adding a todo tasks to a specified group, g. How the `Model` component works: -* Depending on the nature of the command, a static method is called to generate a `TaskOperation` or - a `ChildrenOperation` Object that acts as an interface manipulate the Model +* Depending on the nature of the command, the corresponding method is called to generate a `TaskOperation` or + a `ChildOperation` object that acts as an interface manipulate the model * In this case, a `TaskOperation` object is created. This object would store all the necessary information to make changes directly on the correct state. * The `Command` instance calls the required method in the `TaskOperation` object which results in the `TaskOperation` @@ -250,9 +250,9 @@ How the `Model` component works: -**Note:** For ChildrenOperation, ModelManager provides more specific static factory methods (e.g., GroupChildOperation, -RootChildOperation) to generate the `ChildOperation` object. It is implemented this way so that ModelManager is able -to check that the Operation required matches with the intended effect of the Command object's Execution. +**Note:** For `ChildrenOperation`, `ModelManager` provides more specific factory methods (e.g., `groupChildOperation`, +`rootChildOperation`) to generate the `ChildOperation` object. It is implemented this way so that `ModelManager` is able +to check that the operation required matches with the intended effect of the `Command` object's execution. @@ -280,7 +280,7 @@ Here is a class diagram for the path package: * `AbsolutePath` represents an absolute path within the system and strictly commences with the `~` element. * The `resolve` method is crucial to resolve a `RelativePath` and return the resolved path in `AbsolutePath` type. * e.g. Consider an `AbsolutePath` represents `~/grp-001/0001A`. If the `resolve` method is called with the - `RelativePath` representing `../grp-002`, the resolve method will return the `AbsolutePath` representing the path + `RelativePath` representing `../../grp-002`, the resolve method will return the `AbsolutePath` representing the path `~/grp-002`.
@@ -400,7 +400,7 @@ Given below is an example usage scenario on how an existing user can create a st 3. The parser would retrieve all the relevant information from the input and encapsulates it in a `CreateStudentCommand`. 4. This command would first do these checks: * checks if the specified path contains the group. This is done via the `ModelManager::hasGroup` method. - * checks if the specified path is a valid student path. This is done via the `Path::isStudentDirectory` method. + * checks if the specified path is a valid student path. This is done via the `AbsolutePath::isStudentDirectory` method. * checks if adding the student would result in a duplicate within whole of ProfBook, ie if the student id is already taken. This is done via the `ModelManager::hasStudentWithId` method. 5. In this case, if the input was `touch ~/grp-001/1234Y ...` or `touch ~/grp-001/9876A ...` a `CommandException` will @@ -422,7 +422,7 @@ component, do head over to their respective documentation. Below is an activity diagram showing the general activity of the add student command. - + #### Design Consideration @@ -488,7 +488,7 @@ Given below is an example usage scenario on how an existing user can add Deadlin 3. The parser would retrieve all the relevant information from the input and encapsulate it in a `CreateDeadlineCommand`. 4. This command would first - * check if the specified path is a valid and present group path. This is done via `Path::isGroupDirectory` method. + * check if the specified path is a valid and present group path. This is done via `AbsolutePath::isGroupDirectory` method. * check if all students in the group already has the task. This is done via `GroupChildOperation::checkIfAllChildrenHaveTask` method. 5. If all checks out, the command would create a new `Deadline` instance and add the deadline to all student that do not @@ -512,7 +512,7 @@ diagram for adding a deadline task to a *single* student can be found in the `Mo This is an activity diagram showing the general activity of the add deadline command. - + #### Design Consideration @@ -554,8 +554,8 @@ This is an activity diagram showing the general activity of the add deadline com Due to the dynamic need of our target users, professors and TAs, there is a need for our edit command to be equally dynamic. Our edit command need to be general enough to allow the users to edit both students and groups. This is done by checking -the type of directory that was passed in. This is done through the `Path::isGroupDirectory` -and `Path::isStudentDirectory` method. +the type of directory that was passed in. This is done through the `AbsolutePath::isGroupDirectory` +and `AbsolutePath::isStudentDirectory` method. @@ -567,13 +567,13 @@ for `path` package. This then allows parser to check for the validity of the giv As the implementation for editing students and groups is similar, for simplicity, I would be going through implementation of editing a group. -The following methods of `ModelManager`, `Path` and `RootChildOperation` are used: +The following methods of `ModelManager`, `AbsolutePath` and `RootChildOperation` are used: 1. `ModelManager::rootChildOperation` - To generate an operation class with logic specific to the current root. 2. `ModelManager::hasGroupWithId` - To check if editing results in a duplicate. 3. `RootChildOperation::editChild` - To edit the group with the values extracted from parser. -4. `Path::isGroupDirectory` - To check if the path leads to a group directory. -5. `Path::isStudentDirectory` - To check if the path leads to a student directory. +4. `AbsolutePath::isGroupDirectory` - To check if the path leads to a group directory. +5. `AbsolutePath::isStudentDirectory` - To check if the path leads to a student directory. Given below is an example usage scenario on how an existing user can edit the name of a group @@ -668,7 +668,7 @@ improve this validation by enforcing a tighter validation. This can be achieved common phone extensions to their length and then enforcing that the phone number be of that length. This allows our users to have the peace of mind that the phone number is validated and robust enough to handle international numbers. -### Better marking and un-marking validation (// TODO low priority, remove when needed ) +### Better marking and un-marking validation Currently, our application does not check if the tasks are marked or unmarked before any operation. This results in users being able to mark/un-mark tasks infinitely, this is not intuitive and may mislead some users. Hence, we plan to @@ -683,7 +683,7 @@ and only if their ids are identical. This means that two students with identical considered different in ProfBook, needless to say this does not reflect requirements in the real world. Therefore, we plan to revamp our duplication checking for students by checking for equality between their phone number and email. -### More descriptive error message (// TODO low priority, remove when needed ) +### More descriptive error message Currently, while our application tries to output a descriptive and apt message for each error, we have received feedback that some of our error message could be more descriptive. One such example is trying to edit the root `~/` directory or From 6453d84851b9bfd8c6863d6454cd6b221f0b1dfd Mon Sep 17 00:00:00 2001 From: Nereus Ng Wei Bin Date: Mon, 13 Nov 2023 11:15:25 +0800 Subject: [PATCH 5/6] Fix manual testing error --- docs/DeveloperGuide.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 3308f13afb7..0ddd2f2d98c 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -1303,7 +1303,7 @@ need to change according to your current directory. More information can be foun - Creating a new group, - - Prerequisites: There exist a group with GroupId `grp-001`.
+ - Prerequisites: No existing group with GroupId grp-001.
Test case: `mkdir grp-001 --name Amazing Group1`
Expected: A new group will be added to the list in the bottom output box, with name `Amazing Group1` and GroupId `grp-001`. @@ -1326,7 +1326,7 @@ need to change according to your current directory. More information can be foun Test case: `touch ~/grp-001/0199Y --name Mary --email mary@gmail.com --phone 65412987 --address 4 Loyang Walk Loyang Industrial Estate`
Expected: The student with id `0199Y` will be added to `grp-001`. - - Prerequisites: ProfBook does not contain a student with id`0123Y`. + - Prerequisites: ProfBook does not contain a student with id`0123Y`.
Test case: `touch ~/grp-001/0123Y --name Mary`
Expected: The student with id `0123Y` will be added to `grp-001`. @@ -1592,17 +1592,17 @@ need to change according to your current directory. More information can be foun - Prerequisites: Place ProfBook.jar in an empty home folder. Perform the following step in the root directory. - - Test case: `todo grp-001/0001Y --desc Assignment One` + - Test case: `todo grp-001/0001Y --desc Assignment One`
Expected: `profbook.json` appears in data folder inside home folder. Student with name `Tejas` has a field history in profbook.json whereas the other students do not. Sample output [here](https://github.com/AY2324S1-CS2103T-W15-2/tp/tree/master/docs/sample/addTodo.json). - - Test case: `rm grp-001/0001Y` + - Test case: `rm grp-001/0001Y`
Expected: `profbook.json` is updated with `Tejas removed`. Sample output [here](https://github.com/AY2324S1-CS2103T-W15-2/tp/tree/master/docs/sample/removeTejas.json). - Clearing the save file. - Prerequisites: Have `profbook.json` in the data folder. Perform the previous step if the file isn’t there. - - Test case: `clear` + - Test case: `clear`
Expected: An empty `profbook.json` file like [here](https://github.com/AY2324S1-CS2103T-W15-2/tp/tree/master/docs/sample/empty.json)).
From 2e8aaa036d6036e82e57e32671ac900045310029 Mon Sep 17 00:00:00 2001 From: Nereus Ng Wei Bin Date: Mon, 13 Nov 2023 13:58:33 +0800 Subject: [PATCH 6/6] Fix bug --- docs/DeveloperGuide.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 04512660040..8118a4ac2d0 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -378,13 +378,13 @@ implementation for the harder one, which is creating a student. Should you have us. Most of the logic for creating a student is encapsulated in the `CreateStudentCommand` class, this class utilise -the `GroupChildOperation` class to add the student to the group and the `Model` class to check for duplicates. -The following methods of `ModelManager` and `GroupChildOperation` are used: +the `ChildOperation` class to add the student to the group and the `Model` class to check for duplicates. +The following methods of `ModelManager` and `ChildOperation` are used: 1. `ModelManager::groupChildOperation` - To generate an operation class specific to the current group, it also checks for the validity and presence of the specified group. 2. `ModelManager::hasStudentWithId` - To check if the new student id is unique. -3. `GroupChildOperation::addChild` - To add the current student into the group. +3. `ChildOperation::addChild` - To add the current student into the group. Given below is an example usage scenario on how an existing user can create a student. @@ -406,8 +406,8 @@ Given below is an example usage scenario on how an existing user can create a st 5. In this case, if the input was `touch ~/grp-001/1234Y ...` or `touch ~/grp-001/9876A ...` a `CommandException` will be thrown. 6. If all checks out, the command would create a new student and add the student to the `Model`. This addition is done - through getting a `GroupChildOperation` class from the `Model::groupChildOperation` method. This would ensure - the path to the group is present and valid. The student is added through the `GroupChildOperation::addChild` method. + through getting a `ChildOperation` class from the `Model::groupChildOperation` method. This would ensure + the path to the group is present and valid. The student is added through the `ChildOperation::addChild` method. 7. It should look something like this. @@ -462,14 +462,14 @@ tasks can be found at the `Model` component. Most of the logic for creating a task is encapsulated in the `CreateDeadlineCommand` class, this class utilises -the `GroupChildOperation` class to add the Deadline to the group and check for duplicates. -The following methods of `ModelManager` and `GroupChildOperation` are used: +the `ChildOperation` class to add the Deadline to the group and check for duplicates. +The following methods of `ModelManager` and `ChildOperation` are used: 1. `ModelManager::groupChildOperation` - To generate an operation class specific to the current group, it also checks for the validity and presence of the specified group. -2. `GroupChildOperation::addAllTasks` - To add the tasks to all student within a group, it also checks if it is a +2. `ChildOperation::addAllTasks` - To add the tasks to all student within a group, it also checks if it is a duplicate task before adding. -3. `GroupChildOperation::checkIfAllChildrenHaveTask` - To check if all children within a group already has the task. +3. `ChildOperation::checkIfAllChildrenHaveTask` - To check if all children within a group already has the task. It is important to note that for adding a task to a singular group/student, the operation class `TaskOperation` is used instead, a sequence diagram illustrating this can be found in the `Model` component. @@ -490,11 +490,11 @@ Given below is an example usage scenario on how an existing user can add Deadlin 4. This command would first * check if the specified path is a valid and present group path. This is done via `AbsolutePath::isGroupDirectory` method. * check if all students in the group already has the task. This is done - via `GroupChildOperation::checkIfAllChildrenHaveTask` method. + via `ChildOperation::checkIfAllChildrenHaveTask` method. 5. If all checks out, the command would create a new `Deadline` instance and add the deadline to all student that do not already have the aforementioned task. This is done - through getting a `GroupChildOperation` class from the `Model::groupChildOperation` method. The tasks are then - added through the `GroupChildOperation::addTaskToAllStudent` method. For each student, the method would check if the + through getting a `ChildOperation` class from the `Model::groupChildOperation` method. The tasks are then + added through the `ChildOperation::addTaskToAllStudent` method. For each student, the method would check if the task is already present, if not it would add the task. 6. It should look something like this. @@ -567,11 +567,11 @@ for `path` package. This then allows parser to check for the validity of the giv As the implementation for editing students and groups is similar, for simplicity, I would be going through implementation of editing a group. -The following methods of `ModelManager`, `AbsolutePath` and `RootChildOperation` are used: +The following methods of `ModelManager`, `AbsolutePath` and `ChildOperation` are used: 1. `ModelManager::rootChildOperation` - To generate an operation class with logic specific to the current root. 2. `ModelManager::hasGroupWithId` - To check if editing results in a duplicate. -3. `RootChildOperation::editChild` - To edit the group with the values extracted from parser. +3. `ChildOperation::editChild` - To edit the group with the values extracted from parser. 4. `AbsolutePath::isGroupDirectory` - To check if the path leads to a group directory. 5. `AbsolutePath::isStudentDirectory` - To check if the path leads to a student directory. @@ -587,7 +587,7 @@ Given below is an example usage scenario on how an existing user can edit the na 4. The fields to be edited is then stored in an `EditGroupDescriptor` instance. (For student it would be stored in an `EditStudentDescriptor`) 5. If the id is being edited, `ModelManager::hasGroupWithId` is called to ensure it does not result in a duplicate. -6. The `RootChildOperation::editChild` then makes a copy of the existing group while updating the values found in +6. The `ChildOperation::editChild` then makes a copy of the existing group while updating the values found in the `EditGroupDescriptor`. @@ -630,7 +630,7 @@ Initially, implementing this feature seemed like a daunting task. However, after realised that implementing move was quite straight forward. Moving a student can be easily done by removing the student's reference from its current group by removing its key-value pair from the group's `Map` field. Then to complete the move, the student is added to the target group by adding it into the target -group's `Map` field. All of this operation is facilitated by the `GroupChildOperation` class. +group's `Map` field. All of this operation is facilitated by the `ChildOperation` class. Given below is an example usage scenario whereby a student is moved from group1 to group2. @@ -639,8 +639,8 @@ Given below is an example usage scenario whereby a student is moved from group1 user would execute the following command: `mv ~/grp-001/1234Y ~/grp-002`. 3. The parser would extract the relevant information and creates a `MoveStudentCommand` instance. 4. The command would check that path to the student and target group is valid and present. -5. Command would then add the student to the target group via the `GroupChildOperation::addChild` method. The old - reference is removed via the `GroupChildOperation::deleteChild` method. +5. Command would then add the student to the target group via the `ChildOperation::addChild` method. The old + reference is removed via the `ChildOperation::deleteChild` method. 6. As uniqueness of student is validated before each student is added, there is no need to check for clashes when executing. @@ -1320,7 +1320,7 @@ need to change according to your current directory. More information can be foun - Adding a student into the specified directory, - - Prerequisites: There exist a group with GroupId `grp-001` + - Prerequisites for all test cases: There exist a group with GroupId `grp-001` - Prerequisites: ProfBook does not contain a student with id `0199Y`.
Test case: `touch ~/grp-001/0199Y --name Mary --email mary@gmail.com --phone 65412987 --address 4 Loyang Walk Loyang Industrial Estate`
@@ -1379,7 +1379,7 @@ need to change according to your current directory. More information can be foun - Test case: `edit --name Lucy --email lucy@gmail.com --phone 91919191`
Expected: An error message indicating the root directory cannot be edited will be shown. - - Other incorrect `edit` commands to try: `edit ~/grp-001 --name Lucy --email lucy@gmail.com --phone 91919191`, `...` + - Other incorrect `edit` commands to try: `edit ~/grp-001 --name Lucy --email lucy@gmail.com --phone 91919191`, `edit ~/grp-001` (Where one or more required fields are missing)
Expected: An error message indicating the command format is invalid will be displayed.