1
1
import React , { useState , useEffect } from 'react' ;
2
- import { Card , Button , Divider , Alert , message , Table , Tag , Input , Space , Tooltip , Row , Col } from 'antd' ;
2
+ import { Card , Button , Divider , Alert , message , Table , Tag , Input , Space , Tooltip , Row , Col , Avatar } from 'antd' ;
3
3
import {
4
4
SyncOutlined ,
5
5
CloudUploadOutlined ,
@@ -15,7 +15,7 @@ import Title from 'antd/lib/typography/Title';
15
15
import { Environment } from '../types/environment.types' ;
16
16
import { DataSource } from '../types/datasource.types' ;
17
17
import { getMergedWorkspaceDataSources } from '../services/datasources.service' ;
18
- import { Switch , Spin , Empty , Avatar } from 'antd' ;
18
+ import { Switch , Spin , Empty } from 'antd' ;
19
19
import { ManagedObjectType , setManagedObject , unsetManagedObject } from '../services/managed-objects.service' ;
20
20
import { useDeployModal } from '../context/DeployModalContext' ;
21
21
import { dataSourcesConfig } from '../config/data-sources.config' ;
@@ -362,29 +362,6 @@ const DataSourcesTab: React.FC<DataSourcesTabProps> = ({ environment, workspaceI
362
362
</ Col >
363
363
</ Row >
364
364
365
- { /* Update the search and filter bar */ }
366
- < div style = { { display : 'flex' , justifyContent : 'space-between' , marginBottom : 20 } } >
367
- < Search
368
- placeholder = "Search data sources by name or ID"
369
- allowClear
370
- onSearch = { value => setSearchText ( value ) }
371
- onChange = { e => setSearchText ( e . target . value ) }
372
- style = { { width : 300 } }
373
- size = "large"
374
- />
375
- < Button
376
- onClick = { ( ) => setShowManagedOnly ( ! showManagedOnly ) }
377
- type = "default"
378
- icon = { < FilterOutlined /> }
379
- style = { {
380
- marginLeft : '8px' ,
381
- backgroundColor : showManagedOnly ? '#1890ff' : 'white' ,
382
- color : showManagedOnly ? 'white' : '#1890ff' ,
383
- borderColor : '#1890ff'
384
- } }
385
- />
386
- </ div >
387
-
388
365
{ /* Content */ }
389
366
< Card
390
367
style = { {
@@ -403,7 +380,29 @@ const DataSourcesTab: React.FC<DataSourcesTabProps> = ({ environment, workspaceI
403
380
/>
404
381
) : (
405
382
< >
406
- { /* Search Bar */ }
383
+ { /* Search and Filter Bar */ }
384
+ < div style = { { display : 'flex' , justifyContent : 'space-between' , marginBottom : 20 } } >
385
+ < Search
386
+ placeholder = "Search data sources by name or ID"
387
+ allowClear
388
+ onSearch = { value => setSearchText ( value ) }
389
+ onChange = { e => setSearchText ( e . target . value ) }
390
+ style = { { width : 300 } }
391
+ size = "large"
392
+ />
393
+ < Button
394
+ onClick = { ( ) => setShowManagedOnly ( ! showManagedOnly ) }
395
+ type = "default"
396
+ icon = { < FilterOutlined /> }
397
+ style = { {
398
+ marginLeft : '8px' ,
399
+ backgroundColor : showManagedOnly ? '#1890ff' : 'white' ,
400
+ color : showManagedOnly ? 'white' : '#1890ff' ,
401
+ borderColor : '#1890ff'
402
+ } }
403
+ />
404
+ </ div >
405
+
407
406
{ searchText && displayedDataSources . length !== dataSources . length && (
408
407
< div style = { { marginTop : 8 , color : '#8c8c8c' } } >
409
408
Showing { displayedDataSources . length } of { dataSources . length } data sources
0 commit comments