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

Fix external group metadata changes are not merged #8994

Merged
merged 24 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
376760c
Update README.md
HoussemNasri Mar 24, 2022
d898da1
Merge branch 'JabRef:main' into main
HoussemNasri Mar 31, 2022
752954b
Merge branch 'JabRef:main' into main
HoussemNasri Apr 11, 2022
41b499f
Merge branch 'JabRef:main' into main
HoussemNasri Apr 26, 2022
a63045f
Merge branch 'JabRef:main' into main
HoussemNasri May 7, 2022
0901768
Merge branch 'JabRef:main' into main
HoussemNasri May 8, 2022
5874b4e
Merge remote-tracking branch 'origin/main' into main
HoussemNasri May 30, 2022
3c3fb02
Fix Readme
HoussemNasri Jun 7, 2022
81815fa
Merge branch 'JabRef:main' into main
HoussemNasri Jun 7, 2022
18d95c2
Merge branch 'JabRef:main' into main
HoussemNasri Jun 18, 2022
0e08af3
Merge branch 'JabRef:main' into main
HoussemNasri Jun 20, 2022
2bb0b6c
Merge branch 'JabRef:main' into main
HoussemNasri Jun 23, 2022
d71f93a
Commit
HoussemNasri Jun 23, 2022
57005ce
Merge branch 'JabRef:main' into main
HoussemNasri Jun 23, 2022
fffc86c
Update README.md
HoussemNasri Jun 29, 2022
4f480ba
Merge remote-tracking branch 'origin/main' into main
HoussemNasri Jul 12, 2022
63e09ba
Merge branch 'JabRef:main' into main
HoussemNasri Jul 12, 2022
365e968
Merge remote-tracking branch 'origin/main' into main
HoussemNasri Jul 12, 2022
033b9a2
Revert "Commit"
HoussemNasri Jul 12, 2022
b62f8ac
Merge branch 'JabRef:main' into main
HoussemNasri Jul 23, 2022
e1e2bd7
Fixup inverted arguments
HoussemNasri Jul 24, 2022
258e42c
Delegate group metadata change handling to GroupChangeViewModel
HoussemNasri Jul 24, 2022
8d9b794
Update CHANGELOG.md
HoussemNasri Jul 24, 2022
6c51fa6
Fix failing test
HoussemNasri Jul 24, 2022
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 @@ -59,6 +59,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed a bug where switching between themes will cause an error/exception. [#8939](https://github.com/JabRef/jabref/pull/8939)
- We fixed a bug where files that were deleted in the source bibtex file were kept in the index. [#8962](https://github.com/JabRef/jabref/pull/8962)
- We fixed "Error while sending to JabRef" when the browser extension interacts with JabRef. [JabRef-Browser-Extension#479](https://github.com/JabRef/JabRef-Browser-Extension/issues/479)
- We fixed a bug that prevented external group metadata changes from being merged. [#8873](https://github.com/JabRef/jabref/issues/8873)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@ public Node description() {
@Override
public void makeChange(BibDatabaseContext database, NamedCompound undoEdit) {
database.setMetaData(metaDataDiff.getNewMetaData());
// group change is handled by GroupChangeViewModel, so we set the groups root to the original value
// to prevent any inconsistency
metaDataDiff.getGroupDifferences().ifPresent(groupDiff -> database.getMetaData().setGroups(groupDiff.getOriginalGroupRoot()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static Optional<GroupDiff> compare(MetaData originalMetaData, MetaData ne
final Optional<GroupTreeNode> newGroups = newMetaData.getGroups();

if (!originalGroups.equals(newGroups)) {
return Optional.of(new GroupDiff(newGroups.orElse(null), originalGroups.orElse(null)));
return Optional.of(new GroupDiff(originalGroups.orElse(null), newGroups.orElse(null)));
} else {
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void compareWithChangedGroup() {

Optional<GroupDiff> groupDiff = GroupDiff.compare(originalMetaData, newMetaData);

Optional<GroupDiff> expectedGroupDiff = Optional.of(new GroupDiff(newMetaData.getGroups().get(), originalMetaData.getGroups().get()));
Optional<GroupDiff> expectedGroupDiff = Optional.of(new GroupDiff(originalMetaData.getGroups().get(), newMetaData.getGroups().get()));

assertEquals(expectedGroupDiff.get().getNewGroupRoot(), groupDiff.get().getNewGroupRoot());
assertEquals(expectedGroupDiff.get().getOriginalGroupRoot(), groupDiff.get().getOriginalGroupRoot());
Expand Down