Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
calixtus committed Nov 28, 2024
2 parents d124d79 + 2549ab6 commit 5bac391
Show file tree
Hide file tree
Showing 124 changed files with 1,119 additions and 441 deletions.
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
6 changes: 6 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,6 +117,7 @@ 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)
Expand Down
28 changes: 14 additions & 14 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 Down Expand Up @@ -265,7 +265,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 +278,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 +334,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 +370,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 +393,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
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=57dafb5c2622c6cc08b993c85b7c06956a2f53536432a30ead46166dbca0f1e9
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-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
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
8 changes: 4 additions & 4 deletions src/main/java/org/jabref/gui/entryeditor/FieldsEditorTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private void addPreviewPanel() {

public void removePreviewPanelFromThisTab() {
assert this.getContent() instanceof SplitPane;
if (this.getContent() instanceof SplitPane splitPane && splitPane.getItems().contains(previewPanel)) {
if (this.getContent() instanceof SplitPane splitPane) {
splitPane.getItems().remove(previewPanel);
// Needed to "redraw" the split pane with one item (because JavaFX does not readjust if it is shown)
// splitPane.setDividerPositions(1.0);
Expand All @@ -260,10 +260,10 @@ public void removePreviewPanelFromThisTab() {

@Override
protected void handleFocus() {
LOGGER.error("This is {}", preferences.getPreviewPreferences().showPreviewAsExtraTabProperty().get());
LOGGER.error("This is then {}", !preferences.getPreviewPreferences().showPreviewAsExtraTabProperty().get());
LOGGER.trace("This is {}", preferences.getPreviewPreferences().showPreviewAsExtraTabProperty().get());
LOGGER.trace("This is then {}", !preferences.getPreviewPreferences().showPreviewAsExtraTabProperty().get());
if (!preferences.getPreviewPreferences().showPreviewAsExtraTabProperty().get()) {
LOGGER.error("Focus on preview panel");
LOGGER.trace("Focus on preview panel");

// We need to move the preview panel from the non-visible tab to the visible tab
removePreviewPanelFromOtherTabs();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.jabref.gui.entryeditor.citationrelationtab.semanticscholar;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.List;

import org.jabref.logic.importer.FetcherException;
import org.jabref.logic.importer.ImporterPreferences;
import org.jabref.logic.importer.fetcher.CustomizableKeyFetcher;
import org.jabref.logic.net.URLDownload;
import org.jabref.logic.util.URLUtil;
import org.jabref.model.entry.BibEntry;

import com.google.gson.Gson;
Expand Down Expand Up @@ -38,7 +38,7 @@ public List<BibEntry> searchCitedBy(BibEntry entry) throws FetcherException {

URL citationsUrl;
try {
citationsUrl = URI.create(getAPIUrl("citations", entry)).toURL();
citationsUrl = URLUtil.create(getAPIUrl("citations", entry));
} catch (MalformedURLException e) {
throw new FetcherException("Malformed URL", e);
}
Expand All @@ -62,7 +62,7 @@ public List<BibEntry> searchCiting(BibEntry entry) throws FetcherException {

URL referencesUrl;
try {
referencesUrl = URI.create(getAPIUrl("references", entry)).toURL();
referencesUrl = URLUtil.create(getAPIUrl("references", entry));
} catch (MalformedURLException e) {
throw new FetcherException("Malformed URL", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public Parent getNode() {

@FXML
private void addNewFile() {
dialogService.showCustomDialogAndWait(new LinkedFileEditDialog()).ifPresent(newLinkedFile -> {
dialogService.showCustomDialogAndWait(new LinkedFileEditDialog()).filter(file -> !file.isEmpty()).ifPresent(newLinkedFile -> {
viewModel.addNewLinkedFile(newLinkedFile);
});
}
Expand Down
Loading

0 comments on commit 5bac391

Please sign in to comment.