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

Deleting multiple linked files should show a single confirmation dialog #9473

Closed
HoussemNasri opened this issue Dec 19, 2022 · 11 comments · Fixed by #9711
Closed

Deleting multiple linked files should show a single confirmation dialog #9473

HoussemNasri opened this issue Dec 19, 2022 · 11 comments · Fixed by #9711
Assignees
Labels
external files FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement

Comments

@HoussemNasri
Copy link
Member

HoussemNasri commented Dec 19, 2022

Follow up to #8659

When multiple linked items are removed, JabRef will show the "Delete the selected file permanently from disk" dialogue for each item separately. E.g., if the user removes 3 linked items, the dialogue asking whether the respective file should be deleted from disk or should just be removed from entry will be shown 3 times.

This is not the expected behaviour - instead the user would expect to answer this dialogue once for all items that were selected. So if the user selects the option "Remove from entry" from the dialogue, then this should be applied to all linked entries that have been selected for removal (not for each entry separately).

Originally posted by @AEgit

To view the linked files of an entry, follow these steps:

  1. Open JabRef and open the entry editor for an item to which multiple files are linked (e.g., article + several supplements)
  2. Navigate to the "General" tab and then go to the row "File"
@HoussemNasri HoussemNasri added good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement external files labels Dec 19, 2022
@ThiloteE ThiloteE moved this to Normal priority in Features & Enhancements Dec 19, 2022
@ThiloteE ThiloteE moved this to Free to take in Good First Issues Dec 19, 2022
@shreverr
Copy link

shreverr commented Jan 3, 2023

Can I work on this issue?

@HoussemNasri
Copy link
Member Author

Sure, go ahead!

@ThiloteE ThiloteE added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Jan 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2023

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

@shreverr
Copy link

shreverr commented Jan 8, 2023

The deleteFile() method in LinkedFilesEditorViewModel calls delete() method in LinkedFileViewModel.
In the delete() method a new dialog opens every time when delete() method is called to delete a file.
image
image
should I move the code of delete() method to deleteFile() method and only use delete() method to delete the file from disk.

This way the the dialog will be called only once.

@HoussemNasri
Copy link
Member Author

I don't think moving delete to deleteFile will fix the issue. The problem here is that whenever a delete event is detected (e.g. User hits the delete keystroke) we are calling deleteFile for each selected file thus multiple dialogs show up. What you want to do is to call deleteFile only once when a delete event occurs.

Also, you don't want to display the same dialog when user tries to delete one file vs multiple files.

Here is an example of what IntelliJ does when user tries to delete a file(s):

One File

image

Multiple Files

image

Code Hint
Lookup this class and see what happens when a user hits the delete keystroke

private final PreferencesService preferencesService;

@Ravitwr
Copy link
Contributor

Ravitwr commented Jan 18, 2023

Hi @HoussemNasri ,
I can work on this issue if there are no updates.I think the dialog box gui needs to be moved from LinkedFilesEditorViewModel to LinkedFilesEditor. Also do we want to list file names in case of deletion of multilple files ?

@shreverr
Copy link

Hi @Ravitwr ,
I am currently working on this.
I am sorry was not able to work on this last week due to some personal reasons.

@009-KumarJi
Copy link

i want to work on this issue. please assign me this issue. :)

@HoussemNasri
Copy link
Member Author

@009-KumarJi Someone already started working on this, there is plenty of other good first issues you can pick from.

@hiddevanesch
Copy link
Contributor

Hi, since there hasn't been much activity regarding this issue, can I please be assigned to this issue? I would like to work on this for a uni project.

@ThiloteE ThiloteE assigned hiddevanesch and unassigned shreverr Mar 16, 2023
@ThiloteE ThiloteE moved this from In Progress to Reserved in Good First Issues Mar 16, 2023
@ThiloteE ThiloteE moved this from Reserved to In Progress in Good First Issues Mar 28, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Good First Issues Apr 2, 2023
@github-project-automation github-project-automation bot moved this from Normal priority to Done in Features & Enhancements Apr 2, 2023
@AEgit
Copy link

AEgit commented Apr 3, 2023

JabRef 5.10--2023-04-02--1896c99
Windows 10 10.0 amd64
Java 19.0.2
JavaFX 20+19

As far as I can tell, this issue has been fixed in the most recent dev version. Well done!
There are some other issues with deleting/adding files, but I will create a new issue for that problem, since I am not sure it is linked to the improvements made here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external files FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement
Projects
Archived in project
Archived in project
7 participants