Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into addSourceToChangesD…
Browse files Browse the repository at this point in the history
…ialog

* upstream/main:
  Fixed ADS tests
  Bump junit-jupiter from 5.9.1 to 5.9.2 (#9579)
  Bump actions/configure-pages from 2 to 3
  open office csv format correction for abstract column (#9570)
  Update CHANGELOG.md
  add change log entry for the given change
  typo removed (#9577)
  remove filter that consumes mouse rightclick
  • Loading branch information
Siedlerchr committed Jan 28, 2023
2 parents 4dd0b0b + fdcd0fa commit ef10a66
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
working-directory: docs/
- name: Setup Pages
id: pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v3
- name: Build with Jekyll
run: |
cd docs
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- For portable versions, the `.deb` file now works on plain debian again. [#9472](https://github.com/JabRef/jabref/issues/9472)
- We fixed an issue where the download of linked online files failed after an import of entries for certain urls. [#9518](https://github.com/JabRef/jabref/issues/9518)
- We fixed an issue where an exception occured when manually downloading a file from an URL in the entry editor. [#9521](https://github.com/JabRef/jabref/issues/9521)
- We fixed an issue with open office csv file formatting where commas in the abstract field where not escaped. [#9087][https://github.com/JabRef/jabref/issues/9087]
- We fixed an issue with deleting groups where subgroups different from the selected group were deleted. [#9281][https://github.com/JabRef/jabref/issues/9281]

## [5.8] - 2022-12-18

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ General overview about contributing for programmers and non-programmers is avail
## Pull Request Process

1. Understand the basics listed at <https://devdocs.jabref.org/contributing>.
2. Follow the "formal requirements". They are not too hard, they merely support the maintainers to focus on supportive feedback than just stating the obvious. The also have helpful hints how to work with localization.
2. Follow the "formal requirements". They are not too hard, they merely support the maintainers to focus on supportive feedback than just stating the obvious. They also have helpful hints how to work with localization.
3. Create a pull request. You can create a draft pull request to enable automatic checks.
4. Wait for feedback of the developers
5. Address the feedback of the developers
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ dependencies {
implementation group: 'net.harawata', name: 'appdirs', version: '1.2.1'

testImplementation 'io.github.classgraph:classgraph:4.8.154'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testImplementation 'org.junit.platform:junit-platform-launcher:1.9.2'

testImplementation 'org.mockito:mockito-core:5.0.0'
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/org/jabref/gui/groups/GroupTreeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import javafx.scene.control.TreeTableView;
import javafx.scene.input.ClipboardContent;
import javafx.scene.input.Dragboard;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.input.TransferMode;
import javafx.scene.layout.BorderPane;
Expand Down Expand Up @@ -266,10 +265,7 @@ private void initialize() {
.mapOpt(this::createContextMenuForGroup)
.orElseOpt((ContextMenu) null));
row.addEventFilter(MouseEvent.MOUSE_PRESSED, event -> {
if (event.getButton() == MouseButton.SECONDARY) {
// Prevent right-click to select group
event.consume();
} else if (event.getTarget() instanceof StackPane pane) {
if (event.getTarget() instanceof StackPane pane) {
if (pane.getStyleClass().contains("arrow") || pane.getStyleClass().contains("tree-disclosure-node")) {
event.consume();
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jabref/logic/layout/LayoutEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
import org.jabref.logic.layout.format.RemoveTilde;
import org.jabref.logic.layout.format.RemoveWhitespace;
import org.jabref.logic.layout.format.Replace;
import org.jabref.logic.layout.format.ReplaceWithEscapedDoubleQuotes;
import org.jabref.logic.layout.format.RisAuthors;
import org.jabref.logic.layout.format.RisKeywords;
import org.jabref.logic.layout.format.RisMonth;
Expand Down Expand Up @@ -475,6 +476,7 @@ private LayoutFormatter getLayoutFormatterByName(String name) {
case "Markdown" -> new MarkdownFormatter();
case "CSLType" -> new CSLType();
case "ShortMonth" -> new ShortMonthFormatter();
case "ReplaceWithEscapedDoubleQuotes" -> new ReplaceWithEscapedDoubleQuotes();
default -> null;
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.jabref.logic.layout.format;

import org.jabref.logic.layout.LayoutFormatter;

public class ReplaceWithEscapedDoubleQuotes implements LayoutFormatter {
@Override
public String format(String fieldText) {
StringBuilder builder = new StringBuilder(fieldText.length());

for (char c : fieldText.toCharArray()) {
if (c == '\"') {
builder.append("\"\"");
} else {
builder.append(c);
}
}
return builder.toString();
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
\format[GetOpenOfficeType]{\entrytype},"\begin{isbn}\isbn\end{isbn}","\citationkey","\format[Authors(LastFirst,FullName,Semicolon,Semicolon)]{\author}","\format[RemoveBrackets,RemoveWhitespace]{\title}","\journal",\volume,\number,"\month","\pages",\year,"\address","\note","\url","\booktitle","\chapter","\edition","\series","\format[Authors(LastFirst,FullName,Semicolon,Semicolon)]{\editor}","\publisher","\begin{reporttype}\reporttype\end{reporttype}","\howpublished","\institution","\organization","\school","\annote","\format[Replace(\n, )]{\abstract}","\comment","\keywords","\format[FileLink(pdf)]{\file}","\key"
\format[GetOpenOfficeType]{\entrytype},"\begin{isbn}\isbn\end{isbn}","\citationkey","\format[Authors(LastFirst,FullName,Semicolon,Semicolon)]{\author}","\format[RemoveBrackets,RemoveWhitespace]{\title}","\journal",\volume,\number,"\month","\pages",\year,"\address","\note","\url","\booktitle","\chapter","\edition","\series","\format[Authors(LastFirst,FullName,Semicolon,Semicolon)]{\editor}","\publisher","\begin{reporttype}\reporttype\end{reporttype}","\howpublished","\institution","\organization","\school","\annote","\format[Replace(\n, ),ReplaceWithEscapedDoubleQuotes]{\abstract}","\comment","\keywords","\format[FileLink(pdf)]{\file}","\key"
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.jabref.logic.formatter.bibtexfields;

import org.jabref.logic.layout.format.ReplaceWithEscapedDoubleQuotes;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

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

public class ReplaceWithEscapedDoubleQuotesTest {

private ReplaceWithEscapedDoubleQuotes formatter;

@BeforeEach
public void setUp() {
formatter = new ReplaceWithEscapedDoubleQuotes();
}

@Test
public void replacingSingleDoubleQuote() {
assertEquals("single \"\"double quote", formatter.format("single \"double quote"));
}

@Test
public void replacingMultipleDoubleQuote() {
assertEquals("multiple \"\"double\"\" quote", formatter.format("multiple \"double\" quote"));
}

@Test
public void replacingSingleDoubleQuoteHavingCommas() {
assertEquals("this \"\"is\"\", a test", formatter.format("this \"is\", a test"));
}

@Test
public void doNothing() {
assertEquals("this is a test", formatter.format("this is a test"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public void setUp() throws Exception {
.withField(StandardField.TITLE, "Slice theorem and orbit type stratification in infinite dimensions")
.withField(StandardField.YEAR, "2018")
.withField(StandardField.ARCHIVEPREFIX, "arXiv")
.withField(StandardField.DOI, "10.48550/arXiv.1812.04698")
.withField(StandardField.EPRINT, "1812.04698")
.withField(StandardField.JOURNAL, "arXiv e-prints")
.withField(StandardField.KEYWORDS, "Mathematics - Differential Geometry, Mathematical Physics, 58B25, (58D19, 58B20, 22E99, 58A35)")
Expand All @@ -70,7 +71,7 @@ public void setUp() throws Exception {
.withField(StandardField.MONTH, "#sep#")
.withField(StandardField.NUMBER, "1")
.withField(StandardField.ARCHIVEPREFIX, "arXiv")
.withField(StandardField.DOI, "10.12942/lrr-2012-10")
.withField(StandardField.DOI, "10.12942/lrr-2012-1010.48550/arXiv.1112.3960")
.withField(StandardField.PRIMARYCLASS, "astro-ph.CO")
.withField(StandardField.EID, "10")
.withField(StandardField.EPRINT, "1112.3960")
Expand Down

0 comments on commit ef10a66

Please sign in to comment.