Skip to content

Commit

Permalink
Fix #505
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrotsmnrd committed Dec 16, 2024
1 parent f70b5fa commit 7a7eb25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions ragna/deploy/_ui/components/metadata_filters_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ def __init__(self, corpus_metadata, **params):
)
self.add_filter_row_button.on_click(self.add_filter_row)


def create_filter_row(self):
return [
FilterRow(
Expand Down Expand Up @@ -184,7 +183,7 @@ def render_filters_rows(self):
*self.filter_rows,
css_classes=["metadata-filter-row-collection"],
)

def construct_metadata_filters(self):
metadata_filters = [
filter_row.construct_metadata_filter()
Expand All @@ -197,16 +196,13 @@ def construct_metadata_filters(self):
return MetadataFilter.and_(metadata_filters).to_primitive()

def __panel__(self):


if len(self.corpus_names) == 0:
return pn.Column(
pn.pane.HTML("<b>No corpus available for selected source storage</b>"),
sizing_mode="stretch_both",
height_policy="max",
)


return pn.Column(
self.corpus_names_select,
pn.pane.HTML("<b>Metadata Filters</b>"),
Expand Down
5 changes: 3 additions & 2 deletions ragna/deploy/_ui/modal_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ def add_error_message(self):
)
def corpus_or_upload_row(self):
if self.corpus_or_upload == USE_CORPUS_LABEL:

if self.config.source_storage_name in self.corpus_names:
corpus_names = self.corpus_names[self.config.source_storage_name]
else:
Expand All @@ -430,7 +429,9 @@ def corpus_or_upload_row(self):
)

if len(corpus_names) > 0:
data = pn.Column(self.metadata_filter_rows_title, self.metadata_filter_rows)
data = pn.Column(
self.metadata_filter_rows_title, self.metadata_filter_rows
)
else:
data = pn.Column(self.metadata_filter_rows)

Expand Down

0 comments on commit 7a7eb25

Please sign in to comment.