-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Enable groups drag'n'drop to new library #9460
Enable groups drag'n'drop to new library #9460
Conversation
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
|
Please have a look at the checkstlye/reviewdog tests |
fixing all issues raised by checkstlye/reviewdog tests
I have tried many times to fix these issues, but still I keep getting this error "Use a single space to separate non-whitespace characters." Can anyone please help me understand what that mean? |
@rafatd the best is to setup JabRef's code style https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.html#using-jabrefs-code-style PS: I don't get the line as welll |
((LibraryTab) libraryTab).dropEntry(stateManager.getLocalDragboard().getBibEntries()); | ||
if (dragboard.hasContent(DragAndDropDataFormats.GROUP)) { | ||
List<String> groupPathToSources = (List<String>) dragboard.getContent(DragAndDropDataFormats.GROUP); | ||
if (((LibraryTab) libraryTab).getBibDatabaseContext().getMetaData().getGroups().isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would extract this casting to LibraryTab to a new variable, then you don't have to add the casting everywhere
e.g. LibraryTab libraryTab = (LibraryTab) tab;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, thanks for that, I will update the file accordingly. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that this has been updated.
Tested your feature, looks good so far. Just one thing I noticed: Colors and icons are not transfered. Don't know if this is possible as well |
Extract this casting to LibraryTab to a new variable. Fix the "Use a single space to separate non-whitespace characters." error.
I just noticed that. That's weird, since the colour and the icon are stored in the abstract group object, and I am deeply copying that. So I am confused as to why it's not transferring them. I will try to make more research regarding that. In the main time, I can confirm that my last commit passes all the tests. Let me know if I must change anything, or if you are happy with that. |
Enable transferring colours and icons of each group.
Hi again, I can confirm that I fixed that, tuners the deepcopy() function only copy deep copying an explicitgroup object, which does not know anything about the colours and the icons. So instead I choose to copy the whole GroupTreeNode. |
I tried the pull-request with latest commits just now and found that groups were correctly copied (as far as I could see), but encountered issues related to:
|
I believe that I cannot reproduce this error on my local machine. If you have the same entires the merge editor will be open, this had nothing to do with my feature I am assuming. It would be helpful if you can send me the exact steps you did to get that? |
…of_groups_to_new_library * upstream/main: (148 commits) Fix remember last open valid library with empty new one (JabRef#9489) Observable Preferences R (CitationKeyPatternPreferences) (JabRef#9486) Fixed ZBMathTest and extracted keyWordSeparator (JabRef#9485) New Crowdin updates (JabRef#9483) Add log for ignored excepton (JabRef#9302) Select Library to import into (JabRef#9402) Bump org.eclipse.jgit from 6.3.0.202209071007-r to 6.4.0.202211300538-r (JabRef#9476) Bump com.github.andygoossens.modernizer from 1.6.2 to 1.7.0 (JabRef#9478) Bump mockito-core from 4.9.0 to 4.10.0 (JabRef#9479) Bump checkstyle from 10.4 to 10.5.0 (JabRef#9477) Bump slf4j-api from 2.0.5 to 2.0.6 in /buildSrc (JabRef#9480) Bibtex month not deprecated (JabRef#9404) Show development information\n\n+semver: major Release v5.8 Update external libraries add afterburner fx jabref add jakarta inject fix display name for artifact store Prepare CHANGELOG for release Also trigger on branch arm64mac-release Only arm64 m+ Update deployment-arm64.yml ...
After dragging and dropping a group and then deleting it, a notification that says "The library has been modified by another program" is triggered. However, it seems to be an old bug that was not introduced in this PR. #9064 |
I cannot reproduce this issue, as you say it's an old bug! does fixing the issue JabRef#530 also require fixing that? |
You can ignore the comment. It's for documentation purposes to clarify that the bug existed before this PR. It's definitely not a requirement to fix the bug, but you're welcome to give it a try. However, keep in mind that it is not an easy catch. We had many previous attempts of fixing it but it keeps coming back. |
Great, I am not sure that I have enough time to be working on that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried out the feature on my local machine and it works great! However, I have a few comments about the code.
Hi @HoussemNasri, Thanks for your feedback, I have done some updates to the files. I hope that now they should be ok now. I added some methods to With regards to the nested if statement, I have tried my best to reduce that, and as far as I know, I do not think there is a better way to reduce it more. Let me know what you think. |
…of_groups_to_new_library * upstream/main: Update MacOS jabrefHost.py to find local installs (JabRef#9487)
* upstream/main: (145 commits) Enable groups drag'n'drop to new library (JabRef#9460) Update MacOS jabrefHost.py to find local installs (JabRef#9487) Fix remember last open valid library with empty new one (JabRef#9489) Observable Preferences R (CitationKeyPatternPreferences) (JabRef#9486) Fixed ZBMathTest and extracted keyWordSeparator (JabRef#9485) New Crowdin updates (JabRef#9483) Add log for ignored excepton (JabRef#9302) Select Library to import into (JabRef#9402) Bump org.eclipse.jgit from 6.3.0.202209071007-r to 6.4.0.202211300538-r (JabRef#9476) Bump com.github.andygoossens.modernizer from 1.6.2 to 1.7.0 (JabRef#9478) Bump mockito-core from 4.9.0 to 4.10.0 (JabRef#9479) Bump checkstyle from 10.4 to 10.5.0 (JabRef#9477) Bump slf4j-api from 2.0.5 to 2.0.6 in /buildSrc (JabRef#9480) Bibtex month not deprecated (JabRef#9404) Show development information\n\n+semver: major Release v5.8 Update external libraries add afterburner fx jabref add jakarta inject fix display name for artifact store Prepare CHANGELOG for release Also trigger on branch arm64mac-release ... # Conflicts: # CHANGELOG.md # src/main/java/org/jabref/preferences/JabRefPreferences.java
* upstream/main: (120 commits) Enable groups drag'n'drop to new library (JabRef#9460) Update MacOS jabrefHost.py to find local installs (JabRef#9487) Fix remember last open valid library with empty new one (JabRef#9489) Observable Preferences R (CitationKeyPatternPreferences) (JabRef#9486) Fixed ZBMathTest and extracted keyWordSeparator (JabRef#9485) New Crowdin updates (JabRef#9483) Add log for ignored excepton (JabRef#9302) Select Library to import into (JabRef#9402) Bump org.eclipse.jgit from 6.3.0.202209071007-r to 6.4.0.202211300538-r (JabRef#9476) Bump com.github.andygoossens.modernizer from 1.6.2 to 1.7.0 (JabRef#9478) Bump mockito-core from 4.9.0 to 4.10.0 (JabRef#9479) Bump checkstyle from 10.4 to 10.5.0 (JabRef#9477) Bump slf4j-api from 2.0.5 to 2.0.6 in /buildSrc (JabRef#9480) Bibtex month not deprecated (JabRef#9404) Show development information\n\n+semver: major Release v5.8 Update external libraries add afterburner fx jabref add jakarta inject fix display name for artifact store Prepare CHANGELOG for release Also trigger on branch arm64mac-release ...
* upstream/main: (75 commits) Observable Preferences S (LastExportPath and Cleanups in JabRefPreferences and Globals) (#9493) Enable groups drag'n'drop to new library (#9460) Update MacOS jabrefHost.py to find local installs (#9487) Fix remember last open valid library with empty new one (#9489) Observable Preferences R (CitationKeyPatternPreferences) (#9486) Fixed ZBMathTest and extracted keyWordSeparator (#9485) New Crowdin updates (#9483) Add log for ignored excepton (#9302) Select Library to import into (#9402) Bump org.eclipse.jgit from 6.3.0.202209071007-r to 6.4.0.202211300538-r (#9476) Bump com.github.andygoossens.modernizer from 1.6.2 to 1.7.0 (#9478) Bump mockito-core from 4.9.0 to 4.10.0 (#9479) Bump checkstyle from 10.4 to 10.5.0 (#9477) Bump slf4j-api from 2.0.5 to 2.0.6 in /buildSrc (#9480) Bibtex month not deprecated (#9404) Show development information\n\n+semver: major Release v5.8 Update external libraries add afterburner fx jabref add jakarta inject fix display name for artifact store Prepare CHANGELOG for release ...
Fixes JabRef#530
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)