Skip to content

Convert the "Custom API key" list to a table [#10926]#10936

Merged
Siedlerchr merged 11 commits into
JabRef:mainfrom
AbdAlRahmanGad:fix-for-issue-10926
Mar 4, 2024
Merged

Convert the "Custom API key" list to a table [#10926]#10936
Siedlerchr merged 11 commits into
JabRef:mainfrom
AbdAlRahmanGad:fix-for-issue-10926

Conversation

@AbdAlRahmanGad

@AbdAlRahmanGad AbdAlRahmanGad commented Feb 28, 2024

Copy link
Copy Markdown
Contributor

Fixes #10926

demo.mov

The only difference from the previous implementation that the user can edit the "key" even if the "use custom key" is not checked. I still didn't find an efficient way to solve it so I will wait for your feedback.

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (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 developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Comment thread src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java Outdated
@calixtus

Copy link
Copy Markdown
Member

Hi, thanks for your interest in JabRef and OpenSource. I like the change to the ui, yet i have a comment about your implementation. I recommend the book Effective Java by Josh Bloch. Here is a summary that I like to use myself: https://github.com/HugoMatilla/Effective-JAVA-Summary

@AbdAlRahmanGad

Copy link
Copy Markdown
Contributor Author

@calixtus Hi, thanks for the feedback. I will check the resources you provided and modify the code.

@Siedlerchr

Copy link
Copy Markdown
Member

You could disable the field if it's not selected (e.g binding)
And regarding the exception handling, better is to use Validation

@calixtus

Copy link
Copy Markdown
Member

Shouldn't the keys be hidden behind asterisks
@JabRef/developers ?

@Siedlerchr

Copy link
Copy Markdown
Member

Yeah, maybe some kind of PasswordField or something similar can be used

Comment thread src/main/java/org/jabref/gui/preferences/websearch/WebSearchTabViewModel.java Outdated
@koppor koppor mentioned this pull request Feb 28, 2024
6 tasks

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

How can I change a key? I tried to click and double click (Windows 11), but nothing happened.

The checkbox on the right should be enabled only if there is a custom key.

image

@AbdAlRahmanGad

Copy link
Copy Markdown
Contributor Author

@koppor I made that you can't enter a key unless you enable the check. 0914142

Should I make it the opposite: if you enter a key then the checkbox will be enabled?

@koppor

koppor commented Feb 29, 2024

Copy link
Copy Markdown
Member

Yeah, the opposite is great. The checkmark should automatically be set then.

Maybe no disablement of the checkbox. There seem to be two kinds of user flows 🤣🤣

On dialog close, the key should only be enabled if non empty.

@AbdAlRahmanGad

Copy link
Copy Markdown
Contributor Author

@koppor Just to make sure I understood right.

  • If a user enter a key the checkbox is enabled automatically
  • if the key is empty the checkbox is disabled automatically

Also, can the user change the checkbox manually?

@koppor

koppor commented Feb 29, 2024

Copy link
Copy Markdown
Member

@koppor Just to make sure I understood right.

You came up with an even better solution!

Go for it!

@calixtus

Copy link
Copy Markdown
Member

Until now it was also possible to store custom keys, even if they are not used. Would be a regression if we automatically use the key if stored or remove it, when unchecked...

@AbdAlRahmanGad

Copy link
Copy Markdown
Contributor Author

@calixtus Sorry, I saw your comment after I commited.
So, should I make the user able to edit both manually?

@calixtus

calixtus commented Mar 1, 2024

Copy link
Copy Markdown
Member

There are use cases one would want to keep the custom API stored without using it, maybe just to test something maybe.

@AbdAlRahmanGad

Copy link
Copy Markdown
Contributor Author

I think the code is ready for review now.

@AbdAlRahmanGad AbdAlRahmanGad requested a review from koppor March 2, 2024 15:13
@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 3, 2024
@Siedlerchr

Copy link
Copy Markdown
Member

From my side lgtm, just one minor addition: Can you add the note that is at the tab Citation key patterns, here as well?

grafik

Siedlerchr
Siedlerchr previously approved these changes Mar 3, 2024
@Siedlerchr Siedlerchr enabled auto-merge March 4, 2024 19:43
@Siedlerchr Siedlerchr added this pull request to the merge queue Mar 4, 2024
Merged via the queue into JabRef:main with commit 8f46463 Mar 4, 2024
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.

Custom API keys should be a table

4 participants