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

Rework Component Interface Value representations #3364

Merged
merged 41 commits into from
Jun 11, 2024
Merged

Rework Component Interface Value representations #3364

merged 41 commits into from
Jun 11, 2024

Conversation

chrisvanrun
Copy link
Contributor

@chrisvanrun chrisvanrun commented May 31, 2024

Currently, we have several slightly different not-so-nice, representations of component interface values (CIVs).

This PR contains a rework of these representations in the job detail pages for evaluation and algorithms. The ultimate goal is to extend its usage to the ArchiveItem detail page and ArchiveItem/DisplaySet list pages.

Current 'inline' view

New 'inline' view

Template tags

Two template tags are introduced: civ and civ_inline. Each tag takes a component interface value as the only argument and renders an HTML representation of the CIV. The inline variant is meant for list-like representations where horizontal space is limited and relies on a modal—the regular one where there is plenty of horizontal space to render the CIV proper.

A new template civ.html is introduced that accepts the arguments civ and display_inline. The display_inline is a switch that can be set to True and is meant for list-like representations where horizontal space is limited and relies on a modal—the regular one where there is plenty of horizontal space to render the CIV proper

Vega Lazy loading

In addition, this PR adds lazy loading for vega charts which is very much needed if viewing a list of CIVSets that output charts.

New Fixtures

CIVs are a crucial part of development now, and I think adding a bunch of test CIVs by hand is a lot of hassle. This, I think, plays a part in these representations flying under the radar. As such, this PR also introduces the scripts/component_interface_value_fixtures.py. This repeatable script creates an algorithm job that has an overabundance of different CIVs for quick development.

The screenshots are made based on this fixture.

@chrisvanrun
Copy link
Contributor Author

A possibly important change I forgot to mention is the following:

CIVs' rendering on a detail page was selective: some types would show, but some would not. With this PR that changes and they are all shown. For instance, output images will have a download button. This did mean that the BOOL/STRING/FLOAT/INT(?) types used to be gathered in a single table:

long_format_old_render

Whereas they are now shown as individual items:
Screenshot 2024-05-30 172449

IMHO this is fine as not many algorithms output multiple bool/strings.

@chrisvanrun chrisvanrun requested a review from jmsmkn June 7, 2024 11:57
@chrisvanrun chrisvanrun requested a review from jmsmkn June 10, 2024 14:27
Copy link
Member

@jmsmkn jmsmkn left a comment

Choose a reason for hiding this comment

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

Looks good!

@chrisvanrun chrisvanrun merged commit ac5d9db into main Jun 11, 2024
8 checks passed
@chrisvanrun chrisvanrun deleted the civ-repr branch June 11, 2024 09:15
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.

3 participants