Browse Source

mol-plugin: configure remote states in plugin spec (wip)

David Sehnal 5 years ago
parent
commit
ac06b9c018

+ 3 - 0
src/apps/basic-wrapper/index.ts

@@ -41,6 +41,9 @@ class BasicWrapper {
                     // left: 'none',
                     // right: BasicWrapperControls
                 }
+            },
+            components: {
+                remoteState: 'none'
             }
         });
 

+ 3 - 0
src/mol-plugin/spec.ts

@@ -22,6 +22,9 @@ interface PluginSpec {
         initial?: Partial<PluginLayoutStateProps>,
         controls?: PluginSpec.LayoutControls
         viewport?: React.ComponentClass
+    },
+    components?: {
+        remoteState?: 'none' | 'default' // TODO: props for server etc
     }
 }
 

+ 1 - 1
src/mol-plugin/ui/state/snapshots.tsx

@@ -32,7 +32,7 @@ export class StateSnapshots extends PluginUIComponent<{ }> {
             <SectionHeader icon='floppy' title='Plugin State' />
             <LocalStateSnapshots />
             <LocalStateSnapshotList />
-            <RemoteStateSnapshots />
+            {this.plugin.spec.components?.remoteState !== 'none' && <RemoteStateSnapshots />}
 
             <div className='msp-btn-row-group' style={{ marginTop: '10px' }}>
                 <button className='msp-btn msp-btn-block msp-form-control' onClick={this.downloadToFile}>Download JSON</button>