diff --git a/docs/DeveloperGuide.adoc b/docs/DeveloperGuide.adoc index cd8cdd59165e..6df3f6d68e93 100644 --- a/docs/DeveloperGuide.adoc +++ b/docs/DeveloperGuide.adoc @@ -565,14 +565,14 @@ each `Cca` contains the a `Budget` and a set of transaction `Entries`. The budge It implements the following commands: - * `create_cca` -- Creates a CCA with a given budget. + * `create` -- Creates a CCA with a given budget. * `delete_cca` -- Deletes a specified CCA. - * `update` -- Updates the details of the CCA. + * `update` -- Updates the details of a specified CCA. * `add_trans` -- Adds a transaction entry to a specified CCA. * `delete_trans` -- Deletes a transaction entry to a specified CCA. - * `budget` -- Shows the transaction information of each CCA + * `budget` -- Shows the transaction information of each CCA. -However, only the implementation of `create_cca`, `update`, `add_trans` and `budget` will be discussed. +However, only the implementation of `create`, `update`, `add_trans` and `budget` will be discussed. ===== Create Command The `create` mechanism is facilitated by `BudgetBook` and `BudgetBookStorage`. @@ -591,7 +591,7 @@ These operations are exposed in the `Model` interface as: Given below is an example usage scenario and how the create cca mechanism behaves at each step. -Step 1. The user create a new CCA by including the `CCA name` and the 'budget` allocated to the CCA. +Step 1. The user creates a new CCA by including the `CCA name` and the `budget` allocated to the CCA. Step 2. `create` command checks for existing CCA name using `BudgetBook#hasCca(Cca toAdd)`. If a CCA with the same name exists, the CCA is not created. Otherwise, it is added into the `BudgetBook` in the `Model`. @@ -601,25 +601,25 @@ Step 3. `BudgetBook#addCca(Cca cca)` then invokes `ModelManger#indicateBudgetBoo `BudgetBookChangedEvent`, which is handled by `EventsCenter`. Step 4. `BudgetBookChangedEvent` is then handled by `StorageManager#handleBudgetBookChangedEvent(BudgetBookChangedEvent -event)`. `StorageManager#saveBudgetBook(ReadOnlyBudgetBook data)` is then called to write the update the existing +event)`. `StorageManager#saveBudgetBook(ReadOnlyBudgetBook data)` is then called to update the existing `ccabook.xml` file with the new CCA. The following sequence diagram shows how the create operation works: -.Sequence diagram for create CCA command image::CreateCcaCommandSequenceDiagram.png[width="1500"] +_Figure 4.4.1.1: Sequence diagram for create command_ ===== Update Command The `update` mechanism is facilitated by `BudgetBook` and `BudgetBookStorage`. When a CCA is getting updated, it looks up the `BudgetBook` in the `BudgetBookStorage` of the `Model` for the CCA to -update. It then update the `Cca` stored inside the `ccabook.xml` file in the local directory. +update. It then updates the `Cca` stored inside the `ccabook.xml` file in the local directory. It implements the following commands: * `BudgetBook#updateCca(Cca targetCca, Cca editedCca)` -- Updates an existing CCA in the `BudgetBook` in `Model`. -* `BudgetBook#commitBudgetBook()` -- Save a current version of the budget book in the `VersionedBudgetBook`. +* `BudgetBook#commitBudgetBook()` -- Saves a current version of the budget book in the `VersionedBudgetBook`. * `UpdateCommand#createEditedCca(Cca ccaToEdit, EditCcaDescriptor editCcaDescriptor)` -- Creates an updated version of the target CCA. -* `TransactionMath#updateDetails(Cca cca)` -- Update the `Spent` and `Outstanding` amount of the specified CCA. +* `TransactionMath#updateDetails(Cca cca)` -- Updates the `Spent` and `Outstanding` amount of the specified CCA. These operations are exposed in the `Model` interface as: @@ -630,30 +630,29 @@ These operations are exposed in the `Model` interface as: Given below is an example usage scenario and how the update cca mechanism behaves at each step: -Step 1. The user specified the CCA to be updated by including the CCA name and the fields to update. +Step 1. The user specifies the CCA to be updated by including the CCA name and the fields to update. -Step 2. The user can update the head's name, vice-head's name, budget allocated, and the details of a transaction entry -such as its date, amount involved and remarks for the transaction. These information is stored in the -`UpdateCommand#EditCcaDescriptor`. Any fields that are not valid will display error message. +Step 2. The user can update the head's name, the vice-head's name, the budget allocated, and the details of a +transaction entry such as its date, amount involved and remarks for the transaction. These information is stored in the +`UpdateCommand#EditCcaDescriptor`. Any fields that are not valid will display an error message. Step 3. `update` command then checks for existing CCA name using `BudgetBook#hasCca(CcaName ccaName)`. If the cca name - does not exists, an error message will appear. Otherwise, the updated CCA will be created from the + does not exist, an error message will appear. Otherwise, the updated CCA will be created from the `UpdateCommand#EditCcaDescriptor` using `UpdateCommand#createEditedCca(Cca ccaToEdit, EditCcaDescriptor editCcaDescriptor)`. -Step 4. `BudgetBook#updateCca(Cca targetCca, Cca editedCca)` then replace the existing CCA with the updated CCA and -then invoke `ModelManger#indicateBudgetBookChange()` to raise a `BudgetBookChangedEvent`, which is handled by +Step 4. `BudgetBook#updateCca(Cca targetCca, Cca editedCca)` then replaces the existing CCA with the updated CCA and +invokes `ModelManger#indicateBudgetBookChange()` to raise a `BudgetBookChangedEvent`, which is handled by `EventsCenter`. -Step 5. `BudgetBookChangedEvent` is then handled by `StorageManager#handleBudgetBookChangedEvent(BudgetBookChangedEvent +Step 5. `BudgetBookChangedEvent` is handled by `StorageManager#handleBudgetBookChangedEvent(BudgetBookChangedEvent event)`. `StorageManager#saveBudgetBook(ReadOnlyBudgetBook data)` is then called to replace the specified CCA in the the existing `ccabook.xml` with the updated CCA and its information. The following sequence diagram shows how the update operation works: -.Sequence diagram for update command image::UpdateCommandSequenceDiagram.png[width="1500"] - +_Figure 4.4.1.2: Sequence diagram for update command_ ===== Add_Transaction Command @@ -664,8 +663,8 @@ local directory. It implements the following commands: * `BudgetBook#updateCca(Cca targetCca, Cca editedCca)` -- Updates an existing CCA in the `BudgetBook` in `Model`. -* `BudgetBook#commitBudgetBook()` -- Save a current version of the budget book in the `VersionedBudgetBook`. -* `TransactionMath#updateDetails(Cca cca)` -- Update the `Spent` and `Outstanding` amount of the specified CCA. +* `BudgetBook#commitBudgetBook()` -- Saves a current version of the budget book in the `VersionedBudgetBook`. +* `TransactionMath#updateDetails(Cca cca)` -- Updates the `Spent` and `Outstanding` amount of the specified CCA. These operations are exposed in the `Model` interface as: @@ -675,37 +674,38 @@ These operations are exposed in the `Model` interface as: Given below is an example usage scenario and how the add transaction mechanism behaves at each step: -Step 1. The user specified the CCA to add transaction to by including the CCA name and the transaction fields. +Step 1. The user specifies the CCA to add transaction to by including the CCA name and the transaction fields. Step 2. The user must include the `Date`, `Amount` and `Remarks` for the transaction entry. Any fields that are not -valid will display error message. +valid will display an error message. Step 3. `add_trans` command then checks for existing CCA name using `BudgetBook#hasCca(CcaName ccaName)`. If the -cca name does not exists, an error message will appear. Otherwise, the an `Entry` is created and is added to the +cca name does not exist, an error message will appear. Otherwise, the `Entry` is created and is added to the target `Cca` using `Cca#AddNewTransaction(Entry entry)`. Step 4. The `Spent` and `Outstanding` is then updated using `TransactionMath#updateDetails(Cca cca)`. -Step 5. `BudgetBook#updateCca(Cca targetCca, Cca editedCca)` then replace the existing CCA with the updated CCA and -then invoke `ModelManger#indicateBudgetBookChange()` to raise a `BudgetBookChangedEvent`, which is handled by +Step 5. `BudgetBook#updateCca(Cca targetCca, Cca editedCca)` then replaces the existing CCA with the updated CCA and +invokes `ModelManger#indicateBudgetBookChange()` to raise a `BudgetBookChangedEvent`, which is handled by `EventsCenter`. -Step 6. `BudgetBookChangedEvent` is then handled by `StorageManager#handleBudgetBookChangedEvent(BudgetBookChangedEvent +Step 6. `BudgetBookChangedEvent` is handled by `StorageManager#handleBudgetBookChangedEvent(BudgetBookChangedEvent event)`. `StorageManager#saveBudgetBook(ReadOnlyBudgetBook data)` is then called to replace the specified CCA in the the existing `ccabook.xml` with the updated CCA and its transaction entry. -The following sequence diagram shows how the add_trans operation works: +The following sequence diagram shows how the add transaction operation works: .Sequence diagram for update command image::AddTransCommandSequenceDiagram.png[width="1500"] +__Figure 4.4.1.3: Sequence diagram for add_trans command_ ===== Budget Command The `budget` mechanism is facilitated by `BudgetBook` and `BudgetBookStorage`. -It opens ups a separate window to display the CCA information and its transaction history of the . It implements the +It opens up a separate window to display the CCA information and its transaction history. It implements the following command: -* `EventsCenter#getInstance() -- Get the instance of the EventsCenter. -* `EventsCenter#post(E event) -- Post an event to the event bus. +* `EventsCenter#getInstance() -- Gets the instance of the EventsCenter. +* `EventsCenter#post(E event) -- Posts an event to the event bus. Given below is an example usage scenario and how the budget mechanism behaves at each step. @@ -716,7 +716,7 @@ and the `CcaName` is null. Step 3. If the CCA is specified, the `budget` command checks whether the CCA specified exist. -Step 4. `budget` command then raise a `ShowBudgetViewEvent`, which is handled by `EventsCenter`. +Step 4. `budget` command then raises a `ShowBudgetViewEvent`, which is handled by `EventsCenter`. Step 5. `ShowBudgetViewEvent` is handled by `MainWindow#handleShowBudgetEvent(ShowBudgetViewEvent event)` and invokes `MainWindow#handleBudget(CcaName ccaName)`. This opens the budget window through `BudgetWindow#show(CcaName ccaName)`. @@ -728,6 +728,7 @@ Step 6. It then checks whether the CCA name is present in `BudgetWindow#fillInne The following activity diagram summarizes what happens when a user executes a budget command: image::BudgetCommandActivityDiagram.png[width="650"] +__Figure 4.4.1.4: Activity diagram for budget command_ ==== Design Considerations diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc index 2ef1f9bdfda5..63ef7d4b0843 100644 --- a/docs/UserGuide.adoc +++ b/docs/UserGuide.adoc @@ -24,7 +24,7 @@ Hallper is a desktop app for the JCRC that allows *for better and faster managem == Quick Start . Ensure you have Java version `9` or later installed in your Computer. -. Download the latest `Hallper.jar` link:{repoURL}/releases[here]. +. Download the latest `Hallper.jar` https://github.com/CS2103-AY1819S1-W16-1/main/releases[here]. . Copy the file to the folder you want to use as the home folder for your Hallper. . Double-click the file to start the app. The GUI should appear in a few seconds. @@ -214,27 +214,6 @@ Deletes the 2nd resident in Hallper. `delete 1` + Deletes the 1st resident in the results of the `find` command. -==== Deleting a transaction entry : `delete_trans` - -Deletes the specified transaction entry from the specified CCA from Hallper. + -Format: `delete_trans c/NAME_OF_CCA trans/ENTRY_NUMBER` - -**** -* Deletes the specific transaction entry from the CCA with the specified name. -* The transaction entry number must be a *positive interger* (e.g. 1,2,3,4...). -**** - -[NOTE] -==== -* The CCA specifed must exist in the Hallper. -* The transaction entry number must exist for the specified CCA. -==== - -Examples: - -* `delete_cca c/netball trans/1` -* `delete_cca c/Basketball F trans/3` - // tag::import[] ==== Importing residents information : `import` @@ -252,17 +231,17 @@ Format: `import f/FILEPATH` File format examples for importable `.xml` files are as shown below: image::AddressBookExample.png[width="790"] -_Figure 4.1.10.1: Resident information example. Multiple `persons` can be specified._ +_Figure 4.1.9.1: Resident information example. Multiple `persons` can be specified._ image::CCAListExample.png[width="790"] -_Figure 4.1.10.2: CCA list example. Residents are identified by their unique room number. Multiple `room` can be +_Figure 4.1.9.2: CCA list example. Residents are identified by their unique room number. Multiple `room` can be specified for multiple `cca`._ image::BudgetBookExample.png[width="790"] -_Figure 4.1.10.3: Budget book information example. Multiple `transaction` can be specified for multiple `ccas`._ +_Figure 4.1.9.3: Budget book information example. Multiple `transaction` can be specified for multiple `ccas`._ image::TransactionsExample.png[width="790"] -_Figure 4.1.10.4: Transaction information example. Multiple `transaction` can be specified._ +_Figure 4.1.9.4: Transaction information example. Multiple `transaction` can be specified._ Example: @@ -274,6 +253,30 @@ Imports `data.xml` file to be read and for Hallper to be updated accordingly. === Viewing Hallper This section lists features related to viewing all or specific contacts in Hallper. +==== Listing all persons : `list` + +Shows a list of all persons in Hallper. + +Format: `list` + +==== Locating persons by name: `find` +Finds persons whose names contain any of the given keywords. + +Format: `find KEYWORD [MORE_KEYWORDS]` + +**** +* The search is case insensitive. e.g `hans` will match `Hans` +* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans` +* Only the name is searched. +* Only full words will be matched e.g. `Han` will not match `Hans` +* Persons matching at least one keyword will be returned (i.e. `OR` search). e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` +**** + +Examples: + +* `find John` + +Returns `john` and `John Doe` +* `find Betsy Tim John` + +Returns any person having names `Betsy`, `Tim`, or `John` + // tag::search[] ==== Searching all persons under specified tag : `search` @@ -305,31 +308,6 @@ Searches Hallper and lists all residents that are staying in room `A123`. * `search basketball A123 Soc` + // end::search[] -==== Locating persons by name: `find` -Finds persons whose names contain any of the given keywords. + -Format: `find KEYWORD [MORE_KEYWORDS]` - -**** -* The search is case insensitive. e.g `hans` will match `Hans` -* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans` -* Only the name is searched. -* Only full words will be matched e.g. `Han` will not match `Hans` -* Persons matching at least one keyword will be returned (i.e. `OR` search). e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` -**** - -Examples: - -* `find John` + -Returns `john` and `John Doe` -* `find Betsy Tim John` + -Returns any person having names `Betsy`, `Tim`, or `John` - -==== Listing all persons : `list` - -Shows a list of all persons in Hallper. + -Format: `list` -image::list.png[width="790"] - ==== Selecting a person: `select` Selects the person identified by the index number used in the displayed person list. @@ -582,7 +560,7 @@ This section lists features related to CCA budget management in Hallper. ==== Adding a cca: `create` Adds a CCA to Hallper. + -Format: `create n/NAME_OF_CCA budget/500` +Format: `create n/NAME_OF_CCA budget/ALLOCATED_BUDGET` [TIP] ==== @@ -613,8 +591,8 @@ Format: `add_trans c/NAME_OF_CCA date/DATE amount/AMOUNT remarks/REMARKS` Examples: * `add_trans c/Basketball date/31.01.2018 amount/-200 remarks/Competition Fee` + -Adds a transaction entry to `Basketball`. The date, amount and remarks of the transaction entry are `31.01 -.2018`, `-200` and `Competition Fee` respectively. +Adds a transaction entry to `Basketball`. The date, amount and remarks of the transaction entry are `31.01.2018`, + `-200` and `Competition Fee` respectively. ==== Deleting a cca : `delete_cca` @@ -666,7 +644,8 @@ Format: `update c/CCA_NAME [n/NEW_CCA_NAME] [h/NAME_OF_HEAD] [vh/NAME_OF_VIC_HEA **** * At least one of the optional fields must be provided. -* When `trans/` is included, at least one of the fields in the transaction entry must be provided. +* When `trans/` is included, at least one of the fields in the transaction entry must be provided. The transaction +fields are `date`, `amount` and `remarks`. * Existing values will be updated to the input values. **** @@ -694,18 +673,22 @@ respectively. Opens up a Budget Book in a new window. + Format: `budget [c/CCA_NAME]` - -.Budget Window with a blank screen image::BudgetWindowEmpty.png[width="500"] +_Figure 4.5.6.1: Budget Window with a blank screen_ + -.Budget Window showing the transaction history of Softball image::BudgetWindowCca.png[width=500"] +_Figure 4.5.6.2: Budget Window showing the transaction history of Softball_ + **** * `budget` shows the list of CCAs existing in Hallper. * If `c/` is used, the new window will open up, showing the transaction information of the CCA specified. * Otherwise, the new window will open up and show a blank screen until a CCA is selected from the CCA panel. **** +image::BudgetWindowCcaPanel.png[width=500"] +_Figure 4.5.6.3: CCA panel of the Budget Window._ + [NOTE] ==== The CCA specifed must exist in the Hallper. @@ -857,17 +840,19 @@ e.g. `delete_event month/Oct year/2018 sdate/10 edate/10 title/Block Committee A e.g. `view_calendar month/Oct year/2018` ===== Budget and CCA -* *Add Transaction* : `add_transaction CCA AMOUNT TYPE PERSON-IN-CHARGE` + -e.g. `add_transaction soccer 500 debit James` -* *Budget* : `budget` -* *Create CCA Budget* : `create n/CCA bud/BUDGET` + -e.g. `create Basketball 500` -* *Delete CCA* : `delete_cca CCA` + -e.g. `delete_cca basketball` -* *Modify CCA* : `modify_cca CCA BUDGET` + -e.g. `modify_cca basketball 500` -* *View CCA* : `view_cca CCA` + -e.g. `view_cca basketball` +* *Add CCA* : `create n/CCA bud/BUDGET` + +e.g. `create n/Basketball budget/500` +* *Add Transaction* : `add_trans c/NAME_OF_CCA date/DATE amount/AMOUNT remarks/REMARKS` + +e.g. `add_trans c/Basketball date/31.01.2018 amount/-200 remarks/Competition Fee` +* *Delete CCA* : `delete_cca c/CCA` + +e.g. `delete_cca c/basketball` +* *Delete Transaction* : `delete_trans c/NAME_OF_CCA trans/ENTRY_NUMBER` + +e.g. `delete_trans c/netball trans/1` +* *Update CCA Details* : `update c/CCA_NAME [n/NEW_CCA_NAME] [h/NAME_OF_HEAD] [vh/NAME_OF_VIC_HEAD] [budget/BUDGET] +[trans/ENTRY_NUMBER] [date/DATE] [amount/AMOUNT] [remarks/REMARKS]` + +e.g. `update c/track n/Track F h/Alice vh/June Ong budget/500 trans/1 date/28.02.2018 amount/100 remarks/Fund Raising` +* *View CCAs' budget* : `budget [c/CCA_NAME]` + +e.g. `budget c/basketball` ===== Miscellaneous * *Exit* : `exit` diff --git a/docs/team/ericyjw.adoc b/docs/team/ericyjw.adoc index 08191458dd45..d6636708ee11 100644 --- a/docs/team/ericyjw.adoc +++ b/docs/team/ericyjw.adoc @@ -13,14 +13,14 @@ The purpose of this portfolio is to document the contributions I have done to th what the project is about. This project is undertaken by myself and four other Computer Science students as part of our Software Engineering -module.Titled as Hallper, our project is a desktop application specially designed for the Junior Common Room +module. Titled as Hallper, our project is a desktop application specially designed for the Junior Common Room Committee (JCRC). The JCRC is a student representative body from every Hall in National University of Singapore, responsible for managing student affairs. Hallper aims to facilitate the JCRC in its day-to-day management by providing a combined platform that encompasses different functions that are mainly used by the JCRC. This allows the JCRC to carry out its duties more efficiently and systematically. -The user keys in specific commands on Hallper which allows him to create emails, calendar events and manage the -Hall's budget -- all of the main concerns of the JCRC addressed on a single platform. +To use Hallper, the user keys in specific commands to create emails, calendar events and manage the Hall's +budget -- all of the main concerns of the JCRC addressed on a single platform. == Summary of contributions @@ -64,8 +64,11 @@ window. https://github.com/CS2103-AY1819S1-W16-1/main/pull/16[#16]) *** Arrange the command in alphabetical order: https://github.com/CS2103-AY1819S1-W16-1/main/pull/113/commits/59679dc3edf8c607b42ed6fd02889aa79d8f7152[#113] +*** Vet the User Guide, Developer Guide and About Us: +(Pull request: https://github.com/CS2103-AY1819S1-W16-1/main/pull/168) + ** Enhancement: -*** Increase the code coverage from 51% to 62%: (Pull request: https://github.com/CS2103-AY1819S1-W16-1/main/pull/162[#162]) +*** Increase the code coverage from 68% to 81%: (Pull request: https://github.com/CS2103-AY1819S1-W16-1/main/pull/162[#162]) == Contributions to the User Guide diff --git a/src/main/java/seedu/address/logic/commands/ImageCommand.java b/src/main/java/seedu/address/logic/commands/ImageCommand.java index 7cd2955cad16..f27bad8294ab 100644 --- a/src/main/java/seedu/address/logic/commands/ImageCommand.java +++ b/src/main/java/seedu/address/logic/commands/ImageCommand.java @@ -39,7 +39,7 @@ public class ImageCommand extends Command { * otherwise " " (a blank string) becomes a valid input. */ public static final String PROFILE_PICTURE_VALIDATION_REGEX = - "(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*\\.(jpg))"; + "(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*\\.(jpg))"; public static final String COMMAND_WORD = "image"; public static final String MESSAGE_USAGE = COMMAND_WORD + ": Uploads a profile picture to the resident of " diff --git a/src/main/java/seedu/address/model/person/ProfilePicture.java b/src/main/java/seedu/address/model/person/ProfilePicture.java index cd5fc98f00c9..bd5aaca12312 100644 --- a/src/main/java/seedu/address/model/person/ProfilePicture.java +++ b/src/main/java/seedu/address/model/person/ProfilePicture.java @@ -13,7 +13,7 @@ public class ProfilePicture { public static final String PROFILE_PICTURE_VALIDATION_REGEX = - "(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*\\.(jpg))"; + "(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*\\.(jpg))"; public static final String MESSAGE_PROFILE_PICTURE_CONSTRAINTS = "Profile picture should only be a .jpg file, and not empty"; diff --git a/src/main/java/seedu/address/model/util/SampleDataUtil.java b/src/main/java/seedu/address/model/util/SampleDataUtil.java index 5fac49184e63..42fc6085cbdc 100644 --- a/src/main/java/seedu/address/model/util/SampleDataUtil.java +++ b/src/main/java/seedu/address/model/util/SampleDataUtil.java @@ -53,8 +53,8 @@ private static Cca[] getSampleCcas() { return new Cca[]{ new Cca( new CcaName("Hockey"), - new Name("MrYanDao"), - new Name("XiaoMing"), + new Name("Alex Yeoh"), + new Name("Bernice Yu"), new Budget(500), new Spent(300), new Outstanding(200), @@ -66,8 +66,8 @@ private static Cca[] getSampleCcas() { ), new Cca( new CcaName("Floorball"), - new Name("XiaoBitch"), - new Name("RisLow"), + new Name("Charlotte Oliveiro"), + new Name("David Li"), new Budget(600), new Spent(500), new Outstanding(100), @@ -78,8 +78,8 @@ private static Cca[] getSampleCcas() { ), new Cca( new CcaName("Handball"), - new Name("Steven Lim"), - new Name("Bumble Bee"), + new Name("Irfan Ibrahim"), + new Name("Roy Balakrishnan"), new Budget(100), new Spent(100), new Outstanding(0), diff --git a/src/main/resources/ProfileWindow.html b/src/main/resources/ProfileWindow.html index 61d0126b3cf5..7c9013adaab6 100644 --- a/src/main/resources/ProfileWindow.html +++ b/src/main/resources/ProfileWindow.html @@ -4,12 +4,12 @@ Profile of $name - Profile of $name -

Name : $name

-

CCA : $cca

-

Room : $room

-

Number : $number

-

School : $school

-

Email : $email

+Profile of $name +

Name : $name

+

CCA : $cca

+

Room : $room

+

Number : $number

+

School : $school

+

Email : $email

diff --git a/src/test/java/seedu/address/logic/commands/ImageCommandTest.java b/src/test/java/seedu/address/logic/commands/ImageCommandTest.java index e5d8d183fbd9..10d7ca250158 100644 --- a/src/test/java/seedu/address/logic/commands/ImageCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/ImageCommandTest.java @@ -50,7 +50,7 @@ public void execute_nullResident_throwsNullPointerException() { @Test public void execute_invalidFile_throwsCommandException() { ImageCommand imageCommand = new ImageCommand(new Room(VALID_ROOM), - new File(IMAGE_COMMAND_TEST_DATA_FOLDER + INVALID_IMAGE)); + new File(IMAGE_COMMAND_TEST_DATA_FOLDER + INVALID_IMAGE)); String expectedMessage = ImageCommand.FILE_PATH_ERROR; @@ -60,7 +60,7 @@ public void execute_invalidFile_throwsCommandException() { @Test public void execute_invalidResident_throwsCommandException() { ImageCommand imageCommand = new ImageCommand(new Room(INVALID_ROOM), - new File(IMAGE_COMMAND_TEST_DATA_FOLDER + VALID_IMAGE)); + new File(IMAGE_COMMAND_TEST_DATA_FOLDER + VALID_IMAGE)); String expectedMessage = ImageCommand.MESSAGE_NO_SUCH_PERSON; @@ -70,7 +70,7 @@ public void execute_invalidResident_throwsCommandException() { @Test public void execute_noSuchFile_throwsCommandException() { ImageCommand imageCommand = new ImageCommand(new Room(VALID_ROOM), - new File(IMAGE_COMMAND_TEST_DATA_FOLDER + "NoSuchFile.jpg")); + new File(IMAGE_COMMAND_TEST_DATA_FOLDER + "NoSuchFile.jpg")); String expectedMessage = ImageCommand.INVALID_IMAGE_ERROR; @@ -80,15 +80,15 @@ public void execute_noSuchFile_throwsCommandException() { @Test public void execute_validFile_success() { ImageCommand imageCommand = new ImageCommand(ALICE.getRoom(), - new File(IMAGE_COMMAND_TEST_DATA_FOLDER + VALID_IMAGE)); + new File(IMAGE_COMMAND_TEST_DATA_FOLDER + VALID_IMAGE)); String expectedMessage = String.format(ImageCommand.MESSAGE_SUCCESS, ALICE); Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), - new BudgetBook(model.getBudgetBook()), new UserPrefs(), model.getExistingEmails()); + new BudgetBook(model.getBudgetBook()), new UserPrefs(), model.getExistingEmails()); Person editedPerson = new Person(ALICE.getName(), ALICE.getPhone(), ALICE.getEmail(), - ALICE.getRoom(), ALICE.getSchool(), - new ProfilePicture(Paths.get(VALID_ROOM.toLowerCase() + ".jpg")), ALICE.getTags()); + ALICE.getRoom(), ALICE.getSchool(), + new ProfilePicture(Paths.get(VALID_ROOM.toLowerCase() + ".jpg")), ALICE.getTags()); expectedModel.updatePerson(ALICE, editedPerson); expectedModel.commitAddressBook(); @@ -101,16 +101,16 @@ public void equals() { Room aliceRoom = ALICE.getRoom(); Room bobRoom = BOB.getRoom(); ImageCommand imageAliceCommand = new ImageCommand(aliceRoom, - new File(IMAGE_COMMAND_TEST_DATA_FOLDER + VALID_IMAGE)); + new File(IMAGE_COMMAND_TEST_DATA_FOLDER + VALID_IMAGE)); ImageCommand imageBobCommand = new ImageCommand(bobRoom, - new File(IMAGE_COMMAND_TEST_DATA_FOLDER + VALID_IMAGE)); + new File(IMAGE_COMMAND_TEST_DATA_FOLDER + VALID_IMAGE)); // same object -> returns true assertTrue(imageAliceCommand.equals(imageAliceCommand)); // same values -> returns true ImageCommand imageAliceCommandCopy = new ImageCommand(aliceRoom, - new File(IMAGE_COMMAND_TEST_DATA_FOLDER + VALID_IMAGE)); + new File(IMAGE_COMMAND_TEST_DATA_FOLDER + VALID_IMAGE)); assertTrue(imageAliceCommand.equals(imageAliceCommandCopy)); // different types -> returns false diff --git a/src/test/java/seedu/address/logic/parser/ImageCommandParserTest.java b/src/test/java/seedu/address/logic/parser/ImageCommandParserTest.java index b004b48a9f3e..8bc7f5321633 100644 --- a/src/test/java/seedu/address/logic/parser/ImageCommandParserTest.java +++ b/src/test/java/seedu/address/logic/parser/ImageCommandParserTest.java @@ -15,7 +15,7 @@ public class ImageCommandParserTest { private static final String MESSAGE_INVALID_FORMAT = - String.format(MESSAGE_INVALID_COMMAND_FORMAT, ImageCommand.MESSAGE_USAGE); + String.format(MESSAGE_INVALID_COMMAND_FORMAT, ImageCommand.MESSAGE_USAGE); private ImageCommandParser parser = new ImageCommandParser(); @@ -38,10 +38,10 @@ public void parse_notJpgPath_throwsParseException() { public void parse_validArgs_returnsImageCommand() { // path that ends with '.jpg' and room ImageCommand expectedImageCommand = - new ImageCommand(new Room("A123"), - new File("C:\\Users\\javen\\OneDrive\\Pictures\\Saved Pictures\\Default.jpg")); + new ImageCommand(new Room("A123"), + new File("C:\\Users\\javen\\OneDrive\\Pictures\\Saved Pictures\\Default.jpg")); assertParseSuccess(parser, - " r/A123 f/C:\\Users\\javen\\OneDrive\\Pictures\\Saved Pictures\\Default.jpg", - expectedImageCommand); + " r/A123 f/C:\\Users\\javen\\OneDrive\\Pictures\\Saved Pictures\\Default.jpg", + expectedImageCommand); } } diff --git a/src/test/java/seedu/address/model/person/ProfilePictureTest.java b/src/test/java/seedu/address/model/person/ProfilePictureTest.java index 40b1e2021253..1b983cd88743 100644 --- a/src/test/java/seedu/address/model/person/ProfilePictureTest.java +++ b/src/test/java/seedu/address/model/person/ProfilePictureTest.java @@ -27,7 +27,7 @@ public void constructor_invalidProfilePicture_throwsIllegalArgumentException() { @Test public void isValidRoom() { // null room - Assert.assertThrows(NullPointerException.class, () ->ProfilePicture.isValidProfilePicture(null)); + Assert.assertThrows(NullPointerException.class, () -> ProfilePicture.isValidProfilePicture(null)); // invalid profile picture assertFalse(ProfilePicture.isValidProfilePicture(Paths.get(""))); // empty path diff --git a/src/test/java/seedu/address/storage/ProfilePictureDirStorageTest.java b/src/test/java/seedu/address/storage/ProfilePictureDirStorageTest.java index e69018b32045..29b60e0d362b 100644 --- a/src/test/java/seedu/address/storage/ProfilePictureDirStorageTest.java +++ b/src/test/java/seedu/address/storage/ProfilePictureDirStorageTest.java @@ -40,7 +40,7 @@ private BufferedImage readProfilePicture(File file) throws IOException { UserPrefs userPrefs = new UserPrefs(); try { return new ProfilePictureDirStorage(userPrefs.getProfilePicturePath(), - userPrefs.getOutputProfilePicturePath()).readProfilePicture(file); + userPrefs.getOutputProfilePicturePath()).readProfilePicture(file); } catch (IOException e) { throw e; } diff --git a/src/test/java/systemtests/SearchCommandSystemTest.java b/src/test/java/systemtests/SearchCommandSystemTest.java index d2808eab8da0..cbe889d230dc 100644 --- a/src/test/java/systemtests/SearchCommandSystemTest.java +++ b/src/test/java/systemtests/SearchCommandSystemTest.java @@ -150,11 +150,12 @@ public void search() { * {@code AddressBookSystemTest#assertApplicationDisplaysExpected(String, String, Model)}.
* Also verifies that the status bar remains unchanged, and the command box has the default style class, and the * selected card updated accordingly, depending on {@code cardStatus}. + * * @see AddressBookSystemTest#assertApplicationDisplaysExpected(String, String, Model) */ private void assertCommandSuccess(String command, Model expectedModel) { String expectedResultMessage = String.format( - MESSAGE_PERSONS_LISTED_OVERVIEW, expectedModel.getFilteredPersonList().size()); + MESSAGE_PERSONS_LISTED_OVERVIEW, expectedModel.getFilteredPersonList().size()); executeCommand(command); assertApplicationDisplaysExpected("", expectedResultMessage, expectedModel); @@ -169,6 +170,7 @@ private void assertCommandSuccess(String command, Model expectedModel) { * {@code AddressBookSystemTest#assertApplicationDisplaysExpected(String, String, Model)}.
* Also verifies that the browser url, selected card and status bar remain unchanged, and the command box has the * error style. + * * @see AddressBookSystemTest#assertApplicationDisplaysExpected(String, String, Model) */ private void assertCommandFailure(String command, String expectedResultMessage) {