Skip to content

Add restart warning for auto complete settings#6564

Closed
newtypes3 wants to merge 5 commits into
JabRef:masterfrom
newtypes3:fix-6351
Closed

Add restart warning for auto complete settings#6564
newtypes3 wants to merge 5 commits into
JabRef:masterfrom
newtypes3:fix-6351

Conversation

@newtypes3

@newtypes3 newtypes3 commented May 31, 2020

Copy link
Copy Markdown
Contributor

To make auto complete settings come into effect, restart is needed. I add dialog box when someone change the auto complete settings, to remind him restart the software.
Fixes #6351
screenshot

  • Change in CHANGELOG.md described (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.

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

Thank you for your contribution.
Restart warning looks good, besides two typos.

I'm not 100 % sure, but I believe the test is probably interfering with the permanent preferences of JabRef. @tobiasdiez @Siedlerchr ?


@Test
public void storeAutoCompletePreferencesTest() throws NoSuchFieldException, IllegalAccessException {
JabRefPreferences preferencesService = JabRefPreferences.getInstance();

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.

While testing is normally important, I fear in this case you actually permanently set the preferences to true instead of testing the logic.

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.

The test actually does not make any sense. You are just testing that a boolean variable is set in the preferences. This is useless and totally unrelated to your changes.
if you want to write a test, you need to test the View Model to check if your changed are correctly applied. But that's more complicated.

Manual testing should be enough. In jabref we focus on writing tests for important logic or other parts and not just writing tests for the sake of coverage.
So please remove your test.

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.

Yeah, you are right. That test makes no sense for this issue. This was my early attempt while locating the code. It is really kind for you to point it out as well as two typos. Thanks. And I am still learning Github and its features.


@Test
public void storeAutoCompletePreferencesTest() throws NoSuchFieldException, IllegalAccessException {
JabRefPreferences preferencesService = JabRefPreferences.getInstance();

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.

The test actually does not make any sense. You are just testing that a boolean variable is set in the preferences. This is useless and totally unrelated to your changes.
if you want to write a test, you need to test the View Model to check if your changed are correctly applied. But that's more complicated.

Manual testing should be enough. In jabref we focus on writing tests for important logic or other parts and not just writing tests for the sake of coverage.
So please remove your test.

Correct typos.

Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>
firstNameMode = AutoCompleteFirstNameMode.ONLY_FULL;
}

if(initialAutoCompletePreferences.shouldAutoComplete()!=enableAutoCompleteProperty.getValue()){

@Siedlerchr Siedlerchr Jun 1, 2020

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.

you have a lot of checkstyle issues here. Please setup the JabRef Code Style and make your life easier
https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace#using-jabrefs-code-style

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.

Thanks for your review.

@Siedlerchr Siedlerchr changed the title Fix #6351 Add restart warning for auto complete settings Jun 3, 2020
@newtypes3 newtypes3 requested review from Siedlerchr and calixtus June 3, 2020 16:34

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

Please add the strings to the english localization resource file and somehow the two typos came back...

@tobiasdiez tobiasdiez added the status: changes-required Pull requests that are not yet complete label Jun 5, 2020
@koppor

koppor commented Jul 7, 2020

Copy link
Copy Markdown
Member

This is a good start. Since there was no activity since a few weeks and there are minor things to fix to get this ready, we will take over here. Thank you for having been part at the JabRef development.

@calixtus

Copy link
Copy Markdown
Member

I took the liberty to finish this one in another PR, your work is preserved an we will give you credit in the next release of JabRef. Thank you for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: changes-required Pull requests that are not yet complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

autocompletion always turned on; cannot be disabled

5 participants