diff --git a/docs/DeveloperGuide.adoc b/docs/DeveloperGuide.adoc index 2531dd9f33de..e80a0ba45cfe 100644 --- a/docs/DeveloperGuide.adoc +++ b/docs/DeveloperGuide.adoc @@ -153,8 +153,9 @@ This section covers how Augustine is designed while also providing an overview o === Architecture Design +[caption="Figure 1: "] +.Architecture Diagram image::Architecture.png[width="600"] -_Figure 4.1 : Architecture Diagram_ The *_Architecture Diagram_* given above explains the high-level design of Augustine. Given below is a quick overview of each component. @@ -189,8 +190,9 @@ Each of the five components (UI, Logic, Model, Storage and Email) For example, the `Logic` component (see the class diagram given below) defines it's API in the `Logic.java` interface and exposes its functionality using the `LogicManager.java` class. +[caption="Figure 2: "] +.Class diagram of the Logic component. image::LogicClassDiagram.png[width="800"] -_Figure 4.1.1 : Class Diagram of the Logic Component_ ==== @@ -202,16 +204,18 @@ Augustine implements an Event-drive architecture style as explained below. The _Sequence Diagram_ below shows how the components interact for the scenario where the user issues the command `delete 1`. +[caption="Figure 3: "] +.Component interactions for `delete 1` command (part 1) image::SDforDeletePerson.png[width="800"] -_Figure 1 : Component interactions for `delete 1` command (part 1)_ [NOTE] The `Model` simply raises an `AddressBookChangedEvent` when the Address Book data are changed, instead of asking the `Storage` to save the updates to the hard disk. The diagram below shows how the `EventsCenter` reacts to that event, which eventually results in the updates being saved to the hard disk and the status bar of the UI being updated to reflect the 'Last Updated' time. +[caption="Figure 4: "] +.Component interactions for `delete 1` command (part 2) image::SDforDeletePersonEventHandling.png[width="800"] -_Figure 2 : Component interactions for `delete 1` command (part 2)_ [NOTE] The event is propagated through the `EventsCenter` to the `Storage` and `UI` without the `Model` having to be coupled to either of them. This is an example of how this Event Driven approach helps us reduce direct coupling between components. @@ -224,8 +228,9 @@ This section covers an overview of some of the components in the architecture. ==== UI component +[caption="Figure 5: "] +.Structure of the UI component image::UiClassDiagram.png[width="800"] -_Figure 4.3.1 : Structure of the UI component_ *API* : link:{repoURL}/src/main/java/seedu/address/ui/Ui.java[`Ui.java`] @@ -242,17 +247,17 @@ The `UI` component, ==== Logic component The Logic Component is where the user input is being parsed and the corresponding commands are being called from. The newly created command is then executed and depending on the -command executed, the Model component may be accessed. - -_Figure X_ below shows an Overview of the process within Logic Component. +command executed, the Model component may be accessed. (see Figure 6). +[caption="Figure 6: "] +.Class diagram of the Logic component image::LogicClassDiagram.png[width="800"] -_Figure X : Class Diagram of the Logic Component_ -_Figure X_ below shows the detailed process of how the Command class in the Logic Component works +_Figure 7_ below shows the detailed process of how the Command class in the Logic component works. +[caption="Figure 7: "] +.Structure of commands in Logic component image::LogicCommandClassDiagram.png[width="800"] -_Figure X : Structure of Commands in the Logic Component. This diagram shows finer details concerning `XYZCommand` and `Command` in Figure 4.3.1a_ *API* : link:{repoURL}/src/main/java/seedu/address/logic/Logic.java[`Logic.java`] @@ -277,16 +282,18 @@ If there is no relevant CommandParser, AddressBookParser will call the Command i . the result of the Command which is stored in CommandResult will then be returned to LogicManager . The CommandResult is then returned to `handleCommandInputChange` method in the UI Component for display to the user. -_Figure X_ below shows the sequence diagram of the process within the Component when the command +_Figure 8_ below shows the sequence diagram of the process within the Component when the command `Delete 1` is entered by the user. +[caption="Figure 8: "] +.Sequence diagram within the Logic component for the `delete 1` command image::DeletePersonSdForLogic.png[width="800"] -_Figure X : Sequence Diagram within the Logic Component for the `delete 1` Command_ ==== Model component +[caption="Figure 9: "] +.Structure of the Model component image::ModelClassDiagram.png[width="800"] -_Figure 4.4.3 : Structure of the Model component_ *API* : link:{repoURL}/src/main/java/seedu/address/model/Model.java[`Model.java`] @@ -300,8 +307,9 @@ The `Model` component, ==== Email component +[caption="Figure 10: "] +.Structure of the Email component image::EmailComponent.png[width="800"] -_Figure 4.3.4 : Structure of the Email component_ *API* : link:{repoURL}/src/main/java/seedu/address/email/Email.java[`Email.java`] @@ -315,8 +323,9 @@ The `Email` component, // tag::StorageComponent[] ==== Storage component +[caption="Figure 11: "] +.Structure of the Storage component image::StorageClassDiagram.png[width="800"] -_Figure 4.3.5 : Structure of the Storage component_ *API* : link:{repoURL}/src/main/java/seedu/address/storage/Storage.java[`Storage.java`] @@ -346,6 +355,8 @@ The undo/redo mechanism is facilitated by an `UndoRedoStack`, which resides insi ===== UndoableCommands +[caption="Figure 12: "] +.Logic command class diagram image::LogicCommandClassDiagram.png[width="800"] As you can see from the above diagram, `UndoableCommand` adds an extra layer between the abstract `Command` class and concrete commands that can be undone, such as the `DeleteCommand`. Note that extra tasks needs to be done when executing a command in an _undoable_ way, such as saving the state of the address book before execution. `UndoableCommand` contains the high-level algorithm for those extra tasks while its child classes implements the details of the specific command. Note that this technique of putting the high-level algorithm in the parent class and lower-level steps of the algorithm in child classes is also known as the https://www.tutorialspoint.com/design_pattern/template_pattern.htm[template pattern]. @@ -387,10 +398,14 @@ Suppose that the user has just launched the application. The `UndoRedoStack` wil The user executes a new `UndoableCommand`, `delete 5`, to delete the 5th person in the address book. The current state of the address book is saved before the `delete 5` command executes. The `delete 5` command will then be pushed onto the `undoStack` (the current state is saved together with the command). +[caption="Figure 13: "] +.Undo Redo starting stack diagram image::UndoRedoStartingStackDiagram.png[width="800"] As the user continues to use the program, more commands are added into the `undoStack`. For example, the user may execute `add n/David ...` to add a new person. +[caption="Figure 14: "] +.Undo Redo new command stack diagram image::UndoRedoNewCommand1StackDiagram.png[width="800"] [NOTE] @@ -400,6 +415,8 @@ The user now decides that adding the person was a mistake, and decides to undo t We will pop the most recent command out of the `undoStack` and push it back to the `redoStack`. We will restore the address book to the state before the `add` command executed. +[caption="Figure 15: "] +.Undo Redo execute undo stack diagram image::UndoRedoExecuteUndoStackDiagram.png[width="800"] [NOTE] @@ -407,6 +424,8 @@ If the `undoStack` is empty, then there are no other commands left to be undone, The following sequence diagram shows how the undo operation works: +[caption="Figure 16: "] +.Undo Redo sequence diagram image::UndoRedoSequenceDiagram.png[width="800"] The redo does the exact opposite (pops from `redoStack`, push to `undoStack`, and restores the address book to the state after the command is executed). @@ -416,14 +435,20 @@ If the `redoStack` is empty, then there are no other commands left to be redone, The user now decides to execute a new command, `clear`. As before, `clear` will be pushed into the `undoStack`. This time the `redoStack` is no longer empty. It will be purged as it no longer make sense to redo the `add n/David` command (this is the behavior that most modern desktop applications follow). +[caption="Figure 17: "] +.Undo Redo new command stack diagram image::UndoRedoNewCommand2StackDiagram.png[width="800"] Commands that are not undoable are not added into the `undoStack`. For example, `list`, which inherits from `Command` rather than `UndoableCommand`, will not be added after execution: +[caption="Figure 18: "] +.Undo Redo new command stack diagram image::UndoRedoNewCommand3StackDiagram.png[width="800"] The following activity diagram summarize what happens inside the `UndoRedoStack` when a user executes a new command: +[caption="Figure 19: "] +.Undo Redo activity diagram image::UndoRedoActivityDiagram.png[width="200"] ===== Design Considerations @@ -511,15 +536,15 @@ A user may not know all the details of a contact when adding the contact into Au and the Email of a contact to add the contact into Augustine. Unfilled details of a contact will be given a '-' value instead to denote that the detail is not filled up by the user. -_Figure X_ below shows you the sequence diagram of the process within Augustine when a user adds a contact. +_Figure 20_ below shows you the sequence diagram of the process within Augustine when a user adds a contact. -[caption="Figure X: "] +[caption="Figure 20: "] .Sequence diagram of add command. image::AddCommandSequenceDiagram.png[width="900"] ===== Implementation Details -As seen in _Figure X_ above, the `AddCommandParser` class is used to parse the input entered by the user into the different fields for a contact. +As seen in _Figure 20_ above, the `AddCommandParser` class is used to parse the input entered by the user into the different fields for a contact. In `AddCommandParser`, Augustine will do the following. + @@ -596,10 +621,10 @@ When adding a new contact, Augustine will do the following. For example. if `add n/John Doe e/john@example.com dp/photo.jpg` is executed, Augustine will copy the photo `photo.jpg` to `data/images` folder and also name the copied photo as `john@example.com.jpg`. -_Figure X_ below shows the activity diagram of the Image Storage Mechanism during an add command. +_Figure 21_ below shows the activity diagram of the Image Storage Mechanism during an add command. -[caption="Figure X: "] -.Activity Diagram of Image Storage Mechanism +[caption="Figure 21: "] +.Activity diagram of Image Storage Mechanism image::addPhotoActivityDiagram.png[width="900"] ===== During edit command @@ -714,16 +739,16 @@ To edit, the same command is use, new `lessonType` and `lessonSlot` will overwri The diagram below shows how the command handles different flags. -[caption="Figure 3.6.1: "] -.Activity Diagram of NusmodsCommands +[caption="Figure 22: "] +.Activity diagram of NusmodsCommands image::NusmodsCommandActivityDiagram.png[width="500"] ===== Storing NUSmodules in the AddressBook.xml To store in the AddressBook.xml, `NusModules` needs to be able to converted into XML format and back (see part in red border in class diagram below). -[caption="Figure 3.6.2: "] -.Class Diagram of Storage +[caption="Figure 23: "] +.Class diagram of Storage image::StorageClassDiagramNusmods.png[width="500"] In the xml, the data will be stored as such: @@ -999,7 +1024,7 @@ The sections below will explain how the email mechanism works and some of the de Augustine makes use of the email command to send an email. The activity diagram shows what happens when the user enters the email command. -[caption="Figure 28. "] +[caption="Figure 24: "] .Activity diagram for email image::EmailActivityDiagram.png[] @@ -1015,19 +1040,19 @@ The sequence diagram below shows how the component interacts with one another wh [NOTE] *Email* in diagram below = “email em/message to send es/subject el/adam@gmail.com:password et/send” -[caption="Figure 29. "] +[caption="Figure 25: "] .Component level sequence diagram for email image::EmailSequenceDiagramComponent.png[] The sequence diagram below shows how the `Email` component interacts with the 3 email classes that facilitates the email process when the user enters an email command. -[caption="Figure 30. "] +[caption="Figure 26: "] .Sequence diagram for email image::EmailSequenceDiagramEmail.png[] -The diagram below shows how the email draft tab in the Augustine User interface (UI) is updated when the `EventCenter` reacts to the `EmailDraftChangedEvent` in Figure 29. +The diagram below shows how the email draft tab in the Augustine User interface (UI) is updated when the `EventCenter` reacts to the `EmailDraftChangedEvent` in Figure 25. -[caption="Figure 31. "] +[caption="Figure 27: "] .Events Driven Nature of Email image::EmailSequenceDiagramEvents.png[width="700"] @@ -1226,8 +1251,8 @@ the `SetStyle` method from the Java API we can easily update the colour to highl **Alternative 2 (current choice):** Using a separate tab + * **Pros:** User can check for upcoming birthdays without affecting the regular functionality of Augustine. There - is no need for the contact list to be resorted every time, and the birthday tab updates in real-time. + -* **Cons:** As extra tab is harder to implement, and the constant checking of birthdates for sorting and highlighting + is no need for the contact list to be re-sorted every time, and the birthday tab updates in real-time. + +* **Cons:** An extra tab is harder to implement, and the constant checking of birthdates for sorting and highlighting might cost some performance. + ==== --- @@ -1237,14 +1262,14 @@ the `SetStyle` method from the Java API we can easily update the colour to highl **Alternative 1:** To allow any reasonable date formats such as d/mm, dd/m, dd.mm.yy , dd-mm-yyyy + * **Pros:** Users have more control over their preferred formats. + -* **Cons:** Extremely difficult to account for the different variations and their permutations, causing the sort +* **Cons:** Extremely difficult to account for the different variations and all their permutations, causing the sort implementation to be overly complicated. + ==== ==== **Alternative 2 (current choice):** Restrict input to dd/mm/yyyy + * **Pros:** Consistent and simpler implementation. + -* **Cons:** More restrictive, user might intuitively try to input a date like 1/12/1983 and cause an error prompt. + +* **Cons:** More restrictive, user might intuitively try to input a date like 1/12/1983 which Augustine would reject. + ==== // end::birthday[] @@ -1255,15 +1280,17 @@ implementation to be overly complicated. + === Instagram Tab The Instagram tab is facilitated by the `Model`, `Logic`, and `UI` components. It allows the user to view a contact's -Instagram profile page. If a contact does not contain username information, the tab will redirect the user to +Instagram profile page. If a contact does not contain the necessary username information, the tab will redirect the user to Instagram's home page. ===== Implementation Details -The following diagram (Figure 5.10.1) highlights the flow of logic when the user inputs the Instagram command: +The following diagram (Figure 28) highlights the flow of logic when the user inputs the Instagram command: + -image::InstagramDiagram.png[width="900"] -_Figure 5.10.1 : Flow of Instagram command_ +[caption="Figure 28: "] +.Flow of Instagram command +image::InstagramDiagram.png[width="813"] There are several components that are key to the implementation this functionality: @@ -1281,7 +1308,7 @@ field even if the information is not available, an `if` statement allows us to g the case of unavailable information. Instagram profile page URLs are formatted as such: `https://www.instagram.com//`, so it is a simple matter of -appending the contact's userID to `https://www.instagram.com/` to load the required page. +appending the contact's UserId to `https://www.instagram.com/` to load the required page. [source, java] ---- @@ -1302,18 +1329,19 @@ public void loadInsta(ReadOnlyPerson person) { ==== **Alternative 1:** Using Instagram's API to search Instagram with the contact's `Name`. + -* **Pros:** Huge benefit to user convenience since a user is not likely to include Instagram IDs when adding new contacts. + -* **Cons:** As of recent years, Instagram has significantly restricted its API usage permissions, we would not be able to implement this - without going through a permissions request and Instagram's approval, which seems excessive for a student project. + +* **Pros:** Huge benefit to user convenience since a user is not likely to have Instagram IDs of every contact. + +* **Cons:** As of recent years, Instagram has significantly restricted its API usage, we would not be able to implement this + without going through a permissions request and Instagram's approval, which is excessive for a student project. + ==== ==== **Alternative 2 (current choice):** Redirect to homepage + -* **Pros:** Much simpler to implement at the moment. + +* **Pros:** Much simpler to implement. User can still do a manual search from the homepage. + * **Cons:** Not as convenient as Alternative 1 for the user. + ==== // end::insta[] +--- // tag::backup[] === Backup function @@ -1321,10 +1349,17 @@ The Backup function allows the user to save his existing data on a backup file. ===== Implementation Details -The following diagram shows the high-level logic of the Backup command: +`Model` simply raises a `BackupAddressBookEvent` when the command is executed, instead of directly asking `Storage` to +save the backup file to the hard disk. The event is propagated through the `EventsCenter` to the +`Storage` and `UI` without `Model` having to be coupled to either of them, helping to reduce direct coupling between +components. + + +The diagram below shows how the various components react to this command: +[caption="Figure 29: "] +.High-level logic of backup command image::BackupDiagram.png[width="1000"] -_Figure 5.11.1 : High-level logic of backup command_ // end::backup[] == Documentation @@ -1359,8 +1394,9 @@ Here are the steps to convert the project documentation files to PDF format. . Within Chrome, click on the `Print` option in Chrome's menu. . Set the destination to `Save as PDF`, then click `Save` to save a copy of the file in PDF format. For best results, use the settings indicated in the screenshot below. +[caption="Figure 30: "] +.Saving documentation as PDF files in Chrome image::chrome_save_as_pdf.png[width="300"] -_Figure 6.3.1 : Saving documentation as PDF files in Chrome_ == Testing diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc index d2cc1524aea7..e4cde984892d 100644 --- a/docs/UserGuide.adoc +++ b/docs/UserGuide.adoc @@ -249,7 +249,7 @@ Here are some examples to guide you with editing contacts in Augustine: . [red]*Adding and removing tags* + -- -You can add or remove the tags to/from a particular contact using the [fuchsia]`edit` command below (See Figures 6 and 7). +You can add or remove the tags to/from a particular contact using the [fuchsia]`edit` command below (see Figure 6). [horizontal] *Command:* :: [fuchsia]`edit 2 t/colleagues t/friends` @@ -720,7 +720,7 @@ The Birthdays tab lists all your existing contacts starting from the contact wit **** *Things to take note:* + -* You cannot edit Augustine data using with reference to the contacts' ordering in the Birthdays tab. You should be referring to the main Contact List tab +* You cannot edit Augustine data using the contacts' ordering in the Birthdays tab. You should be referring to the main Contact List tab to make changes to the data. * You do not need to manually update the Birthdays tab, any changes made to the data will be reflected in both the Contact List and Birthdays tab automatically. @@ -728,7 +728,7 @@ and Birthdays tab automatically. [TIP] The contact whose birthday is today (according to system time) will be highlighted in blue. Send him your well wishes! -(See Figure 20) +(see Figure 20) [caption="Figure 20. "] .Birthdays tab with highlighted contact diff --git a/docs/team/hengyu.adoc b/docs/team/hengyu.adoc index e7caa845120d..24608065e864 100644 --- a/docs/team/hengyu.adoc +++ b/docs/team/hengyu.adoc @@ -3,10 +3,9 @@ ifdef::env-github,env-browser[:outfilesuffix: .adoc] :imagesDir: ../images :stylesDir: ../stylesheets -== Project: AddressBook - Level 4 -AddressBook - Level 4 is a desktop address book application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 6 kLoC. +== Project: Augustine -*Code contributed*: [https://github.com/CS2103AUG2017-W14-B2/main/blob/master/collated/main/hengyu95.md[Functional code]] [https://github.com/CS2103AUG2017-W14-B2/main/blob/master/collated/test/hengyu95.md[Test code]] {give links to collated code files} +*Code contributed*: [https://github.com/CS2103AUG2017-W14-B2/main/blob/master/collated/main/hengyu95.md[Functional code]] [https://github.com/CS2103AUG2017-W14-B2/main/blob/master/collated/test/hengyu95.md[Test code]] === Enhancement Added: Birthdate Field/Tab @@ -95,3 +94,7 @@ include::../DeveloperGuide.adoc[tag=backup] #End of Extract# --- + +==== Other contributions + +* Proofreader of the user and developer guides. diff --git a/docs/team/ritchie.html b/docs/team/ritchie.html new file mode 100644 index 000000000000..b5a18f7dbd06 --- /dev/null +++ b/docs/team/ritchie.html @@ -0,0 +1,743 @@ + + + + + + + +Ritchie Lam Qiaowei - Project Portfolio + + + + + + +
+
+

Project: Augustine

+
+
+
+
Code contributed
+
+

Functional Code: [Main file] [Reused Code]
+Test Code: [Main file] [Reused Code]

+
+
+
+
+

Enhancement Added: Modified How Edit Command Due With Tags

+
+

Tags now get toggled instead of being overwritten with what the user wrote.

+
+
+

External behavior

+
+
+

Start of Extract [from: User Guide]

+
+
+
+
+

Editing a contact: edit

+
+

The edit command modifies a contact in Augustine.

+
+
+
Format
+
+

The format of the edit command is as follows:

+
+
+
+
+

edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [b/BIRTHDATE] [insta/USER_ID] [t/TAG]…​

+
+
+
+
+
+
+

Things to take note:

+
+
+
    +
  • +

    The command edits the contact at the specified INDEX.

    +
    +
      +
    • +

      INDEX refers to the index number shown in the list of contacts.

      +
    • +
    • +

      The index must be a whole number (1, 2, 3, …​).

      +
    • +
    +
    +
  • +
  • +

    At least one of the optional fields must be filled.

    +
  • +
  • +

    When editing tags, new tags will be added to the contact and existing tags will be removed. (See Example 1)

    +
  • +
  • +

    For the rest of the fields, existing values will be replaced by the new ones.

    +
  • +
  • +

    NAME and TAG must only consist of alphabets and/or numbers.

    +
  • +
  • +

    You can remove all of the contact’s tags by typing just t/ without specifying the tags.

    +
  • +
  • +

    PHONE_NUMBER of the contact must contain exactly 8 numbers and start with '6','8' or '9'.

    +
  • +
+
+
+
+
+ + + + + +
+ + +You can also use the alias e instead of typing out edit. +
+
+
+ + + + + +
+ + +You cannot edit someone to have the exact same details as another contact. +
+
+
+
+
Examples
+
+

Here are some examples to guide you with editing contacts in Augustine:

+
+
+
    +
  1. +

    Adding and removing tags

    +
    +
    +
    +

    You can add or remove the tags to/from a particular contact using the edit command below (see Figure 6).

    +
    +
    + + + + + +
    +Command: + +

    edit 2 t/colleagues t/friends

    +
    +
    +
    +
      +
    • +

      Since Bernice was already tagged under "colleagues", this command removes the tag "colleagues" from Bernice.

      +
    • +
    • +

      Since Bernice was not already tagged under "friends", this command adds the "friends" tag to Bernice.

      +
    • +
    +
    +
    +
    +editChangeTag +
    +
    Figure 6. Before and after the command’s execution
    +
    +
    +
    +
  2. +
  3. +

    Changing phone number and email

    +
    +
    +
    +

    You can change the phone number and email of a particular contact using edit command below (see Figure 7).

    +
    +
    + + + + + +
    +Command: + +

    edit 2 p/87921929 e/bernice@example.com

    +
    +
    +
    +
      +
    • +

      The command will change the phone number of Bernice to 87921929 and her email to bernice@example.com.

      +
    • +
    +
    +
    +
    +editChangePhone +
    +
    Figure 7. Before and after the command’s execution
    +
    +
    +
    +
    +
  4. +
+
+
+

End of Extract

+
+
+
+
+

Justification

+
+

The user will not need to re-type all the existing tags when adding or removing just one.

+
+
+
+
+
+

Enhancement Added: Nusmods Command

+
+

External behavior

+
+
+

Start of Extract [from: User Guide]

+
+
+
+
+

Using NUSmods: nusmods

+
+

Augustine is integrated with https://nusmods.com. +You can use the nusmods command to add, edit or delete modules from a contact’s timetable.

+
+
+

Before adding modules to contacts, you will need to open config.json and enter the current academic year. +The config file can be found in the same folder as Augustine.

+
+
+
Format
+
+

The format of the nusmods command is as follows:

+
+
+
+
+

nusmods INDEX t/<add|delete|url> m/<MODULE_CODE|URL> [LESSON_TYPE/LESSON_SLOT]…​

+
+
+
+
+
+
+

Things to take note:

+
+
+
    +
  • +

    This command changes the modules of the contact at the specified INDEX.

    +
  • +
  • +

    INDEX refers to the index number shown in the the list of contacts.

    +
  • +
  • +

    The index must be a whole number (1, 2, 3, …​).

    +
  • +
  • +

    t/ is followed by "add", "delete" or "url".

    +
    +
      +
    • +

      "t/add" will require m/MODULE_CODE and at least one LESSON_TYPE/LESSON_SLOT

      +
      +
        +
      • +

        LESSON_TYPE refers to the lesson type. Here is a list of possible lesson types:

        +
        +
          +
        • +

          Dlec

          +
        • +
        • +

          Lec

          +
        • +
        • +

          Lab

          +
        • +
        • +

          Plec

          +
        • +
        • +

          Ptut

          +
        • +
        • +

          Rec

          +
        • +
        • +

          Sec

          +
        • +
        • +

          Sem

          +
        • +
        • +

          Tut

          +
        • +
        • +

          Tut2

          +
        • +
        • +

          Tut3

          +
        • +
        +
        +
      • +
      • +

        LESSON_SLOT is to indicate which slot the contact is allocated to. For example, "tut/5" means that he belongs in tutorial group 5.

        +
      • +
      • +

        You can use "t/add" to update lesson slots too.

        +
      • +
      +
      +
    • +
    • +

      "t/delete" will require m/MODULE_CODE only.

      +
    • +
    • +

      "t/url" will require m/URL.

      +
      +
        +
      • +

        URL is a NUSmods URL which already contains all the modules. This will make it easy to share entire timetables instead of manually inserting modules one by one.

        +
      • +
      • +

        This will overwrite all existing modules the contact had.

        +
      • +
      +
      +
    • +
    +
    +
  • +
+
+
+
+
+ + + + + +
+ + +You can also use the alias nm instead of typing out nusmods. +
+
+
+ + + + + +
+ + +Most students in NUS use NUSmods, ask them for their timetable URL to save time populating Augustine! +
+
+
+
+
Example
+
+

Here are some examples of using the nusmods command:

+
+
+
    +
  1. +

    Inputting timetable with URL

    +
    +
    +
    +

    The following command will overwrite the timetable of the contact listed at index 1 with the timetable given in the URL. +You can copy the URL from your friend and paste it into Augustine.

    +
    +
    + + + + + +
    +Command: + +

    nusmods 1 t/url m/https://nusmods.com/timetable/2017-2018/sem1?cs2101[SEC]=5&CS2103T[TUT]=T5&MA1101R[LAB]=B01&MA1101R[LEC]=SL2&MA1101R[TUT]=T13&CS2010[LEC]=1&CS2010[LAB]=6&CS2010[TUT]=5&GET1020[LEC]=L1

    +
    +
    +
    +
    +
  2. +
  3. +

    Adding or updating a module and its time slots

    +
    +
    +
    +

    The following command will add the module MA1101R 's tutorial group T13 and lecture slot SL2 to the timetable of the contact listed at index 2.

    +
    +
    + + + + + +
    +Command: + +

    nusmods 2 t/add m/MA1101R lec/SL2 tut/T13

    +
    +
    +
    +
    +
  4. +
  5. +

    Removing a module from a contact

    +
    +
    +
    +

    The following command will remove the module CS2010 from the timetable of the contact listed at index 2.

    +
    +
    + + + + + +
    +Command: + +

    nusmods 2 t/remove m/CS2010

    +
    +
    +
    +
    +
  6. +
+
+
+

End of Extract

+
+
+
+
+

Implementation

+
+
+

Start of Extract [from: Developer Guide]

+
+
+
+
+

NUSmods integration

+
+

Each contact in Augustine can be contain a NUSmodules which stores all their modules and lesson slots. +Augustine utilizes https://nusmods.com to display through the browser. The current academic year and semester is set inside config.json

+
+
+
Implementation details
+
+

Timetables are stored in NusModules class and each Person will have a NusModules if they have a timetable. +NusModules uses a HashMap<String moduleCode, HashMap<String lessonType, String lessonSlot>> to store the modules.

+
+
+
+
nusmods Command
+
+

Modules are added, edited and deleted using the nusmod command. +The command will be phase by NusmodCommandParser and executed in NusmodCommand. +As NusmodCommand changes the AddressBook.xml, it will inherit from UndoableCommands. +A flag will be used to tell if the user wants to parse a url, add or delete a module.

+
+
+

The command nusmod 2 t/add m/CS1231 sec/2 tut/9 will modify the schedule of the second person in the list +by adding a module with the moduleCode CS1231 with the lessonType "sec" and "tut", with lessonSlot 2 and 9 respectively.

+
+
+

To edit, the same command is use, new lessonType and lessonSlot will overwrite previous data. To delete, nusmod 2 t/delete m/CS1231 can be used.

+
+
+

The diagram below shows how the command handles different flags.

+
+
+
+NusmodsCommandActivityDiagram +
+
Figure 22 : Activity diagram of NusmodsCommands
+
+
+
+
Storing NUSmodules in the AddressBook.xml
+
+

To store in the AddressBook.xml, NusModules needs to be able to converted into XML format and back (see part in red border in class diagram below).

+
+
+
+StorageClassDiagramNusmods +
+
Figure 23 : Class diagram of Storage
+
+
+

In the xml, the data will be stored as such:

+
+
+
+
<nusModule moduleCode="CS1231">
+    <lesson lessonType="SEC">2</lesson>
+    <lesson lessonType="TUT">9</lesson>
+</nusModule>
+<nusModule moduleCode="CS2010">
+    <lesson lessonType="SEC">1</lesson>
+    <lesson lessonType="TUT">2</lesson>
+    <lesson lessonType="LEC">3</lesson>
+</nusModule>
+
+
+
+
+
Process converting from AddressBook.xml to NUSModule (see code snippets below):
+
+
+
    +
  1. +

    In XMLAdaptedPerson, a ArrayList is created and each <nusModule> from AddressBook.xml file will an XMLAdaptedNusModule in it.

    +
  2. +
  3. +

    Each XMLAdaptedNusModule will read the moduleCode and get the corresponding list of lessons by calling XMLAdaptedModuleLessons

    +
  4. +
  5. +

    XMLAdaptedModuleLessons will read the lessonType and respective lesson slot and return those values.

    +
  6. +
+
+
+
+
+
+
+
public class XmlAdaptedPerson {
+    ...
+    @XmlElement(name = "nusModule")
+    private List<XmlAdaptedNusModule> nusModules = new ArrayList<>();
+    ...
+}
+
+
+
+
+
public class XmlAdaptedNusModule {
+    @XmlAttribute
+    private String moduleCode;
+    @XmlElement(name = "lesson")
+    private List<XmlAdaptedModuleLessons> nusLessons = new ArrayList<>();
+    ...
+}
+
+
+
+
+
public class XmlAdaptedModuleLessons {
+
+    @XmlAttribute
+    private String lessonType;
+    @XmlValue
+    private String lessonSlot;
+    ...
+}
+
+
+
+

Converting from NUSModule back to AddressBook.xml is simply a similar process in reverse. +Both XMLAdaptedNusModule and XMLAdaptedModuleLessons have methods for converting to and fro.

+
+
+
+
Design considerations
+
+

Aspect: Displaying of schedule

+
+
+
+
+

Alternative 1: Use javafx to draw the schedule

+
+
+
    +
  • +

    Pros: Flexibility with visuals and capabilities

    +
  • +
  • +

    Cons: Much more work will need to be done.

    +
  • +
+
+
+
+
+
+
+

Alternative 2 (current choice): Use browser to go to NusMods and use their system to display the schedule

+
+
+
    +
  • +

    Pros: Need to do less work as much of the framework is already done

    +
  • +
  • +

    Cons: Less flexibility and reliance on external servers which might be subjected to changes. Also limited to NUS modules.

    +
  • +
+
+
+
+
+
+

Aspect: Storing of schedule

+
+
+
+
+

Alternative 1(current choice): Store it as a HashMap<String moduleCode, HashMap<String lessonType, String lessonSlot>>

+
+
+
    +
  • +

    Pros: Easier to modify and extend with other features, more readable in xml

    +
  • +
  • +

    Cons: More complicated to store in xml

    +
  • +
+
+
+
+
+
+
+

Alternative 2: Store it as one long string that is similar to the query to nusmods

+
+
+
    +
  • +

    Pros: As it is a single string, it will be easier to store. And being the same format as the query, less work needs to be done when fetching the webpage

    +
  • +
  • +

    Cons: Need to parse when want to modify part of the string, then reformat it back into a string, which can be inefficient

    +
  • +
+
+
+
+
+
+

Aspect: Command to edit timetables

+
+
+
+
+

Alternative 1(current choice): Create new command to add/edit timetables

+
+
+
    +
  • +

    Pros: Codebase can be kept neater as it will be more cohesive

    +
  • +
  • +

    Cons: User will need to know more commands

    +
  • +
+
+
+
+
+
+
+

Alternative 2: Modify currently existing Edit command to handle timetables too

+
+
+
    +
  • +

    Pros: User will not need to know more commands

    +
  • +
  • +

    Cons: It can be confusing for user if one command does too many things, also reduce cohesion in the program.

    +
  • +
+
+
+
+
+
+

End of Extract

+
+
+
+

Justification

+
+

This will allow augustine users to view their friends timetable so it is easy for them to find out when they are free to meet up. +It is a separate command from edit because it will need many fields and it will cause too much confusion to the user to overload the edit command. +The type of command (add/delete/url) is taken in as a parameter so that the user only needs to remember one command.

+
+
+
+
+

Enhancement Added: Shortcut menu

+
+

External behavior

+
+

Users can press Ctrl-Z and Ctrl-Y to undo and redo respectively.
+Users can press Page up and Page down to scroll through the contact list.

+
+
+
+

Justification

+
+

Ctrl-Z and Ctrl-Y are common across many applications.
+Augustine did not have a good way of going through the contact list without using the mouse previously.

+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/src/main/java/seedu/address/model/person/Name.java b/src/main/java/seedu/address/model/person/Name.java index fa34d62f7f6f..e19a8271c85b 100644 --- a/src/main/java/seedu/address/model/person/Name.java +++ b/src/main/java/seedu/address/model/person/Name.java @@ -29,10 +29,8 @@ public class Name { public Name(String name) throws IllegalValueException { requireNonNull(name); String trimmedName = name.trim(); - if (!trimmedName.equals("-")) { - if (!isValidName(trimmedName)) { - throw new IllegalValueException(MESSAGE_NAME_CONSTRAINTS); - } + if (!isValidName(trimmedName)) { + throw new IllegalValueException(MESSAGE_NAME_CONSTRAINTS); } this.fullName = trimmedName; } diff --git a/src/test/data/ManualTesting/[W14-B2][Augustine]TestScript.adoc b/src/test/data/ManualTesting/[W14-B2][Augustine]TestScript.adoc index 90210bb18a09..096e8b28f6c8 100644 --- a/src/test/data/ManualTesting/[W14-B2][Augustine]TestScript.adoc +++ b/src/test/data/ManualTesting/[W14-B2][Augustine]TestScript.adoc @@ -113,27 +113,43 @@ This segment covers how to find contacts in Augustine's contact list tab. *Command*: [red]`find t/wiz` + *Expected*: Contact List tab will only have 2 contact: "Emma Watson", "Harry Potter" -- +''' -== Displaying contact's information +=== Adding/Editing/Deleting contacts -This section covers on command select, insta and nusmods to display the contact's information on the right browser of Augustine. +This section cover commands add, edit, delete, undo, redo and clear. ''' -- -*Command*: [red]`list` + -*Expected*: GUI will be on contact list tab, with 20 contacts listed. +*Command*: [red]`clear` + +*Expected*: Addressbook will be cleared. Contact List tab display will be empty and white. -- -== Adding/Editing/Deleting contacts +''' +-- +*Command*: [red]`undo` + +*Expected*: Contact List tab should have 20 contacts. +-- -This section covers on commands add, edit, delete, undo, redo and clear. +''' +-- +*Command*: [red]`undo` + +*Expected*: No more commands to undo! +-- ''' -- -*Command*: [red]`clear` + +*Command*: [red]`redo` + *Expected*: Addressbook will be cleared. Contact List tab display will be empty and white. -- +''' +-- +*Command*: [red]`redo` + +*Expected*: Command fails. +The display message is: + No more commands to redo! +-- + ''' -- *Command*: [red]`undo` + @@ -143,12 +159,498 @@ This section covers on commands add, edit, delete, undo, redo and clear. ''' -- *Command*: [red]`add n/Ji SukJin` + -*Expected*: Adding fail. +*Expected*: Add command fails. +The display message is: + +Invalid command format! add: Adds a person to the address book. Parameters (Both name and email address are compulsory): + +n/NAME p/PHONE e/EMAIL a/ADDRESS b/BIRTHDATE insta/INSTAGRAM ID [t/TAG]... + +Example: add n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 b/25/12/1980 dp//data/photo.jpeg t/friends t/owesMoney insta/johndoe80 +-- + +''' +-- +*Command*: [red]`add e/tester@example.com` + +*Expected*: Add command fails. +The display message is: + +Invalid command format! add: Adds a person to the address book. Parameters (Both name and email address are compulsory): + +n/NAME p/PHONE e/EMAIL a/ADDRESS b/BIRTHDATE insta/INSTAGRAM ID [t/TAG]... + +Example: add n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 b/25/12/1980 dp//data/photo.jpeg t/friends t/owesMoney insta/johndoe80 +-- + +''' +-- +*Command*: [red]`add n/tester e/tester@example.com` + +*Expected*: Command succeeds. The display message is + +New person added: tester Phone: - Email: tester@example.com Address: - Image: data/images/default.jpeg Birthdate: - User ID: - Tags: +-- + +''' +-- +*Command*: [red]`add n/tester e/tester@example.com` + +*Expected*: Command fails. The display message is + +This email is already used by a contact in Augustine. +-- + +''' +-- +*Command*: [red]`add n/tester e/tester2@example.com` + +*Expected*: Command succeeds. The display message is + +New person added: tester Phone: - Email: tester2@example.com Address: - Image: data/images/default.jpeg Birthdate: - User ID: - Tags: +-- + +''' +-- +*Command*: [red]`add n/tester e/tester3@example.com b/12-12-1995` + +*Expected*: Command fails. Invalid date entry error will be shown. +-- + +''' +-- +*Command*: [red]`add n/tester e/tester3@example.com b/12-12-1995` + +*Expected*: Command fails. The display message is + +A valid date entry is in the form of dd/mm/yyyy +-- + +''' +-- +*Command*: [red]`add n/tester e/tester3@example.com b/12/12/1995` + +*Expected*: Command succeeds. The display message is + +New person added: tester Phone: - Email: tester3@example.com Address: - Image: data/images/default.jpeg Birthdate: 12/12/1995 User ID: - Tags: +-- + +''' +-- +*Command*: [red]`add n/tester e/tester4@example.com b/12/13/1995` + +*Expected*: Command fails. The display message is + +A valid date entry is in the form of dd/mm/yyyy +-- + +''' +-- +*Command*: [red]`add n/tester e/tester4@example.com b/32/12/1995` + +*Expected*: Command fails. The display message is + +A valid date entry is in the form of dd/mm/yyyy +-- + +''' +-- +*Command*: [red]`add n/tester e/tester4@example.com b/31/11/1995` + +*Expected*: Command fails. The display message is + +A valid date entry is in the form of dd/mm/yyyy +-- + +''' +-- +*Command*: [red]`add n/tester e/tester4@example.com b/28/2/2017` + +*Expected*: Command fails. The display message is + +A valid date entry is in the form of dd/mm/yyyy +-- + +''' +-- +*Command*: [red]`add n/tester e/tester4@example.com b/29/02/2017` + +*Expected*: Command fails. The display message is + +A valid date entry is in the form of dd/mm/yyyy +-- + +''' +-- +*Command*: [red]`add n/tester e/tester4@example.com b/-01/02/2017` + +*Expected*: Command fails. The display message is + +A valid date entry is in the form of dd/mm/yyyy +-- + +''' +-- +*Command*: [red]`add n/tester e/tester4@example.com b/29/02/2016` + +*Expected*: Command succeeds. The display message is + +New person added: tester Phone: - Email: tester4@example.com Address: - Image: data/images/default.jpeg Birthdate: 29/02/2016 User ID: - Tags: +-- + +''' +-- +*Command*: [red]`add n/tester e/tester5@example.com p/12345678` + +*Expected*: Command fails. The display message is + +Phone numbers can only contain numbers, start from either 6, 8 or 9 and should be at only 8 digits long +-- + +''' +-- +*Command*: [red]`add n/tester e/tester5@example.com p/6127` + +*Expected*: Command fails. The display message is + +Phone numbers can only contain numbers, start from either 6, 8 or 9 and should be at only 8 digits long +-- + +''' +-- +*Command*: [red]`add n/tester e/tester5@example.com p/888888888` + +*Expected*: Command fails. The display message is + +Phone numbers can only contain numbers, start from either 6, 8 or 9 and should be at only 8 digits long +-- + +''' +-- +*Command*: [red]`add n/tester e/tester5@example.com p/988888888` + +*Expected*: Command fails. The display message is + +Phone numbers can only contain numbers, start from either 6, 8 or 9 and should be at only 8 digits long +-- + +''' +-- +*Command*: [red]`add n/tester e/tester5@example.com p/688888888` + +*Expected*: Command fails. The display message is + +Phone numbers can only contain numbers, start from either 6, 8 or 9 and should be at only 8 digits long +-- + +''' +-- +*Command*: [red]`add n/tester e/tester5@example.com p/6123 4567` + +*Expected*: Command fails. The display message is + +Phone numbers can only contain numbers, start from either 6, 8 or 9 and should be at only 8 digits long +-- + +''' +-- +*Command*: [red]`add n/tester e/tester5@example.com p/61234567` + +*Expected*: Command succeeds. The display message is + +New person added: tester Phone: 61234567 Email: tester5@example.com Address: - Image: data/images/default.jpeg Birthdate: - User ID: - Tags: +-- + +''' +-- +*Command*: [red]`add n/tester e/tester5@example.com p/61234567` + +*Expected*: Command succeeds. The display message is + +New person added: tester Phone: 61234567 Email: tester5@example.com Address: - Image: data/images/default.jpeg Birthdate: - User ID: - Tags: +-- + +''' +-- +*Command*: [red]`add n/tester e/tester6@example.com dp/invalidimage.png` + +*Expected*: Command fails. The display message is + +Person's photo should be in .jpg or .jpeg and preferred to be of 340px x 453px dimension. If the photo is on the local system, please provide the +absolute file path. If the photo is from the internet, ensure that the link starts with http or https and ends with .jpg or .jpeg +-- + +''' +-- +*Command*: [red]`add n/tester e/tester6@example.com dp/invalidimage.jpg` + +*Expected*: Command fails. The display message is + +Error! Photo does not exist! +-- + +''' +-- +*Command*: [red]`add n/tester e/tester6@example.com dp/data/images/default.jpeg` + +*Expected*: Command succeeds. The display message is + +New person added: tester Phone: - Email: tester6@example.com Address: - Image: data/images/default.jpeg Birthdate: - User ID: - Tags: +-- + +''' +-- +*Command*: [red]`add n/tester e/tester7@example.com dp/http://www.comp.nus.edu.sg/~anarayan/files/me.jpg` + +*Expected*: Command succeeds. The display message is + +New person added: tester Phone: - Email: tester7@example.com Address: - Image: data/download.jpg Birthdate: - User ID: - Tags: +-- + +''' +-- +*Command*: [red]`add n/tester e/tester9@example.com insta/` + +*Expected*: Command succeeds. The display message is + +New person added: tester Phone: - Email: tester9@example.com Address: - Image: data/images/default.jpeg Birthdate: - User ID: Tags: +-- + +''' +-- +*Command*: [red]`add n/tester e/tester10@example.com insta/nba` + +*Expected*: Command succeeds. The display message is + +New person added: tester Phone: - Email: tester10@example.com Address: - Image: data/images/default.jpeg Birthdate: - User ID: nba Tags: +-- + +''' +-- +*Command*: [red]`edit` + +*Expected*: Command fails. The display message is + +Invalid command format! + +edit: Edits the details of the person identified by the index number used in the last person listing. + +Apart from tags, existing values will be overwritten by the input values. + +Tags will be added if person does not have the tag and deleted otherwise. + +You can remove all the person's tags by typing `t/` without specifying any tags after it. + +Parameters: INDEX (must be a positive integer) [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [dp/PHOTO] [b/BIRTHDATE] [t/TAG]... + +[insta/INSTAGRAM ID]... + +Example: edit 1 p/91234567 e/johndoe@example.com + +-- + +''' +-- +*Command*: [red]`edit -1` + +*Expected*: Command fails. The display message is + +Invalid command format! + +edit: Edits the details of the person identified by the index number used in the last person listing. + +Apart from tags, existing values will be overwritten by the input values. + +Tags will be added if person does not have the tag and deleted otherwise. + +You can remove all the person's tags by typing `t/` without specifying any tags after it. + +Parameters: INDEX (must be a positive integer) [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [dp/PHOTO] [b/BIRTHDATE] [t/TAG]... + +[insta/INSTAGRAM ID]... + +Example: edit 1 p/91234567 e/johndoe@example.com + +-- + +''' +-- +*Command*: [red]`edit 1` + +*Expected*: Command fails. The display message is + +At least one field to edit must be provided. +-- + +''' -- +*Command*: [red]`edit 100` + +*Expected*: Command fails. The display message is + +At least one field to edit must be provided. +-- + +''' +-- +*Command*: [red]`edit 1 e/tester@example.com` + +*Expected*: Command fails. The display message is + +This person already exists in the address book. +-- + +''' +-- +*Command*: [red]`edit 100 e/tester@example.com` + +*Expected*: Command fails. The display message is + +The person index provided is invalid +-- + +''' +-- +*Command*: [red]`edit 1 e/tester` + +*Expected*: Command fails. The display message is + +Person emails should be 2 alphanumeric/period strings separated by '@' +-- + +''' +-- +*Command*: [red]`edit 1 e/tester8@example.com` + +*Expected*: Command succeeds. The display message is + +Edited Person: Baby Phone: - Email: tester8@example.com Address: Singapore Image: data/images/baby@example.com.jpg Birthdate: 01/01/2016 User ID: - Tags: [niece][baby] +-- + +''' +-- +*Command*: [red]`edit 1 dp/http://www.comp.nus.edu.sg/~anarayan/files/me.jpg` + +*Expected*: Command succeeds. Photo is now the downloaded photo. The display message is + +Edited Person: Baby Phone: - Email: tester8@example.com Address: Singapore Image: data/download.jpg Birthdate: 01/01/2016 User ID: - Tags: [niece][baby] +-- + +''' +-- +*Command*: [red]`undo` + +*Expected*: Command succeeds. Photo is now the default photo. The display message is + +Undo success! +-- + +''' +-- +*Command*: [red]`redo` + +*Expected*: Command succeeds. Photo is now the downloaded photo. The display message is + +Redo success! +-- + +''' +-- +*Command*: [red]`edit 1 dp/-` + +*Expected*: Command succeeds. Photo is now the default photo. The display message is + +Edited Person: Baby Phone: - Email: tester8@example.com Address: Singapore Image: data/images/default.jpeg Birthdate: 01/01/2016 User ID: - Tags: [niece][baby] +-- + +''' +-- +*Command*: [red]`edit 1 n/-` + +*Expected*: Command fails. The display message is + +Person name should not be blank and should consist of letters and spaces +-- + +''' +-- +*Command*: [red]`edit 1 e/-` + +*Expected*: Command fails. The display message is + +Person emails should be 2 alphanumeric/period strings separated by '@' +-- + +''' +-- +*Command*: [red]`delete` + +*Expected*: Command fails. The display message is + +Invalid command format! + +delete: Deletes the person identified by the index number used in the last person listing. + +Parameters: INDEX (must be a positive integer) + +Example: delete 1 +-- + +''' +-- +*Command*: [red]`delete -1` + +*Expected*: Command fails. The display message is + +Invalid command format! + +delete: Deletes the person identified by the index number used in the last person listing. + +Parameters: INDEX (must be a positive integer) + +Example: delete 1 +-- + +''' +-- +*Command*: [red]`delete 100` + +*Expected*: Command fails. The display message is + +The person index provided is invalid +-- + +''' +-- +*Command*: [red]`delete 1` + +*Expected*: Command succeeds. The display message is + +Deleted Person: Baby Phone: - Email: tester8@example.com Address: Singapore Image: data/images/tester8@example.com.jpg Birthdate: 01/01/2016 User ID: - Tags: [niece][baby] +-- + +''' +-- +*Command*: [red]`undo` + +*Expected*: Command succeeds. The display message is + +Undo success! +-- + +''' +-- +*Command*: [red]`redo` + +*Expected*: Command succeeds. The display message is + +Redo success! +-- + +=== Displaying a contact's Instagram profile page + +This section covers the command `insta` which displays the contact's Instagram profile on the right browser of Augustine. + +''' +-- +*Command*: [red]`edit 1 insta/arsenal` + +*Expected*: The first contact's Instagram ID will be set to `arsenal`. +-- + +''' +-- +*Command*: [red]`insta 1` + +*Expected*: Right browser will switch to the Instagram tab and load the Instagram page of `arsenal`. +-- + +''' +-- +*Command*: [red]`undo` + +*Expected*: The first contact's Instagram ID will revert back to `-`, but the browser will not automatically update +until refreshed. +-- + +''' +-- +*Command*: [red]`insta 1` + +*Expected*: Right browser will remain at the Instagram tab and load the Instagram homepage. +-- + +''' +-- +*Command*: [red]`e 1 insta/johncena` + +*Expected*: The first contact's Instagram ID will be set to `johncena`, but the browser will not automatically update +until refreshed. +-- + +''' +-- +*Command*: [red]`Left-click contact 1` + +*Expected*: Right browser will switch to the Instagram tab and load the Instagram page of `johncena`. +-- + +''' +-- +*Command*: [red]`delete 1` + +*Expected*: The first contact will be deleted, but the browser will remain at `johncena` 's page and not automatically +update until refreshed. +-- +''' +-- + +-- +=== Editing and Displaying timetable with nusmods + +This section covers nusmods command. + +''' +-- +*Command*: [red]`nusmods 1 t/url m/https://nusmods.com/timetable/2017-2018/sem1?CS2101[SEC]=5&CS2103T[TUT]=T5&MA1101R[LAB]=B01&MA1101R[LEC]=SL2&MA1101R[TUT]=T13&CS2010[LEC]=1&CS2010[LAB]=6&CS2010[TUT]=5&GET1020[LEC]=L1` + +*Expected*: Person at index 1 will be given the timetable in the url. Browser panel will switch to nusmods tab and display the timetable. + + +''' +-- +*Command*: [red]`nm 1 t/delete m/randomString` + +*Excepted*: The timetable of person will remain the same. The browser tab will refresh to show table the same timetable. + +''' +-- +*Command*: [red]`nm 1 t/d m/get1020` + +*Excepted*: The nusmods browser tab will refresh and the module "GET1020" will be removed (for person at index 1). + +''' +-- +*Command*: [red]`undo` + +*Excepted*: The contact will be deselected (browser will show a blank page) and "GET1020" will be added back (for person at index 1). + +''' +-- +*Command*: [red]`redo` + +*Excepted*: The browser tab will show the timetable. Note that "GET1020" has returned (for person at index 1). + +''' +-- +*Command*: [red]`nm 1 t/add m/cs2010 lab/7` + +*Excepted*: The nusmods browser tab will refresh and the LAB slot of module "CS2010" will be changed from 6 to 7 (for person at index 1). + +''' +-- +*Command*: [red]`select 2` + +*Excepted*: As the person at index 2 does not have a timetable yet the browser tab will tell you that you can add one. + +''' +-- +*Command*: [red]`nm 2 t/add m/cs1231` + +*Excepted*: The nusmods browser tab will refresh and show the person at index 2. The module "CS1231" will be added. The lessons slots will be randomly placed as they are not specified. + +''' +-- +*Command*: [red]`nm 2 t/add m/cs1231 sec/2 tut/28` + +*Excepted*: The nusmods browser tab will refresh and the sectional group and tutorial slot of "CS1231" will be fixed to "2" and "28" respectively (for person at index 2). + +''' +-- +*Command*: [red]`nm 2 t/add m/CS2100 lec/1 lab/8 tut/8` + +*Excepted*: The nusmods browser tab will refresh and the lecture, lab and tutorial of "CS2100" will be fixed to "1", "8" and "8" respectively (for person at index 1). + +''' +-- +*Command*: [red]`undo` + +*Excepted*: The contact will be deselected (browser will show a blank page). The module "CS2100" will be removed. + +''' +-- +*Command*: [red]`select 2` + +*Excepted*: The nusmods browser tab will show the timetable of the person at 2. It should contain CS1231 with the lesson slots previously set. And without CS2100 as an 'undo' was done. + +''' +-- +*Command*: [red]`select 1` + +*Excepted*: The nusmods browser tab will switch to the timetable of the person at 1. + -== Email contacts +=== Email contacts -This section covers on command email. +This section covers email command. ''' -- @@ -220,7 +722,7 @@ The display message is "You are unable to log in to your gmail account. Please c If email still fails to send after you use your own gmail account and password, please ensure that you have enable "allow less secure app to sign in" in your gmail account settings. Go to Google. Your Account -> Sign in and Security -> scroll down and ensure "allow less secure app:ON" is enabled. -== Backup contacts +=== Backup contacts This section covers how to backup your data. ''' @@ -228,7 +730,7 @@ This section covers how to backup your data. *Command*: [red]`backup` + *Expected*: The display message is "Data backed up at "/data/addressbook-backup.xml". There will be a addressbook-backup.xml created in the data folder. -== Miscs +=== Miscs This section covers history and exit commands. diff --git a/src/test/java/seedu/address/logic/parser/ParserUtilTest.java b/src/test/java/seedu/address/logic/parser/ParserUtilTest.java index d889ad7c49f5..7ede91311c15 100644 --- a/src/test/java/seedu/address/logic/parser/ParserUtilTest.java +++ b/src/test/java/seedu/address/logic/parser/ParserUtilTest.java @@ -81,14 +81,6 @@ public void parseName_invalidValue_throwsIllegalValueException() throws Exceptio ParserUtil.parseName(Optional.of(INVALID_NAME)); } - @Test - public void parseName_unfilledName_returnsUnfilledName() throws Exception { - Name expectedName = new Name(NOT_FILLED); - Optional actualName = ParserUtil.parseName(Optional.of("-")); - - assertEquals(expectedName, actualName.get()); - } - @Test public void parseName_validValue_returnsName() throws Exception { Name expectedName = new Name(VALID_NAME);