Skip to content

Add validations to file directories in library properties#12867

Merged
Siedlerchr merged 8 commits into
JabRef:mainfrom
paudelritij:fix-for-issue-11840
Apr 6, 2025
Merged

Add validations to file directories in library properties#12867
Siedlerchr merged 8 commits into
JabRef:mainfrom
paudelritij:fix-for-issue-11840

Conversation

@paudelritij

@paudelritij paudelritij commented Mar 31, 2025

Copy link
Copy Markdown
Contributor

Closes #11840

Change under libraryproperties

  • Implemented validateDirectory method to check if a directory exists and is valid.
  • Added validateAndShowError method to display error messages for invalid statuses.
  • Updated validateSettings method to validate multiple directory statuses and show errors if any.
  • Initialized visualizers error icon for library-specific, user-specific, and LaTeX file directories.
test1 test2

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.

koppor
koppor previously requested changes Mar 31, 2025
Comment thread src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesView.java Outdated
@paudelritij paudelritij requested a review from koppor April 3, 2025 09:22
@paudelritij

Copy link
Copy Markdown
Contributor Author

@koppor I was wondering to have any direction you might have, as it would help in ongoing improvements on requested review.

Comment thread src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesView.java Outdated
@Siedlerchr

Copy link
Copy Markdown
Member

Just one change, rest is good

@Siedlerchr

Copy link
Copy Markdown
Member

Changelog entry is missing

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 6, 2025
@trag-bot

trag-bot Bot commented Apr 6, 2025

Copy link
Copy Markdown

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

@Siedlerchr Siedlerchr enabled auto-merge April 6, 2025 16:14
@Siedlerchr Siedlerchr added this pull request to the merge queue Apr 6, 2025
Merged via the queue into JabRef:main with commit ad6efc5 Apr 6, 2025
@koppor

koppor commented Apr 28, 2025

Copy link
Copy Markdown
Member

Does not work with relative paths. My JabRef does not work any more. See #13017.

krishnagjsForGit pushed a commit to krishnagjsForGit/jabref that referenced this pull request May 2, 2025
* Add validations to file directories in library properties

* Add error dialog for file directories in library properties

* Add comment to LibraryPropertiesView

* Improve directory validation condition

* Refactor directory validation visualizers in library properties dialog

* Add CHANGELOG.md entry
krishnagjsForGit pushed a commit to krishnagjsForGit/jabref that referenced this pull request May 2, 2025
* Add validations to file directories in library properties

* Add error dialog for file directories in library properties

* Add comment to LibraryPropertiesView

* Improve directory validation condition

* Refactor directory validation visualizers in library properties dialog

* Add CHANGELOG.md entry
@koppor

koppor commented Jul 5, 2025

Copy link
Copy Markdown
Member

Can I make the validatoin optional for saving preferences?

I am on a machine where the directory cannot be accessed and I modified OTHER preferences. Now, I cannot save the preferences

image

@paudelritij

Copy link
Copy Markdown
Contributor Author

I propose implementing a warning notification system while saving other preferences and setting the directory to a default location. This approach will also retain the user's chosen directory in the event they switch back to a machine with a defined directory. I will create a follow-up PR to address these changes.

@koppor

koppor commented Jul 5, 2025

Copy link
Copy Markdown
Member

setting the directory to a default location

No - because the directory will work on another machine 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add validations to file directories in library properties

3 participants