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

added an option in preferences/groups to change the default the hierarchical context #9344

Closed
wants to merge 3 commits into from

Conversation

roryoday
Copy link
Contributor

@roryoday roryoday commented Nov 3, 2022

Fixes #9141

added an option in preferences/groups to change the default the hierarchical context. Options are Union/Intersection/Independent.

  • 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

ThiloteE commented Nov 4, 2022

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.

@Siedlerchr
Copy link
Member

Please have a look at the failing checkstyle tests or reviewdog

Copy link
Member

@calixtus calixtus left a comment

Choose a reason for hiding this comment

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

Hi, thanks for your interest in JabRef programming. I looked quickly into your changes. Please configure checkstyle according to our code style standards. Please look into our Getting Started guide here (https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.html),

Plase integrate the requested changes, so we can discuss merging.

Comment on lines +33 to +42
public String getFormattedName() {
if (this == INDEPENDENT) {
return "Independent";
} else if (this == REFINING) {
return "Intersection";
}
else {
return "Union";
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This should be implemented as an constructor argument for the enum e.g. INDEPENDENT("Independent") and be localized. Open/closed design principle.

Comment on lines +59 to +69
@Test
void groupContextCorrect() {
String groupName = "group";
ExplicitGroup group = new ExplicitGroup(groupName, GroupHierarchyType.INDEPENDENT, ',');
BibEntry entry = new BibEntry();
databaseContext.getDatabase().insertEntry(entry);
GroupNodeViewModel model = new GroupNodeViewModel(databaseContext, stateManager, taskExecutor, group, new CustomLocalDragboard(), preferencesService);
model.addEntriesToGroup(databaseContext.getEntries());
// make sure group default hierarchy preference does not override new group
assertEquals(model.getGroupNode().getGroup().getHierarchicalContext(),GroupHierarchyType.INDEPENDENT);
}
Copy link
Member

@calixtus calixtus Nov 8, 2022

Choose a reason for hiding this comment

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

I really don't get what you want to test here?
The constructor of GroupNodeViewModel?
This test seems superfluous to me, especially it does not seem to be related to any code change in the PR. The thing that should be tested is if someone clicks in the UI on "add new group" the default GroupHierarchyType is selected.

@calixtus calixtus added the status: changes required Pull requests that are not yet complete label Nov 8, 2022
@ThiloteE
Copy link
Member

closing this, as there is a lack of response and to reduce the number of open pull-requests.
@roryoday Feel free to reopen, if you think you will continue to work on this.

@ThiloteE ThiloteE closed this Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
groups preferences status: changes required Pull requests that are not yet complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add default hierachical context in group creation
4 participants