15
15
* limitations under the License.
16
16
*/
17
17
18
- import { ReactWidget } from '@jupyterlab/apputils' ;
19
18
import { JupyterLab } from '@jupyterlab/application' ;
20
19
import React , { useEffect , useState } from 'react' ;
21
20
import { Tree , NodeRendererProps } from 'react-arborist' ;
@@ -47,6 +46,8 @@ import { authApi } from '../utils/utils';
47
46
import { Table } from './tableInfo' ;
48
47
import { ClipLoader } from 'react-spinners' ;
49
48
import { ToastContainer , toast } from 'react-toastify' ;
49
+ import { DataprocWidget } from '../controls/DataprocWidget' ;
50
+ import { IThemeManager } from '@jupyterlab/apputils' ;
50
51
51
52
const iconDatabase = new LabIcon ( {
52
53
name : 'launcher:database-icon' ,
@@ -99,7 +100,13 @@ const calculateDepth = (node: any): number => {
99
100
return depth ;
100
101
} ;
101
102
102
- const DpmsComponent = ( { app } : { app : JupyterLab } ) : JSX . Element => {
103
+ const DpmsComponent = ( {
104
+ app,
105
+ themeManager
106
+ } : {
107
+ app : JupyterLab ;
108
+ themeManager : IThemeManager ;
109
+ } ) : JSX . Element => {
103
110
const [ searchTerm , setSearchTerm ] = useState ( '' ) ;
104
111
const [ notebookValue , setNotebookValue ] = useState < string > ( '' ) ;
105
112
const [ dataprocMetastoreServices , setDataprocMetastoreServices ] =
@@ -268,7 +275,8 @@ fetching database name from fully qualified name structure */
268
275
const content = new Database (
269
276
node . data . name ,
270
277
dataprocMetastoreServices ,
271
- databaseDetails
278
+ databaseDetails ,
279
+ themeManager
272
280
) ;
273
281
const widget = new MainAreaWidget < Database > ( { content } ) ;
274
282
const widgetId = 'node-widget-db' ;
@@ -285,7 +293,8 @@ fetching database name from fully qualified name structure */
285
293
dataprocMetastoreServices ,
286
294
database ,
287
295
column ,
288
- tableDescription
296
+ tableDescription ,
297
+ themeManager
289
298
) ;
290
299
const widget = new MainAreaWidget < Table > ( { content } ) ;
291
300
const widgetId = `node-widget-${ uuidv4 ( ) } ` ;
@@ -707,15 +716,12 @@ fetching database name from fully qualified name structure */
707
716
) ;
708
717
} ;
709
718
710
- export class dpmsWidget extends ReactWidget {
711
- app : JupyterLab ;
712
-
713
- constructor ( app : JupyterLab ) {
714
- super ( ) ;
715
- this . app = app ;
719
+ export class dpmsWidget extends DataprocWidget {
720
+ constructor ( private app : JupyterLab , themeManager : IThemeManager ) {
721
+ super ( themeManager ) ;
716
722
}
717
723
718
- render ( ) : JSX . Element {
719
- return < DpmsComponent app = { this . app } /> ;
724
+ renderInternal ( ) : JSX . Element {
725
+ return < DpmsComponent app = { this . app } themeManager = { this . themeManager } /> ;
720
726
}
721
727
}
0 commit comments