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

Enable casing for adding fields for entry types #9945

Closed
wants to merge 7 commits into from

Conversation

eric052199
Copy link

@eric052199 eric052199 commented May 23, 2023

This is a follow-up for pull request #9883

  1. Created a new getDisplayNameForField() function that enables casing when adding unknown field instead of changing the original getDisplayName() function.
  2. Wrote a testcase to check the new getDisplayNameForField() in src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTabViewModel.java.

image
image

Compulsory checks

Preview Give feedback

@ThiloteE ThiloteE added the ui label May 27, 2023
@@ -318,6 +318,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We replaced the [OttoBib](https://en.wikipedia.org/wiki/OttoBib) fetcher by a fetcher by [OpenLibrary](https://openlibrary.org/dev/docs/api/books). [#8652](https://github.com/JabRef/jabref/issues/8652)
- We first fetch ISBN data from OpenLibrary, if nothing found, ebook.de is tried.
- We now only show a warning when exiting for tasks that will not be recovered automatically upon relaunch of JabRef. [#8468](https://github.com/JabRef/jabref/issues/8468)
- We enabled casing when adding field for entry type. [#9840](https://github.com/JabRef/jabref/issues/9840)
Copy link
Member

Choose a reason for hiding this comment

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

Please no two entries for the same fix. Decide for fix or feature. I think, feature is enough.

@koppor
Copy link
Member

koppor commented Jun 8, 2023

This will conflict with #9977, which added following code

// This makes the displayed name consistent to org.jabref.model.entry.field.Field #getDisplayName()
String newFieldValue = StringUtil.capitalizeFirst(event.getNewValue());

That PR solved the second TODO, so this PR is obsolete. Sorry for not noticing that earlier.


In general, the issue is a difficult thing. With this PR, we have three getters for names. I don't see, where getDisplayName is still used. I think, this should still should be used. -- Or maybe removed completely as you first suggested in your first PR. However, the core team did not have the time to properly investigate and find out the consequences. We put that on our TODO list. First thoughts: The displayname should be the name (as you suggested). However, for "DOI" or "ISBN" it should be the upper casing. We need to think about user expecation - should the displayed name be the same as used in BibTeX? Should we have two different UI renderings? For BibTeX pros and for average users, maybe even using JabRef for Word or orther typesetting systems?

@koppor koppor closed this Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants