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

Bind "Find unlinked files" default directory to the current library #9290

Merged
merged 6 commits into from
Nov 6, 2022

Conversation

DavidOWade
Copy link
Contributor

@DavidOWade DavidOWade commented Oct 23, 2022

Fixes koppor#546

When a user changes a library's general file directory the default directory for unlinked file lookup will reflect this change.

Demonstration: https://www.youtube.com/watch?v=ZWKGnoPRGPA&feature=youtu.be

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • [/] 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.

@ThiloteE
Copy link
Member

To ease organizational workflows I have linked the pull-request to the issue with syntax as described in https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue

Linking a pull request to an issue using a keyword

You can link a pull request to an issue by using a supported keyword in the pull request's description or in a commit message. The pull request must be on the default branch.

  • close
  • closes
  • closed
  • fix
  • fixes
  • fixed
  • resolve
  • resolves
  • resolved

If you use a keyword to reference a pull request comment in another pull request, the pull requests will be linked. Merging the referencing pull request also closes the referenced pull request.

The syntax for closing keywords depends on whether the issue is in the same repository as the pull request.

* upstream/main: (30 commits)
  New translations JabRef_en.properties (German) (JabRef#9336)
  Fix Abbreviation for Escaped Ampersand (JabRef#9288)
  Fix font size preference not updating in preference dialog 8386 (JabRef#9287)
  New Crowdin updates (JabRef#9333)
  Refresh example styles
  Squashed 'buildres/csl/csl-styles/' changes from 4eee79a..13fd98e
  Bump unirest-java from 3.13.11 to 3.13.12 (JabRef#9330)
  Bump checkstyle from 10.3.4 to 10.4 (JabRef#9331)
  Bump gittools/actions from 0.9.14 to 0.9.15 (JabRef#9332)
  Group context menu presents relevant options depending on number of subgroups (JabRef#9286)
  Removed BibTeX file type and included HTML and Markdown types (JabRef#9318)
  Fix issue: Auto-linking files with safe character replacements JabRef#9267 (JabRef#9316)
  Fix for issue 8806: Button highlights doesn't respect rounded corners (JabRef#9320)
  New Crowdin updates (JabRef#9324)
  Update CHANGELOG.md
  Try to relocate listener binding (JabRef#9238)
  Changed the messages after importing unlinked local files to past passive tense. (JabRef#9308)
  Changed the color of found text from red to high contrast  (JabRef#9315)
  New Crowdin updates (JabRef#9317)
  Add skips for MacOS X build (JabRef#9305)
  ...
@Siedlerchr Siedlerchr added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed status: changes required Pull requests that are not yet complete labels Nov 3, 2022
@Siedlerchr
Copy link
Member

@koppor
I decided to adjust the code a little bit and to use the getFirstExistingFileDirectory, so that not only library specifc dirs are considered, but the main file directory or the libraries user file directory

@calixtus calixtus changed the title Default value of "Find unlinked files" is default file directory of the current library koppor#546 Bind "Find unlinked files" default directory to the current library Nov 4, 2022
@@ -109,6 +116,8 @@ public UnlinkedFilesDialogView() {
private void initialize() {
viewModel = new UnlinkedFilesDialogViewModel(dialogService, undoManager, fileUpdateMonitor, preferencesService, stateManager, taskExecutor, importFormatReader);

this.bibDatabaseContext = stateManager.getActiveDatabase().orElseThrow(() -> new NullPointerException("Database null"));
Copy link
Member

Choose a reason for hiding this comment

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

Can you improve the error message please? Remember we are dealing with users, not coders. ;-)

Copy link
Member

Choose a reason for hiding this comment

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

Please also check that the calling UI command requires an opened database.

Copy link
Member

Choose a reason for hiding this comment

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

Already checked in the action

@calixtus calixtus requested a review from koppor November 4, 2022 07:56
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.

Thank you for working on this. I refined the CHANGELOG.md to reflect the changes more - and to link the documentation.

We hope for future updates. Two remarks for that:

  • Choose another branch than main to work on your contribution. - This is especially useful if you have more contributions running in parallel
  • loom is a tool for sharing videos for issues (in case you would like to embed the video in the PR only and not clutter YouTube with some small videos)

@koppor koppor merged commit 2e18b64 into JabRef:main Nov 6, 2022
Siedlerchr added a commit to yanyanliu1400/jabref that referenced this pull request Nov 7, 2022
* upstream/main: (61 commits)
  Bump jackson-datatype-jsr310 from 2.13.4 to 2.14.0 (JabRef#9357)
  Bump jackson-dataformat-yaml from 2.13.4 to 2.14.0 (JabRef#9356)
  Bump tika-core from 2.5.0 to 2.6.0 (JabRef#9358)
  Refine guideline "Set up a local workspace" (JabRef#9355)
  Adds missing "requires" statement (JabRef#9354)
  Bind "Find unlinked files" default directory to the current library (JabRef#9290)
  Rename "Remote" to "Tele" (JabRef#9270)
  Fixed display of file field adjusting for the dark theme (JabRef#9343)
  Update sorting of entries in maintable by special fields immediately (JabRef#9338)
  New translations JabRef_en.properties (German) (JabRef#9336)
  Fix Abbreviation for Escaped Ampersand (JabRef#9288)
  Fix font size preference not updating in preference dialog 8386 (JabRef#9287)
  New Crowdin updates (JabRef#9333)
  Refresh example styles
  Squashed 'buildres/csl/csl-styles/' changes from 4eee79a..13fd98e
  Bump unirest-java from 3.13.11 to 3.13.12 (JabRef#9330)
  Bump checkstyle from 10.3.4 to 10.4 (JabRef#9331)
  Bump gittools/actions from 0.9.14 to 0.9.15 (JabRef#9332)
  Group context menu presents relevant options depending on number of subgroups (JabRef#9286)
  Removed BibTeX file type and included HTML and Markdown types (JabRef#9318)
  ...
Siedlerchr added a commit that referenced this pull request Nov 8, 2022
* upstream/main:
  Add date format and respective test case (#9310)
  Bump jackson-datatype-jsr310 from 2.13.4 to 2.14.0 (#9357)
  Bump jackson-dataformat-yaml from 2.13.4 to 2.14.0 (#9356)
  Bump tika-core from 2.5.0 to 2.6.0 (#9358)
  Refine guideline "Set up a local workspace" (#9355)
  Adds missing "requires" statement (#9354)
  Bind "Find unlinked files" default directory to the current library (#9290)
  Rename "Remote" to "Tele" (#9270)
  Fixed display of file field adjusting for the dark theme (#9343)
  Update sorting of entries in maintable by special fields immediately (#9338)
  New translations JabRef_en.properties (German) (#9336)
  Fix Abbreviation for Escaped Ampersand (#9288)
  Fix font size preference not updating in preference dialog 8386 (#9287)

# Conflicts:
#	CHANGELOG.md
Siedlerchr added a commit to shafinkamal/jabref that referenced this pull request Nov 11, 2022
* upstream/main: (55 commits)
  Update guidelines-for-setting-up-a-local-workspace.md
  Add link to good first issues (and fix link)
  Refine guidelines (and fix .md file linking)
  Extend ArXiv fetcher results by using data from related DOIs (JabRef#9170)
  New Crowdin updates (JabRef#9366)
  Fix token
  New translations JabRef_en.properties (Chinese Simplified) (JabRef#9364)
  Fix date field change causes an uncaught exception (JabRef#9365)
  Add date format and respective test case (JabRef#9310)
  Bump jackson-datatype-jsr310 from 2.13.4 to 2.14.0 (JabRef#9357)
  Bump jackson-dataformat-yaml from 2.13.4 to 2.14.0 (JabRef#9356)
  Bump tika-core from 2.5.0 to 2.6.0 (JabRef#9358)
  Refine guideline "Set up a local workspace" (JabRef#9355)
  Adds missing "requires" statement (JabRef#9354)
  Bind "Find unlinked files" default directory to the current library (JabRef#9290)
  Rename "Remote" to "Tele" (JabRef#9270)
  Fixed display of file field adjusting for the dark theme (JabRef#9343)
  Update sorting of entries in maintable by special fields immediately (JabRef#9338)
  New translations JabRef_en.properties (German) (JabRef#9336)
  Fix Abbreviation for Escaped Ampersand (JabRef#9288)
  ...

# Conflicts:
#	CHANGELOG.md
#	src/main/java/org/jabref/preferences/AppearancePreferences.java
#	src/main/java/org/jabref/preferences/JabRefPreferences.java
#	src/test/java/org/jabref/gui/theme/ThemeManagerTest.java
Siedlerchr added a commit that referenced this pull request Nov 12, 2022
* upstream/main: (40 commits)
  Update guidelines-for-setting-up-a-local-workspace.md
  Add link to good first issues (and fix link)
  Refine guidelines (and fix .md file linking)
  Extend ArXiv fetcher results by using data from related DOIs (#9170)
  New Crowdin updates (#9366)
  Fix token
  New translations JabRef_en.properties (Chinese Simplified) (#9364)
  Fix date field change causes an uncaught exception (#9365)
  Add date format and respective test case (#9310)
  Bump jackson-datatype-jsr310 from 2.13.4 to 2.14.0 (#9357)
  Bump jackson-dataformat-yaml from 2.13.4 to 2.14.0 (#9356)
  Bump tika-core from 2.5.0 to 2.6.0 (#9358)
  Refine guideline "Set up a local workspace" (#9355)
  Adds missing "requires" statement (#9354)
  Bind "Find unlinked files" default directory to the current library (#9290)
  Rename "Remote" to "Tele" (#9270)
  Fixed display of file field adjusting for the dark theme (#9343)
  Update sorting of entries in maintable by special fields immediately (#9338)
  New translations JabRef_en.properties (German) (#9336)
  Fix Abbreviation for Escaped Ampersand (#9288)
  ...

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external files search 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.

Default value of "Find unlinked files" should be the default file directory of the current library
5 participants