From eb8456d81a60a2db6cbb14249df31f6e08493c02 Mon Sep 17 00:00:00 2001 From: Carlos Herrero <26092748+hbcarlos@users.noreply.github.com> Date: Fri, 31 Mar 2023 10:04:05 +0200 Subject: [PATCH] Follow up #133 (#136) --- packages/collaboration-extension/src/filebrowser.ts | 12 +++++++++--- packages/docprovider/src/ydrive.ts | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/collaboration-extension/src/filebrowser.ts b/packages/collaboration-extension/src/filebrowser.ts index b32732b6..087914e6 100644 --- a/packages/collaboration-extension/src/filebrowser.ts +++ b/packages/collaboration-extension/src/filebrowser.ts @@ -30,10 +30,11 @@ namespace CommandIDs { } /** - * The default file browser factory provider. + * The default collaborative drive provider. */ export const drive: JupyterFrontEndPlugin = { id: '@jupyter/collaboration-extension:drive', + description: 'The default collaborative drive provider', provides: ICollaborativeDrive, requires: [ITranslator], optional: [], @@ -49,10 +50,12 @@ export const drive: JupyterFrontEndPlugin = { }; /** - * The default file browser factory provider. + * Plugin to register the shared model factory for the content type 'file'. */ export const yfile: JupyterFrontEndPlugin = { id: '@jupyter/collaboration-extension:yfile', + description: + "Plugin to register the shared model factory for the content type 'file'", autoStart: true, requires: [ICollaborativeDrive], optional: [], @@ -65,10 +68,12 @@ export const yfile: JupyterFrontEndPlugin = { }; /** - * The default file browser factory provider. + * Plugin to register the shared model factory for the content type 'notebook'. */ export const ynotebook: JupyterFrontEndPlugin = { id: '@jupyter/collaboration-extension:ynotebook', + description: + "Plugin to register the shared model factory for the content type 'notebook'", autoStart: true, requires: [ICollaborativeDrive], optional: [ISettingRegistry], @@ -116,6 +121,7 @@ export const ynotebook: JupyterFrontEndPlugin = { */ export const defaultFileBrowser: JupyterFrontEndPlugin = { id: '@jupyter/collaboration-extension:defaultFileBrowser', + description: 'The default file browser factory provider', provides: IDefaultFileBrowser, requires: [ICollaborativeDrive, IFileBrowserFactory], optional: [ diff --git a/packages/docprovider/src/ydrive.ts b/packages/docprovider/src/ydrive.ts index 2fb86ed8..8fa6761a 100644 --- a/packages/docprovider/src/ydrive.ts +++ b/packages/docprovider/src/ydrive.ts @@ -187,6 +187,9 @@ class SharedModelFactory implements ISharedModelFactory { type: Contents.ContentType, factory: SharedDocumentFactory ) { + if (this._documentFactories.has(type)) { + throw new Error(`The content type ${type} already exists`); + } this._documentFactories.set(type, factory); }