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' ;
@@ -46,6 +45,8 @@ import { authApi, toastifyCustomStyle } from '../utils/utils';
46
45
import { Table } from './tableInfo' ;
47
46
import { ClipLoader } from 'react-spinners' ;
48
47
import { toast } from 'react-toastify' ;
48
+ import { DataprocWidget } from '../controls/DataprocWidget' ;
49
+ import { IThemeManager } from '@jupyterlab/apputils' ;
49
50
50
51
const iconDatabase = new LabIcon ( {
51
52
name : 'launcher:database-icon' ,
@@ -94,7 +95,13 @@ const calculateDepth = (node: any): number => {
94
95
return depth ;
95
96
} ;
96
97
97
- const DpmsComponent = ( { app } : { app : JupyterLab } ) : JSX . Element => {
98
+ const DpmsComponent = ( {
99
+ app,
100
+ themeManager
101
+ } : {
102
+ app : JupyterLab ;
103
+ themeManager : IThemeManager ;
104
+ } ) : JSX . Element => {
98
105
const [ searchTerm , setSearchTerm ] = useState ( '' ) ;
99
106
const [ notebookValue , setNotebookValue ] = useState < string > ( '' ) ;
100
107
const [ dataprocMetastoreServices , setDataprocMetastoreServices ] =
@@ -265,7 +272,8 @@ fetching database name from fully qualified name structure */
265
272
const content = new Database (
266
273
node . data . name ,
267
274
dataprocMetastoreServices ,
268
- databaseDetails
275
+ databaseDetails ,
276
+ themeManager
269
277
) ;
270
278
const widget = new MainAreaWidget < Database > ( { content } ) ;
271
279
const widgetId = 'node-widget-db' ;
@@ -286,7 +294,8 @@ fetching database name from fully qualified name structure */
286
294
dataprocMetastoreServices ,
287
295
database ,
288
296
column ,
289
- tableDescription
297
+ tableDescription ,
298
+ themeManager
290
299
) ;
291
300
const widget = new MainAreaWidget < Table > ( { content } ) ;
292
301
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