@@ -6,30 +6,26 @@ import React, {
6
6
useMemo
7
7
} from 'react' ;
8
8
import Grid from '@material-ui/core/Grid' ;
9
- import Tabs from '@material-ui/core/Tabs' ;
10
- import Tab from '@material-ui/core/Tab' ;
11
- import Typography from '@material-ui/core/Typography' ;
12
- import Tooltip from '@material-ui/core/Tooltip' ;
13
- import Select from '@material-ui/core/Select' ;
14
- import MenuItem from '@material-ui/core/MenuItem' ;
15
- import IconButton from '@material-ui/core/IconButton' ;
16
- import Button from '@material-ui/core/Button' ;
17
- import AddIcon from '@material-ui/icons/Add' ;
18
- import DeleteIcon from '@material-ui/icons/Delete' ;
19
- import CopyIcon from '@material-ui/icons/FileCopy' ;
20
- import Pagination from '@material-ui/lab/Pagination' ;
21
- import Switch from '@material-ui/core/Switch' ;
22
- import FormControlLabel from '@material-ui/core/FormControlLabel' ;
9
+ import TextField from '@material-ui/core/TextField' ;
23
10
24
11
import { makeStyles , Theme } from '@material-ui/core/styles' ;
25
12
import { SchemaContext , SchemaProvider } from './schema-context' ;
26
13
14
+ import { PickBucket } from 'etna-js/components/metis_exploration' ;
27
15
import { Script , Job } from '../polyphemus' ;
28
16
import AddModel from './add-model' ;
29
17
30
18
export const useStyles = makeStyles ( ( theme : Theme ) => ( {
31
19
} ) ) ;
32
20
21
+ export type Config = {
22
+ bucket_name : string ,
23
+ magic_string : string ,
24
+ deposit_root_path : string ,
25
+ metis_root_path : string ,
26
+ ingest_root_path : string
27
+ } ;
28
+
33
29
const IngestionForm = ( {
34
30
config,
35
31
project_name,
@@ -51,6 +47,8 @@ const IngestionForm = ({
51
47
52
48
const bucket_name = config . bucket_name || '' ;
53
49
50
+ const { magic_string, metis_root_path, ingest_root_path, deposit_root_path } = config ;
51
+
54
52
const setBucket = useCallback (
55
53
( bucket_name : string ) => {
56
54
let c = { ...config , bucket_name } ;
@@ -62,28 +60,54 @@ const IngestionForm = ({
62
60
return (
63
61
< Grid container className = { classes . form } direction = 'column' >
64
62
< Grid item container >
65
- regex
66
- </ Grid >
67
- < Grid item container >
68
- root_dir
69
- </ Grid >
70
- < Grid item container >
71
- file_regex
72
- </ Grid >
73
- < Grid item container >
74
- sftp_root_dir
63
+ < Grid item xs = { 3 } style = { { paddingLeft :'10px' } } > Magic string</ Grid >
64
+ < Grid item xs = { 9 } >
65
+ < TextField
66
+ fullWidth
67
+ placeholder = 'Match string for target files'
68
+ onChange = { ( e ) => update ( { ...config , magic_string : e . target . value } ) }
69
+ value = { magic_string }
70
+ />
71
+ </ Grid >
75
72
</ Grid >
76
73
< Grid item container >
77
- path_to_write_files
74
+ < Grid item xs = { 3 } style = { { paddingLeft :'10px' } } > Ingest root path</ Grid >
75
+ < Grid item xs = { 9 } >
76
+ < TextField
77
+ fullWidth
78
+ placeholder = 'Search path for files on ingest host'
79
+ onChange = { ( e ) => update ( { ...config , ingest_root_path : e . target . value } ) }
80
+ value = { ingest_root_path }
81
+ />
82
+ </ Grid >
78
83
</ Grid >
79
84
< Grid item container >
80
- bucket_name
85
+ < Grid item xs = { 3 } style = { { paddingLeft :'10px' } } > Deposit root path</ Grid >
86
+ < Grid item xs = { 9 } >
87
+ < TextField
88
+ fullWidth
89
+ placeholder = 'Path to copy files onto deposit host'
90
+ onChange = { ( e ) => update ( { ...config , deposit_root_path : e . target . value } ) }
91
+ value = { deposit_root_path }
92
+ />
93
+ </ Grid >
81
94
</ Grid >
82
95
< Grid item container >
83
- metis_root_path
96
+ < Grid item xs = { 3 } style = { { paddingLeft :'10px' } } > Metis bucket</ Grid >
97
+ < Grid item xs = { 9 } >
98
+ < PickBucket setBucket = { setBucket } project_name = { project_name } bucket = { bucket_name } label = { null } />
99
+ </ Grid >
84
100
</ Grid >
85
101
< Grid item container >
86
- deposit_root_path
102
+ < Grid item xs = { 3 } style = { { paddingLeft :'10px' } } > Metis root path</ Grid >
103
+ < Grid item xs = { 9 } >
104
+ < TextField
105
+ fullWidth
106
+ placeholder = 'Path to copy files onto Metis'
107
+ onChange = { ( e ) => update ( { ...config , metis_root_path : e . target . value } ) }
108
+ value = { metis_root_path }
109
+ />
110
+ </ Grid >
87
111
</ Grid >
88
112
</ Grid >
89
113
) ;
0 commit comments