Skip to content

Conversation

@Bha2912
Copy link

@Bha2912 Bha2912 commented May 9, 2025

Closes #12487
This PR introduce GUI dialog box that will show consistency check result with progress e.g 1 entry out of 123456...

Screenshot

3BC74052-8AEC-4F41-A946-70720DB8ADE5

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • [/] Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (if change is visible to the user)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@Siedlerchr
Copy link
Member

Looks ok so far. Please add a changelog entry!

@koppor
Copy link
Member

koppor commented May 11, 2025

@Bha2912 Please fix localization - see https://devdocs.jabref.org/code-howtos/localization.html for help


> Task :jablib:test
org.jabref.logic.l10n.LocalizationConsistencyTest

  Test findMissingLocalizationKeys() FAILED

  org.opentest4j.AssertionFailedError: 
  DETECTED LANGUAGE KEYS WHICH ARE NOT IN THE ENGLISH LANGUAGE FILE.
  PASTE THESE INTO THE ENGLISH LANGUAGE FILE "JabRef_en.properties".
  Search for a proper place; typically related keys are grouped together.
  If a similar key is already present, please adapt your language instead of adding load to translators by adding a new key.
  
  Checking consistency...=Checking consistency...
  
   ==> expected: <[]> but was: <[Checking consistency... (../jabgui/src/main/java/org/jabref/gui/consistency/ConsistencyCheckAction.java LANG)]>

@Bha2912 Bha2912 marked this pull request as ready for review May 16, 2025 02:08
Task<BibliographyConsistencyCheck.Result> task = new Task<>() {
protected BibliographyConsistencyCheck.Result call() throws Exception {
BibDatabaseContext databaseContext = stateManager.getActiveDatabase()
.orElseThrow(() -> new NullPointerException("Database null"));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using exceptions for control flow is not recommended. Instead, handle the absence of a database more gracefully without throwing a NullPointerException.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jsut use get() or - even better: stateManager.getActiveDatabase().ifpresent( ...)

@trag-bot
Copy link

trag-bot bot commented May 18, 2025

@trag-bot didn't find any issues in the code! ✅✨

@jabref-machine
Copy link
Collaborator

You committed your code on the main brach of your fork. This is a bad practice. The right way is to branch out from main, work on your patch/feature in that new branch, and then get that branch merged via the pull request (see GitHub flow).

For this pull request, this is OK. For subsequent pull requests, please start with a different branch with a proper branch name. See CONTRIBUTING.md for more details.

Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please re-read the issue description again

image

You should try to make use of org.jabref.logic.util.BackgroundTask#updateProgress(double, double)

See other code how this is done...

I think, the best example is org.jabref.gui.citationkeypattern.GenerateCitationKeyAction#generateKeysInBackground

image

@Bha2912 Bha2912 marked this pull request as draft May 23, 2025 01:15
@Siedlerchr Siedlerchr self-assigned this May 26, 2025
@Siedlerchr
Copy link
Member

Superseded by #13181

@Siedlerchr Siedlerchr closed this May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show progress in GUI for consistency check

4 participants