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

Group order reset after adding a new group #10066

Merged
merged 4 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- In the context of the "systematic literature functionality", we changed the name "database" to "catalog" to use a separate term for online catalogs in comparison to SQL databases. [#9951](https://github.com/JabRef/jabref/pull/9951)
- We now show more fields (including Special Fields) in the dropdown selection for "Save sort order" in the library properties and for "Export sort order" in the preferences. [#10010](https://github.com/JabRef/jabref/issues/10010)
- We now encrypt and store the custom API keys in the OS native credential store. [#10044](https://github.com/JabRef/jabref/issues/10044)
- We changed the behavior of group addition/edit, so that sorting by alphabetical order is not performed by default after the modification [#10017](https://github.com/JabRef/jabref/issues/10017)

### Fixed

Expand Down
7 changes: 1 addition & 6 deletions src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ private void onActiveDatabaseChanged(Optional<BibDatabaseContext> newDatabase) {
}

/**
* Opens "New Group Dialog" and adds the resulting group as subgroup to the specified group while maintaining the
* alphabetical order
* Opens "New Group Dialog" and adds the resulting group as subgroup to the specified group
*/
public void addNewSubgroup(GroupNodeViewModel parent, GroupDialogHeader groupDialogHeader) {
currentDatabase.ifPresent(database -> {
Expand All @@ -176,8 +175,6 @@ public void addNewSubgroup(GroupNodeViewModel parent, GroupDialogHeader groupDia
// TODO: Expand parent to make new group visible
// parent.expand();

sortAlphabeticallyRecursive(parent.getGroupNode());

dialogService.notify(Localization.lang("Added group \"%0\".", group.getName()));
writeGroupChangesToMetaData();
});
Expand Down Expand Up @@ -368,8 +365,6 @@ public void editGroup(GroupNodeViewModel oldGroup) {
// undoAddPreviousEntries = UndoableChangeEntriesOfGroup.getUndoableEdit(null, addChange);
// }

oldGroup.getParent().ifPresent(this::sortAlphabeticallyRecursive);

dialogService.notify(Localization.lang("Modified group \"%0\".", group.getName()));
writeGroupChangesToMetaData();
// This is ugly but we have no proper update mechanism in place to propagate the changes, so redraw everything
Expand Down