Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into allEntriesDuplicates
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
Siedlerchr committed Jan 3, 2024
2 parents 98b9173 + bd92577 commit 42774ed
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
uses: lycheeverse/[email protected]
with:
fail: true
args: --max-concurrency 1 --cache --no-progress --exclude-all-private './**/*.md'
args: --accept '200,201,202,203,204,429,500' --max-concurrency 1 --cache --no-progress --exclude-all-private './**/*.md'
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

- 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)
- 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)
- 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)
- We fixed the colors of the icon on hover for unset special fields. [#10431](https://github.com/JabRef/jabref/issues/10431)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/actions/StandardActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public enum StandardActions implements Action {

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

PARSE_LATEX(Localization.lang("Search for citations in LaTeX files..."), IconTheme.JabRefIcons.LATEX_CITATIONS),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Node getGraphicNode() {
FontIcon fontIcon = FontIcon.of(icon);
fontIcon.getStyleClass().add("glyph-icon");

// Override the default color from the css files
// Override the default color from the css files
color.ifPresent(color -> fontIcon.setStyle(fontIcon.getStyle() +
String.format("-fx-fill: %s;", ColorUtil.toRGBCode(color)) +
String.format("-fx-icon-color: %s;", ColorUtil.toRGBCode(color))));
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/maintable/MainTable.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

.table-row-cell:hover .empty-special-field {
visibility: visible;
-fx-icon-color: -jr-gray-2;
-fx-fill: -jr-gray-2;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/sidepane/SidePaneType.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Definition of all possible components in the side pane.
*/
public enum SidePaneType {
OPEN_OFFICE("OpenOffice/LibreOffice", IconTheme.JabRefIcons.FILE_OPENOFFICE, StandardActions.TOOGLE_OO),
OPEN_OFFICE("OpenOffice/LibreOffice", IconTheme.JabRefIcons.FILE_OPENOFFICE, StandardActions.TOGGLE_OO),
WEB_SEARCH(Localization.lang("Web search"), IconTheme.JabRefIcons.WWW, StandardActions.TOGGLE_WEB_SEARCH),
GROUPS(Localization.lang("Groups"), IconTheme.JabRefIcons.TOGGLE_GROUPS, StandardActions.TOGGLE_GROUPS);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public SpecialFieldAction getSpecialFieldAction(SpecialFieldValue value,
}

public JabRefIcon getIcon() {
return getAction().getIcon().orElse(null);
return getAction().getIcon().get();
}

public String getLocalization() {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/jabref/logic/database/DuplicateCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ private static double[] compareFieldSet(final Collection<Field> fields, final Bi
}

private static int compareSingleField(final Field field, final BibEntry one, final BibEntry two) {
final Optional<String> optionalStringOne = one.getField(field);
final Optional<String> optionalStringTwo = two.getField(field);
if (!optionalStringOne.isPresent()) {
if (!optionalStringTwo.isPresent()) {
final Optional<String> optionalStringOne = one.getFieldLatexFree(field);
final Optional<String> optionalStringTwo = two.getFieldLatexFree(field);
if (optionalStringOne.isEmpty()) {
if (optionalStringTwo.isEmpty()) {
return EMPTY_IN_BOTH;
}
return EMPTY_IN_ONE;
} else if (!optionalStringTwo.isPresent()) {
} else if (optionalStringTwo.isEmpty()) {
return EMPTY_IN_TWO;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ public void testDuplicateDetectionWithSameAuthor() {
assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX));
}

@Test
public void testDuplicateDetectionWithSameAuthorAndUmlauts() {
BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bobä");
BibEntry two = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Bill{\\\"{a}} Bob{\\\"{a}}");

assertTrue(duplicateChecker.isDuplicate(one, two, BibDatabaseMode.BIBTEX));
}

@Test
public void testDuplicateDetectionWithDifferentAuthors() {
BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bob");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ void fieldDoesNotAcceptUnicode() {

@Test
void fieldAcceptsOnlyAsciiCharacters() {
String field = "";
StringBuilder field = new StringBuilder();
for (int i = 32; i <= 127; i++) {
field += Character.toString(i);
field.append(Character.toString(i));
}
entry.setField(StandardField.TITLE, field);
entry.setField(StandardField.TITLE, field.toString());
assertEquals(Collections.emptyList(), checker.check(entry));
}

Expand Down

0 comments on commit 42774ed

Please sign in to comment.