Skip to content

Commit

Permalink
Update UG & DG on sort feature
Browse files Browse the repository at this point in the history
  • Loading branch information
bendymochi committed Mar 25, 2019
1 parent cb37c3a commit cdfb706
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
27 changes: 21 additions & 6 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,33 @@ We have implemented a `SortCommand` that allow users to sort the current shown l

==== Current Implementation

`SortCommand` sorts the list by client name in lexicographical order.
`SortCommand` sorts the list by specified field in lexicographical order.

The following sequence diagram shows how the sort command works:
Step 1. The user launches the application and add equipment.

image::SortCommandSequenceDiagram.png[width="800"]
Step 2. The user executes `sort [FIELD]`

Step 3. The list is sorted by specified field and returned to the GUI.

Step 1. The user launches the application and add equipment.
Test cases:

- Input: `sort`

Output: By default, the list is sorted in alphabetical order of the client names.

- Input: `sort address`

Output: The list is sorted in alphabetical order.

- Input: `sort email`

Output: The list is sorted in alphabetical order.

- Input: `sort phone`

Output: The list is sorted in ascending order.

Step 2. The user executes `sort`

Step 3. The list is sorted by specific field and returned to the GUI.

==== Design Considerations
*Implementation of `SortCommand`*
Expand Down
13 changes: 9 additions & 4 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,20 @@ Example:

=== Sort the list: `sort`
Sort the current shown list.
Format: `sort /[fieldname to be sorted by] [/desc or /asc]`
The user can sort the current shown list with any fields, and can sort by multiple fields.
Format: `sort /[fieldname to be sorted by]`
The user can sort the current shown list with any valid field.

The sort parameters are case-insensitive.

By default, `sort` sorts the list by name in lexicographical order.
[TIP]
Equipment, client, and work list can all be sorted, by any fields of them.
Equipment, client, and work list can only be sorted by address, email and phone at the moment.

Example:

* `sort /region /desc /id /asc`
* `sort address`
* `sort email`
* `sort phone`

=== Filtering the list: `filter`
Filter the current shown list.
Expand Down

0 comments on commit cdfb706

Please sign in to comment.