-
-
-
- When published, this notebook will appear in the Azure Cosmos DB notebooks public gallery. Make sure you have removed any sensitive data or output before publishing.
-
-
-
-
- Would you like to publish and share "SampleNotebook" to the gallery?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Preview
-
-
-
-
-
-
-
-`;
diff --git a/src/Explorer/Panes/PublishNotebookPane/styled.less b/src/Explorer/Panes/PublishNotebookPane/styled.less
deleted file mode 100644
index e1170b670..000000000
--- a/src/Explorer/Panes/PublishNotebookPane/styled.less
+++ /dev/null
@@ -1,6 +0,0 @@
-.publishNotebookPanelContent {
- display: flex;
- flex-direction: column;
- flex: 1;
- overflow-y: auto;
-}
\ No newline at end of file
diff --git a/src/Explorer/Tabs/GalleryTab.tsx b/src/Explorer/Tabs/GalleryTab.tsx
deleted file mode 100644
index 7932f8301..000000000
--- a/src/Explorer/Tabs/GalleryTab.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import React from "react";
-import type { DatabaseAccount } from "../../Contracts/DataModels";
-import type { TabOptions } from "../../Contracts/ViewModels";
-import type { IGalleryItem, JunoClient } from "../../Juno/JunoClient";
-import { GalleryAndNotebookViewerComponent as GalleryViewer } from "../Controls/NotebookGallery/GalleryAndNotebookViewerComponent";
-import type { GalleryTab as GalleryViewerTab } from "../Controls/NotebookGallery/GalleryViewerComponent";
-import { SortBy } from "../Controls/NotebookGallery/GalleryViewerComponent";
-import type Explorer from "../Explorer";
-import TabsBase from "./TabsBase";
-
-interface Props {
- account: DatabaseAccount;
- container: Explorer;
- junoClient: JunoClient;
- selectedTab: GalleryViewerTab;
- notebookUrl?: string;
- galleryItem?: IGalleryItem;
- isFavorite?: boolean;
-}
-
-export default class GalleryTab extends TabsBase {
- constructor(
- options: TabOptions,
- private props: Props,
- ) {
- super(options);
- }
-
- public render() {
- return ;
- }
-
- public getContainer(): Explorer {
- return this.props.container;
- }
-}
diff --git a/src/Explorer/Tabs/NotebookV2Tab.ts b/src/Explorer/Tabs/NotebookV2Tab.ts
index 92e0e6958..b54efc00e 100644
--- a/src/Explorer/Tabs/NotebookV2Tab.ts
+++ b/src/Explorer/Tabs/NotebookV2Tab.ts
@@ -1,7 +1,6 @@
import { stringifyNotebook, toJS } from "@nteract/commutable";
import * as ko from "knockout";
import * as Q from "q";
-import { userContext } from "UserContext";
import ClearAllOutputsIcon from "../../../images/notebook/Notebook-clear-all-outputs.svg";
import CopyIcon from "../../../images/notebook/Notebook-copy.svg";
import CutIcon from "../../../images/notebook/Notebook-cut.svg";
@@ -12,8 +11,7 @@ import RunAllIcon from "../../../images/notebook/Notebook-run-all.svg";
import RunIcon from "../../../images/notebook/Notebook-run.svg";
import { default as InterruptKernelIcon, default as KillKernelIcon } from "../../../images/notebook/Notebook-stop.svg";
import SaveIcon from "../../../images/save-cosmos.svg";
-import { useNotebookSnapshotStore } from "../../hooks/useNotebookSnapshotStore";
-import { Action, ActionModifiers, Source } from "../../Shared/Telemetry/TelemetryConstants";
+import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants";
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
import * as NotebookConfigurationUtils from "../../Utils/NotebookConfigurationUtils";
import { logConsoleInfo } from "../../Utils/NotificationConsoleUtils";
@@ -21,9 +19,7 @@ import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandBu
import { useDialog } from "../Controls/Dialog";
import * as CommandBarComponentButtonFactory from "../Menus/CommandBar/CommandBarComponentButtonFactory";
import { KernelSpecsDisplay } from "../Notebook/NotebookClientV2";
-import * as CdbActions from "../Notebook/NotebookComponent/actions";
import { NotebookComponentAdapter } from "../Notebook/NotebookComponent/NotebookComponentAdapter";
-import { CdbAppState, SnapshotRequest } from "../Notebook/NotebookComponent/types";
import { NotebookContentItem } from "../Notebook/NotebookContentItem";
import { NotebookUtil } from "../Notebook/NotebookUtil";
import { useNotebook } from "../Notebook/useNotebook";
@@ -97,7 +93,6 @@ export default class NotebookTabV2 extends NotebookTabBase {
const saveLabel = "Save";
const copyToLabel = "Copy to ...";
- const publishLabel = "Publish to gallery";
const kernelLabel = "No Kernel";
const runLabel = "Run";
const runActiveCellLabel = "Run Active Cell";
@@ -130,17 +125,6 @@ export default class NotebookTabV2 extends NotebookTabBase {
});
}
- if (userContext.features.publicGallery) {
- saveButtonChildren.push({
- iconName: "PublishContent",
- onCommandClick: async () => await this.publishToGallery(),
- commandButtonLabel: publishLabel,
- hasPopup: false,
- disabled: false,
- ariaLabel: publishLabel,
- });
- }
-
let buttons: CommandButtonComponentProps[] = [
{
iconSrc: SaveIcon,
@@ -383,40 +367,6 @@ export default class NotebookTabV2 extends NotebookTabBase {
);
}
- private publishToGallery = async () => {
- TelemetryProcessor.trace(Action.NotebooksGalleryClickPublishToGallery, ActionModifiers.Mark, {
- source: Source.CommandBarMenu,
- });
-
- const notebookReduxStore = NotebookTabV2.clientManager.getStore();
- const unsubscribe = notebookReduxStore.subscribe(() => {
- const cdbState = (notebookReduxStore.getState() as CdbAppState).cdb;
- useNotebookSnapshotStore.setState({
- snapshot: cdbState.notebookSnapshot?.imageSrc,
- error: cdbState.notebookSnapshotError,
- });
- });
-
- const notebookContent = this.notebookComponentAdapter.getContent();
- const notebookContentRef = this.notebookComponentAdapter.contentRef;
- const onPanelClose = (): void => {
- unsubscribe();
- useNotebookSnapshotStore.setState({
- snapshot: undefined,
- error: undefined,
- });
- notebookReduxStore.dispatch(CdbActions.takeNotebookSnapshot(undefined));
- };
-
- await this.container.publishNotebook(
- notebookContent.name,
- notebookContent.content,
- notebookContentRef,
- (request: SnapshotRequest) => notebookReduxStore.dispatch(CdbActions.takeNotebookSnapshot(request)),
- onPanelClose,
- );
- };
-
private copyNotebook = () => {
const notebookContent = this.notebookComponentAdapter.getContent();
let content: string;
diff --git a/src/Explorer/Tree/ResourceTreeAdapter.tsx b/src/Explorer/Tree/ResourceTreeAdapter.tsx
index 819c73d6c..2d19bc8e9 100644
--- a/src/Explorer/Tree/ResourceTreeAdapter.tsx
+++ b/src/Explorer/Tree/ResourceTreeAdapter.tsx
@@ -10,7 +10,6 @@ import CopyIcon from "../../../images/notebook/Notebook-copy.svg";
import NewNotebookIcon from "../../../images/notebook/Notebook-new.svg";
import NotebookIcon from "../../../images/notebook/Notebook-resource.svg";
import FileIcon from "../../../images/notebook/file-cosmos.svg";
-import PublishIcon from "../../../images/notebook/publish_content.svg";
import RefreshIcon from "../../../images/refresh-cosmos.svg";
import CollectionIcon from "../../../images/tree-collection.svg";
import { ReactAdapter } from "../../Bindings/ReactBindingHandler";
@@ -18,7 +17,7 @@ import { isPublicInternetAccessAllowed } from "../../Common/DatabaseAccountUtili
import * as DataModels from "../../Contracts/DataModels";
import * as ViewModels from "../../Contracts/ViewModels";
import { IPinnedRepo } from "../../Juno/JunoClient";
-import { Action, ActionModifiers, Source } from "../../Shared/Telemetry/TelemetryConstants";
+import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants";
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
import { userContext } from "../../UserContext";
import { isServerlessAccount } from "../../Utils/CapabilityUtils";
@@ -49,7 +48,6 @@ export class ResourceTreeAdapter implements ReactAdapter {
public parameters: ko.Observable;
- public galleryContentRoot: NotebookContentItem;
public myNotebooksContentRoot: NotebookContentItem;
public gitHubNotebooksContentRoot: NotebookContentItem;
@@ -102,11 +100,6 @@ export class ResourceTreeAdapter implements ReactAdapter {
public async initialize(): Promise {
const refreshTasks: Promise[] = [];
- this.galleryContentRoot = {
- name: "Gallery",
- path: "Gallery",
- type: NotebookContentItemType.File,
- };
this.myNotebooksContentRoot = {
name: useNotebook.getState().notebookFolderName,
path: useNotebook.getState().notebookBasePath,
@@ -538,20 +531,7 @@ export class ResourceTreeAdapter implements ReactAdapter {
];
if (item.type === NotebookContentItemType.Notebook) {
- items.push({
- label: "Publish to gallery",
- iconSrc: PublishIcon,
- onClick: async () => {
- TelemetryProcessor.trace(Action.NotebooksGalleryClickPublishToGallery, ActionModifiers.Mark, {
- source: Source.ResourceTreeMenu,
- });
-
- const content = await this.container.readFile(item);
- if (content) {
- await this.container.publishNotebook(item.name, content);
- }
- },
- });
+ // Additional notebook-specific context menu items can be added here
}
// "Copy to ..." isn't needed if github locations are not available
diff --git a/src/GalleryViewer/GalleryViewer.less b/src/GalleryViewer/GalleryViewer.less
deleted file mode 100644
index 2eab230e9..000000000
--- a/src/GalleryViewer/GalleryViewer.less
+++ /dev/null
@@ -1,5 +0,0 @@
-@import "../../less/Common/Constants";
-
-.standalone-gallery-root {
- background: @GalleryBackgroundColor;
-}
\ No newline at end of file
diff --git a/src/GalleryViewer/GalleryViewer.tsx b/src/GalleryViewer/GalleryViewer.tsx
deleted file mode 100644
index 2026415af..000000000
--- a/src/GalleryViewer/GalleryViewer.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { initializeIcons, Link, Text } from "@fluentui/react";
-import "bootstrap/dist/css/bootstrap.css";
-import * as React from "react";
-import * as ReactDOM from "react-dom";
-import { userContext } from "UserContext";
-import { initializeConfiguration } from "../ConfigContext";
-import { GalleryHeaderComponent } from "../Explorer/Controls/Header/GalleryHeaderComponent";
-import {
- GalleryAndNotebookViewerComponent,
- GalleryAndNotebookViewerComponentProps,
-} from "../Explorer/Controls/NotebookGallery/GalleryAndNotebookViewerComponent";
-import { GalleryTab, SortBy } from "../Explorer/Controls/NotebookGallery/GalleryViewerComponent";
-import { JunoClient } from "../Juno/JunoClient";
-import * as GalleryUtils from "../Utils/GalleryUtils";
-import "./GalleryViewer.less";
-
-const enableNotebooksUrl = "https://aka.ms/cosmos-enable-notebooks";
-const createAccountUrl = "https://aka.ms/cosmos-create-account-portal";
-
-const onInit = async () => {
- const dataExplorerUrl = new URL("./", window.location.href).href;
-
- initializeIcons();
- await initializeConfiguration();
- const galleryViewerProps = GalleryUtils.getGalleryViewerProps(window.location.search);
-
- const props: GalleryAndNotebookViewerComponentProps = {
- junoClient: new JunoClient(),
- selectedTab:
- galleryViewerProps.selectedTab ||
- (userContext.features.publicGallery ? GalleryTab.PublicGallery : GalleryTab.OfficialSamples),
- sortBy: galleryViewerProps.sortBy || SortBy.MostRecent,
- searchText: galleryViewerProps.searchText,
- };
-
- const element = (
-
-
-
-
-
-
-
- Welcome to the Azure Cosmos DB notebooks gallery! View the sample notebooks to learn about use cases, best
- practices, and how to get started with Azure Cosmos DB.
-
-
- If {`you'd`} like to run or edit the notebook in your own Azure Cosmos DB account,{" "}
- sign in and select an account with{" "}
- notebooks enabled. From there, you can download the sample to your
- account. If you {`don't`} have an account yet, you can{" "}
- create one from the Azure portal.
-
-