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

Fixed group creation with default settings #4801

Merged
merged 7 commits into from
Apr 7, 2019

Conversation

harinda05
Copy link
Contributor

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.


  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef
  • Screenshots added in PR description (for bigger UI changes)
  • Ensured that the git commit message is a good one
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)

Copy link
Member

@tobiasdiez tobiasdiez left a 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) -> {
Copy link
Member

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.

Copy link
Contributor Author

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]
Copy link
Member

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).

Copy link
Contributor Author

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>() {
Copy link
Member

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:

Suggested change
nameField.textProperty().addListener(new ChangeListener<String>() {
nameField.textProperty().addListener((observable, oldValue, newValue) -> upddateComponent());

Copy link
Contributor Author

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

Copy link
Contributor Author

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 :)

@Siedlerchr
Copy link
Member

Please fix the remaining isuses mentioned by @tobiasdiez so we can merge (e.g. remove the action listeners) so we can merge

@LinusDietz
Copy link
Member

Can you please give the PR a shorter and more decriptive name?

@harinda05 harinda05 changed the title Fix for the issue - #4783 Group creation not possible anymore with de… Fixed Group Creation with default settings Mar 26, 2019
@harinda05 harinda05 changed the title Fixed Group Creation with default settings Fixed group creation with default settings Mar 26, 2019
@harinda05
Copy link
Contributor Author

Can you please give the PR a shorter and more decriptive name?

Done :)

@tobiasdiez tobiasdiez added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 26, 2019
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);
Copy link
Member

Choose a reason for hiding this comment

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

Are these obsolete now?

@Siedlerchr Siedlerchr merged commit 8fb663e into JabRef:master Apr 7, 2019
Siedlerchr added a commit that referenced this pull request Apr 13, 2019
* 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)
  ...
Siedlerchr added a commit that referenced this pull request Apr 13, 2019
* 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
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.

4 participants