From bde32664bdc269b81fbf0d9507cae6269803d6bc Mon Sep 17 00:00:00 2001 From: Nishtha Ahuja Date: Fri, 21 Feb 2025 15:25:24 +0530 Subject: [PATCH] cleaning --- .../SettingsSubComponents/MaterializedViewComponent.tsx | 8 ++------ .../MaterializedViewSourceComponent.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewComponent.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewComponent.tsx index 0798711d8..af899426a 100644 --- a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewComponent.tsx @@ -8,11 +8,7 @@ export interface MaterializedViewComponentProps { } export const MaterializedViewComponent: React.FC = ({ collection }) => { - // If this container itself defines a materialized view, skip rendering this component. - const isTargetContainer = !!collection?.materializedViewDefinition(); - if (isTargetContainer) { - return null; - } + const isSourceContainer = !!collection?.materializedViews(); return ( @@ -26,7 +22,7 @@ export const MaterializedViewComponent: React.FC about how to define materialized views and how to use them. - + {isSourceContainer && } ); }; diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx index 3f52fb252..88c1a02bb 100644 --- a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx @@ -20,11 +20,11 @@ export const MaterializedViewSourceComponent: React.FC { - database.collections().forEach((coll) => { - if (coll.id() === viewId) { - const materializedViewDefinition = coll.materializedViewDefinition(); + database.collections().forEach((collection) => { + if (collection.id() === viewId) { + const materializedViewDefinition = collection.materializedViewDefinition(); materializedViewDefinition && (definition = materializedViewDefinition.definition); - coll.partitionKey?.paths && (partitionKey = coll.partitionKey.paths); + collection.partitionKey?.paths && (partitionKey = collection.partitionKey.paths); } }); });