Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix-melting-630
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Oct 17, 2024
2 parents af40b8d + b4d5db4 commit 3523d1c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- run: ./gradlew traceRequirements
- if: failure()
run: cat build/reports/tracing.txt

# This is https://github.com/marketplace/actions/gradle-wrapper-validation
# It ensures that the jar file is from gradle and not by a strange third party.
Expand Down
1 change: 1 addition & 0 deletions .vscode/ltex.dictionary.en-US.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Checkstyle
CouchDB
JabDrive
JabRef
OpenFastTrace
OpenRewrite
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Detailed instructions about this step can be found in our [guidelines for settin
* [Getting a task assigned](#getting-a-task-assigned)
* [Pull Request Process](#pull-request-process)
* [Requirements on the pull request and code](#requirements-on-the-pull-request-and-code)
* [After submission of a pull request](#after-submission-of-a-pull-request)
* [Development hints](#development-hints)

## Choosing a task [![Join the chat at https://gitter.im/JabRef/jabref](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/JabRef/jabref)
Expand Down Expand Up @@ -126,6 +127,22 @@ More reading on that is available at <https://roe.dev/blog/using-ai-in-open-sour

We reserve the right to reject pull requests that contain little or no genuine and original contribution from the contributor.

### After submission of a pull request

After you submitted a pull request, automated checks will run.
You will maybe see "Some checks were not successful".
Then, please look into them and handle accordingly.

Afterwards, you will receive comments on it.
Maybe, the pull request is approved immediatly, maybe changes are requested.
In case changes are requested, please implement them.

After changing your code, commit on the branch and push.
The pull request will update automatically.

Never ever close the pull request and open a new one.
This causes much load on our side and is not the style of the GitHub open source community.

### Development hints

#### When adding an external dependency
Expand Down
2 changes: 2 additions & 0 deletions docs/code-howtos/ui-recommendations.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ More information:
### Name your buttons for the actions
`req~ui.dialogs.confirmation.naming~1`

Needs: impl

## Form validation

* Only validate input after leaving the field (or after the user stopped typing for some time)
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Example:
It is important that there is no empty line directly after the heading.

{: note}
One needs to add `<!-- markdownlint-disable-file MD022 -->` to the end of the file, because the id of the requirement needs to follow the heading directly.
One needs to add `<!-- markdownlint-disable-file MD022 -->` to the end of the file, because the ID of the requirement needs to follow the heading directly.

## Linking implementations

Expand Down
20 changes: 6 additions & 14 deletions src/main/java/org/jabref/gui/externalfiles/ImportHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.jabref.logic.citationkeypattern.CitationKeyGenerator;
import org.jabref.logic.database.DuplicateCheck;
import org.jabref.logic.externalfiles.ExternalFilesContentImporter;
import org.jabref.logic.importer.CompositeIdFetcher;
import org.jabref.logic.importer.FetcherException;
import org.jabref.logic.importer.ImportCleanup;
import org.jabref.logic.importer.ImportException;
Expand Down Expand Up @@ -393,22 +394,13 @@ public List<BibEntry> handleStringData(String data) throws FetcherException {
return Collections.emptyList();
}

Optional<DOI> doi = DOI.findInText(data);
if (doi.isPresent()) {
return fetchByDOI(doi.get());
if (!CompositeIdFetcher.containsValidId(data)) {
return tryImportFormats(data);
}

Optional<ArXivIdentifier> arXiv = ArXivIdentifier.parse(data);
if (arXiv.isPresent()) {
return fetchByArXiv(arXiv.get());
}

Optional<ISBN> isbn = ISBN.parse(data);
if (isbn.isPresent()) {
return fetchByISBN(isbn.get());
}

return tryImportFormats(data);
CompositeIdFetcher compositeIdFetcher = new CompositeIdFetcher(preferences.getImportFormatPreferences());
Optional<BibEntry> optional = compositeIdFetcher.performSearchById(data);
return OptionalUtil.toList(optional);
}

private List<BibEntry> tryImportFormats(String data) {
Expand Down

0 comments on commit 3523d1c

Please sign in to comment.