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

Add download example link to interface form field #3823

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

ammar257ammar
Copy link
Contributor

closes #3809

@ammar257ammar
Copy link
Contributor Author

ammar257ammar commented Feb 10, 2025

This is how the download example link looks now

Screenshot 2025-02-10 at 10 57 24

@ammar257ammar ammar257ammar marked this pull request as ready for review February 10, 2025 10:55
@ammar257ammar ammar257ammar removed the request for review from jmsmkn February 10, 2025 10:55
Copy link
Contributor

@chrisvanrun chrisvanrun left a comment

Choose a reason for hiding this comment

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

Looks pretty good already! A few questions and suggestions for spit and polish.

app/grandchallenge/components/form_fields.py Outdated Show resolved Hide resolved
app/grandchallenge/components/form_fields.py Outdated Show resolved Hide resolved
)
@pytest.mark.parametrize("store_in_db", [True, False])
@pytest.mark.django_db
def test_interface_form_field_help_text_example_download_link(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could:

  • move this to a dedicated test_fields.py, create it if it doesn't already exists
  • not use the django_db but rather pass user=None, this speeds things up a lot
  • add a negative test: i.e. add an case where there should not be an example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All points were taken except:

not use the django_db but rather pass user=None, this speeds things up a lot

There are factories for component interface creation which need access to the database to create them.

Maybe I am mistaken, can you please clarify that point and if it is meant for this type of tests?

app/tests/components_tests/test_forms.py Outdated Show resolved Hide resolved
self.kwargs["widget"] = FlexibleFileWidget(
help_text=self.help_text,
help_text=_join_with_br(self.help_text, extra_help),
Copy link
Contributor Author

@ammar257ammar ammar257ammar Feb 14, 2025

Choose a reason for hiding this comment

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

After the new implementation of file widget #8ae9479
The download link is not showing correctly.
Looking into it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thomas is still in the process of heavily refactoring the logic there, so maybe best to wait until he is done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, I will wait then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add download example link when trying out algorithm
3 participants