Skip to content

Commit

Permalink
Merge 966082e into a7f1b59
Browse files Browse the repository at this point in the history
  • Loading branch information
hanchingyong committed Apr 10, 2020
2 parents a7f1b59 + 966082e commit d46e056
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 63 deletions.
18 changes: 10 additions & 8 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ image::LogicClassDiagram.png[]
*API* :
link:{repoURL}/src/main/java/seedu/address/logic/Logic.java[`Logic.java`]

. `Logic` uses the `AddressBookParser` class to parse the user command.
. `Logic` uses the `TAbleParser` class to parse the user command.
. This results in a `Command` object which is executed by the `LogicManager`.
. The command execution can affect the `Model` (e.g. adding a student).
. The result of the command execution is encapsulated as a `CommandResult` object which is passed back to the `Ui`.
Expand Down Expand Up @@ -126,11 +126,6 @@ The `Model`,
* exposes an unmodifiable `ObservableList<Student>` that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.
* does not depend on any of the other three components.

[NOTE]
As a more OOP model, we can store a `Tag` list in `Address Book`, which `Student` can reference. This would allow `Address Book` to only require one `Tag` object per unique `Tag`, instead of each `Student` needing their own `Tag` object. An example of how such a model may look like is given below. +
+
image:BetterModelClassDiagram.png[]

[[Design-Storage]]
=== Storage component

Expand All @@ -142,7 +137,7 @@ image::StorageClassDiagram.png[]
The `Storage` component,

* can save `UserPref` objects in json format and read it back.
* can save the Address Book and TAble data in json format and read it back.
* can save the TAble data in json format and read it back.

[[Design-Commons]]
=== Common classes
Expand Down Expand Up @@ -617,6 +612,8 @@ Use case ends.
+
Use case resumes at step 2.

// tag::hc[]

[discrete]
=== Use case: Add consult (U02)

Expand Down Expand Up @@ -708,6 +705,8 @@ Use case ends.
+
Use case ends.

// end::hc[]

[discrete]
=== Use case: Add tutorial (U06)

Expand Down Expand Up @@ -1237,8 +1236,8 @@ _{ more test cases ... }_
.. Other incorrect delete commands to try: `deleteStudent`, `deleteStudent x` (where x is larger than the list size) _{give more}_ +
Expected: Similar to previous.

_{ more test cases ... }_

=======
=== Snoozing a reminder
. Snoozing a reminder while some reminders are listed
Expand All @@ -1253,6 +1252,8 @@ _{ more test cases ... }_
.. Other incorrect snooze commands to try: `snoozeReminder`, `snoozeReminder x` (where x is larger than the list size), `snoozeReminder 1 hour/y (where y is a negative integer)` +
Expected: Similar to previous.
// tag::hc1[]
=== Viewing calendar
. Displaying the calendar for the current month and year.
Expand All @@ -1264,3 +1265,4 @@ _{ more test cases ... }_
Expected: The new month before/after the current displayed month is displayed in the new `Calendar` window.
.. Test case: `closeCalendar` +
Expected: The `Calendar` window will be closed. Alternatively, the user may choose to click the cross on the top right corner of the `Calendar` window to close it.
// end::hc1[]
6 changes: 3 additions & 3 deletions docs/diagrams/ArchitectureSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ 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 : "deleteStudent 1"
activate ui UI_COLOR

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

logic -[LOGIC_COLOR]> model : deleteStudent(s)
Expand All @@ -19,7 +19,7 @@ activate model MODEL_COLOR
model -[MODEL_COLOR]-> logic
deactivate model

logic -[LOGIC_COLOR]> storage : saveAddressBook(studentTAble)
logic -[LOGIC_COLOR]> storage : saveStudentTAble(studentTAble)
activate storage STORAGE_COLOR

storage -[STORAGE_COLOR]> storage : Save to file
Expand Down
20 changes: 10 additions & 10 deletions docs/diagrams/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":TAbleParser" as TAbleParser LOGIC_COLOR
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
Expand All @@ -13,20 +13,20 @@ box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("delete 1")
[-> LogicManager : execute("deleteStudent 1")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("delete 1")
activate AddressBookParser
LogicManager -> TAbleParser : parseCommand("deleteStudent 1")
activate TAbleParser

create DeleteCommandParser
AddressBookParser -> DeleteCommandParser
TAbleParser -> DeleteCommandParser
activate DeleteCommandParser

DeleteCommandParser --> AddressBookParser
DeleteCommandParser --> TAbleParser
deactivate DeleteCommandParser

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

create DeleteCommand
Expand All @@ -36,13 +36,13 @@ activate DeleteCommand
DeleteCommand --> DeleteCommandParser : d
deactivate DeleteCommand

DeleteCommandParser --> AddressBookParser : d
DeleteCommandParser -->TAbleParser : d
deactivate DeleteCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
DeleteCommandParser -[hidden]-> AddressBookParser
DeleteCommandParser -[hidden]-> TAbleParser
destroy DeleteCommandParser

AddressBookParser --> LogicManager : d
TAbleParser --> LogicManager : d
deactivate AddressBookParser

LogicManager -> DeleteCommand : execute()
Expand Down
6 changes: 3 additions & 3 deletions docs/diagrams/LogicClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package Logic {

package Parser {
Interface Parser <<Interface>>
Class AddressBookParser
Class TAbleParser
Class XYZCommandParser
Class CliSyntax
Class ParserUtil
Expand All @@ -35,8 +35,8 @@ Class HiddenOutside #FFFFFF
HiddenOutside ..> Logic

LogicManager .up.|> Logic
LogicManager -->"1" AddressBookParser
AddressBookParser .left.> XYZCommandParser: creates >
LogicManager -->"1" TAbleParser
TAbleParser .left.> XYZCommandParser: creates >

XYZCommandParser ..> XYZCommand : creates >
XYZCommandParser ..|> Parser
Expand Down
3 changes: 0 additions & 3 deletions docs/diagrams/ModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Class Student
Class Email
Class Name
Class MatricNumber
Class Remark
Class UniqueStudentList
Class StudentTAble
}
Expand Down Expand Up @@ -69,13 +68,11 @@ UniqueStudentList o--> "*" Student
Student *--> Name
Student *--> MatricNumber
Student *--> Email
Student *--> Remark
Student *--> "*" Tag

Tag -[hidden]right-> Name
Name -[hidden]right-> MatricNumber
MatricNumber -[hidden]right-> Email
Email -[hidden]right-> Remark

ModelManager -->"1" Student : filtered list

Expand Down
12 changes: 6 additions & 6 deletions docs/diagrams/StorageClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ skinparam classBackgroundColor STORAGE_COLOR

Interface Storage <<Interface>>
Interface UserPrefsStorage <<Interface>>
Interface AddressBookStorage <<Interface>>
Interface StudentStorage <<Interface>>

Class StorageManager
Class JsonUserPrefsStorage
Class JsonAddressBookStorage
Class JsonStudentStorage

Package Consults {
Interface ConsultStorage <<Interface>>
Expand All @@ -33,17 +33,17 @@ Interface TutorialStorage <<Interface>>

StorageManager .up.|> Storage
StorageManager o-up-> UserPrefsStorage
StorageManager o-right-> AddressBookStorage
StorageManager o-right-> StudentStorage
StorageManager o--> ConsultStorage
StorageManager o--> ModStorage
StorageManager o--> ReminderStorage
StorageManager o--> TutorialStorage

JsonUserPrefsStorage ..|> UserPrefsStorage

JsonAddressBookStorage ..|> AddressBookStorage
JsonAddressBookStorage ..> JsonSerializableAddressBookStorage
JsonSerializableAddressBookStorage ..> JsonAdaptedStudent
JsonStudentStorage ..|> StudentStorage
JsonStudentStorage ..> JsonSerializableStudentStorage
JsonSerializableStudentStorage ..> JsonAdaptedStudent
JsonAdaptedStudent ..> JsonAdaptedTag

JsonConsultStorage ..|> ConsultStorage
Expand Down
Binary file modified docs/images/ArchitectureSequenceDiagram.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/DeleteSequenceDiagram.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/LogicClassDiagram.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/ModelClassDiagram.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/StorageClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 30 additions & 14 deletions docs/team/hanchingyong.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,36 @@

== Overview

TAble is your handy desktop app, optimized for TAs who prefer to work with a Command Line Interface (CLI) while still having the benefits of a Graphical User Interface (GUI)! Mark attendance, arrange consults, add module notes, and more with TAble! It has a GUI created with JavaFX and written in Java, and has about 10 kLoC.
TAble is your handy desktop app, optimized for TAs who prefer to work with a Command Line Interface (CLI) while still having the benefits of a Graphical User Interface (GUI)! I have added the functionality for TAs to arrange consults and view all upcoming events in a calendar! The GUI of TAble was created with JavaFX and written in Java, and I have written about 4 kLoC.

== Summary of contributions

* *Major enhancement*: Enabled support for *Consults*
** What it does: Allows the user to work with all of his/her consults using *TAble*.
** Credits: _{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}_
** *What it does*: The user is able to add/edit/delete/list all `Consults` which he has scheduled with a current `Student`.
** *Highlights*: A separate consult panel that displays all of the user's `Consults` exist for the user to easily keep track of all his consults.
Any consults that are overdue are also highlighted in red, to remind the user to delete these outdated consults.

* *Minor enhancement*: added a history command that allows the user to navigate to previous commands using up/down keys.
* *Major enhancement*: Added a calendar view for TAble.
** *What it does*: Added a calendar view that displays all the `Consults`, `Tutorials` and `Reminders` for the user.
** *Highlights*: This calendar is able to show the number of `Consults`, `Tutorials` and `Reminders` that occurs on a given day in one view, without any information being ommitted.
** Credits: _{Code for the Calendar Window adapted from https://github.com/SirGoose3432/javafx-calendar/blob/master/src/FullCalendarView.java}_

* *Code contributed*: [https://nus-cs2103-ay1920s2.github.io/tp-dashboard/#search=&sort=totalCommits%20dsc&sortWithin=title&since=2020-02-14&timeframe=commit&mergegroup=false&groupSelect=groupByRepos&breakdown=false&tabOpen=true&tabType=authorship&tabAuthor=hanchingyong&tabRepo=AY1920S2-CS2103-W15-3%2Fmain%5Bmaster%5D[RepoSense - Code Report]]

* *All code contributed*: [https://nus-cs2103-ay1920s2.github.io/tp-dashboard/#search=hanchingyong&sort=groupTitle&sortWithin=title&since=2020-02-14&timeframe=commit&mergegroup=false&groupSelect=groupByRepos&breakdown=false[RepoSense - Code Report]]

* *Other contributions*:

** Project management:
***
** Enhancements to existing features:
*** To be Updated
*** Raised issues that needed to be solved and provided some solutions to these problems. [https://github.com/AY1920S2-CS2103-W15-3/main/issues?q=is%3Aissue+involves%3Ahanchingyong[Issues raised/discussed]]
** Documentation:
*** Added Consults feature in User Guide: https://github.com[#0]
*** Added Consults user stories and use cases.
** Community:
*** To be updated
*** Contributed in the `Consult` and `Calendar` sections of the User Guide:
*** Contributed in the `Consult` and `Calendar` sections of the Developer Guide: which includes the class diagram for `Consults`, activity diagram for `addConsult` command and a sequence diagram for the creation of the Calendar. More details on these are covered below.
** Tools:
*** Helped to set up Travis-CI and Netifly.
** Summary of contributions:
*** Created over [https://github.com/AY1920S2-CS2103-W15-3/main/pulls?q=is%3Apr+author%3Ahanchingyong[35 pull requests]] on GitHub
*** Reviewed over [https://github.com/AY1920S2-CS2103-W15-3/main/pulls?q=is%3Apr+reviewed-by%3Ahanchingyong[36 pull requests]]on GitHub

_{you can add/remove categories in the list above}_

== Contributions to the User Guide

Expand All @@ -44,10 +47,23 @@ _{you can add/remove categories in the list above}_

include::../UserGuide.adoc[tag=Consult]

include::../UserGuide.adoc[tag=Calendar]

== Contributions to the Developer Guide

|===
|_Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project._
|===

_To be updated_
include::../DeveloperGuide.adoc[tag=consult]

include::../DeveloperGuide.adoc[tag=calendar]

== Use Cases

include::../DeveloperGuide.adoc[tag=hc]

== Instructions for Manual Testing
include::../DeveloperGuide.adoc[tag=hc1]


Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@
* An Immutable StudentTAble that is serializable to JSON format.
*/
@JsonRootName(value = "addressbook")
class JsonSerializableAddressBook {
class JsonSerializableStudentStorage {

public static final String MESSAGE_DUPLICATE_STUDENT = "Students list contains duplicate student(s).";

private final List<JsonAdaptedStudent> students = new ArrayList<>();

/**
* Constructs a {@code JsonSerializableAddressBook} with the given students.
* Constructs a {@code JsonSerializableStudentStorage} with the given students.
*/
@JsonCreator
public JsonSerializableAddressBook(@JsonProperty("students") List<JsonAdaptedStudent> students) {
public JsonSerializableStudentStorage(@JsonProperty("students") List<JsonAdaptedStudent> students) {
this.students.addAll(students);
}

/**
* Converts a given {@code ReadOnlyStudent} into this class for Jackson use.
*
* @param source future changes to this will not affect the created {@code JsonSerializableAddressBook}.
* @param source future changes to this will not affect the created {@code JsonSerializableStudentStorage}.
*/
public JsonSerializableAddressBook(ReadOnlyStudent source) {
public JsonSerializableStudentStorage(ReadOnlyStudent source) {
students.addAll(source.getStudentList().stream().map(JsonAdaptedStudent::new).collect(Collectors.toList()));
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/storage/JsonStudentStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public Optional<ReadOnlyStudent> readStudentTAble() throws DataConversionExcepti
public Optional<ReadOnlyStudent> readStudentTAble(Path filePath) throws DataConversionException {
requireNonNull(filePath);

Optional<JsonSerializableAddressBook> jsonAddressBook = JsonUtil.readJsonFile(
filePath, JsonSerializableAddressBook.class);
Optional<JsonSerializableStudentStorage> jsonAddressBook = JsonUtil.readJsonFile(
filePath, JsonSerializableStudentStorage.class);
if (!jsonAddressBook.isPresent()) {
return Optional.empty();
}
Expand Down Expand Up @@ -74,7 +74,7 @@ public void saveStudentTAble(ReadOnlyStudent studentTAble, Path filePath) throws
requireNonNull(filePath);

FileUtil.createIfMissing(filePath);
JsonUtil.saveJsonFile(new JsonSerializableAddressBook(studentTAble), filePath);
JsonUtil.saveJsonFile(new JsonSerializableStudentStorage(studentTAble), filePath);
}

}
3 changes: 2 additions & 1 deletion src/main/java/seedu/address/ui/consult/ConsultCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ public ConsultCard(Consult consult, int displayedIndex) {
if (consult.getEndDateTime().isBefore(nowDateTime)) {
cardPane.setStyle("-fx-background-color: " + OVERDUE_CONSULT_BACKGROUND + ";");
}

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm dd-MMM-YY");
id.setText(displayedIndex + ". ");
beginDateTime.setText("Start: " + consult.getBeginDateTime().format(formatter));
endDateTime.setText("End: " + consult.getEndDateTime().format(formatter));
eventLocation.setText("Location: " + consult.getLocation().toString());
studentName.setText(consult.getStudentName().toString());

logger.fine(consult.getLocation().toString());
logger.fine(consult.getStudentName().toString());

}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/view/ConsultListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.FlowPane?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
Expand Down
Loading

0 comments on commit d46e056

Please sign in to comment.