Kaynağa Gözat

Update state database plugin commands.

Afshin Darian 8 yıl önce
ebeveyn
işleme
428dec5794
3 değiştirilmiş dosya ile 9 ekleme ve 8 silme
  1. 3 3
      src/help/plugin.ts
  2. 4 3
      src/statedb/index.ts
  3. 2 2
      src/statedb/plugin.ts

+ 3 - 3
src/help/plugin.ts

@@ -50,7 +50,7 @@ import {
 } from '../mainmenu';
 
 import {
-  cmdIds as statedbCmdIds
+  CommandIDs as StateDBCommandIDs
 } from '../statedb';
 
 import {
@@ -203,7 +203,7 @@ function activate(app: JupyterLab, mainMenu: IMainMenu, palette: ICommandPalette
     menu.addItem({ type: 'separator' });
     RESOURCES.forEach(args => { menu.addItem({ args, command }); });
     menu.addItem({ type: 'separator' });
-    menu.addItem({ command: statedbCmdIds.clear });
+    menu.addItem({ command: StateDBCommandIDs.clear });
 
     return menu;
   }
@@ -283,7 +283,7 @@ function activate(app: JupyterLab, mainMenu: IMainMenu, palette: ICommandPalette
 
   RESOURCES.forEach(args => { palette.addItem({ args, command, category }); });
 
-  palette.addItem({ command: statedbCmdIds.clear, category });
+  palette.addItem({ command: StateDBCommandIDs.clear, category });
 
   app.commands.addCommand(CommandIDs.launchClassic, {
     label: 'Launch Classic Notebook',

+ 4 - 3
src/statedb/index.ts

@@ -13,11 +13,12 @@ export * from './statedb';
 
 
 /**
- * The map of command ids used by the console plugin.
+ * The command IDs used by the state database plugin.
  */
 export
-const cmdIds = {
-  clear: 'statedb:clear'
+namespace CommandIDs {
+  export
+  const clear = 'statedb:clear';
 };
 
 

+ 2 - 2
src/statedb/plugin.ts

@@ -14,7 +14,7 @@ import {
 } from './index';
 
 import {
-  StateDB, cmdIds
+  CommandIDs, StateDB
 } from './';
 
 
@@ -41,7 +41,7 @@ export default plugin;
 function activate(app: JupyterLab): Promise<IStateDB> {
   let state = new StateDB({ namespace: app.info.namespace });
   let version = app.info.version;
-  let command = cmdIds.clear;
+  let command = CommandIDs.clear;
   let key = 'statedb:version';
   let fetch = state.fetch(key);
   let save = () => state.save(key, { version });