Skip to content

Commit

Permalink
Update PPP (#237)
Browse files Browse the repository at this point in the history
* Add changes from team repo (#5)

* Refactor package name from 'seedu.address' to 'tagline'

* Update mainClassName in build.gradle

* Merge pull request #6 from from AY1920S1-CS2103T-F12-3/master

* Refactor package name from 'seedu.address' to 'tagline'

* Update mainClassName in build.gradle

* Added Contact Command + Basic Commands to UserGuide.adoc

* Update mentions of AddressBook to TagLine

* Update AboutUs.adoc

* Add more use cases to Developer Guide

* Update team name

* Add newline after EOF for README and AboutUs

* Fix Yehez image name

* Merge PR #10 from AY1920S1-CS2103T-F12-3/main

* Update Prof name in AboutUs (#35)

#21

* Rename Yehezkiel image (#36)

* Fix typos in Developer Guide and User Guide (#37)

* Updates from upstream (#14)

* Add chat pane to GUI (#9)

* Refactor result pane view (#42)

* Implement view switching in GUI (#46)

* Refactor Contact Command Parsers (#43)

* Update contact parser (#62)

* Rename person to contact (#65)

* Fix merge conflicts from upstream

* Fix merge conflicts

* Add missing files to master from upstream

* Remove dummy view

* Merge updates from  AY1920S1-CS2103T-F12-3/main (#18)

Add DeleteNoteCommandTest

* Updates from upstream (#19)

* Refactor TagList to UniqueTagList and TagBook to follow structure

Full changelist:
- Refactor TagList to UniqueTagList
- Add TagBook to implement ReadOnlyTagBook
- Change storage to use ReadOnlyTagBook instead of TagList
- Include new definition of equality for Tags (all fields equal except ID)
- Standardize UniqueXXXXList method naming convention

* Update architecture diagrams, UI structure, user stories, use cases and NFRs (#108)

* Fix NoteBook.java for duplicate findNote()

* Updates from upstream (#21)

* Update Dev Guide Proposed Component (#123)

* DG changes in diagram to update future proposed implementation

* clearer docs

* added linebreaks

* line breaks

* linebreak

* formatting

* Refactor ResultPane into a separate class (#103)

* Update AboutUs.adoc for team members to commit

* Add a newline in AboutUs.adoc

* Add more use cases to Developer Guide

* Fix missing endline

* Update various docs to display TagLine

* Add placeholder image

* Fix minor typo in user guide

* Update Tagline to TagLine

* Update team name

* Fix some typos in user guide and developer guide

* Add some tests and remove ContactCard index

* Add new test to NoteListCardTest

* Remove magic literal in NoteListCard

* Fix variable declaration order

* Refactor ResultPane into a separate class

* Add missing Javadoc

* Add note filtering implementation to DG (#124)

* Merge updates from AY1920S1-CS2103T-F12-3/main

Tests for delete note
Tests for edit note
XML for DG
Group feature

* Add detailed example for note create, delete, edit in UG

* Add detail example for note list, clear in UG

* Set image width to 600

* Add images for UG

* Fix some bugs in UG

* Add comment on deleted note id

* Update note filter in DG

* Show all notes after deleting

* Fix test error

* Fix test error

* Fix checkstyle

* Add PPP

* Fix PPP

* Udate PPP

* Fix link in PPP
  • Loading branch information
shiweing authored and tanlk99 committed Nov 10, 2019
1 parent f3c2c6e commit 293983f
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/AboutUs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Roles:

=== Ng Shi Wei
image::shiweing.png[width="150", align="left"]
{empty}[https://github.com/shiweing[github]] [<<shiwei#, portfolio>>]
{empty}[https://github.com/shiweing[github]] [<<shiweing#, portfolio>>]

Roles:

Expand Down
10 changes: 5 additions & 5 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,11 @@ image::FilterKeywordSequenceDiagram1.png[]
**Step 2:** The `ListNoteCommand` returned will be executed by the `LogicManager`. If a `NoteFilter` exists and is of `FilterType.KEYWORD`, `ListNoteCommand#filterAndListByKeyword()` will be called.

.Sequence diagram of executing `ListNoteCommand` to update filtered note list by keyword in `Model`
image::FilterKeywordSequenceDiagram2.png[]
image::FilterKeywordSequenceDiagram2.png[width=700]

The method will create a `NoteContainsKeywordsPredicate` and update the list of notes to be displayed via `Model#updateFilteredNoteList()`.

image::FilterKeywordExample.png[]
image::FilterKeywordExample.png[width=700]

===== Filter by Tag

Expand All @@ -635,18 +635,18 @@ Given below is an example scenario where the user enters a command to filter not
The tag strings are passed into `NoteFilterUtil#generateTagFilter()`. `TagParserUtil#parseTag()` is called to get `Tag` from the tag string. `TagFilter` containing the list of tags and `FilterType.TAG` is returned.

.Sequence diagram of parsing user input tag strings to obtain a `ListNoteCommand`
image::FilterTagSequenceDiagram1.png[]
image::FilterTagSequenceDiagram1.png[width=700]

**Step 2:** The `ListNoteCommand` returned will be executed by the `LogicManager`. If a `NoteFilter` exists and is of `FilterType.TAG`, `ListNoteCommand#filterAndListByTag()` will be called.

.Sequence diagram of executing `ListNoteCommand` to update filtered note list by `Tag` in `Model`
image::FilterTagSequenceDiagram2.png[]
image::FilterTagSequenceDiagram2.png[width=700]

The method will check if the tags in the `NoteFilter` exists via `Model#findTag()`. If a `Tag` does not exist, an error message will be displayed.

If all tags exist, the tags will be passed into the `NoteContainsTagsPredicate` and update the list of notes to be displayed via `Model#updateFilteredNoteList()`.

image::FilterTagExample.png[]
image::FilterTagExample.png[width=700]
// end::note-filter[]

=== Logging
Expand Down
2 changes: 1 addition & 1 deletion docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ Example:
. When you would like to see all the notes you have in TagLine, you can enter the command `note list`.
+
.Entering `note list` command
image::ug_notelist1.png[width="600"]
image::ug_notelist1.png[width=600]

. All notes are displayed.
+
Expand Down
164 changes: 155 additions & 9 deletions docs/team/shiweing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
:site-section: AboutUs
:imagesDir: ../images
:stylesDir: ../stylesheets
:repoURL: https://github.com/AY1920S1-CS2103T-F12-3/main/tree/master

== PROJECT: Tagline

Expand All @@ -13,7 +14,7 @@ My team of 5 software engineering students were tasked with enhancing a basic co
This is what our project looks like:

.The graphical user interface for TagLine
image::ui.png[]
image::Ui.png[width=400]

My role was to design and write the codes for the note commands, including basic add, delete, edit command as well as a filter feature. The following sections illustrate these enhancements in more detail, as well as the relevant documentation I have added to the user and developer guides in relation to these enhancements.

Expand All @@ -37,11 +38,16 @@ This section shows a summary of my coding, documentation, and other helpful cont
** The implementation was challenging as TagLine has 3 different tags – Hashtags, Contact as tag, and Group name as tag. The note list command has to be implemented such that the filtering applies generally to all 3 tags.
** Credit: The architecture and code of note create/delete/edit commands were reused and morphed from AddressBook commands.

**Code contributed:** Please click these links to see a sample of my code: [Functional code ] [Test code]
**Code contributed:** Please click these links to see a sample of my code:
[ link:{repoURL}/src/main/java/tagline/logic/parser/note/ListNoteParser.java[ListNoteParser] ]
[ link:{repoURL}/src/main/java/tagline/logic/commands/note/ListNoteCommand.java[ListNoteCommand] ]
[ link:{repoURL}/src/test/java/tagline/logic/parser/note/ListNoteParserTest.java[ListNoteParserTest] ]
[ link:{repoURL}/src/test/java/tagline/logic/commands/note/ListNoteCommandTest.java[ListNoteCommandTest] ]

**Other contributions:**

* Documentation:
** Add the details for basic note commands in user guide: link:../UserGuide.adoc#note-command[NoteCommand]
** Add the logic of note commands in developer guide after their addition to TagLine: link:../DeveloperGuide.html#Design-NoteLogic[NoteLogic]

* Community:
Expand All @@ -54,19 +60,159 @@ This section shows a summary of my coding, documentation, and other helpful cont
|We had to update the original AddressBook User Guide with instructions for the enhancements that we had added. The following is an excerpt from our **TagLine User Guide**, showing additions that I have made for the `note` commands.
|===

include::../UserGuide.adoc[tag=note-command]
include::../UserGuide.adoc[tag=note-create]
include::../UserGuide.adoc[tag=note-delete]
include::../UserGuide.adoc[tag=note-edit]
include::../UserGuide.adoc[tag=note-list]
include::../UserGuide.adoc[tag=note-clear]
==== List notes: `list`

Lists all notes in the application. Filters can be applied to show only notes related to certain keywords, hashtags, users or groups.

Format:

`note list [# / @ / %][FILTER]`

Example:

[cols=3*,options=header]
|===
|Format
|Example
|Outcome

|`note list`
|`note list`
|Lists all notes.

|`note list KEYWORD`
|`note list meeting`
|Lists all notes which contain the phrase “_meeting_”.

|`note list #HASHTAG`
|`note list #cs2100`
|Lists all notes with the hashtag '_#cs2100_'.

|`note list @CONTACTID`
|`note list @12345`
|Lists all notes tagged with the contact of ID '_12345_'.

|`note list %GROUPNAME`
|`note list %cs2103t`
|Lists all notes tagged with the group '_cs2103 team_'.
|===

. When you would like to see all the notes you have in TagLine, you can enter the command `note list`.
+
.Entering `note list` command
image::ug_notelist1.png[width=400]

. All notes are displayed.
+
.All notes displayed
image::ug_notelist2.png[width=400]

. When you would like to find the notes containing the keyword "cs", you can enter the command `note list cs`.
+
.Entering `note list` command with keyword
image::ug_notelist3.png[width=400]

. Notes with the keyword "cs" found in the title or content are displayed.
+
.Notes containing keyword displayed
image::ug_notelist4.png[width=400]

. When you would like to see the notes tagged with the hashtag "assignment", you can enter the command `note list #assignment`.
+
.Entering `note list` command with tag filter
image::ug_notelist5.png[width=400]

. Notes tagged with "#assignment" are displayed.
+
.Filtered tagged notes displayed
image::ug_notelist6.png[width=400]

. When you would like to filter by multiple tags, you can enter the command `note list @00001 %cs2103t`.
+
.Entering `note list` command with multiple tag filter
image::ug_notelist7.png[width=400]

. Notes tagged with contact of contact id "1" or with group with group name "cs2103t" are displayed.
+
.Filtered notes displayed
image::ug_notelist8.png[width=400]

=== Contributions to the Developer Guide
---
|===
|The following section shows my additions to the TagLine Developer Guide for the `note` logic and filter feature.
|===

include::../DeveloperGuide.adoc[tag=note-filter]
=== Note filtering feature
==== Description

The user can filter notes by providing a filter in the <<UserGuide#note-list, `note list`>> command.

Types of filter:

* No prefix - filter by String keyword
* Prefix `#` - filter by hashtag
* Prefix `@` - filter by contact
* Prefix `%` - filter by group

==== Implementation

The note filter mechanism is facilitated by the link:{repoURL}/src/main/java/tagline/logic/commands/note/NoteFilter.java[`NoteFilter`] class.
It contains the filter value and the enum `FilterType`.

A `NoteFilter` is generated by the `NoteFilterUtil` inner class in link:{repoURL}/src/main/java/tagline/logic/parser/note/ListNoteParser.java[`ListNoteParser`] and passed into link:{repoURL}/src/main/java/tagline/logic/commands/note/ListNoteCommand.java[`ListNoteCommand`].

`ListNoteCommand` then creates a `Predicate` based on the filter and updates the list of notes in the UI via `Model`.

===== Filter by String keyword

Filter by keyword is facilitated by the following classes:

* link:{repoURL}/src/main/java/tagline/logic/commands/note/KeywordFilter.java[`KeywordFilter`] - implementation of `NoteFilter` that is passed into `ListNoteCommand`
* link:{repoURL}/src/main/java/tagline/model/note/NoteContainsKeywordsPredicate.java[`NoteContainsKeywordsPredicate`] - `Predicate` passed into `Model#updateFilteredNoteList()` to list only notes that contain the keywords.

Given below is an example scenario where the user enters a command to filter notes by keywords.

**Step 1:** The user command is passed through the `LogicManager` to `ListNoteParser`. `ListNoteParser` checks the input arguments and identify the String keywords.

The keywords are passed into `NoteFilterUtil#generateKeywordFilter()` which returns a `KeywordFilter` containing the keywords and `FilterType.KEYWORD`.

.Sequence diagram of parsing `note list` user command to obtain a `ListNoteCommand`
image::FilterKeywordSequenceDiagram1.png[width=500]

**Step 2:** The `ListNoteCommand` returned will be executed by the `LogicManager`. If a `NoteFilter` exists and is of `FilterType.KEYWORD`, `ListNoteCommand#filterAndListByKeyword()` will be called.

.Sequence diagram of executing `ListNoteCommand` to update filtered note list by keyword in `Model`
image::FilterKeywordSequenceDiagram2.png[width=300]

The method will create a `NoteContainsKeywordsPredicate` and update the list of notes to be displayed via `Model#updateFilteredNoteList()`.

image::FilterKeywordExample.png[width=300]

===== Filter by Tag

Filter by `Tag` is facilitated by the following classes/methods:

* link:{repoURL}/src/main/java/tagline/logic/parser/tag/TagParserUtil.java[`TagParserUtil#parseTag()`] - to obtain the `Tag` objects from the user input tag strings
* link:{repoURL}/src/main/java/tagline/logic/commands/note/TagFilter.java[`TagFilter`] - implementation of `NoteFilter` that is passed into `ListNoteCommand`
* link:{repoURL}/src/main/java/tagline/model/note/NoteContainsKeywordsPredicate.java[`NoteContainsTagsPredicate`] - `Predicate` passed into `Model#updateFilteredNoteList()` to list only notes that is tagged by specified `Tag`

Given below is an example scenario where the user enters a command to filter notes by tag.

**Step 1:** Similar to filtering by keyword, the user command is passed to the `ListNoteParser`. The `ListNoteParser` checks the input arguments and identify the tag strings.

The tag strings are passed into `NoteFilterUtil#generateTagFilter()`. `TagParserUtil#parseTag()` is called to get `Tag` from the tag string. `TagFilter` containing the list of tags and `FilterType.TAG` is returned.

.Sequence diagram of parsing user input tag strings to obtain a `ListNoteCommand`
image::FilterTagSequenceDiagram1.png[width=400]

**Step 2:** The `ListNoteCommand` returned will be executed by the `LogicManager`. If a `NoteFilter` exists and is of `FilterType.TAG`, `ListNoteCommand#filterAndListByTag()` will be called.

.Sequence diagram of executing `ListNoteCommand` to update filtered note list by `Tag` in `Model`
image::FilterTagSequenceDiagram2.png[width=400]

The method will check if the tags in the `NoteFilter` exists via `Model#findTag()`. If a `Tag` does not exist, an error message will be displayed.

If all tags exist, the tags will be passed into the `NoteContainsTagsPredicate` and update the list of notes to be displayed via `Model#updateFilteredNoteList()`.

image::FilterTagExample.png[width=400]

0 comments on commit 293983f

Please sign in to comment.