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

Supports creating and deleting of multiple tags within one user input #37

Merged

Conversation

Chongjx
Copy link
Collaborator

@Chongjx Chongjx commented Oct 8, 2020

*Refactored prepareCreateTag and prepareDeleteTag into one function
*Created function to process TAG message
*Added more SystemException for specific missing information
*Modified the prepare functions to throw a SystemException, which is to be catched in the parseCommand function for the various missing information
*Included JColor library to support printing colored fonts

Closes #26
Closes #19

Updated CreateTagCommand and DeleteTagCommand to support creating and deleting of multiple tags within 1 instruction.
Added new enum to SystemException to handle more specific missing information.
Restructured the handling of exception in the prepare functions to return SystemException and catch them within the parseCommand function.
@Chongjx Chongjx added type.Story A user story priority.High Must do labels Oct 8, 2020
@Chongjx Chongjx added this to the v1.0 milestone Oct 8, 2020
@Chongjx Chongjx self-assigned this Oct 8, 2020
Copy link
Collaborator

@R-Ramana R-Ramana left a comment

Choose a reason for hiding this comment

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

Looks good, apart from some minor changes!

src/main/java/seedu/duke/data/notebook/Tag.java Outdated Show resolved Hide resolved
private int index;
private String tagName;
private String tagColor;
private final int index;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Private final right, so should be all CAPS? Can just commit directly from my suggestion :D

Suggested change
private final int index;
private final int INDEX;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The intellji gave warning saying that the field may be final so I changed it. Will be reverting that since the int cannot be final. Likewise for the rest of the similar cases below

private String tagName;
private String tagColor;
private final int index;
private final ArrayList<Tag> tags;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above

Suggested change
private final ArrayList<Tag> tags;
private final ArrayList<Tag> TAGS;

text-ui-test/EXPECTED.TXT Outdated Show resolved Hide resolved
private static final String STRING_TAG_EMPTY = "There are no tags!";
private static final String STRING_TAG_LIST = "Here are the available tags:" + InterfaceManager.LS;

private final Map<Tag, ArrayList<Note>> tagMap;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should it be TAGMAP?

Suggested change
private final Map<Tag, ArrayList<Note>> tagMap;
private final Map<Tag, ArrayList<Note>> TAGMAP;

Chongjx and others added 4 commits October 8, 2020 20:57
Co-authored-by: R Ramana <54029207+R-Ramana@users.noreply.github.com>
… into JunXiang-branch-TagNote

# Conflicts:
#	src/main/java/seedu/duke/data/notebook/Tag.java
# Conflicts:
#	src/main/java/seedu/duke/data/notebook/TagManager.java
#	src/main/java/seedu/duke/util/Parser.java
#	text-ui-test/EXPECTED.TXT

Did some clean up of the code. Added more SystemException. Modified some of the prepare functions in parser to throw SystemException.
@Chongjx Chongjx merged commit ac5502a into AY2021S1-CS2113-T13-1:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.High Must do type.Story A user story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tag note Categorize my notes by colour (CLI)
2 participants