Skip to content

Commit

Permalink
Add updates to the UG for sort
Browse files Browse the repository at this point in the history
Helps ensure that users and developers know how to use and continue to develop the app
  • Loading branch information
jylow committed Oct 25, 2023
1 parent 69d7baa commit 10dae3d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 19 deletions.
47 changes: 31 additions & 16 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
layout: page
title: User Guide
---
Expand All @@ -8,12 +8,20 @@ optimized for use via a Command Line Interface** (CLI) while still having the be
Graphical User Interface (GUI). If you can type fast, UNOFAS can help you manage and retrieve client's information
better than traditional GUI apps.

**Table of Contents**
* Quick Start
* Features
* FAQ
* Known Issues
* Command Summary
## Table of Contents
* [Quick Start](#quick-start)
* [Features](#features)
* [Help](#viewing-help--help)
* [List](#listing-all-persons--list)
* [Edit](#editing-a-person--edit)
* [Find](#locating-persons-by-name--find)
* [Gather](#gathering-clients-emails-by-financial-plan--gather)
* [Delete](#deleting-a-clients-contact--delete)
* [Clear](#clearing-all-entries--clear)
* [Sort](#sorting-of-data--sort)
* [FAQ](#faq)
* [Known Issues](#known-issues)
* [Command Summary](#command-summary)


--------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -47,7 +55,7 @@ better than traditional GUI apps.

--------------------------------------------------------------------------------------------------------------------

## Features
# Features

<div markdown="block" class="alert alert-info">

Expand All @@ -71,8 +79,10 @@ better than traditional GUI apps.
e.g. if the command specifies `help 123`, it will be interpreted as `help`.

* If you are using a PDF version of this document, be careful when copying and pasting commands that span multiple lines as space characters surrounding line-breaks may be omitted when copied over to the application.

</div>

-----------------------
### Viewing help : `help`
> :warning: Due to new features, help page is currently being updated.
Expand All @@ -81,7 +91,7 @@ Shows a message explaining how to access the help page, as well as a list of ava
![help message](images/helpMessage.png)

Format: `help`

---------------------------
### Adding a client's contact: `add`

Add a client’s contacts to address book (name, phone number, email, home address, next-of-kin name, next-of-kin phone number) into Address Book
Expand All @@ -103,14 +113,15 @@ A person can have any number of tags (including 0)

Examples:
* `add n/John p/80101010 e/johndoe@gmail.com a/Punggol Central Blk 444 #15-32 820123 nk/Brennan nkp/82020202 [t/TAG]…​`

------------------

### Listing all persons : `list`

Display a list of all the clients and their contact details

Format: `list`

--------------------------------
### Editing a person : `edit`

Edit clients contact fields using an entry index followed by the updated details.
Expand Down Expand Up @@ -147,7 +158,7 @@ Address: 23 woodlands ave 123
Next-of-Kin: Brennan
Next-of-Kin Phone: 82020202
`

---------------
### Locating persons by name: `find`

Finds persons whose names contain any of the given keywords.
Expand All @@ -165,7 +176,7 @@ Examples:
* `find John` returns `john` and `John Doe`
* `find alex david` returns `Alex Yeoh`, `David Li`<br>
![result for 'find alex david'](images/findAlexDavidResult.png)

----------------
### Gathering clients' emails by financial plan: `gather`

Gathers all the emails of persons with a desired financial plan.
Expand All @@ -181,6 +192,7 @@ Examples:
Successful Output:
`lowjunyu@gmail.com johndoe@gmail.com`

------------
### Deleting a client's contact : `delete`

Deletes the client contact from the contact book by their index.
Expand All @@ -200,6 +212,7 @@ Successful Output:
`Contact Deleted!
Low Jun Yu is removed.`

----------
### Clearing all entries : `clear`

Clears all entries from the address book. UNOFAS will ask for confirmation first to ensure it is not a mistake. Click
Expand All @@ -211,19 +224,21 @@ Example:
* `clear`
![confirm clear window](images/confirmClear.png)

### Sorting of data listed on the UI: `sort`
----------------------------
### Sorting of data: `sort`

Sorts all the entries with predefined sorting functionalities. After sorting the list, the ordering of the entries will be changed. As a result, performing delete operations that require indexing will reference the new ordering that is currently displayed on the screen.

**Here are the current predefined sorting functions that have been implemented**

* `sort` : sorts list by lexicographical ordering of name (case-insensitive).
* `name` : sorts list by lexicographical ordering of name (case-insensitive).
* `appointment`: sorts list by appointment timing in order of the earliest appointment first.

Format: `sort` + `keyword`

Example: `sort sort` performs sorting by lexicographical ordering
Example: `sort name` performs sorting by lexicographical ordering

------------
### Exiting the program : `exit`

Exits the program.
Expand All @@ -238,7 +253,7 @@ UNOFAS data are saved in the hard disk automatically after any command that chan

UNOFAS data are saved automatically as a JSON file `[JAR file location]/data/addressbook.json`. Advanced users are welcome to update data directly by editing that data file.

<div markdown="span" class="alert alert-warning">:exclamation: **Caution:**
<div markdown="span" class="alert alert-warning"> :exclamation: **Caution:**
If your changes to the data file makes its format invalid, UNOFAS will discard all data and start with an empty data file at the next run. Hence, it is recommended to take a backup of the file before editing it.
</div>

Expand Down
5 changes: 4 additions & 1 deletion docs/team/jylow.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ Given below are my contributions to the project.
* **Enhancements Implemented**: Sort Command to enable the list to be sorted by lexicographical order of name of client

* **Contributions to the UG**:
* Added documentation for the features `sort` [\#73]()
* Added documentation for the features `sort` [\#81](https://github.com/AY2324S1-CS2103T-F12-1/tp/pull/81)

* **Contributions to the DG**: to be added soon.
*
* **Community**:
* PRs reviewed (with non-trivial review comments): [\#125](https://github.com/AY2324S1-CS2103T-F12-1/tp/pull/125)

* **Contributions to team-based tasks**: to be added soon.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public SortCommand parse(String args) throws ParseException {
if (trimmedArgs.isEmpty()) {
throw new ParseException(
String.format(MESSAGE_INVALID_COMMAND_FORMAT, SortCommand.MESSAGE_USAGE));
} else if (trimmedArgs.equals("sort")) { //sort name by lexicographical order
} else if (trimmedArgs.equals("name")) { //sort name by lexicographical order
return new SortCommand(new SortByNameComparator());
} else if (trimmedArgs.equals("appointment")) { //sort appointments by time
return new SortCommand(new SortByAppointmentComparator());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void parse_validArgs_returnsSortByNameCommand() {
// no leading and trailing whitespaces
SortCommand expectedSortCommand =
new SortCommand(new SortByNameComparator());
assertParseSuccess(parser, "sort", expectedSortCommand);
assertParseSuccess(parser, "name", expectedSortCommand);
}

@Test
Expand Down

0 comments on commit 10dae3d

Please sign in to comment.