Skip to content

Sorted list of content selectors#7458

Merged
calixtus merged 6 commits into
JabRef:masterfrom
BJaroszkowski:fix-for-issue-3791
Feb 22, 2021
Merged

Sorted list of content selectors#7458
calixtus merged 6 commits into
JabRef:masterfrom
BJaroszkowski:fix-for-issue-3791

Conversation

@BJaroszkowski

@BJaroszkowski BJaroszkowski commented Feb 20, 2021

Copy link
Copy Markdown
Contributor

List of keywords added in "Manage content selectors" is now always displayed in alphabetic order. Also added tests for ContentSelectorSuggestionProvider and ContentSelectorDialogViewModel classes which include asserting alphabetical order in suggestions affected by content selectors as well.
Fixes #3791.

  • 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 documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

mcs_sorted_image

existingKeywords.add(keywordToAdd);
existingKeywords.sort(Comparator.naturalOrder());
fieldKeywordsMap.put(field, existingKeywords);
keywords.add(keywordToAdd);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please explain why this is removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On the next line we call populateKeywords which clears the keywords and then populates it with keywords from fieldKeywordsMap. Since it makes no difference if we add to keywords at this point I simply deleted this line.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah thanks for the clarification!

@Siedlerchr

Copy link
Copy Markdown
Member

Thanks, in general looks good to me, just one question and please have a look at the failing checkstyle test

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Feb 21, 2021

@calixtus calixtus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me too. Thanks!

@calixtus calixtus changed the title Fix for issue 3791 Sorted list of content selectors Feb 22, 2021
@calixtus calixtus merged commit f60c15a into JabRef:master Feb 22, 2021
@BJaroszkowski BJaroszkowski deleted the fix-for-issue-3791 branch March 6, 2021 16:49
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.

No order of items in content selectors

3 participants