VictorPlusC commented on a change in pull request #17127:
URL: https://github.com/apache/beam/pull/17127#discussion_r836958881



##########
File path: 
sdks/python/apache_beam/runners/interactive/extensions/apache-beam-jupyterlab-sidepanel/src/SidePanel.ts
##########
@@ -35,24 +40,30 @@ import {
 export class SidePanel extends BoxPanel {
   constructor(
     manager: ServiceManager.IManager,
-    rendermime: IRenderMimeRegistry
+    rendermime: IRenderMimeRegistry,
+    pageType: string
   ) {
     super({
       direction: 'top-to-bottom',
       alignment: 'end'
     });
     this.id = 'apache-beam-jupyterlab-sidepanel';
-    this.title.label = 'Interactive Beam Inspector';
     this.title.closable = true;
-
     this._sessionContext = new SessionContext({
       sessionManager: manager.sessions,
       specsManager: manager.kernelspecs,
       name: 'Interactive Beam Inspector Session'
     });
 
-    this._inspector = new InteractiveInspectorWidget(this._sessionContext);
-    this.addWidget(this._inspector);
+    if (pageType === 'Inspector') {
+      this.title.label = 'Interactive Beam Inspector';
+      this._inspector = new InteractiveInspectorWidget(this._sessionContext);
+      this.addWidget(this._inspector);
+    } else if (pageType === 'Clusters') {
+      this.title.label = 'Interactive Beam Cluster Manager';
+      this._clusters = new ClustersWidget(this._sessionContext);
+      this.addWidget(this._clusters);
+    }

Review comment:
       That is a great point. Thanks for the suggestion! I now pass in the 
widget and the code is much cleaner.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to