From 473272debe92ba63e021b318da5f5396bd847a66 Mon Sep 17 00:00:00 2001 From: Cameron Hyde Date: Mon, 16 Dec 2024 09:52:06 +1000 Subject: [PATCH 1/3] Add ItemInput to fix labs schema --- app/labs/lab_schema.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/labs/lab_schema.py b/app/labs/lab_schema.py index ba78575..de3abd9 100644 --- a/app/labs/lab_schema.py +++ b/app/labs/lab_schema.py @@ -32,6 +32,12 @@ def html_tags(v: str) -> str: ] +class ItemInput(BaseModel): + """An expected dataset input for a Galaxy tool.""" + datatypes: list[str] + label: str + + class IconEnum(str, Enum): """Define material icon types for buttons.""" run = 'run' # play_arrow @@ -62,6 +68,7 @@ class TabItem(BaseModel): view_md: Optional[MarkdownStr] = None view_icon: Optional[IconEnum] = None exclude_from: Optional[list[str]] = [] + inputs: Optional[list[ItemInput]] = None @field_validator( 'title_md', 'description_md', 'button_md', 'view_md', @@ -106,7 +113,7 @@ class LabSchema(BaseModel, extra='allow'): """Validate Galaxy Lab content.""" site_name: str lab_name: str - nationality: str + nationality: Optional[str] = '' galaxy_base_url: str subdomain: str root_domain: str From 4cadf91f84f1011f9792e60117ce50bb4b1f8c79 Mon Sep 17 00:00:00 2001 From: Cameron Hyde Date: Mon, 16 Dec 2024 11:12:09 +1000 Subject: [PATCH 2/3] Fix InputItem pydantic model --- app/labs/lab_schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/labs/lab_schema.py b/app/labs/lab_schema.py index de3abd9..af2c7fc 100644 --- a/app/labs/lab_schema.py +++ b/app/labs/lab_schema.py @@ -34,8 +34,8 @@ def html_tags(v: str) -> str: class ItemInput(BaseModel): """An expected dataset input for a Galaxy tool.""" - datatypes: list[str] - label: str + datatypes: Optional[list[str]] = [] + label: Optional[str] = '' class IconEnum(str, Enum): From 4a1ab8678df65ee0a7cfc0d22a5c6ae20fc06df9 Mon Sep 17 00:00:00 2001 From: Cameron Hyde Date: Mon, 16 Dec 2024 12:02:40 +1000 Subject: [PATCH 3/3] Fix inputs table styling --- app/labs/static/labs/css/labs.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/labs/static/labs/css/labs.css b/app/labs/static/labs/css/labs.css index 0f00606..3e5e520 100644 --- a/app/labs/static/labs/css/labs.css +++ b/app/labs/static/labs/css/labs.css @@ -32,7 +32,9 @@ a:hover .lab-header { } .table-inputs td { padding: .5rem 1rem; - border: 1px solid #ddd; +} +.table-inputs tr:not(:last-child) { + border-bottom: 1px solid #ddd; } .contributor { margin: 0 4px;