Skip to content

Commit

Permalink
Merge branch 'AY2324S2-CS2103T-T12-2:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
smolegz authored Apr 13, 2024
2 parents e5248fa + 94770d0 commit 3cac14f
Show file tree
Hide file tree
Showing 33 changed files with 1,019 additions and 398 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: ./gradlew check coverage

- name: Upload coverage reports to Codecov
if: runner.os == 'Linux'
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: AidenLYT/tp
371 changes: 180 additions & 191 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

162 changes: 115 additions & 47 deletions docs/UserGuide.md

Large diffs are not rendered by default.

42 changes: 18 additions & 24 deletions docs/diagrams/AddByStepActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
@startuml
'https://plantuml.com/activity-diagram-beta

sprite $rake [16x16/8] {
0000000000000000
0000000jj0000000
0000000jj0000000
0005555jj5555000
000jjeejjeejj000
000jj00jj00jj000
000jj00jj00jj000
0000000000000000
}
skin rose
skinparam ActivityFontSize 15
skinparam ArrowFontSize 12
start
:User enters "addbystep";
repeat :User enters name;
:process name;
repeat while (Name is valid?) is (no)
repeat :User enters number;
:process number;
repeat while (Number is valid?) is (no)
repeat :User enters email;
:process email;
repeat while (Email is valid?) is (no)
repeat :User enters address;
:process address;
repeat while (address are valid?) is (no)
:display the end message;
:User enters a command;

if(Is it the copy command?) then (yes)
:copy command to clipboard;
else (no)
:display the end message;
endif
:User executes "addbystep" command;
:Get all the necessary inputs from user<$rake>;
:User types the the "cp" command;
:Command is copied to the clipboard of the user;
:User closes the window;


stop


@enduml
40 changes: 0 additions & 40 deletions docs/diagrams/AddByStepActivityDiagram2.puml

This file was deleted.

75 changes: 75 additions & 0 deletions docs/diagrams/DuplicateSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":DuplicateCommandParser" as DuplicateCommandParser LOGIC_COLOR
participant "rc:DuplicateCommand" as DuplicateCommand LOGIC_COLOR
participant "rs:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("duplicate n/Alex Yeoh...")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("duplicate n/Alex Yeoh...")
activate AddressBookParser

create DuplicateCommandParser
AddressBookParser -> DuplicateCommandParser
activate DuplicateCommandParser

DuplicateCommandParser --> AddressBookParser
deactivate DuplicateCommandParser

AddressBookParser -> DuplicateCommandParser : parse("n/Alex Yeoh ...")
activate DuplicateCommandParser

create DuplicateCommand
DuplicateCommandParser -> DuplicateCommand
activate DuplicateCommand

DuplicateCommand --> DuplicateCommandParser :
deactivate DuplicateCommand

DuplicateCommandParser --> AddressBookParser : rc
deactivate DuplicateCommandParser
DuplicateCommandParser -[hidden]-> AddressBookParser
destroy DuplicateCommandParser

AddressBookParser --> LogicManager : rc
deactivate AddressBookParser

LogicManager -> DuplicateCommand : execute(m)
activate DuplicateCommand

DuplicateCommand -> Model : addDuplicatePerson(Person)
activate Model

Model --> DuplicateCommand
deactivate Model

DuplicateCommand -> Model : commitAddressBook()
activate Model

Model --> DuplicateCommand
deactivate Model

create CommandResult
DuplicateCommand -> CommandResult
activate CommandResult

CommandResult --> DuplicateCommand
deactivate CommandResult

DuplicateCommand --> LogicManager : rs
deactivate DuplicateCommand

[<--LogicManager
deactivate LogicManager
@enduml
75 changes: 75 additions & 0 deletions docs/diagrams/OverwriteSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":OverwriteCommandParser" as OverwriteCommandParser LOGIC_COLOR
participant "rc:OverwriteCommand" as OverwriteCommand LOGIC_COLOR
participant "rs:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("Overwrite 1 n/Alex Yeoh...")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("Overwrite 1 n/Alex Yeoh...")
activate AddressBookParser

create OverwriteCommandParser
AddressBookParser -> OverwriteCommandParser
activate OverwriteCommandParser

OverwriteCommandParser --> AddressBookParser
deactivate OverwriteCommandParser

AddressBookParser -> OverwriteCommandParser : parse("1 n/Alex Yeoh ...")
activate OverwriteCommandParser

create OverwriteCommand
OverwriteCommandParser -> OverwriteCommand
activate OverwriteCommand

OverwriteCommand --> OverwriteCommandParser :
deactivate OverwriteCommand

OverwriteCommandParser --> AddressBookParser : rc
deactivate OverwriteCommandParser
OverwriteCommandParser -[hidden]-> AddressBookParser
destroy OverwriteCommandParser

AddressBookParser --> LogicManager : rc
deactivate AddressBookParser

LogicManager -> OverwriteCommand : execute(m)
activate OverwriteCommand

OverwriteCommand -> Model : setDuplicatePerson(Person)
activate Model

Model --> OverwriteCommand
deactivate Model

OverwriteCommand -> Model : commitAddressBook()
activate Model

Model --> OverwriteCommand
deactivate Model

create CommandResult
OverwriteCommand -> CommandResult
activate CommandResult

CommandResult --> OverwriteCommand
deactivate CommandResult

OverwriteCommand --> LogicManager : rs
deactivate OverwriteCommand

[<--LogicManager
deactivate LogicManager
@enduml
3 changes: 3 additions & 0 deletions docs/diagrams/UiClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Class PersonCard
Class StatusBarFooter
Class CommandBox
Class ExitWindow
Class CommandHelperWindow
}

package Model <<Rectangle>> {
Expand All @@ -37,6 +38,7 @@ MainWindow *-down-> "1" PersonListPanel
MainWindow *-down-> "1" StatusBarFooter
MainWindow --> "0..1" HelpWindow
MainWindow --> "0..1" ExitWindow
MainWindow --> "0..1" CommandHelperWindow

PersonListPanel -down-> "*" PersonCard

Expand All @@ -50,6 +52,7 @@ StatusBarFooter --|> UiPart
HelpWindow --|> UiPart
ExitWindow -left-|> UiPart


PersonCard ..> Model
UiManager -right-> Logic
MainWindow -left-> Logic
Expand Down
20 changes: 20 additions & 0 deletions docs/diagrams/UserInputActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@startuml
'https://plantuml.com/activity-diagram-beta

start
:AddCommandHelper prompts user for input;

repeat
:User enters input;
:Input is checked by AddCommandHelper;
if () then ([Input is invalid])
:Show error message and prompt user for same input field;
elseif () then ([Prompt user for next input])
else ([Last input field needed from user?])




stop

@enduml
Binary file modified docs/images/confirmation.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 docs/images/index-remove.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 removed docs/images/no-confirm.png
Binary file not shown.
Binary file modified docs/images/no-result.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 removed docs/images/remove-index.png
Binary file not shown.
Binary file removed docs/images/remove.png
Binary file not shown.
Binary file removed docs/images/yes-confirm.png
Binary file not shown.
Binary file modified docs/images/yes-result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package seedu.address;
package seedu.address.logic;


import java.util.HashSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG;

import java.util.logging.Logger;

import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.LogicManager;
import seedu.address.logic.Messages;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.person.Person;


/**
* Adds a duplicate identity i.e. person to the address book.
*/
Expand Down Expand Up @@ -41,6 +46,8 @@ public class DuplicateCommand extends Command {
+ "address book. Please try again with another person.";
private final Person toAdd;

private final Logger logger = LogsCenter.getLogger(LogicManager.class);

/**
* Creates an DuplicateCommand to add the specified {@code Person}
*/
Expand All @@ -53,6 +60,7 @@ public CommandResult execute(Model model) throws CommandException {
requireNonNull(model);

if (!model.hasPerson(toAdd)) {
logger.info("Failed to add person, doesn't currently exist");
throw new CommandException(MESSAGE_NO_EXISTING_PERSON);
}

Expand Down
8 changes: 8 additions & 0 deletions src/main/java/seedu/address/logic/commands/FilterCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

import static java.util.Objects.requireNonNull;

import java.util.logging.Logger;

import seedu.address.commons.core.LogsCenter;
import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.LogicManager;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.person.TagContainsKeywordsPredicate;


/**
* Lists all persons in the address book with the matching filtered tags
*/
Expand All @@ -23,13 +28,16 @@ public class FilterCommand extends Command {

private final TagContainsKeywordsPredicate predicate;

private final Logger logger = LogsCenter.getLogger(LogicManager.class);

public FilterCommand(TagContainsKeywordsPredicate predicate) {
this.predicate = predicate;
}

@Override
public CommandResult execute(Model model) throws CommandException {
requireNonNull(model);
logger.info("Filtering by predicate " + predicate.toString());
model.updateFilteredPersonList(predicate);
return new CommandResult(MESSAGE_SUCCESS);
}
Expand Down
Loading

0 comments on commit 3cac14f

Please sign in to comment.