Explorar o código

Respect deprecated flag in setting editor; return better error message if loading fails in setting editor.

Afshin Darian %!s(int64=6) %!d(string=hai) anos
pai
achega
b6374a582b

+ 3 - 3
packages/settingeditor/src/pluginlist.tsx

@@ -273,11 +273,11 @@ namespace Private {
   ): void {
     const plugins = sortPlugins(registry.plugins.slice()).filter(plugin => {
       const { schema } = plugin;
+      const deprecated = schema['jupyter.lab.setting-deprecated'] === true;
       const editable = Object.keys(schema.properties || {}).length > 0;
       const extensible = schema.additionalProperties !== false;
 
-      // Only render schemas that can be edited or extended.
-      return editable || extensible;
+      return !deprecated && (editable || extensible);
     });
     const items = plugins.map(plugin => {
       const { id, schema, version } = plugin;
@@ -317,7 +317,7 @@ namespace Private {
   }
 
   /**
-   * Sort a list of plugins by ID.
+   * Sort a list of plugins by title and ID.
    */
   function sortPlugins(
     plugins: ISettingRegistry.IPlugin[]

+ 2 - 2
packages/settingeditor/src/settingeditor.tsx

@@ -342,8 +342,8 @@ export class SettingEditor extends Widget {
         list.selection = container.plugin;
         this._setLayout();
       })
-      .catch((reason: Error) => {
-        console.error(`Loading settings failed: ${reason.message}`);
+      .catch(reason => {
+        console.error(`Loading ${container.plugin} settings failed.`, reason);
         list.selection = this._state.container.plugin = '';
         editor.settings = null;
         this._setLayout();