-
-
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
Fixed group creation with default settings #4801
Conversation
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.
Thanks for your PR. The code looks good to me and seems to do the job.
Next time please have a look if somebody else is already working on the same issue before you open a PR (in this case #4799 is attacking the same problem). It's a bit unfair to other contributors if there work is rendered obsolete because somebody else opened another PR on the same topic. Thanks.
@@ -135,6 +136,19 @@ public GroupDialog(DialogService dialogService, BasePanel basePanel, JabRefPrefe | |||
this.setTitle(Localization.lang("Edit group")); | |||
} | |||
|
|||
nameField.textProperty().addListener((observable, oldValue, newValue) -> { |
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.
Can you please move these lines further down to https://github.com/JabRef/jabref/pull/4801/files#diff-2afbba630cb28bced7c30efa7c0a24dfR362, where similar listeners are registered for the other controls. Please also remove the onAction
listener for these three controls as they are now obsolete.
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'm really sorry that I didn't notice that there's someone else working on this. I have made the necessary changes you've requested.
Regards,
Harinda
CHANGELOG.md
Outdated
@@ -99,6 +99,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# | |||
- We fixed an issue where only one PDF file could be imported [#4422](https://github.com/JabRef/jabref/issues/4422) | |||
- We fixed an issue where "Move to group" would always move the first entry in the library and not the selected [#4414](https://github.com/JabRef/jabref/issues/4414) | |||
- We fixed an issue where an older dialog appears when downloading full texts from the quality menu. [#4489](https://github.com/JabRef/jabref/issues/4489) | |||
- We fixed an issue where the enabling/disabling OK button in Create/Edit group was not properly validated with the text boxes present in the window - Group creation not possible anymore with default settings [#4783] |
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.
Please remove the changelog entry. This bug was introduced in the dev version and we use the changelog only to inform about changes relative to the latest release (I'll update the PR template to makes this more clear).
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.
The Changelog entry is removed.
@@ -345,6 +347,32 @@ public GroupDialog(DialogService dialogService, BasePanel basePanel, JabRefPrefe | |||
return null; | |||
}); | |||
|
|||
nameField.textProperty().addListener(new ChangeListener<String>() { |
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.
You can simplify the changeLIstener with lambdas:
nameField.textProperty().addListener(new ChangeListener<String>() { | |
nameField.textProperty().addListener((observable, oldValue, newValue) -> upddateComponent()); |
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.
Hi, Thanks for the suggestion. Working on it now. Will update soon
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.
@Siedlerchr The changes have been committed :)
Please fix the remaining isuses mentioned by @tobiasdiez so we can merge (e.g. remove the action listeners) so we can merge |
Can you please give the PR a shorter and more decriptive name? |
Done :) |
nameField.textProperty().addListener((observable, oldValue, newValue) -> updateComponents()); | ||
keywordGroupSearchTerm.textProperty().addListener((observable, oldValue, newValue) -> updateComponents()); | ||
searchGroupSearchExpression.textProperty().addListener((observable, oldValue, newValue) -> updateComponents()); | ||
|
||
EventHandler<ActionEvent> actionHandler = (ActionEvent e) -> updateComponents(); | ||
nameField.setOnAction(actionHandler); |
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.
Are these obsolete now?
* upstream/master: (61 commits) fix missing l10n from previous merge fix compile error Fix right clicking on any entry and selecting "Open folder" results in the NullPointer exception (#4797) Bump fontbox from 2.0.14 to 2.0.15 (#4882) Bump pdfbox from 2.0.14 to 2.0.15 (#4881) Bump xmpbox from 2.0.14 to 2.0.15 (#4883) Bump mockito-core from 2.26.0 to 2.27.0 (#4879) Bump java-string-similarity from 1.1.0 to 1.2.1 (#4878) Fix JabRef dying silently without enough inotify instances (#4875) #4795 disable menu item if database not connected (#4828) Remove deprecated awt apple extension (#4860) Fix IllegalArgumentException when ranking entries (#4779) Bump junit-vintage-engine from 5.4.1 to 5.4.2 (#4866) Bump junit-platform-launcher from 1.4.1 to 1.4.2 (#4865) Bump junit-jupiter from 5.4.1 to 5.4.2 (#4867) Add author normalizer for medline import (#4863) Fixed group creation with default settings (#4801) removed default constructor of FXDialogService (#4847) QuotedStringTokenizer now does not unquote (#4830) Bump juh from 5.4.2 to 6.2.2 (#4851) ...
* upstream/master: (184 commits) Try to update to gradle 5.0.2 (#4766) Post change notifications on JavaFX (#4871) fix missing l10n from previous merge fix compile error Fix right clicking on any entry and selecting "Open folder" results in the NullPointer exception (#4797) Bump fontbox from 2.0.14 to 2.0.15 (#4882) Bump pdfbox from 2.0.14 to 2.0.15 (#4881) Bump xmpbox from 2.0.14 to 2.0.15 (#4883) Bump mockito-core from 2.26.0 to 2.27.0 (#4879) Bump java-string-similarity from 1.1.0 to 1.2.1 (#4878) Fix JabRef dying silently without enough inotify instances (#4875) #4795 disable menu item if database not connected (#4828) Remove deprecated awt apple extension (#4860) Fix IllegalArgumentException when ranking entries (#4779) Bump junit-vintage-engine from 5.4.1 to 5.4.2 (#4866) Bump junit-platform-launcher from 1.4.1 to 1.4.2 (#4865) Bump junit-jupiter from 5.4.1 to 5.4.2 (#4867) Add author normalizer for medline import (#4863) Fixed group creation with default settings (#4801) removed default constructor of FXDialogService (#4847) ... # Conflicts: # build.gradle # src/main/java/org/jabref/gui/JabRefFrame.java # src/main/java/org/jabref/gui/collab/ChangeDisplayDialog.java # src/main/java/org/jabref/gui/collab/EntryChangeViewModel.java
Fix for the issue #4783
Now the enabling/disabling the OK button with regards to the text fields have been validated properly without changing the logic of the existing code. As @Siedlerchr mentioned now, no need to switch to another radio button and back again to enable the OK button.