Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cattag duplicate tag within command #257

Merged

Conversation

chrisjohntan
Copy link

This should:

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ Complexity Δ
...u/address/logic/commands/CategorizeTagCommand.java 46.66% <100.00%> (ø) 7.00 <0.00> (ø)

Comment on lines +84 to +95
**[Add](#adding-a-person-add)** | `add n/NAME p/PHONE_NUMBER e/EMAIL [t/TAG]…​` <br> e.g., `add n/James Ho p/91231234 e/[email protected] t/friend t/classmate`
**[Clear](#clearing-all-entries--clear)** | `clear`
**[Delete](#deleting-a-person--delete)** | `delete INDEX`<br> e.g., `delete 3`
**[Edit](#editing-a-person--edit)** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [t/TAG]…​`<br> e.g.,`edit 2 n/James Lee e/[email protected]`
**[Find by contact information](#locating-persons-by-contact-information-find)** | `find PREFIX/KEYWORD [PREFIX/MORE_KEYWORDS]…​`<br> e.g., `find n/James t/floorball`
**[Delete tag](#deleting-a-persons-tag--deltag)** | `deltag INDEX t/KEYWORD` <br> e.g. `deltag 1 t/friend`
**[Add tag](#adds-tags-to-a-specific-person--addtag)** | `addtag INDEX t/KEYWORD [t/MORE_TAGS]…​` <br> e.g. `addtag 1 t/friend t/classmate`
**[Categorize tag](#categorizing-a-tag--cattag)** | `cattag t/TAG [t/MORE_TAGS…​] CATEGORY` <br> e.g. `cattag t/floorball t/mahjong activity`
**[Undo action](#undo-a-command--undo)** | `undo`
**[Redo action](#redo-a-command-redo)** | `redo`
**[List](#listing-all-persons--list)** | `list`
**[Help](#viewing-help--help)** | `help`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look better

Comment on lines +245 to +247
* `cattag t/CS2100 acads` categorizes the tag `CS2100` under `Academics` and display colour of the tag`CS2100` becomes `Gold`.
* `cattag t/floorball t/mahjong activity` categorizes both tags `floorball` and `mahjong` under `Activities` with colour `Blue`.
* Newly created tags (by [`add`](#adding-a-person-add) or [`addtag`](#adds-tags-to-a-specific-person--addtag)) will have category `General` and colour `Grey` by default.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better details

Copy link

@CYX22222003 CYX22222003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -66,7 +68,7 @@ private boolean isDuplicateCategory(TagCategory cat) {
return updatedCategory.equals(cat);
}

private String formatTags(List<Tag> tags) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the use of set will solve duplicate tag expectedly.

@CYX22222003 CYX22222003 merged commit cbb3ec3 into AY2425S1-CS2103T-F14a-4:master Nov 7, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants