From 3ea9106c1a3ed5ffd869c97e64a9ac9f5181be36 Mon Sep 17 00:00:00 2001 From: Christopher Tan Date: Thu, 7 Nov 2024 01:34:44 +0800 Subject: [PATCH 1/2] Remove extra brackets in success message --- .../address/logic/commands/CategorizeTagCommand.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/CategorizeTagCommand.java b/src/main/java/seedu/address/logic/commands/CategorizeTagCommand.java index ba8ec3e64ed..8810f890263 100644 --- a/src/main/java/seedu/address/logic/commands/CategorizeTagCommand.java +++ b/src/main/java/seedu/address/logic/commands/CategorizeTagCommand.java @@ -24,7 +24,7 @@ public class CategorizeTagCommand extends Command { + "Parameters: " + PREFIX_TAG + "TAG (existing tag label) CATEGORY\n" + "Example: " + COMMAND_WORD + " " + PREFIX_TAG + "CS1101S acads"; - public static final String MESSAGE_CAT_TAG_SUCCESS = "Category of tag %1$s has been changed successfully."; + public static final String MESSAGE_CAT_TAG_SUCCESS = "Category of tag(s) %1$s has been changed successfully."; public static final String MESSAGE_TAG_NOT_EXIST = "Tag not found: %1$s"; public static final String MESSAGE_INVALID_CATEGORY = "Invalid category: %1$s"; public static final String MESSAGE_DUPLICATE_CATEGORY = "Current category of %s is already %s"; @@ -57,13 +57,19 @@ public CommandResult execute(Model model) throws CommandException { model.refreshCampusConnect(); } - return new CommandResult(String.format(MESSAGE_CAT_TAG_SUCCESS, targetTags)); + String formattedTags = formatTags(targetTags); + return new CommandResult(String.format(MESSAGE_CAT_TAG_SUCCESS, formattedTags)); } private boolean isDuplicateCategory(TagCategory cat) { return updatedCategory.equals(cat); } + private String formatTags(List tags) { + String result = tags.toString(); + return result.substring(1, result.length() - 1); + } + @Override public boolean equals(Object other) { if (other == this) { From fd337baef42eb22bf77d81e65a5cf5b0f401f2aa Mon Sep 17 00:00:00 2001 From: Christopher Tan Date: Thu, 7 Nov 2024 01:56:02 +0800 Subject: [PATCH 2/2] Add info on tag category colours --- docs/UserGuide.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 6a4c2969e6b..e1f83d6d28e 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -225,15 +225,15 @@ Categorizes a tag under a defined category. Format: `cattag t/TAG [t/MORE_TAGS]…​ CATEGORY` * Sets the tag(s) in CampusConnect with the specified name `TAG` to fall under the specified `CATEGORY`. -* Currently available categories and their respective keywords are: - - Category | Keyword (case sensitive) - --------------|------------------------- - **General** | `general` - **Academics** | `acads` - **Activities**| `activity` - **Networking**| `network` - **Mentorship**| `mentor` +* Currently available categories with their respective keywords and colours are: + + Category | Keyword (case sensitive) | Colour + --------------|--------------------------|- + **General** | `general` | Grey + **Academics** | `acads` | Gold + **Activities**| `activity` | Blue + **Networking**| `network` | Green + **Mentorship**| `mentor` | Pink * Multiple tags can be categorized to the same category at a time. * All tags specified must be valid existing tags. * Attempts to set a tag to its current category will cause the whole command to be rejected.