Skip to content

Commit

Permalink
Fix #506
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrotsmnrd committed Dec 16, 2024
1 parent 17f9bf3 commit 4385843
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
21 changes: 15 additions & 6 deletions ragna/deploy/_ui/components/metadata_filters_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, on_delete_callback, key_value_pairs=None, **params):
self.param.multi_value,
name="",
css_classes=["metadata-filter-value"],
min_height=60,
option_limit=3,
delete_button=False,
)

Expand Down Expand Up @@ -94,11 +94,19 @@ def compute_valid_operator_options(self, type_str):
def construct_metadata_filter(self):
if self.key_select.value == NO_FILTER_KEY:
return None
return MetadataFilter(
MetadataOperator[self.operator_select.value],
self.key_select.value,
self.value_select.value,
)

if self.operator_select.value in ["IN", "NOT_IN"]:
return MetadataFilter(
MetadataOperator[self.operator_select.value],
self.key_select.value,
self.multi_value_select.value,
)
else:
return MetadataFilter(
MetadataOperator[self.operator_select.value],
self.key_select.value,
self.value_select.value,
)

@param.depends("operator")
def display(self):
Expand Down Expand Up @@ -206,6 +214,7 @@ def construct_metadata_filters(self):

if not metadata_filters:
return None

return MetadataFilter.and_(metadata_filters).to_primitive()

def __panel__(self):
Expand Down
20 changes: 11 additions & 9 deletions ragna/deploy/_ui/css/modal_configuration/multichoice.css
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
:host(.metadata-filter-value) {
max-width: 38%;
min-width: 38%;
height: 30px;
height: 60px;
overflow: visible;
}

.choices__inner {
:host(.metadata-filter-value) .choices__inner {
padding-top: 0px;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
:host(.metadata-filter-value) .choices__list--dropdown,
:host(.metadata-filter-value) .choices__list[aria-expanded] {
border-radius: 10px;
font-size: 10px;
}

.choices {
:host(.metadata-filter-value) .choices {
visibility: visible !important;
}

.choices__list {
height: 60px;
:host(.metadata-filter-value) .choices__list {
height: 120px;
}

.choices__item {
:host(.metadata-filter-value) .choices__item {
font-size: 13px !important;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 0px;
margin-right: 3.75px;
}

.choices__item--selectable:not(.choices__item--choice) {
:host(.metadata-filter-value) .choices__item--selectable:not(.choices__item--choice) {
width: 25% !important;
background-color: #e9ecef !important;
color: black !important;
Expand Down
1 change: 0 additions & 1 deletion ragna/deploy/_ui/css/modal_configuration/row.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
}

:host(.metadata-filter-row) {
background-color: lightsalmon;
overflow: visible;
}

0 comments on commit 4385843

Please sign in to comment.