Skip to content

Commit

Permalink
Merge branch 'master' into branch-updateUserGuide
Browse files Browse the repository at this point in the history
  • Loading branch information
SwaminathanViswa committed Nov 4, 2024
2 parents 6b7b2d6 + 902c268 commit e17eb66
Show file tree
Hide file tree
Showing 107 changed files with 2,790 additions and 737 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dependencies {

implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.0'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.7.4'
implementation 'com.opencsv:opencsv:5.7.1'

testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: jUnitVersion

Expand All @@ -69,4 +70,8 @@ shadowJar {
archiveFileName = 'addressbook.jar'
}

run {
enableAssertions = true;
}

defaultTasks 'clean', 'test'
80 changes: 40 additions & 40 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

472 changes: 386 additions & 86 deletions docs/UserGuide.md

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions docs/diagrams/ArchitectureSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ Participant ":Logic" as logic LOGIC_COLOR
Participant ":Model" as model MODEL_COLOR
Participant ":Storage" as storage STORAGE_COLOR

user -[USER_COLOR]> ui : "delete 1"
user -[USER_COLOR]> ui : "delete n/John"
activate ui UI_COLOR

ui -[UI_COLOR]> logic : execute("delete 1")
ui -[UI_COLOR]> logic : execute("delete n/John")
activate logic LOGIC_COLOR

logic -[LOGIC_COLOR]> model : getPerson(name)
activate model MODEL_COLOR

model -[MODEL_COLOR]-> logic
deactivate model

logic -[LOGIC_COLOR]> model : deletePerson(p)
activate model MODEL_COLOR

Expand Down
3 changes: 3 additions & 0 deletions docs/diagrams/BetterModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ Person *--> Name
Person *--> Phone
Person *--> Email
Person *--> Address
Person *--> Github
Person *--> Telegram
Person *--> "*" Assignment
@enduml
14 changes: 10 additions & 4 deletions docs/diagrams/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("delete 1")
[-> LogicManager : execute("delete n/John")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("delete 1")
LogicManager -> AddressBookParser : parseCommand("delete n/John")
activate AddressBookParser

create DeleteCommandParser
Expand All @@ -27,7 +27,7 @@ activate DeleteCommandParser
DeleteCommandParser --> AddressBookParser
deactivate DeleteCommandParser

AddressBookParser -> DeleteCommandParser : parse("1")
AddressBookParser -> DeleteCommandParser : parse("John")
activate DeleteCommandParser

create DeleteCommand
Expand All @@ -49,7 +49,7 @@ deactivate AddressBookParser
LogicManager -> DeleteCommand : execute(m)
activate DeleteCommand

DeleteCommand -> Model : deletePerson(1)
DeleteCommand -> Model : deletePerson(person)
activate Model

Model --> DeleteCommand
Expand All @@ -61,9 +61,15 @@ activate CommandResult

CommandResult --> DeleteCommand
deactivate CommandResult
'Hidden arrow to position the destroy marker below the end of the activation bar.
CommandResult -[hidden]-> DeleteCommand
destroy CommandResult

DeleteCommand --> LogicManager : r
deactivate DeleteCommand
'Hidden arrow to position the destroy marker below the end of the activation bar.
DeleteCommand -[hidden]-> LogicManager
destroy DeleteCommand

[<--LogicManager
deactivate LogicManager
Expand Down
16 changes: 14 additions & 2 deletions docs/diagrams/ModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ Package Model as ModelPackage <<Rectangle>>{
Class "<<interface>>\nReadOnlyAddressBook" as ReadOnlyAddressBook
Class "<<interface>>\nReadOnlyUserPrefs" as ReadOnlyUserPrefs
Class "<<interface>>\nModel" as Model
Class "<<interface>>\nReadOnlyPredefinedAssignmentsData" as ReadOnlyPredefinedAssignmentsData
Class AddressBook
Class ModelManager
Class UserPrefs
Class PredefinedAssignmentData
Class ReadOnlyPredefinedAssignmentsData

Class UniquePersonList
Class Person
Expand All @@ -19,6 +22,9 @@ Class Email
Class Name
Class Phone
Class Tag
Class Telegram
Class Github
Class Assignment

Class I #FFFFFF
}
Expand All @@ -29,11 +35,14 @@ HiddenOutside ..> Model
AddressBook .up.|> ReadOnlyAddressBook

ModelManager .up.|> Model
Model .right.> ReadOnlyUserPrefs
Model .left.> ReadOnlyAddressBook
Model .down.> ReadOnlyUserPrefs
Model .down.> ReadOnlyAddressBook
Model .down.> ReadOnlyPredefinedAssignmentsData
ModelManager -left-> "1" AddressBook
ModelManager -right-> "1" UserPrefs
ModelManager -right-> "1" PredefinedAssignmentData
UserPrefs .up.|> ReadOnlyUserPrefs
PredefinedAssignmentData .up.|> ReadOnlyPredefinedAssignmentsData

AddressBook *--> "1" UniquePersonList
UniquePersonList --> "~* all" Person
Expand All @@ -42,6 +51,9 @@ Person *--> Phone
Person *--> Email
Person *--> Address
Person *--> "*" Tag
Person *--> Telegram
Person *--> Github
Person *--> "*" Assignment

Person -[hidden]up--> I
UniquePersonList -[hidden]right-> I
Expand Down
23 changes: 21 additions & 2 deletions docs/diagrams/StorageClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ skinparam arrowThickness 1.1
skinparam arrowColor STORAGE_COLOR
skinparam classBackgroundColor STORAGE_COLOR


package Storage as StoragePackage {

package "UserPrefs Storage" #F4F6F6{
Expand All @@ -22,22 +23,40 @@ Class JsonAdaptedPerson
Class JsonAdaptedTag
}

package "PredefinedAssignmentData Storage\n" #F4F6F6 {
Class "<<interface>>\nPredefinedAssignmentDataStorage" as PredefinedAssignmentDataStorage
Class JsonPredefinedAssignmentDataStorage
Class JsonSerializablePredefinedAssignmentData
Class JsonAdaptedPredefinedAssignment
}

}



Class HiddenOutside #FFFFFF
HiddenOutside ..> Storage

StorageManager .up.|> Storage
StorageManager -up-> "1" UserPrefsStorage
StorageManager -up-> "1" AddressBookStorage
StorageManager -left-> "1" UserPrefsStorage
StorageManager -right> "1" AddressBookStorage
StorageManager -down-> "1" PredefinedAssignmentDataStorage


Storage -left-|> UserPrefsStorage
Storage -right-|> AddressBookStorage
Storage -down-|> PredefinedAssignmentDataStorage




JsonUserPrefsStorage .up.|> UserPrefsStorage
JsonAddressBookStorage .up.|> AddressBookStorage
JsonAddressBookStorage ..> JsonSerializableAddressBook
JsonSerializableAddressBook --> "*" JsonAdaptedPerson
JsonAdaptedPerson --> "*" JsonAdaptedTag
JsonPredefinedAssignmentDataStorage .up.|> PredefinedAssignmentDataStorage
JsonPredefinedAssignmentDataStorage ..> JsonSerializablePredefinedAssignmentData
JsonSerializablePredefinedAssignmentData --> "*" JsonAdaptedPredefinedAssignment

@enduml
4 changes: 4 additions & 0 deletions docs/diagrams/UiClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Class PersonListPanel
Class PersonCard
Class StatusBarFooter
Class CommandBox
Class ViewWindow
}

package Model <<Rectangle>> {
Expand All @@ -35,6 +36,7 @@ MainWindow *-down-> "1" ResultDisplay
MainWindow *-down-> "1" PersonListPanel
MainWindow *-down-> "1" StatusBarFooter
MainWindow --> "0..1" HelpWindow
MainWindow *-down-> "0..1" ViewWindow

PersonListPanel -down-> "*" PersonCard

Expand All @@ -46,6 +48,7 @@ PersonListPanel --|> UiPart
PersonCard --|> UiPart
StatusBarFooter --|> UiPart
HelpWindow --|> UiPart
ViewWindow --|> UiPart

PersonCard ..> Model
UiManager -right-> Logic
Expand All @@ -55,6 +58,7 @@ PersonListPanel -[hidden]left- HelpWindow
HelpWindow -[hidden]left- CommandBox
CommandBox -[hidden]left- ResultDisplay
ResultDisplay -[hidden]left- StatusBarFooter
ViewWindow -[hidden]left- PersonListPanel

MainWindow -[hidden]-|> UiPart
@enduml
Binary file added docs/images/markPresent.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/markViswaPresent.png
Binary file not shown.
Binary file added docs/images/unmarkStudent.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/unmarkViswa.png
Binary file not shown.
15 changes: 11 additions & 4 deletions src/main/java/seedu/address/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,30 @@ private Model initModelManager(Storage storage, ReadOnlyUserPrefs userPrefs) {
ReadOnlyAddressBook initialData;
ReadOnlyPredefinedAssignmentsData predefinedAssignments;
try {
readAssignmentOptional = storage.readAssignment();
addressBookOptional = storage.readAddressBook();
if (!addressBookOptional.isPresent()) {
logger.info("Creating a new data file " + storage.getAddressBookFilePath()
+ " populated with a sample AddressBook.");
}
initialData = addressBookOptional.orElseGet(SampleDataUtil::getSampleAddressBook);
} catch (DataLoadingException e) {
logger.warning("Data file at " + storage.getAddressBookFilePath() + " could not be loaded."
+ " Will be starting with an empty AddressBook.");
initialData = new AddressBook();
e.printStackTrace();
}

try {
readAssignmentOptional = storage.readAssignment();
if (!readAssignmentOptional.isPresent()) {
logger.info("Creating a new data file " + storage.getAssignmentFilePath()
+ " populated with a sample assignment file.");
}
initialData = addressBookOptional.orElseGet(SampleDataUtil::getSampleAddressBook);
predefinedAssignments = readAssignmentOptional
.orElseGet(SampleAssignmentsUtil::getSamplePredefinedAssignments);
} catch (DataLoadingException e) {
logger.warning("Data file at " + storage.getAddressBookFilePath() + " could not be loaded."
+ " Will be starting with an empty AddressBook.");
initialData = new AddressBook();
+ " Will be starting with an empty predefined assignments data.");
predefinedAssignments = new PredefinedAssignmentsData();
}

Expand Down
11 changes: 8 additions & 3 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ public class Messages {
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d persons listed!";
public static final String MESSAGE_DUPLICATE_FIELDS =
"Multiple values specified for the following single-valued field(s): ";
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_NAME = "The person name provided is invalid";
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_NAME = "Person not found. "
+ "Please check the name and try again.";
public static final String MESSAGE_MARK_SUCCESS = "%1$s is marked present for week %2$d";
public static final String MESSAGE_INVALID_WEEK = "Invalid week number.";
public static final String MESSAGE_MARK_ALREADY_SUCCESS = "Attendance is already marked for this student!";
public static final String MESSAGE_UNMARK_ALREADY_SUCCESS = "Attendance is already unmarked for this student";
public static final String MESSAGE_UNMARK_SUCCESS = "%1$s is marked as absent for week %2$d";


/**
* Returns an error message indicating the duplicate prefixes.
Expand All @@ -42,8 +49,6 @@ public static String format(Person person) {
.append(person.getPhone())
.append("; Email: ")
.append(person.getEmail())
.append("; Address: ")
.append(person.getAddress())
.append("; Telegram: ")
.append(person.getTelegram())
.append("; Tags: ");
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/seedu/address/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL;
import static seedu.address.logic.parser.CliSyntax.PREFIX_GITHUB;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
Expand All @@ -22,20 +21,18 @@ public class AddCommand extends Command {

public static final String COMMAND_WORD = "add";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book. "
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book.\n"
+ "Parameters: "
+ PREFIX_NAME + "NAME "
+ PREFIX_PHONE + "PHONE "
+ PREFIX_EMAIL + "EMAIL "
+ PREFIX_ADDRESS + "ADDRESS "
+ PREFIX_TELEGRAM + "TELEGRAM "
+ "[" + PREFIX_TAG + "TAG]... "
+ PREFIX_GITHUB + "GITHUB\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_NAME + "John Doe "
+ PREFIX_PHONE + "98765432 "
+ PREFIX_EMAIL + "[email protected] "
+ PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 "
+ PREFIX_TELEGRAM + "@john "
+ PREFIX_TAG + "friends "
+ PREFIX_TAG + "owesMoney "
Expand Down
Loading

0 comments on commit e17eb66

Please sign in to comment.