Skip to content

Commit

Permalink
Add tag category to display as text in the UI
Browse files Browse the repository at this point in the history
Let's:
- Implement the colour coding in the UI
- Remove the textual display of tag category after implementing colours
- Ensure that all the person displays are updated after every cattag command
  • Loading branch information
chrisjohntan committed Nov 2, 2024
1 parent d4dbafd commit 7cb08cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/seedu/address/ui/PersonCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public PersonCard(Person person, int displayedIndex) {
email.setText(person.getEmail().value);
person.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
// Tag category displayed for visual testing
// TODO: remove tag category text display after implementing colour code
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName + " " + tag.getTagCategory())));

Check warning on line 56 in src/main/java/seedu/address/ui/PersonCard.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/PersonCard.java#L56

Added line #L56 was not covered by tests

// add horizontal and vertical gaps for the tags FlowPane
tags.setHgap(5);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/seedu/address/ui/TagCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class TagCard extends UiPart<Region> {
public TagCard(Tag tag, int displayedIndex) {
super(FXML);
this.tag = tag;
tagName.setText((displayedIndex + 1) + ". " + tag.tagName);
// Tag category displayed for visual testing
// TODO: remove tag category text display after implementing colour code
tagName.setText((displayedIndex + 1) + ". " + tag.tagName + "(" + tag.getTagCategory() + ")");

Check warning on line 31 in src/main/java/seedu/address/ui/TagCard.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/TagCard.java#L31

Added line #L31 was not covered by tests
}
}

0 comments on commit 7cb08cf

Please sign in to comment.