-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Preserve casing of field names for customize entry types #9993
Conversation
src/main/java/org/jabref/gui/preferences/customentrytypes/FieldViewModel.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/gui/preferences/customentrytypes/CustomEntryTypesTab.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java
Outdated
Show resolved
Hide resolved
BibtexDatabaseWriterTest > writeCustomizedTypesInAlphabeticalOrder() FAILED |
", requiredFields=" + requiredFields + | ||
", fields=" + fields + | ||
'}'; | ||
return "type = " + type + "," + OS.NEWLINE + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this will break many tests! Rather add a new method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -395,7 +395,7 @@ void writeCustomizedTypesInAlphabeticalOrder() throws Exception { | |||
database.insertEntry(entry); | |||
bibtexContext.setMode(BibDatabaseMode.BIBTEX); | |||
|
|||
databaseWriter.savePartOfDatabase(bibtexContext, Arrays.asList(entry, otherEntry)); | |||
databaseWriter.savePartOfDatabase(bibtexContext, List.of(entry, otherEntry)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there was a reason to pass a modifiable list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I double checked the code - no modification of the list inside. I added a JavaDoc comment.
The problem you know have is that the tests don't distinguish between custom field names and normal field names if they have the same name. This is hella complex now... |
Please unzip. 😅 MetaDataParsing: Yesterday, we opted to use |
Please take a look at the failng tests :-P |
Only problem I now see is migration of existing custom entry types/fields. |
Why? When parsing the bib file, the casing is stored in JabRef. That casing is written out again. Thus, the bib file are kept.as is..IMHO also covered by tests. What does break is the UI: The first letter will be lower case. |
Yeah, seems fine but after we resave it in the UI the casing is changed? |
The UI displays the casing found in the bib file.. User modifies casing: bib modified User does not modify casing: bib not modified IMHO as exected. |
no risk no fun! |
Follow-up to #9977, refs #9840.
This PR especially (tries) to adhere that
Field
is constant and that the ViewModel is the thing collecting data and at the end converts it to a "real" data object.Result of a coding session started with @calixtus and @Siedlerchr.
@Comment{jabref-entrytype: person: req[GoogleScholar;ORCID;name] opt[]}
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)