Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into customizeEntrydlg
Browse files Browse the repository at this point in the history
* upstream/master:
  Add select all buttons to change dialog (#5803)
  Squashed 'src/main/resources/csl-locales/' changes from 9785a6e358..a3e8843f75
  Squashed 'src/main/resources/csl-styles/' changes from 49a1841..b2fbe15
  Fix CSL update
  Add new authors
  Remove ACM Fetcher in one more check
  Adapt WebFetchersTest
  Disable ACM Fetcher
  Try to fix branch name on cleanup pr action
  Remove obsolete class (#5801)
  Try to use right ref
  Run tests only once at pull requets
  Add ignored dependency
  Fix "&" on previews (#5786)
  [WIP] Batch Insert entries (#5691)
  • Loading branch information
Siedlerchr committed Jan 3, 2020
2 parents c3d4f31 + f11949f commit 70147eb
Show file tree
Hide file tree
Showing 160 changed files with 20,862 additions and 6,797 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/cleanup_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ on:
types: [closed]

jobs:
build:

cleanup:
runs-on: ubuntu-latest

steps:
- name: Extract branch name
id: extract_branch
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "##[set-output name=branch;]$(echo ${{ github.event.pull_request.head.ref }})"
- name: Delete folder on builds.jabref.org
uses: appleboy/[email protected]
with:
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/refresh-csl-subtrees.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Refresh Citation Style Language Files

on:
push:
paths:
- '.github/workflows/refresh-csl-subtrees.yml'
- 'src/main/resources/csl-locales/**'
schedule:
# run on 1st and 15th of each month
- cron: '1 2 1,15 * *'
Expand All @@ -11,28 +15,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2-beta
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0
- name: Add csl-styles remote
run: git remote add -f csl-styles https://github.com/citation-style-language/styles.git
- name: Update csl-styles
run: |
run: |
git checkout master
git config --local core.editor /usr/bin/cat
git config user.name "github actions"
git config user.email "[email protected]"
git subtree pull --prefix src/main/resources/csl-styles csl-styles master --squash
- name: Add csl-locales remote
run: git remote add -f csl-locales https://github.com/citation-style-language/locales.git
- name: Update csl-locales
run: |
git checkout master
git subtree pull --prefix src/main/resources/csl-locales csl-locales master --squash
- uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
- name: Report issues
if: failure()
uses: JasonEtco/create-an-issue@master
env:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/failure-csl-update.md
2 changes: 2 additions & 0 deletions .github/workflows/tests-oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Oracle Tests

on:
push:
branches:
- master
paths:
- 'src/test/java/org/jabref/model/database/**'
- 'src/test/java/org/jabref/logic/shared/**'
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Tests

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
# always run on pull requests

jobs:
checkstyle:
Expand Down
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ Jong-Ho Shinn
Jorge Tornero
josephshin93
Joshua Ramon Enslin
José Jesús Sinohui Fernández
Julian Pfeifer
Jure Slak
József Pallagi
Expand Down Expand Up @@ -182,6 +183,7 @@ Ling Wang
Linus Dietz
Lorenzo Genta
Luciana de Melo e Abud
Luis Romero
Mairieli Wessel
Malik Atalla
Malte Deiseroth
Expand All @@ -196,6 +198,7 @@ Martin Stolle
Martina Catizone
Mathias Walter
Matthias Geiger
Matthias Mueller
Mattia Bunel
Mattias Ulbrich
mcmoody
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where the Medline fetcher was only working when JabRef was running from source [#5645](https://github.com/JabRef/jabref/issues/5645)
- We fixed some visual issues in the dark theme [#5764](https://github.com/JabRef/jabref/pull/5764) [#5753](https://github.com/JabRef/jabref/issues/5753)
- We fixed an issue where non-default previews didn't handle unicode characters. [#5779](https://github.com/JabRef/jabref/issues/5779)
- We fixed an issue where the ampersand character wasn't rendering correctly on previews.[#3840](https://github.com/JabRef/jabref/issues/3840)


### Removed
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ dependencyUpdates.resolutionStrategy = {
}
}
rules.withModule("de.jensd:fontawesomefx-materialdesignfont") { ComponentSelection selection ->
if (selection.candidate.version ==~ /2.0.26-9.1.1/ || selection.candidate.version ==~ /2.0.26-9.1.2/) {
if (selection.candidate.version ==~ /2.0.26-9.1.2/
|| selection.candidate.version ==~ /2.0.26-9.1.1/
|| selection.candidate.version ==~ /2.0.26-9.1.0/) {
selection.reject('1.7.22-11 is actually newer (strange version system)')
}
}
Expand Down
59 changes: 34 additions & 25 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import org.jabref.gui.undo.CountingUndoManager;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableFieldChange;
import org.jabref.gui.undo.UndoableInsertEntry;
import org.jabref.gui.undo.UndoableInsertEntries;
import org.jabref.gui.undo.UndoableRemoveEntries;
import org.jabref.gui.util.DefaultTaskExecutor;
import org.jabref.gui.worker.SendAsEMailAction;
Expand All @@ -80,8 +80,8 @@
import org.jabref.model.database.KeyCollisionException;
import org.jabref.model.database.event.BibDatabaseContextChangedEvent;
import org.jabref.model.database.event.CoarseChangeFilter;
import org.jabref.model.database.event.EntriesAddedEvent;
import org.jabref.model.database.event.EntriesRemovedEvent;
import org.jabref.model.database.event.EntryAddedEvent;
import org.jabref.model.database.shared.DatabaseLocation;
import org.jabref.model.database.shared.DatabaseSynchronizer;
import org.jabref.model.entry.BibEntry;
Expand Down Expand Up @@ -168,7 +168,7 @@ public BasePanel(JabRefFrame frame, BasePanelPreferences preferences, BibDatabas
setupActions();

this.getDatabase().registerListener(new SearchListener());
this.getDatabase().registerListener(new EntryRemovedListener());
this.getDatabase().registerListener(new EntriesRemovedListener());

// ensure that at each addition of a new entry, the entry is added to the groups interface
this.bibDatabaseContext.getDatabase().registerListener(new GroupTreeListener());
Expand Down Expand Up @@ -605,29 +605,39 @@ public void registerUndoableChanges(List<FieldChange> changes) {
}
}

public void insertEntry(final BibEntry bibEntry) {
if (bibEntry != null) {
insertEntries(Collections.singletonList(bibEntry));
}
}

/**
* This method is called from JabRefFrame when the user wants to create a new entry.
* This method is called from JabRefFrame when the user wants to create a new entry or entries.
* It is necessary when the user would expect the added entry or one of the added entries
* to be selected in the entry editor
*
* @param bibEntry The new entry.
* @param entries The new entries.
*/
public void insertEntry(final BibEntry bibEntry) {
if (bibEntry != null) {

public void insertEntries(final List<BibEntry> entries) {
if (!entries.isEmpty()) {
try {
bibDatabaseContext.getDatabase().insertEntry(bibEntry);
bibDatabaseContext.getDatabase().insertEntries(entries);

// Set owner and timestamp
UpdateField.setAutomaticFields(bibEntry, true, true, Globals.prefs.getUpdateFieldPreferences());

// Create an UndoableInsertEntry object.
getUndoManager().addEdit(new UndoableInsertEntry(bibDatabaseContext.getDatabase(), bibEntry));
for (BibEntry entry : entries) {
UpdateField.setAutomaticFields(entry, true, true, Globals.prefs.getUpdateFieldPreferences());
}
// Create an UndoableInsertEntries object.
getUndoManager().addEdit(new UndoableInsertEntries(bibDatabaseContext.getDatabase(), entries));

markBaseChanged(); // The database just changed.
if (Globals.prefs.getBoolean(JabRefPreferences.AUTO_OPEN_FORM)) {
showAndEdit(bibEntry);
showAndEdit(entries.get(0));
}
clearAndSelect(bibEntry);
clearAndSelect(entries.get(0));
} catch (KeyCollisionException ex) {
LOGGER.info("Collision for bibtex key" + bibEntry.getId(), ex);
LOGGER.info("Collision for bibtex key" + ex.getId(), ex);
}
}
}
Expand Down Expand Up @@ -1111,22 +1121,21 @@ public void searchAndOpen() {
private class GroupTreeListener {

@Subscribe
public void listen(EntryAddedEvent addedEntryEvent) {
// if the added entry is an undo don't add it to the current group
if (addedEntryEvent.getEntriesEventSource() == EntriesEventSource.UNDO) {
public void listen(EntriesAddedEvent addedEntriesEvent) {
// if the event is an undo, don't add it to the current group
if (addedEntriesEvent.getEntriesEventSource() == EntriesEventSource.UNDO) {
return;
}

// Automatically add new entry to the selected group (or set of groups)
// Automatically add new entries to the selected group (or set of groups)
if (Globals.prefs.getBoolean(JabRefPreferences.AUTO_ASSIGN_GROUP)) {
final List<BibEntry> entries = Collections.singletonList(addedEntryEvent.getBibEntry());
Globals.stateManager.getSelectedGroup(bibDatabaseContext).forEach(
selectedGroup -> selectedGroup.addEntriesToGroup(entries));
selectedGroup -> selectedGroup.addEntriesToGroup(addedEntriesEvent.getBibEntries()));
}
}
}

private class EntryRemovedListener {
private class EntriesRemovedListener {

@Subscribe
public void listen(EntriesRemovedEvent entriesRemovedEvent) {
Expand All @@ -1141,8 +1150,8 @@ public void listen(EntriesRemovedEvent entriesRemovedEvent) {
private class SearchAutoCompleteListener {

@Subscribe
public void listen(EntryAddedEvent addedEntryEvent) {
DefaultTaskExecutor.runInJavaFXThread(() -> searchAutoCompleter.indexEntry(addedEntryEvent.getBibEntry()));
public void listen(EntriesAddedEvent addedEntriesEvent) {
DefaultTaskExecutor.runInJavaFXThread(() -> addedEntriesEvent.getBibEntries().forEach(entry -> searchAutoCompleter.indexEntry(entry)));
}

@Subscribe
Expand All @@ -1158,7 +1167,7 @@ public void listen(EntryChangedEvent entryChangedEvent) {
private class SearchListener {

@Subscribe
public void listen(EntryAddedEvent addedEntryEvent) {
public void listen(EntriesAddedEvent addedEntryEvent) {
DefaultTaskExecutor.runInJavaFXThread(() -> frame.getGlobalSearchBar().performSearch());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package org.jabref.gui.autocompleter;

import org.jabref.model.database.event.EntryAddedEvent;
import java.util.List;

import org.jabref.model.database.event.EntriesAddedEvent;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.event.EntryChangedEvent;

import com.google.common.eventbus.Subscribe;
Expand All @@ -17,8 +20,11 @@ public AutoCompleteUpdater(SuggestionProviders suggestionProviders) {
}

@Subscribe
public void listen(EntryAddedEvent addedEntryEvent) {
suggestionProviders.indexEntry(addedEntryEvent.getBibEntry());
public void listen(EntriesAddedEvent entryAddedEvent) {
List<BibEntry> entries = entryAddedEvent.getBibEntries();
for (BibEntry entry : entries) {
suggestionProviders.indexEntry(entry);
}
}

@Subscribe
Expand Down
Loading

0 comments on commit 70147eb

Please sign in to comment.