Skip to content

feature mx-1888 adds infobox to the ingest page #368

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

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

Conversation

eckelmannf
Copy link
Contributor

@eckelmannf eckelmannf commented Jul 11, 2025

PR Context

Added a type for the different aux values. Maybe its a bit overengineered but now u cant say sth like 'set_current_aux_provider("best_aux_ever")'. Would be lovely if we can achieve that the string "ldap", "orcid", "wikidata" are only written once (DRY). Only found a solution with an enum, which i didn't like.

Added

  • infobox to ingest page for "ldap" and "wikidata"
  • new type for aux_provider instead of str

Changes

  • type of aux provider from str to AuxProvider

Copy link
Contributor

@cutoffthetop cutoffthetop left a comment

Choose a reason for hiding this comment

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

nice, congrats to your first mex pull request!

AUX_PROVIDER_ORDIC,
AUX_PROVIDER_WIKIDATA,
]

Copy link
Contributor

Choose a reason for hiding this comment

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

i know you wrote you didn't like enums, but i also think that's the only way of avoiding to write the strings more than once

class AuxProvider(Enum):
    """Allowed auxiliary providers."""
    LDAP = "ldap"
    ORCID = "orcid"
    WIKIDATA = "wikidata"

@@ -137,7 +141,18 @@ def search_input() -> rx.Component:
autofocus=True,
max_length=100,
name="query_string",
placeholder="Search here...",
Copy link
Contributor

@cutoffthetop cutoffthetop Jul 18, 2025

Choose a reason for hiding this comment

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

these new placeholders don't really fit in the width of the search box, could you either revert the change, shorten the placeholder text or widen the input element?

Screenshot 2025-07-18 at 13-23-29 MEx Editor Ingest

if you decide to keep them, you would need to update the failing test. but maybe it's more stable to match the input field by testid rather than by placeholder anyway.

so instead of page.get_by_placeholder("Search here...") you could use page.get_by_test_id("aux-search-input") and then add the testid to the input like this rx.input(..., custom_attrs={"data-testid": "aux-search-input"})

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 removed the dynamic placeholder stuff due to its not part of the ticket and i might have done a bit too much.

'Search Wikidata by "Concept URI". Please paste URI e.g. "http://www.wikidata.org/entity/Q918501".'
),
),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

could you add a test in tests/ingest/test_main.py please to verify callouts (and placeholders) show the correct text for the selected provider? (at least for one or two of the providers)

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.

2 participants