Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "Add example entry" and "Import existing PDFs" when a library is empty #12741

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

sanjyot242
Copy link

@sanjyot242 sanjyot242 commented Mar 14, 2025

  • Added "Add example entry" and "Import existing PDFs" when a library is empty
  • Add listeners to track database and table entry changes to show buttons only when database is empty

Snip1
snip2
snip3
snip4-filter
snip5-open library properties
snip5-warning directory not configured
snip6 directory exists

Closes #12662

Mandatory checks

  • I own the copyright of the code submitted and I licence 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 (for UI changes)
  • 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.

Sorry, something went wrong.

-Ensures button is hidden when entries exist but are filtered
-Add listeners to track database and table entry changes
@koppor koppor mentioned this pull request Mar 14, 2025
7 tasks
@koppor koppor mentioned this pull request Mar 16, 2025
6 tasks
-used localization
-added styles for button
…e-12662

# Conflicts:
#	src/main/java/org/jabref/gui/maintable/MainTable.java
-checks if directory exists
-triggers search for unlinked files ( if directory exists )
-Shows notification and open library properties ( if directory doesn't exist)
Comment on lines 614 to 615
dialogService.showWarningDialogAndWait(
Localization.lang("File directory is not set or does not exist!"),
Copy link

Choose a reason for hiding this comment

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

The warning message ends with an exclamation mark, which should be avoided in UI messages as per guidelines. Should end with a period instead.

Copy link
Author

Choose a reason for hiding this comment

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

Used Key which was already defined in properties , Should i update ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please. Do it in a separate PR so that we can integrate this fast.

If you feel uncomfortable to create a new branch based on main, you can use git town hack.

Copy link
Author

Choose a reason for hiding this comment

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

I noticed that this message was originally used in an Error Dialog, while the review comment specifically refers to a Warning message. Should I still proceed with making this a global change and remove the exclamation mark?

Copy link
Author

Choose a reason for hiding this comment

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

Also , After reviewing the properties file, I found that many messages contain exclamation marks. Should I update all of them for consistency ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but please think whether it could be critical error, then leave the !.

@sanjyot242 sanjyot242 changed the title Add placeholder with "Add Example Entry" for empty library Added "Add example entry" and "Import existing PDFs" when a library is empty Mar 18, 2025
@sanjyot242 sanjyot242 marked this pull request as ready for review March 18, 2025 06:54
@sanjyot242 sanjyot242 requested a review from koppor March 20, 2025 12:13
Comment on lines 614 to 615
dialogService.showWarningDialogAndWait(
Localization.lang("File directory is not set or does not exist!"),
Copy link
Member

Choose a reason for hiding this comment

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

Yes, but please think whether it could be critical error, then leave the !.

@@ -2875,6 +2875,12 @@ Editor\ related=Editor related
Title\ related=Title related
Entry\ fields=Entry fields
Please\ configure\ a\ file\ directory=Please configure a file directory
Add\ example\ entry=Add example entry
No\ content\ in\ table=No content in table
Copy link
Member

Choose a reason for hiding this comment

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

I don't get why this is here - I also see it in current JabREf

image

Copy link
Author

Choose a reason for hiding this comment

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

Currently the following message is defined in control.properties ( javafx ) .
and fetched using ControlResources.getString("TableView.noContent") .

For consistency i used Localization.lang and hence had to add it in properties .

@koppor
Copy link
Member

koppor commented Mar 20, 2025

I need to try out the directory.

Global prefs:

image

  • If unsaved AND "search and store relative", then not possible to import PDFs.
  • If unsaved AND "Main file directory" exists, one can import PDFs.
  • If saved, import should be good to go

- Removed Unnecessary comments
- Used withField for BibEntry instead of setField
Copy link

trag-bot bot commented Mar 21, 2025

👋 Hey! As a free user, you're receiving reviews for every 5th PR. Upgrade to get reviews on every pull request and boost your code quality! Learn more here 🚀

@sanjyot242
Copy link
Author

I need to try out the directory.

Global prefs:

image

  • If unsaved AND "search and store relative", then not possible to import PDFs.
  • If unsaved AND "Main file directory" exists, one can import PDFs.
  • If saved, import should be good to go

Hey ,
So i didnt understand the flow clearly yet , According to what was mentioned in the issue , the checks were with respect to fileDirectory .

Could you please explain in detail about the global prefs checks .

Thanks

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.

Empty library should offer two actions
2 participants