diff --git a/oarepo_ui/resources/catalog.py b/oarepo_ui/resources/catalog.py index 8c23c126..a3decb8d 100644 --- a/oarepo_ui/resources/catalog.py +++ b/oarepo_ui/resources/catalog.py @@ -74,6 +74,7 @@ def _get_component_path( f"Unable to find a file named {name}{file_ext} " f"or one following the pattern {name_dot}*{file_ext}" ) + def _get_from_file(self, *, prefix: str, name: str, url_prefix: str, file_ext: str) -> "Component": root_path, path = self._get_component_path(prefix, name, file_ext=file_ext) component = Component( @@ -87,7 +88,9 @@ def _get_from_file(self, *, prefix: str, name: str, url_prefix: str, file_ext: s return component -def get_jinja_template(_catalog, template_def, fields=[]): +def get_jinja_template(_catalog, template_def, fields=None): + if fields is None: + fields = [] jinja_content = None for component in _catalog.jinja_env.loader.searchpath: if component["component_file"].endswith(template_def["layout"]): diff --git a/oarepo_ui/resources/resource.py b/oarepo_ui/resources/resource.py index 7b6e0c55..e7df6db0 100644 --- a/oarepo_ui/resources/resource.py +++ b/oarepo_ui/resources/resource.py @@ -260,13 +260,13 @@ def search(self): ) search_config = partial(self.config.search_app_config, **search_options) + search_app_config = search_config(app_id=app_id) - json_data = json.dumps(search_app_config, default=lazy_string_encoder, indent=4) return _catalog.render( "search", __source=source, - search_app_config=json_data, + search_app_config=search_app_config, ui_config=self.config, ui_resource=self, layout=layout,