diff --git a/src/Explorer/Controls/Settings/SettingsComponent.tsx b/src/Explorer/Controls/Settings/SettingsComponent.tsx index 88e83a83f..11e399410 100644 --- a/src/Explorer/Controls/Settings/SettingsComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsComponent.tsx @@ -1281,6 +1281,7 @@ export class SettingsComponent extends React.Component = ({ collection }) => { +export const MaterializedViewComponent: React.FC = ({ collection, explorer }) => { const isTargetContainer = !!collection?.materializedViewDefinition(); const isSourceContainer = !!collection?.materializedViews(); @@ -17,14 +19,17 @@ export const MaterializedViewComponent: React.FC This container has the following views defined for it. - + Learn more {" "} about how to define materialized views and how to use them. - {isSourceContainer && } + {isSourceContainer && } {isTargetContainer && } ); diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx index 96fbcf290..da7c4dcd3 100644 --- a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewSourceComponent.tsx @@ -1,15 +1,23 @@ import { PrimaryButton } from "@fluentui/react"; +import { MaterializedViewsLabels } from "Common/Constants"; +import Explorer from "Explorer/Explorer"; import { loadMonaco } from "Explorer/LazyMonaco"; +import { AddMaterializedViewPanel } from "Explorer/Panes/AddMaterializedViewPanel/AddMaterializedViewPanel"; import { useDatabases } from "Explorer/useDatabases"; +import { useSidePanel } from "hooks/useSidePanel"; import * as monaco from "monaco-editor"; import React, { useEffect, useRef } from "react"; import * as ViewModels from "../../../../Contracts/ViewModels"; export interface MaterializedViewSourceComponentProps { collection: ViewModels.Collection; + explorer: Explorer; } -export const MaterializedViewSourceComponent: React.FC = ({ collection }) => { +export const MaterializedViewSourceComponent: React.FC = ({ + collection, + explorer, +}) => { const editorContainerRef = useRef(null); const editorRef = useRef(null); @@ -88,7 +96,18 @@ export const MaterializedViewSourceComponent: React.FC - {}} /> + + useSidePanel + .getState() + .openSidePanel( + MaterializedViewsLabels.NewMaterializedView, + , + ) + } + /> ); };