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

Copy to option #12374

Merged
merged 17 commits into from
Jan 27, 2025
Merged

Copy to option #12374

merged 17 commits into from
Jan 27, 2025

Conversation

priyanshu16095
Copy link
Contributor

@priyanshu16095 priyanshu16095 commented Jan 9, 2025

Fixes #12339, #12340 and #12341

This PR introduces a 'Copy to' context menu option with features for cross-reference inclusion/exclusion, as well as the ability to save user preferences.

THE CHANGES MADE

  • Implemented a 'Copy to' context menu that lists the names of currently opened libraries, excluding the active one, as submenu items. Selecting a library from the submenu copies the selected entry to the chosen library.
  • If an entry includes a cross-referenced entry, a dialog box is displayed, allowing users to choose whether to include or exclude the cross-references.
  • Added functionality to save user preferences for cross-reference inclusion/exclusion, ensuring a personalized experience for future use.

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.

Screenshot (280)
b

@priyanshu16095 priyanshu16095 marked this pull request as draft January 9, 2025 23:24
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Your code currently does not meet JabRef's code guidelines.
We use Checkstyle to identify issues.
Please carefully follow the setup guide for the codestyle.
Afterwards, please run checkstyle locally and fix the issues.

In case of issues with the import order, double check that you activated Auto Import.
You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Your code currently does not meet JabRef's code guidelines.
We use Checkstyle to identify issues.
Please carefully follow the setup guide for the codestyle.
Afterwards, please run checkstyle locally and fix the issues.

In case of issues with the import order, double check that you activated Auto Import.
You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Your code currently does not meet JabRef's code guidelines.
We use Checkstyle to identify issues.
Please carefully follow the setup guide for the codestyle.
Afterwards, please run checkstyle locally and fix the issues.

In case of issues with the import order, double check that you activated Auto Import.
You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.

@priyanshu16095
Copy link
Contributor Author

Please review it and provide any suggestions.

@Siedlerchr
Copy link
Member

Siedlerchr commented Jan 11, 2025 via email

@priyanshu16095
Copy link
Contributor Author

Apologies, and thanks for the update! I understand, and I really appreciate your time.

Copy link
Member

@subhramit subhramit left a comment

Choose a reason for hiding this comment

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

Comments on first look.

src/main/java/org/jabref/gui/edit/CopyTo.java Outdated Show resolved Hide resolved
src/main/java/org/jabref/gui/edit/CopyTo.java Outdated Show resolved Hide resolved
src/main/java/org/jabref/gui/edit/CopyTo.java Outdated Show resolved Hide resolved
src/main/java/org/jabref/gui/edit/CopyTo.java Outdated Show resolved Hide resolved
src/main/java/org/jabref/gui/maintable/RightClickMenu.java Outdated Show resolved Hide resolved
@subhramit
Copy link
Member

Please also fix the Checkstyle, Openrewrite and Unit tests. The FAQ page will help you.

@priyanshu16095
Copy link
Contributor Author

I have fixed the Checkstyle, OpenRewrite, and Unit tests errors and made changes based on the reviews.

@priyanshu16095
Copy link
Contributor Author

What should I do next? Is this PR now eligible for merging?

@subhramit
Copy link
Member

What should I do next? Is this PR now eligible for merging?

You can refer to Houssem's replies and ask him for further steps if any: #12374 (comment)

@HoussemNasri
Copy link
Member

HoussemNasri commented Jan 16, 2025

@priyanshu16095 We received no response from the assignee of #12339 about progress, so it's yours, please comment there so we can assign you.

About the next steps, since you have already tackled #12339 and (partially) #12341 you might as well include #12340 in this PR. It was a mistake anyway to split the tasks in the first place, that is my bad.

@priyanshu16095
Copy link
Contributor Author

priyanshu16095 commented Jan 16, 2025

@HoussemNasri I’ve already included the code for #12340 in the pull request.
This task involves showing a dialog to provide a choice for including or excluding cross-references.

This PR implements the following tasks:

#12339: Implemented a 'Copy to' context menu that displays the names of currently opened libraries as checkable menu items.

#12340: Added a dialog that appears after selecting the libraries, allowing users to include or exclude cross-references.

#12341: Implemented functionality to save user preferences for cross-reference inclusion or exclusion, ensuring a personalized experience for future use.

@priyanshu16095
Copy link
Contributor Author

@HoussemNasri I’ve already included the code for #12340 in the pull request.
This task involves showing a dialog to provide a choice for including or excluding cross-references.

This PR implements the following tasks:

#12339: Implemented a 'Copy to' context menu that displays the names of currently opened libraries as checkable menu items.
#12340: Added a dialog that appears after selecting the libraries, allowing users to include or exclude cross-references.
#12341: Implemented functionality to save user preferences for cross-reference inclusion or exclusion, ensuring a personalized experience for future use.

Have I understood correctly?
Is there any feature left to implement in this PR?

@HoussemNasri
Copy link
Member

@priyanshu16095 why are the menu items checkable? We need to copy the bib entry to the library that the user chose in the menu. Also, I see no code that does the copying (neither normal copying nor cross-ref copying). Please re-read the issue descriptions.

@priyanshu16095
Copy link
Contributor Author

Yeah, my bad. I thought it was only for creating the UI.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Your code currently does not meet JabRef's code guidelines.
We use OpenRewrite to ensure "modern" Java coding practices.
The issues found can be automatically fixed.
Please execute the gradle task rewriteRun, check the results, commit, and push.

You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "OpenRewrite".

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

@priyanshu16095
Copy link
Contributor Author

priyanshu16095 commented Jan 24, 2025

Recording.2025-01-24.mp4

The feature is working fine; it copies the entry to the selected library.

If an entry has a cross-referenced entry, it shows dialog, allowing the user to choose whether to include or exclude the cross-referenced entry.

Please review

@subhramit subhramit marked this pull request as ready for review January 24, 2025 18:10
@subhramit subhramit added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jan 24, 2025
Copy link
Member

@subhramit subhramit left a comment

Choose a reason for hiding this comment

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

Looks good from my end. Just a few nitpicks. Houssem and others will take a more thorough look.

@subhramit
Copy link
Member

subhramit commented Jan 24, 2025

Also, @priyanshu16095, please add a changelog entry, as well as unit tests as described in the issues.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

@priyanshu16095
Copy link
Contributor Author

@subhramit @Siedlerchr I mistakenly clicked the re-request review button. Please ignore.

@Siedlerchr
Copy link
Member

I took the liberty to test and improve the code a little bit with streams. works fine so far

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 "copy to" context menu option for entries in maintable
4 participants