From 9d2d4a2da18983694aaf6c5bf16f56077519d04f Mon Sep 17 00:00:00 2001 From: Mirek Simek Date: Wed, 30 Oct 2024 08:45:32 +0100 Subject: [PATCH 1/2] fix: CustomFieldsComponent warning shown even if added --- oarepo_ui/resources/resource.py | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/oarepo_ui/resources/resource.py b/oarepo_ui/resources/resource.py index 1e1c4348..16a50e74 100644 --- a/oarepo_ui/resources/resource.py +++ b/oarepo_ui/resources/resource.py @@ -76,7 +76,7 @@ def components(self) -> Iterator["UIResourceComponent"]: # TODO: just for deprecation, will be removed later for c in self.config.components or []: - if isinstance(c, CustomFieldsComponent): + if issubclass(c, CustomFieldsComponent): break else: log.warning( diff --git a/setup.cfg b/setup.cfg index bf97c045..28422565 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = oarepo-ui -version = 5.2.18 +version = 5.2.19 description = UI module for invenio 3.5+ long_description = file: README.md long_description_content_type = text/markdown From 5fec283867a03bbde695907bc2fc3a4f2d2e9a57 Mon Sep 17 00:00:00 2001 From: Mirek Simek Date: Wed, 30 Oct 2024 08:54:05 +0100 Subject: [PATCH 2/2] Removed deprecation code completely --- oarepo_ui/resources/resource.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/oarepo_ui/resources/resource.py b/oarepo_ui/resources/resource.py index 16a50e74..f60f1bba 100644 --- a/oarepo_ui/resources/resource.py +++ b/oarepo_ui/resources/resource.py @@ -73,21 +73,6 @@ class UIComponentsMixin: @property def components(self) -> Iterator["UIResourceComponent"]: """Return initialized service components.""" - - # TODO: just for deprecation, will be removed later - for c in self.config.components or []: - if issubclass(c, CustomFieldsComponent): - break - else: - log.warning( - "CustomFieldsComponent not found in components, adding it to be backwards compatible." - ) - if not self.config.components: - self.config.components = [] - if isinstance(self.config.components, tuple): - self.config.components = list(self.config.components) - self.config.components.append(CustomFieldsComponent) - return (c(self) for c in self.config.components or []) def run_components(self, action, *args, **kwargs):