Skip to content

Commit 66ccb58

Browse files
committed
Merge branch 'main' of https://github.com/JabRef/jabref into fix-for-issue-JabRef#12272
2 parents fc78dc5 + 1492443 commit 66ccb58

File tree

15 files changed

+88
-36
lines changed

15 files changed

+88
-36
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
YOU HAVE TO MODIFY THIS TEXT TO FIT YOUR PR. OTHERWISE, YOUR PR WILL BE CLOSED WITHOUT FURTHER COMMENT.
22
Describe the changes you have made here: what, why, ...
3-
Link the issue that will be closed. Example: "Closes #333".
3+
Closes #xyz. <!-- number of the issue that will be closed -->
44

55
### Mandatory checks
66

7-
<!--
7+
<!--
88
- Go through the list below. Please don't remove any items.
99
- [x] done; [ ] not done / not applicable
1010
-->

.github/workflows/cleanup-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }}
3030
- name: Delete folder on builds.jabref.org
3131
if: steps.checksecrets.outputs.secretspresent == 'YES'
32-
uses: appleboy/[email protected].1
32+
uses: appleboy/[email protected].2
3333
with:
3434
script: rm -rf /var/www/builds.jabref.org/www/pull/${{ github.event.pull_request.number }} || true
3535
host: build-upload.jabref.org

.github/workflows/product-map.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ jobs:
2222
FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} -- '*.java' | sed 's|^|\"|' | sed 's|$|\"|' | paste -sd "," -)
2323
if [ -z "$FILES" ]; then FILES="\"dummy.java\""; fi
2424
echo "expected_files=(${FILES})" >> $GITHUB_ENV
25+
echo "Files: ${FILES}"
2526
2627
- name: ProductMap Map Generation
2728
uses: product-map/product-map-action@main
28-
# disabled because of https://github.com/product-map/product-map-action/issues/7
29-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
3029
with:
3130
github_token: ${{ secrets.GITHUB_TOKEN }}
3231
expected_files: ${{ env.expected_files }}

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
4444
- We changed the "Copy Preview" button to "Copy citation (html) in the context menu of the preview. [#12551](https://github.com/JabRef/jabref/issues/12551)
4545
- Pressing Tab in empty text fields of the entry editor now moves the focus to the next field instead of inserting a tab character. [#11938](https://github.com/JabRef/jabref/issues/11938)
4646
- The embedded PostgresSQL server for the search now supports Linux and macOS ARM based distributions natively [#12607](https://github.com/JabRef/jabref/pull/12607)
47+
- We disabled the search and group fields in the sidebar when no library is opened. [#12657](https://github.com/JabRef/jabref/issues/12657)
48+
- We removed the obsolete Twitter link and added Mastodon and LinkedIn links in Help -> JabRef resources. [#12660](https://github.com/JabRef/jabref/issues/12660)
4749

4850
### Fixed
4951

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ You can click on failing checks to see more information about why they failed.
154154
Then, please look into them and handle accordingly.
155155

156156
Afterwards, you will receive comments on your pull request.
157+
Since JabRef is driven by volunteers in their spare time, reviews may take more time than a project with full time developers.
157158
The pull request may be approved immediatly, or a reviewer may request changes.
158159
In that case, please implement the requested changes.
159160

build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ dependencies {
182182
implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.13.0'
183183
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0'
184184
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.13.0'
185-
implementation 'commons-logging:commons-logging:1.3.4'
185+
implementation 'commons-logging:commons-logging:1.3.5'
186186
implementation 'com.h2database:h2-mvstore:2.3.232'
187187

188188
// required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635
@@ -265,7 +265,7 @@ dependencies {
265265
implementation 'org.controlsfx:controlsfx:11.2.1'
266266

267267
// region HTTP clients
268-
implementation 'org.jsoup:jsoup:1.18.3'
268+
implementation 'org.jsoup:jsoup:1.19.1'
269269
implementation 'com.konghq:unirest-java-core:4.4.5'
270270
implementation 'com.konghq:unirest-modules-gson:4.4.5'
271271
implementation 'org.apache.httpcomponents.client5:httpclient5:5.4.2'
@@ -301,7 +301,7 @@ dependencies {
301301
implementation 'com.vladsch.flexmark:flexmark:0.64.8'
302302
implementation 'com.vladsch.flexmark:flexmark-html2md-converter:0.64.8'
303303

304-
implementation group: 'net.harawata', name: 'appdirs', version: '1.3.0'
304+
implementation group: 'net.harawata', name: 'appdirs', version: '1.4.0'
305305

306306
implementation group: 'org.jooq', name: 'jool', version: '0.9.15'
307307
// JAX-RS implemented by Jersey
@@ -382,7 +382,7 @@ dependencies {
382382
implementation 'io.zonky.test.postgres:embedded-postgres-binaries-linux-arm64v8'
383383

384384
testImplementation 'io.github.classgraph:classgraph:4.8.179'
385-
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
385+
testImplementation 'org.junit.jupiter:junit-jupiter:5.12.0'
386386
testImplementation 'org.junit.platform:junit-platform-launcher:1.11.4'
387387

388388
testImplementation 'org.mockito:mockito-core:5.16.0'
@@ -396,7 +396,7 @@ dependencies {
396396
testImplementation "com.github.javaparser:javaparser-symbol-solver-core:3.26.3"
397397

398398
// recommended by https://github.com/wiremock/wiremock/issues/2149#issuecomment-1835775954
399-
testImplementation 'org.wiremock:wiremock-standalone:3.10.0'
399+
testImplementation 'org.wiremock:wiremock-standalone:3.12.1'
400400

401401
checkstyle 'com.puppycrawl.tools:checkstyle:10.21.3'
402402
// xjc needs the runtime as well for the ant task, otherwise it fails

src/main/java/org/jabref/gui/actions/StandardActions.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ public enum StandardActions implements Action {
174174
WEB_MENU(Localization.lang("JabRef resources")),
175175
OPEN_WEBPAGE(Localization.lang("Website"), Localization.lang("Opens JabRef's website"), IconTheme.JabRefIcons.HOME),
176176
OPEN_FACEBOOK("Facebook", Localization.lang("Opens JabRef's Facebook page"), IconTheme.JabRefIcons.FACEBOOK),
177-
OPEN_TWITTER("Twitter", Localization.lang("Opens JabRef's Twitter page"), IconTheme.JabRefIcons.TWITTER),
177+
OPEN_LINKEDIN("LinkedIn", Localization.lang("Opens JabRef's LinkedIn page"), IconTheme.JabRefIcons.LINKEDIN),
178+
OPEN_MASTODON("Mastodon", Localization.lang("Opens JabRef's Mastodon page"), IconTheme.JabRefIcons.MASTODON),
178179
OPEN_BLOG(Localization.lang("Blog"), Localization.lang("Opens JabRef's blog"), IconTheme.JabRefIcons.BLOG),
179180
OPEN_DEV_VERSION_LINK(Localization.lang("Development version"), Localization.lang("Opens a link where the current development version can be downloaded")),
180181
OPEN_CHANGELOG(Localization.lang("View change log"), Localization.lang("See what has been changed in the JabRef versions")),

src/main/java/org/jabref/gui/frame/MainMenu.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,9 @@ private void createMenu() {
356356
factory.createSubMenu(StandardActions.WEB_MENU,
357357
factory.createMenuItem(StandardActions.OPEN_WEBPAGE, new OpenBrowserAction("https://jabref.org/", dialogService, preferences.getExternalApplicationsPreferences())),
358358
factory.createMenuItem(StandardActions.OPEN_BLOG, new OpenBrowserAction("https://blog.jabref.org/", dialogService, preferences.getExternalApplicationsPreferences())),
359+
factory.createMenuItem(StandardActions.OPEN_LINKEDIN, new OpenBrowserAction("https://linkedin.com/company/jabref/", dialogService, preferences.getExternalApplicationsPreferences())),
359360
factory.createMenuItem(StandardActions.OPEN_FACEBOOK, new OpenBrowserAction("https://www.facebook.com/JabRef/", dialogService, preferences.getExternalApplicationsPreferences())),
360-
factory.createMenuItem(StandardActions.OPEN_TWITTER, new OpenBrowserAction("https://twitter.com/jabref_org", dialogService, preferences.getExternalApplicationsPreferences())),
361+
factory.createMenuItem(StandardActions.OPEN_MASTODON, new OpenBrowserAction("https://foojay.social/@jabref", dialogService, preferences.getExternalApplicationsPreferences())),
361362
factory.createMenuItem(StandardActions.OPEN_GITHUB, new OpenBrowserAction("https://github.com/JabRef/jabref", dialogService, preferences.getExternalApplicationsPreferences())),
362363

363364
new SeparatorMenuItem(),

src/main/java/org/jabref/gui/groups/GroupTreeView.java

+12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import javafx.application.Platform;
1919
import javafx.beans.binding.Bindings;
2020
import javafx.beans.property.ObjectProperty;
21+
import javafx.beans.value.ObservableBooleanValue;
2122
import javafx.css.PseudoClass;
2223
import javafx.geometry.Orientation;
2324
import javafx.scene.Node;
@@ -132,6 +133,7 @@ public GroupTreeView(TaskExecutor taskExecutor,
132133
this.undoManager = undoManager;
133134
this.fileUpdateMonitor = fileUpdateMonitor;
134135
this.keyBindingRepository = preferences.getKeyBindingRepository();
136+
this.disableProperty().bind(groupsDisabledProperty());
135137
createNodes();
136138
initialize();
137139
}
@@ -643,6 +645,16 @@ private void setupClearButtonField(CustomTextField customTextField) {
643645
}
644646
}
645647

648+
/**
649+
* Creates an observable boolean value that is true if no database is open
650+
*/
651+
private ObservableBooleanValue groupsDisabledProperty() {
652+
return Bindings.createBooleanBinding(
653+
() -> stateManager.getOpenDatabases().isEmpty(),
654+
stateManager.getOpenDatabases()
655+
);
656+
}
657+
646658
private static class DragExpansionHandler {
647659
private static final long DRAG_TIME_BEFORE_EXPANDING_MS = 1000;
648660
private TreeItem<GroupNodeViewModel> draggedItem;

src/main/java/org/jabref/gui/icon/IconTheme.java

+2
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ public enum JabRefIcons implements JabRefIcon {
298298
CONSOLE(MaterialDesignC.CONSOLE),
299299
FORUM(MaterialDesignF.FORUM),
300300
FACEBOOK(MaterialDesignF.FACEBOOK),
301+
MASTODON(MaterialDesignM.MASTODON),
302+
LINKEDIN(MaterialDesignL.LINKEDIN),
301303
TWITTER(MaterialDesignT.TWITTER),
302304
BLOG(MaterialDesignR.RSS),
303305
DATE_PICKER(MaterialDesignC.CALENDAR),

src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneView.java

+49-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.jabref.gui.importer.fetcher;
22

3+
import javafx.beans.binding.Bindings;
34
import javafx.beans.binding.BooleanExpression;
5+
import javafx.beans.value.ObservableBooleanValue;
46
import javafx.css.PseudoClass;
57
import javafx.scene.control.Button;
68
import javafx.scene.control.ComboBox;
@@ -33,36 +35,26 @@ public class WebSearchPaneView extends VBox {
3335
private final WebSearchPaneViewModel viewModel;
3436
private final GuiPreferences preferences;
3537
private final DialogService dialogService;
38+
private final StateManager stateManager;
3639

3740
public WebSearchPaneView(GuiPreferences preferences, DialogService dialogService, StateManager stateManager) {
3841
this.preferences = preferences;
3942
this.dialogService = dialogService;
43+
this.stateManager = stateManager;
4044
this.viewModel = new WebSearchPaneViewModel(preferences, dialogService, stateManager);
4145
initialize();
4246
}
4347

4448
private void initialize() {
45-
ComboBox<SearchBasedFetcher> fetchers = new ComboBox<>();
46-
new ViewModelListCellFactory<SearchBasedFetcher>()
47-
.withText(SearchBasedFetcher::getName)
48-
.install(fetchers);
49-
fetchers.itemsProperty().bind(viewModel.fetchersProperty());
50-
fetchers.valueProperty().bindBidirectional(viewModel.selectedFetcherProperty());
51-
fetchers.setMaxWidth(Double.POSITIVE_INFINITY);
52-
HBox.setHgrow(fetchers, Priority.ALWAYS);
53-
5449
StackPane helpButtonContainer = createHelpButtonContainer();
55-
HBox fetcherContainer = new HBox(fetchers, helpButtonContainer);
56-
TextField query = SearchTextField.create(preferences.getKeyBindingRepository());
57-
getChildren().addAll(fetcherContainer, query, createSearchButton());
58-
59-
viewModel.queryProperty().bind(query.textProperty());
60-
61-
addQueryValidationHints(query);
62-
63-
enableEnterToTriggerSearch(query);
64-
65-
ClipBoardManager.addX11Support(query);
50+
HBox fetcherContainer = new HBox(createFetcherComboBox(), helpButtonContainer);
51+
52+
getChildren().addAll(
53+
fetcherContainer,
54+
createQueryField(),
55+
createSearchButton()
56+
);
57+
this.disableProperty().bind(searchDisabledProperty());
6658
}
6759

6860
/**
@@ -89,6 +81,33 @@ private void addQueryValidationHints(TextField query) {
8981
});
9082
}
9183

84+
/**
85+
* Create combo box for selecting fetcher
86+
*/
87+
private ComboBox<SearchBasedFetcher> createFetcherComboBox() {
88+
ComboBox<SearchBasedFetcher> fetchers = new ComboBox<>();
89+
new ViewModelListCellFactory<SearchBasedFetcher>()
90+
.withText(SearchBasedFetcher::getName)
91+
.install(fetchers);
92+
fetchers.itemsProperty().bind(viewModel.fetchersProperty());
93+
fetchers.valueProperty().bindBidirectional(viewModel.selectedFetcherProperty());
94+
fetchers.setMaxWidth(Double.POSITIVE_INFINITY);
95+
HBox.setHgrow(fetchers, Priority.ALWAYS);
96+
return fetchers;
97+
}
98+
99+
/**
100+
* Create text field for search query
101+
*/
102+
private TextField createQueryField() {
103+
TextField query = SearchTextField.create(preferences.getKeyBindingRepository());
104+
viewModel.queryProperty().bind(query.textProperty());
105+
addQueryValidationHints(query);
106+
enableEnterToTriggerSearch(query);
107+
ClipBoardManager.addX11Support(query);
108+
return query;
109+
}
110+
92111
/**
93112
* Create button that triggers search
94113
*/
@@ -118,4 +137,14 @@ private StackPane createHelpButtonContainer() {
118137
});
119138
return helpButtonContainer;
120139
}
140+
141+
/**
142+
* Creates an observable boolean value that is true if no database is open
143+
*/
144+
private ObservableBooleanValue searchDisabledProperty() {
145+
return Bindings.createBooleanBinding(
146+
() -> stateManager.getOpenDatabases().isEmpty(),
147+
stateManager.getOpenDatabases()
148+
);
149+
}
121150
}

src/main/resources/l10n/JabRef_en.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,8 @@ Set\ read\ status\ to\ read=Set read status to read
13441344
Set\ read\ status\ to\ skimmed=Set read status to skimmed
13451345

13461346
Opens\ JabRef's\ GitHub\ page=Opens JabRef's GitHub page
1347-
Opens\ JabRef's\ Twitter\ page=Opens JabRef's Twitter page
1347+
Opens\ JabRef's\ LinkedIn\ page=Opens JabRef's LinkedIn page
1348+
Opens\ JabRef's\ Mastodon\ page=Opens JabRef's Mastodon page
13481349
Opens\ JabRef's\ Facebook\ page=Opens JabRef's Facebook page
13491350
Opens\ JabRef's\ blog=Opens JabRef's blog
13501351
Opens\ JabRef's\ website=Opens JabRef's website

src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
import org.jabref.logic.importer.ImporterPreferences;
1010
import org.jabref.logic.importer.PagedSearchBasedFetcher;
1111
import org.jabref.logic.importer.SearchBasedFetcher;
12+
import org.jabref.logic.util.BuildInfo;
1213
import org.jabref.model.entry.BibEntry;
1314
import org.jabref.model.entry.field.StandardField;
1415
import org.jabref.model.entry.types.StandardEntryType;
1516
import org.jabref.testutils.category.FetcherTest;
1617

18+
import com.airhacks.afterburner.injection.Injector;
1719
import kong.unirest.core.json.JSONObject;
1820
import org.junit.jupiter.api.BeforeEach;
1921
import org.junit.jupiter.api.Disabled;
@@ -32,8 +34,10 @@ class SpringerFetcherTest implements SearchBasedFetcherCapabilityTest, PagedSear
3234

3335
@BeforeEach
3436
void setUp() {
35-
when(importerPreferences.getApiKeys()).thenReturn(FXCollections.emptyObservableSet());
37+
BuildInfo buildInfo = Injector.instantiateModelOrService(BuildInfo.class);
3638
fetcher = new SpringerFetcher(importerPreferences);
39+
when(importerPreferences.getApiKeys()).thenReturn(FXCollections.emptyObservableSet());
40+
when(importerPreferences.getApiKey(fetcher.getName())).thenReturn(Optional.of(buildInfo.springerNatureAPIKey));
3741
}
3842

3943
@Test

0 commit comments

Comments
 (0)