Skip to content

Commit 42774ed

Browse files
committed
Merge remote-tracking branch 'upstream/main' into allEntriesDuplicates
* upstream/main: Fix duplicate checker does not respect umlauts / latex free fields (#10744) Ignore 429 at link check (#10743) Fix color for hovered special fields (#10742)
2 parents 98b9173 + bd92577 commit 42774ed

File tree

10 files changed

+24
-13
lines changed

10 files changed

+24
-13
lines changed

.github/workflows/check-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
uses: lycheeverse/[email protected]
3333
with:
3434
fail: true
35-
args: --max-concurrency 1 --cache --no-progress --exclude-all-private './**/*.md'
35+
args: --accept '200,201,202,203,204,429,500' --max-concurrency 1 --cache --no-progress --exclude-all-private './**/*.md'

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
1717

1818
- We fixed an issue where attempting to cancel the importing/generation of an entry from id is ignored. [#10508](https://github.com/JabRef/jabref/issues/10508)
1919
- We fixed an issue where the preview panel showing the wrong entry (an entry that is not selected in the entry table). [#9172](https://github.com/JabRef/jabref/issues/9172)
20+
- We fixed an issue where the duplicate check did not take umlauts or other LaTeX-encoded characters into account. [#10744](https://github.com/JabRef/jabref/pull/10744)
21+
- We fixed the colors of the icon on hover for unset special fields. [#10431](https://github.com/JabRef/jabref/issues/10431)
2022

2123
### Removed
2224

src/main/java/org/jabref/gui/actions/StandardActions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public enum StandardActions implements Action {
8585

8686
AUTOMATIC_FIELD_EDITOR(Localization.lang("Automatic field editor")),
8787
TOGGLE_GROUPS(Localization.lang("Groups"), IconTheme.JabRefIcons.TOGGLE_GROUPS, KeyBinding.TOGGLE_GROUPS_INTERFACE),
88-
TOOGLE_OO(Localization.lang("OpenOffice/LibreOffice"), IconTheme.JabRefIcons.FILE_OPENOFFICE, KeyBinding.OPEN_OPEN_OFFICE_LIBRE_OFFICE_CONNECTION),
88+
TOGGLE_OO(Localization.lang("OpenOffice/LibreOffice"), IconTheme.JabRefIcons.FILE_OPENOFFICE, KeyBinding.OPEN_OPEN_OFFICE_LIBRE_OFFICE_CONNECTION),
8989
TOGGLE_WEB_SEARCH(Localization.lang("Web search"), Localization.lang("Toggle web search interface"), IconTheme.JabRefIcons.WWW, KeyBinding.WEB_SEARCH),
9090

9191
PARSE_LATEX(Localization.lang("Search for citations in LaTeX files..."), IconTheme.JabRefIcons.LATEX_CITATIONS),

src/main/java/org/jabref/gui/icon/InternalMaterialDesignIcon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public Node getGraphicNode() {
4444
FontIcon fontIcon = FontIcon.of(icon);
4545
fontIcon.getStyleClass().add("glyph-icon");
4646

47-
// Override the default color from the css files
47+
// Override the default color from the css files
4848
color.ifPresent(color -> fontIcon.setStyle(fontIcon.getStyle() +
4949
String.format("-fx-fill: %s;", ColorUtil.toRGBCode(color)) +
5050
String.format("-fx-icon-color: %s;", ColorUtil.toRGBCode(color))));

src/main/java/org/jabref/gui/maintable/MainTable.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
.table-row-cell:hover .empty-special-field {
1616
visibility: visible;
17+
-fx-icon-color: -jr-gray-2;
1718
-fx-fill: -jr-gray-2;
1819
}
1920

src/main/java/org/jabref/gui/sidepane/SidePaneType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Definition of all possible components in the side pane.
1111
*/
1212
public enum SidePaneType {
13-
OPEN_OFFICE("OpenOffice/LibreOffice", IconTheme.JabRefIcons.FILE_OPENOFFICE, StandardActions.TOOGLE_OO),
13+
OPEN_OFFICE("OpenOffice/LibreOffice", IconTheme.JabRefIcons.FILE_OPENOFFICE, StandardActions.TOGGLE_OO),
1414
WEB_SEARCH(Localization.lang("Web search"), IconTheme.JabRefIcons.WWW, StandardActions.TOGGLE_WEB_SEARCH),
1515
GROUPS(Localization.lang("Groups"), IconTheme.JabRefIcons.TOGGLE_GROUPS, StandardActions.TOGGLE_GROUPS);
1616

src/main/java/org/jabref/gui/specialfields/SpecialFieldViewModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public SpecialFieldAction getSpecialFieldAction(SpecialFieldValue value,
5656
}
5757

5858
public JabRefIcon getIcon() {
59-
return getAction().getIcon().orElse(null);
59+
return getAction().getIcon().get();
6060
}
6161

6262
public String getLocalization() {

src/main/java/org/jabref/logic/database/DuplicateCheck.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ private static double[] compareFieldSet(final Collection<Field> fields, final Bi
154154
}
155155

156156
private static int compareSingleField(final Field field, final BibEntry one, final BibEntry two) {
157-
final Optional<String> optionalStringOne = one.getField(field);
158-
final Optional<String> optionalStringTwo = two.getField(field);
159-
if (!optionalStringOne.isPresent()) {
160-
if (!optionalStringTwo.isPresent()) {
157+
final Optional<String> optionalStringOne = one.getFieldLatexFree(field);
158+
final Optional<String> optionalStringTwo = two.getFieldLatexFree(field);
159+
if (optionalStringOne.isEmpty()) {
160+
if (optionalStringTwo.isEmpty()) {
161161
return EMPTY_IN_BOTH;
162162
}
163163
return EMPTY_IN_ONE;
164-
} else if (!optionalStringTwo.isPresent()) {
164+
} else if (optionalStringTwo.isEmpty()) {
165165
return EMPTY_IN_TWO;
166166
}
167167

src/test/java/org/jabref/logic/database/DuplicateCheckTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ public void testDuplicateDetectionWithSameAuthor() {
7878
assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX));
7979
}
8080

81+
@Test
82+
public void testDuplicateDetectionWithSameAuthorAndUmlauts() {
83+
BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bobä");
84+
BibEntry two = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Bill{\\\"{a}} Bob{\\\"{a}}");
85+
86+
assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX));
87+
}
88+
8189
@Test
8290
public void testDuplicateDetectionWithDifferentAuthors() {
8391
BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bob");

src/test/java/org/jabref/logic/integrity/ASCIICharacterCheckerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ void fieldDoesNotAcceptUnicode() {
3535

3636
@Test
3737
void fieldAcceptsOnlyAsciiCharacters() {
38-
String field = "";
38+
StringBuilder field = new StringBuilder();
3939
for (int i = 32; i <= 127; i++) {
40-
field += Character.toString(i);
40+
field.append(Character.toString(i));
4141
}
42-
entry.setField(StandardField.TITLE, field);
42+
entry.setField(StandardField.TITLE, field.toString());
4343
assertEquals(Collections.emptyList(), checker.check(entry));
4444
}
4545

0 commit comments

Comments
 (0)