diff --git a/docs/UserGuide.md b/docs/UserGuide.md index f624e670705..7f5f15a1a58 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -225,17 +225,17 @@ 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 with their respective keywords and colors are: +* +* Currently available categories with their respective keywords and colours are: -| Category | Keyword (case sensitive) | Color | -|---------------|--------------------------|-------| -| **General** | `general` | Gray | -| **Academics** | `acads` | Gold | -| **Activities**| `activity` | Blue | -| **Networking**| `network` | Green | -| **Mentorship**| `mentor` | Pink | + Category | Keyword (case sensitive) | Colour + --------------|--------------------------|- + **General** | `general` | Grey + **Academics** | `acads` | Gold + **Activities**| `activity` | Blue + **Networking**| `network` | Green + **Mentorship**| `mentor` | Pink -* All tags are categorized `General` by default. * 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. diff --git a/src/main/java/seedu/address/logic/commands/CategorizeTagCommand.java b/src/main/java/seedu/address/logic/commands/CategorizeTagCommand.java index 6f6534f04e8..0e5b9453a17 100644 --- a/src/main/java/seedu/address/logic/commands/CategorizeTagCommand.java +++ b/src/main/java/seedu/address/logic/commands/CategorizeTagCommand.java @@ -25,7 +25,7 @@ public class CategorizeTagCommand extends Command { + "Parameters: " + PREFIX_TAG + "TAG (at least one 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"; @@ -58,17 +58,19 @@ public CommandResult execute(Model model) throws CommandException { model.refreshCampusConnect(); } - String targetTagsResult = targetTags.stream() - .map(x -> x.toString()) - .collect(Collectors.joining(", ")); - - return new CommandResult(String.format(MESSAGE_CAT_TAG_SUCCESS, targetTagsResult)); + 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) {