Added Clear group option#15017
Conversation
| } | ||
|
|
||
| public void clearGroup(GroupNodeViewModel group) { | ||
| if (group.getGroupNode().getGroup() instanceof ExplicitGroup) { |
There was a problem hiding this comment.
Use instanceof pattern matching - see diff of #15013
There was a problem hiding this comment.
Ok that was nice to know about instanceof pattern matching, it's my first time to know it.
but why is it important for this solution?
|
|
||
| Remove=Remove | ||
|
|
||
| Remove\ subgroups=Remove subgroups |
There was a problem hiding this comment.
Why did you go pack to the state before #15005 ?
you can do git checkout upstream/main jablib/src/main/resources/l10n/JabRef_en.properties - and then add your key again.
Do not destroy work of others at merge conflict resoluiton.
There was a problem hiding this comment.
Sorry for that it was by fault.
| - REST-API: Added the possibility to trigger the import dialog. [#14855](https://github.com/JabRef/jabref/pull/14855) | ||
| - REST-API: Allow import of supported formats via `POST http://localhost:23119/libraries/current/entries`. [#14896](https://github.com/JabRef/jabref/pull/14896) | ||
| - We added the ability to update bibliographic information based on the existing entry data. [#14185](https://github.com/JabRef/jabref/issues/14185) | ||
| - We added Clear group option to easily clear explicits groups. [#15001](https://github.com/JabRef/jabref/issues/15001) |
There was a problem hiding this comment.
| - We added Clear group option to easily clear explicits groups. [#15001](https://github.com/JabRef/jabref/issues/15001) | |
| - We added an option to easily clear explicits groups. [#15001](https://github.com/JabRef/jabref/issues/15001) |
There was a problem hiding this comment.
You could have clicked on "Commit suggestion" - then GitHub would have just made a commit :)
There was a problem hiding this comment.
Wow 😮
This is so cool.
|
|
||
| public void clearGroup(GroupNodeViewModel group) { | ||
| if (group.getGroupNode().getGroup() instanceof ExplicitGroup explicitGroup) { | ||
| List<BibEntry> entriesInGroup = group.getGroupNode().getEntriesInGroup(this.currentDatabase.get().getEntries()); |
There was a problem hiding this comment.
group.getGroupNode() apprearing three times - extract variable please.
…java Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Hope they will be the last ones 🫠 |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
koppor
left a comment
There was a problem hiding this comment.
OK, let's get this in.
Maybe, someone will say that
Remove all entries from this group
is a better string.
I think, its good to have a significant other string to say that it is a dangerous operation.
…4902 * upstream/main: (23 commits) Some more recipes from OpenRewrite (JabRef#15030) feat: Add PDF Upload endpoint to EntryResource (JabRef#14963) Heuristics also used at batch (JabRef#15025) Fix cleanup-pr.yml New Crowdin updates (JabRef#15035) Use patched Gradle version (JabRef#15034) Add OpenAlex-based Citation Fetcher (JabRef#15023) Update null annotaitons at EntryBasedFetcher (JabRef#15024) Fix CHANGELOG.md test Use _ for unused variables (JabRef#15028) Use ubuntu-latest for checkstyle and javadoc Update Gradle Wrapper from 9.3.0-jabref-2 to 9.3.1 (JabRef#15021) Use "ubuntu-slim" for most workflows (JabRef#15019) Refine GroupsTree (JabRef#15013) New Crowdin updates (JabRef#15018) Added Clear group option (JabRef#15017) Chore(deps): Bump com.uber.nullaway:nullaway from 0.12.15 to 0.13.1 in /versions (JabRef#15006) Chore(deps): Bump tools.jackson:jackson-bom in /versions (JabRef#15007) No rush in Docker building Yaml issue workaround ...
User description
Closes #15001
Added clear group option that lets user to clear the entries in Explicit Groups.
Steps to test
First open example library, then Go to group "Used", then Open context menu, now you can see clear group option.

Select clear group. Now the group is empty.

To double check that it works with Explicit Groups only go to any other group try to clear it.

It will stay the same.

Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)PR Type
Enhancement
Description
Added "Clear group" context menu option for explicit groups
Removes all entries from explicit groups with single action
Option only appears for explicit groups, not other group types
Updated localization strings and changelog documentation
Diagram Walkthrough
File Walkthrough
StandardActions.java
Add GROUP_ENTRIES_CLEAR standard actionjabgui/src/main/java/org/jabref/gui/actions/StandardActions.java
GROUP_ENTRIES_CLEARaction enum with localized labelGroupTreeView.java
Integrate clear group action into context menujabgui/src/main/java/org/jabref/gui/groups/GroupTreeView.java
GROUP_ENTRIES_CLEARcase to visibility condition checkGROUP_ENTRIES_CLEARcase to execute method to callclearGroup()GroupTreeViewModel.java
Implement clearGroup method for explicit groupsjabgui/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java
clearGroup()method that clears explicit groupsExplicitGroupbefore clearingCHANGELOG.md
Document clear group feature in changelogCHANGELOG.md
JabRef_en.properties
Add English localization for clear groupjablib/src/main/resources/l10n/JabRef_en.properties