Skip to content

Commit

Permalink
Move the sorting of the tagList into the LogicManager
Browse files Browse the repository at this point in the history
  • Loading branch information
yooplo committed Oct 21, 2024
1 parent 8d1e6d0 commit 98f50e1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface Logic {
/** Returns an unmodifiable view of the filtered list of persons */
ObservableList<Person> getFilteredPersonList();

/** Returns a list of currently defined tags */
/** Returns a list of currently defined tags alphabetically sorted */
ObservableList<Tag> getListOfCurrentTags();

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/LogicManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public ObservableList<Person> getFilteredPersonList() {

@Override
public ObservableList<Tag> getListOfCurrentTags() {
return model.getListOfCurrentTags();
return model.getListOfCurrentTags().sorted();

Check warning on line 77 in src/main/java/seedu/address/logic/LogicManager.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/logic/LogicManager.java#L77

Added line #L77 was not covered by tests
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/ui/TagListPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class TagListPanel extends UiPart<Region> {
*/
public TagListPanel(ObservableList<Tag> tagList) {
super(FXML);
tagListView.setItems(FXCollections.observableArrayList(tagList.sorted()));
tagListView.setItems(FXCollections.observableArrayList(tagList));
tagListView.setCellFactory(listView -> new TagListViewCell());
}

Check warning on line 33 in src/main/java/seedu/address/ui/TagListPanel.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/seedu/address/ui/TagListPanel.java#L30-L33

Added lines #L30 - L33 were not covered by tests

Expand Down

0 comments on commit 98f50e1

Please sign in to comment.