Skip to content

Commit

Permalink
Merge branch 'main' into fix-for-issue-11878
Browse files Browse the repository at this point in the history
  • Loading branch information
agondekova authored Nov 29, 2024
2 parents 1f4f813 + 37593bf commit df539a3
Show file tree
Hide file tree
Showing 136 changed files with 1,174 additions and 469 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/assign-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: takanome-dev/assign-issue-action@beta
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
days_until_unassign: 30
days_until_unassign: 90
maintainers: koppor, Siedlerchr, ThiloteE, calixtus, HoussemNasri
assigned_comment: |
👋 Hey @{{ handle }}, thank you for your interest in this issue! 🎉
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }}
- name: Delete folder on builds.jabref.org
if: steps.checksecrets.outputs.secretspresent == 'YES'
uses: appleboy/ssh-action@v1.1.0
uses: appleboy/ssh-action@v1.2.0
with:
script: rm -rf /var/www/builds.jabref.org/www/pull/${{ github.event.pull_request.number }} || true
host: build-upload.jabref.org
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deployment-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ jobs:
submodules: 'true'
show-progress: 'false'
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected].0
uses: gittools/actions/gitversion/[email protected].3
with:
versionSpec: "5.x"
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected].0
uses: gittools/actions/gitversion/[email protected].3
- name: Setup JDK
uses: actions/setup-java@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deployment-jdk-ea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ jobs:
packages: pigz
version: 1.0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected].0
uses: gittools/actions/gitversion/[email protected].3
with:
versionSpec: "5.x"
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected].0
uses: gittools/actions/gitversion/[email protected].3

# JDK
- name: 'Set up JDK ${{ matrix.jdk }}'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ jobs:
packages: pigz
version: 1.0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected].0
uses: gittools/actions/gitversion/[email protected].3
with:
versionSpec: "5.x"
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected].0
uses: gittools/actions/gitversion/[email protected].3
- name: Setup JDK
uses: actions/setup-java@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
submodules: 'false'
show-progress: 'false'
- name: markdownlint-cli2-action
uses: DavidAnson/markdownlint-cli2-action@v17
uses: DavidAnson/markdownlint-cli2-action@v18
with:
globs: |
*.md
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:
CI: "true"
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
DBMS: "postgresql"
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
if: (github.ref == 'refs/heads/main') && (steps.checksecrets.outputs.secretspresent == 'YES')
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .moderne/moderne.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
specs: specs.moderne.ai/v1/cli
java:
selectedJdk: '23'
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Added

- We added a Markdown export layout. [#12220](https://github.com/JabRef/jabref/pull/12220)
- We added a "view as BibTeX" option before importing an entry from the citation relation tab. [#11826](https://github.com/JabRef/jabref/issues/11826)
- We added support finding LaTeX-encoded special characters based on plain Unicode and vice versa. [#11542](https://github.com/JabRef/jabref/pull/11542)
- When a search hits a file, the file icon of that entry is changed accordingly. [#11542](https://github.com/JabRef/jabref/pull/11542)
Expand Down Expand Up @@ -43,8 +44,10 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We added automatic browser extension install on Windows for Chrome and Edge. [#6076](https://github.com/JabRef/jabref/issues/6076)
- We added support to automatically open a `.bib` file in the current/parent folder if no other library is opened. [koppor#377](https://github.com/koppor/jabref/issues/377)
- We added a search bar for filtering keyboard shortcuts. [#11686](https://github.com/JabRef/jabref/issues/11686)
- We added new modifiers `camel_case`, `camel_case_n`, `short_title`, and `very_short_title` for the [citation key generator](https://docs.jabref.org/setup/citationkeypatterns). [#11367](https://github.com/JabRef/jabref/issues/11367)
- By double clicking on a local citation in the Citation Relations Tab you can now jump the linked entry. [#11955](https://github.com/JabRef/jabref/pull/11955)
- We use the menu icon for background tasks as a progress indicator to visualise an import's progress when dragging and dropping several PDF files into the main table. [#12072](https://github.com/JabRef/jabref/pull/12072)
- The PDF content importer now supports importing title from upto the second page of the PDF. [#12139](https://github.com/JabRef/jabref/issues/12139)

### Changed

Expand Down Expand Up @@ -76,6 +79,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We changed the name of the library-based file directory from 'General File Directory' to 'Library-specific File Directory' per issue. [#571](https://github.com/koppor/jabref/issues/571)
- We changed the defualt [unwanted charachters](https://docs.jabref.org/setup/citationkeypatterns#removing-unwanted-characters) in the citation key generator and allow a dash (`-`) and colon (`:`) being part of a citation key. [#12144](https://github.com/JabRef/jabref/pull/12144)
- The CitationKey column is now a default shown column for the entry table. [#10510](https://github.com/JabRef/jabref/issues/10510)
- We disabled the actions "Open Terminal here" and "Reveal in file explorer" for unsaved libraries. [#11920](https://github.com/JabRef/jabref/issues/11920)
- JabRef now opens the corresponding directory in the library properties when "Browse" is clicked. [#12223](https://github.com/JabRef/jabref/pull/12223)

### Fixed

Expand Down Expand Up @@ -112,11 +117,13 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where the "Do not ask again" checkbox was not working, when asking for permission to use Grobid [koppor#556](https://github.com/koppor/jabref/issues/566).
- We fixed an issue where we display warning message for moving attached open files. [#10121](https://github.com/JabRef/jabref/issues/10121)
- We fixed an issue where it was not possible to select selecting content of other user's comments.[#11106](https://github.com/JabRef/jabref/issues/11106)
- We fixed an issue when handling URLs containing a pipe (`|`) character. [#11876](https://github.com/JabRef/jabref/issues/11876)
- We fixed an issue where web search preferences "Custom API key" table modifications not discarded. [#11925](https://github.com/JabRef/jabref/issues/11925)
- We fixed an issue when opening attached files in [extra file columns](https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#adding-additional-columns-to-entry-table-for-file-types). [#12005](https://github.com/JabRef/jabref/issues/12005)
- We fixed an issue where trying to open a library from a failed mounted directory on Mac would cause an error. [#10548](https://github.com/JabRef/jabref/issues/10548)
- We fixed an issue when the preview was out of sync. [#9172](https://github.com/JabRef/jabref/issues/9172)
- We fixed an issue where identifier paste couldn't work with Unicode REPLACEMENT CHARACTER. [#11986](https://github.com/JabRef/jabref/issues/11986)
- We fixed an issue when click on entry at "Check Integrity" wasn't properly focusing the entry and field. [#11997](https://github.com/JabRef/jabref/issues/11997)

### Removed

Expand Down
33 changes: 17 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins {

id 'idea'

id 'org.openrewrite.rewrite' version '6.27.0'
id 'org.openrewrite.rewrite' version '6.27.2'

id "org.itsallcode.openfasttrace" version "3.0.1"
}
Expand All @@ -54,13 +54,14 @@ java {

toolchain {
// If this is updated, also update
// - .gitpod.Dockerfile
// - build.gradle -> jacoco -> toolVersion (because JaCoCo does not support newest JDK out of the box. Check versions at https://www.jacoco.org/jacoco/trunk/doc/changes.html)
// - .devcontainer/devcontainer.json#L34 and
// - .gitpod.Dockerfile
// - .moderne/moderne.yml
// - .github/workflows/deployment*.yml
// - .github/workflows/tests*.yml
// - .github/workflows/update-gradle-wrapper.yml
// - docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.md
// - build.gradle -> jacoco -> toolVersion (because JaCoCo does not support newest JDK out of the box. Check versions at https://www.jacoco.org/jacoco/trunk/doc/changes.html)
languageVersion = JavaLanguageVersion.of(23)
// See https://docs.gradle.org/current/javadoc/org/gradle/jvm/toolchain/JvmVendorSpec.html for a full list
// vendor = JvmVendorSpec.AMAZON
Expand Down Expand Up @@ -265,7 +266,7 @@ dependencies {

// region HTTP clients
implementation 'org.jsoup:jsoup:1.18.1'
implementation 'com.konghq:unirest-java-core:4.4.4'
implementation 'com.konghq:unirest-java-core:4.4.5'
implementation 'com.konghq:unirest-modules-gson:4.4.5'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.4'
// endregion
Expand All @@ -278,7 +279,7 @@ dependencies {
// route all requests to java.util.logging to SLF4J (which in turn routes to tinylog)
implementation 'org.slf4j:jul-to-slf4j:2.0.16'
// route all requests to log4j to SLF4J
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.24.1'
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.24.2'

implementation('de.undercouch:citeproc-java:3.1.0') {
exclude group: 'org.antlr'
Expand Down Expand Up @@ -334,23 +335,23 @@ dependencies {
implementation 'org.yaml:snakeyaml:2.3'

// region AI
implementation 'dev.langchain4j:langchain4j:0.35.0'
implementation 'dev.langchain4j:langchain4j:0.36.0'
// Even though we use jvm-openai for LLM connection, we still need this package for tokenization.
implementation('dev.langchain4j:langchain4j-open-ai:0.35.0') {
implementation('dev.langchain4j:langchain4j-open-ai:0.36.0') {
exclude group: 'com.squareup.okhttp3'
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
exclude group: 'org.jetbrains.kotlin'
}
implementation('dev.langchain4j:langchain4j-mistral-ai:0.35.0') {
implementation('dev.langchain4j:langchain4j-mistral-ai:0.36.2') {
exclude group: 'com.squareup.okhttp3'
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
exclude group: 'org.jetbrains.kotlin'
}
implementation('dev.langchain4j:langchain4j-google-ai-gemini:0.35.0') {
implementation('dev.langchain4j:langchain4j-google-ai-gemini:0.36.0') {
exclude group: 'com.squareup.okhttp3'
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
}
implementation('dev.langchain4j:langchain4j-hugging-face:0.35.0') {
implementation('dev.langchain4j:langchain4j-hugging-face:0.36.0') {
exclude group: 'com.squareup.okhttp3'
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
exclude group: 'org.jetbrains.kotlin'
Expand All @@ -370,17 +371,17 @@ dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.21'
// endregion

implementation 'commons-io:commons-io:2.17.0'
implementation 'commons-io:commons-io:2.18.0'

// Even if "compileOnly" is used, IntelliJ always adds to module-info.java. To avoid issues during committing, we use "implementation" instead of "compileOnly"
implementation 'io.github.adr:e-adr:2.0.0-SNAPSHOT'

implementation 'io.zonky.test:embedded-postgres:2.0.7'
implementation 'io.zonky.test:embedded-postgres:2.1.0'
implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:17.0.0')

testImplementation 'io.github.classgraph:classgraph:4.8.177'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.0'
testImplementation 'org.junit.platform:junit-platform-launcher:1.10.3'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.3'
testImplementation 'org.junit.platform:junit-platform-launcher:1.11.3'

testImplementation 'org.mockito:mockito-core:5.14.2'
testImplementation 'org.xmlunit:xmlunit-core:2.10.0'
Expand All @@ -393,14 +394,14 @@ dependencies {
testImplementation "com.github.javaparser:javaparser-symbol-solver-core:3.26.2"

// recommended by https://github.com/wiremock/wiremock/issues/2149#issuecomment-1835775954
testImplementation 'org.wiremock:wiremock-standalone:3.3.1'
testImplementation 'org.wiremock:wiremock-standalone:3.9.2'

checkstyle 'com.puppycrawl.tools:checkstyle:10.20.1'
// xjc needs the runtime as well for the ant task, otherwise it fails
xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '3.0.2'
xjc group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '3.0.2'

rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.19.0"))
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:2.22.0"))
rewrite("org.openrewrite.recipe:rewrite-static-analysis")
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks")
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks")
Expand Down
2 changes: 1 addition & 1 deletion config/IntelliJ Code Style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,4 @@
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</code_scheme>
7 changes: 7 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
<property name="fileExtensions" value="groovy,java" />
</module>

<!-- Prevent newline after catch opening parenthesis -->
<module name="RegexpMultiline">
<property name="message" value="No newline allowed after catch opening parenthesis" />
<property name="format" value="catch\s*\(\s*[\r]?\n" />
<property name="fileExtensions" value="groovy,java" />
</module>

<!-- Checks for size violations: https://checkstyle.sourceforge.io/config_sizes.html -->

<!-- LineLength not in place as PreviewerViewer and RelatedArticlesTab have line length with more than 500 charachters -->
Expand Down
7 changes: 7 additions & 0 deletions config/checkstyle/checkstyle_reviewdog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
<property name="fileExtensions" value="groovy,java" />
</module>

<!-- Prevent newline after catch opening parenthesis -->
<module name="RegexpMultiline">
<property name="message" value="No newline allowed after catch opening parenthesis" />
<property name="format" value="catch\s*\(\s*[\r]?\n" />
<property name="fileExtensions" value="groovy,java" />
</module>

<!-- Checks for size violations: https://checkstyle.sourceforge.io/config_sizes.html -->

<!-- LineLength not in place as PreviewerViewer and RelatedArticlesTab have line length with more than 500 charachters -->
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,7 @@ public void pasteEntry() {
private List<BibEntry> handleNonBibTeXStringData(String data) {
try {
return this.importHandler.handleStringData(data);
} catch (
FetcherException exception) {
} catch (FetcherException exception) {
if (exception instanceof FetcherClientException) {
dialogService.showInformationDialogAndWait(Localization.lang("Look up identifier"), Localization.lang("No data was found for the identifier"));
} else if (exception instanceof FetcherServerException) {
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/org/jabref/gui/actions/ActionHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public static BooleanExpression needsDatabase(StateManager stateManager) {
return stateManager.activeDatabaseProperty().isPresent();
}

public static BooleanExpression needsSavedLocalDatabase(StateManager stateManager) {
EasyBinding<Boolean> binding = EasyBind.map(stateManager.activeDatabaseProperty(), context -> context.filter(c -> c.getLocation() == DatabaseLocation.LOCAL && c.getDatabasePath().isPresent()).isPresent());
return BooleanExpression.booleanExpression(binding);
}

public static BooleanExpression needsSharedDatabase(StateManager stateManager) {
EasyBinding<Boolean> binding = EasyBind.map(stateManager.activeDatabaseProperty(), context -> context.filter(c -> c.getLocation() == DatabaseLocation.SHARED).isPresent());
return BooleanExpression.booleanExpression(binding);
Expand All @@ -49,7 +54,7 @@ public static BooleanExpression needsEntriesSelected(StateManager stateManager)

public static BooleanExpression needsEntriesSelected(int numberOfEntries, StateManager stateManager) {
return Bindings.createBooleanBinding(() -> stateManager.getSelectedEntries().size() == numberOfEntries,
stateManager.getSelectedEntries());
stateManager.getSelectedEntries());
}

public static BooleanExpression isFieldSetForSelectedEntry(Field field, StateManager stateManager) {
Expand Down
21 changes: 19 additions & 2 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.SortedSet;
import java.util.stream.Collectors;

import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.geometry.Side;
import javafx.scene.control.Button;
Expand Down Expand Up @@ -61,6 +62,7 @@
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.entry.EntryConverter;
import org.jabref.model.entry.field.Field;
import org.jabref.model.util.DirectoryMonitorManager;
import org.jabref.model.util.FileUpdateMonitor;
Expand Down Expand Up @@ -463,11 +465,26 @@ private void fetchAndMerge(EntryBasedFetcher fetcher) {

public void setFocusToField(Field field) {
UiTaskExecutor.runInJavaFXThread(() -> {
Field actualField = field;
boolean fieldFound = false;
for (Tab tab : tabbed.getTabs()) {
tabbed.getSelectionModel().select(tab);
if ((tab instanceof FieldsEditorTab fieldsEditorTab)
&& fieldsEditorTab.getShownFields().contains(field)) {
&& fieldsEditorTab.getShownFields().contains(actualField)) {
tabbed.getSelectionModel().select(tab);
fieldsEditorTab.requestFocus(field);
Platform.runLater(() -> {
fieldsEditorTab.requestFocus(actualField);
});
// This line explicitly brings focus back to the main window containing the Entry Editor.
getScene().getWindow().requestFocus();
fieldFound = true;
break;
}
}
if (!fieldFound) {
Field aliasField = EntryConverter.FIELD_ALIASES.get(field);
if (aliasField != null) {
setFocusToField(aliasField);
}
}
});
Expand Down
Loading

0 comments on commit df539a3

Please sign in to comment.