Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -50,6 +50,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

- We fixed an issue where it was hard to distinguish between enabled/disabled status of search buttons in dark mode and added tooltips. [#11569](https://github.com/JabRef/jabref/issues/11569)
- We fixed an issue where entries containing dollar signs, backslashes, or unset fields passed to `substring$` caused citation style preview and export to fail. [#12799](https://github.com/JabRef/jabref/issues/12799)
- We fixed an issue where citationcount, day, and dayfiled columns were sorted alphabetically instead of numerically. [#17459](https://github.com/JabRef/jabref/issues/17459)
- We fixed exports to RIS, CSV, HTML, and other template-based formats in native JabKit. [#17408](https://github.com/JabRef/jabref/issues/17408)
- We fixed JabKit to preserve existing citation keys when generating keys with the avoid-overwrite setting. [#17458](https://github.com/JabRef/jabref/issues/17458)
- We fixed an issue where JabRef showed an "Executor has been shut down" error on Windows after resuming from suspend. [#17144](https://github.com/JabRef/jabref/pull/17144)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public enum FieldProperty {
MONTH,

MULTILINE_TEXT,

/// Enables numeric-aware sorting and influences how JabRef treats field content.
/// This is a JabRef property, not a BibLaTeX datatype: fields such as `number` and
/// `edition` can also contain literal values. See the [BibLaTeX field definitions](https://github.com/plk/biblatex/blob/dev/doc/latex/biblatex/biblatex.tex).
NUMERIC,
PAGINATION,
PERSON_NAMES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public enum StandardField implements Field {
CROSSREF("crossref", FieldProperty.SINGLE_ENTRY_LINK),
CITES("cites", FieldProperty.MULTIPLE_ENTRY_LINK),
DATE("date", FieldProperty.DATE),
DAY("day"),
DAYFILED("dayfiled"),
DAY("day", FieldProperty.NUMERIC),
DAYFILED("dayfiled", FieldProperty.NUMERIC),
DOI("doi", FieldProperty.VERBATIM, FieldProperty.IDENTIFIER),
EDITION("edition", FieldProperty.NUMERIC),
EDITOR("editor", FieldProperty.PERSON_NAMES),
Expand Down Expand Up @@ -144,7 +144,7 @@ public enum StandardField implements Field {

// region: JabRef-specific fields

CITATIONCOUNT("citationcount"),
CITATIONCOUNT("citationcount", FieldProperty.NUMERIC),
GROUPS("groups"),
ICORERANKING("icore"),
OWNER("owner"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,26 @@
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

class StandardFieldTest {

@Test
void fieldsConsideredEqualIfSame() {
assertEquals(StandardField.TITLE, StandardField.TITLE);
}

@Test
void numericFieldsHaveNumericProperty() {
assertTrue(StandardField.CITATIONCOUNT.isNumeric());
assertTrue(StandardField.DAY.isNumeric());
assertTrue(StandardField.DAYFILED.isNumeric());
}

@Test
void nonNumericFieldsDoNotHaveNumericProperty() {
assertFalse(StandardField.CHAPTER.isNumeric());
assertFalse(StandardField.PART.isNumeric());
}
}