Skip to content

TagSpaces is an offline, open source, document manager with tagging support

form fixes

Stanimir Marinov908c0314fe71
diff --git a/app/components/dialogs/CreateLocationDialog.js b/app/components/dialogs/CreateLocationDialog.js
index a01008b54..cd0b07ba9 100644
--- a/app/components/dialogs/CreateLocationDialog.js
+++ b/app/components/dialogs/CreateLocationDialog.js
@@ -35,6 +35,7 @@ import FormGroup from '@material-ui/core/FormGroup';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import InputAdornment from '@material-ui/core/InputAdornment';
+import Grid from '@material-ui/core/Grid';
import Radio from '@material-ui/core/Radio';
import RadioGroup from '@material-ui/core/RadioGroup';
import FormLabel from '@material-ui/core/FormLabel';
@@ -45,7 +46,7 @@ import { extractDirectoryName } from '../../utils/paths';
import { type Location } from '../../reducers/locations';
import AppConfig from '../../config';
import { Pro } from '../../pro';
-import S3Form from '../S3Form';
+import ObjectStoreForm from './ObjectStoreForm';
const styles = theme => ({
root: {
@@ -122,6 +123,10 @@ class CreateLocationDialog extends React.Component<Props, State> {
const value = target.type === 'checkbox' ? target.checked : target.value;
const name = target.name;
+ this.handleChange(name, value);
+ };
+
+ handleChange = (name, value) => {
this.setState({
[name]: value
}, this.handleValidation);
@@ -130,17 +135,24 @@ class CreateLocationDialog extends React.Component<Props, State> {
handleValidation() {
// const pathRegex = this.state.path.match('^((\.\./|[a-zA-Z0-9_/\-\\])*\.[a-zA-Z0-9]+)$');
// const nameRegex = this.state.name.match('^[A-Z][-a-zA-Z]+$');
+ if (this.state.type === 'local') {
+ if (this.state.path && this.state.path.length > 0) {
+ this.setState({ errorTextPath: false, disableConfirmButton: false });
+ } else {
+ this.setState({ errorTextPath: true, disableConfirmButton: true });
+ }
- if (this.state.path && this.state.path.length > 0) {
- this.setState({ errorTextPath: false, disableConfirmButton: false });
- } else {
- this.setState({ errorTextPath: true, disableConfirmButton: true });
- }
-
- if (this.state.name && this.state.name.length > 0) {
- this.setState({ errorTextName: false, disableConfirmButton: false });
- } else {
- this.setState({ errorTextName: true, disableConfirmButton: true });
+ if (this.state.name && this.state.name.length > 0) {
+ this.setState({ errorTextName: false, disableConfirmButton: false });
+ } else {
+ this.setState({ errorTextName: true, disableConfirmButton: true });
+ }
+ } else if (this.state.type === 'cloud') {
+ if (this.state.name && this.state.name.length > 0) {
+ this.setState({ errorTextName: false, disableConfirmButton: false });
+ } else {
+ this.setState({ errorTextName: true, disableConfirmButton: true });
+ }
}
}
@@ -188,15 +200,11 @@ class CreateLocationDialog extends React.Component<Props, State> {
<DialogTitle>{i18n.t('core:createLocationTitle')}</DialogTitle>
);
- handleTypeChange = event => {
- this.setState({ type: event.target.value });
- };
-
renderContent = () => {
const { classes } = this.props;
let content;
if (this.state.type === 'cloud') {
- content = (<S3Form />);
+ content = (<ObjectStoreForm handleInputChange={this.handleInputChange} handleChange={this.handleChange} state={this.state} />);
} else {
content = (
<div>
@@ -243,76 +251,79 @@ class CreateLocationDialog extends React.Component<Props, State> {
/>
{this.state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
</FormControl>
- <FormGroup>
- <FormControlLabel
- control={
- <Switch
- data-tid="locationIsDefault"
- name="isDefault"
- checked={this.state.isDefault}
- onChange={this.handleInputChange}
- />
- }
- label={i18n.t('core:startupLocation')}
- />
- <FormControlLabel
- control={
- <Switch
- disabled={!Pro}
- data-tid="changeReadOnlyMode"
- name="isReadOnly"
- checked={this.state.isReadOnly}
- onChange={this.handleInputChange}
- />
- }
- label={i18n.t('core:readonlyModeSwitch') + (Pro ? '' : ' - ' + i18n.t('core:proFeature'))}
- />
- <FormControlLabel
- control={
- <Switch
- disabled={!Pro}
- data-tid="changePersistIndex"
- name="persistIndex"
- checked={this.state.persistIndex}
- onChange={this.handleInputChange}
- />
- }
- label={i18n.t('core:persistIndexSwitch') + (Pro ? '' : ' - ' + i18n.t('core:proFeature'))}
- />
- <FormControlLabel
- control={
- <Switch
- disabled={!Pro}
- data-tid="changeWatchForChanges"
- name="watchForChanges"
- checked={this.state.watchForChanges}
- onChange={this.handleInputChange}
- />
- }
- label={i18n.t('core:watchForChangesInLocation') + (Pro ? '' : ' - ' + i18n.t('core:proFeature'))}
- />
- </FormGroup>
</div>
);
}
return (
<DialogContent>
- <FormControl className={classes.formControl} component="fieldset" fullWidth={true}>
- <span>Type</span>
- <RadioGroup
- for="local"
- component="label"
- aria-label="Type"
- name="Type"
- value={this.state.type}
- onChange={this.handleTypeChange}
- row
- >
- <FormControlLabel value="local" control={<Radio />} label="Local" />
- <FormControlLabel value="cloud" control={<Radio />} label="Cloud (S3 AWS)" />
- </RadioGroup>
- </FormControl>
+ <Grid container spacing={24}>
+ <Grid item xs={2} style={{ lineHeight: 3, textAlign: 'right' }}>
+ Type
+ </Grid>
+ <Grid item xs={10}>
+ <RadioGroup
+ component="label"
+ aria-label="Type"
+ name="type"
+ value={this.state.type}
+ onChange={this.handleInputChange}
+ row
+ >
+ <FormControlLabel value="local" control={<Radio />} label="Local" />
+ <FormControlLabel value="cloud" control={<Radio />} label="Cloud (S3 AWS)" />
+ </RadioGroup>
+ </Grid>
+ </Grid>
{content}
+ <FormGroup>
+ <FormControlLabel
+ control={
+ <Switch
+ data-tid="locationIsDefault"
+ name="isDefault"
+ checked={this.state.isDefault}
+ onChange={this.handleInputChange}
+ />
+ }
+ label={i18n.t('core:startupLocation')}
+ />
+ <FormControlLabel
+ control={
+ <Switch
+ disabled={!Pro}
+ data-tid="changeReadOnlyMode"
+ name="isReadOnly"
+ checked={this.state.isReadOnly}
+ onChange={this.handleInputChange}
+ />
+ }
+ label={i18n.t('core:readonlyModeSwitch') + (Pro ? '' : ' - ' + i18n.t('core:proFeature'))}
+ />
+ <FormControlLabel
+ control={
+ <Switch
+ disabled={!Pro}
+ data-tid="changePersistIndex"
+ name="persistIndex"
+ checked={this.state.persistIndex}
+ onChange={this.handleInputChange}
+ />
+ }
+ label={i18n.t('core:persistIndexSwitch') + (Pro ? '' : ' - ' + i18n.t('core:proFeature'))}
+ />
+ <FormControlLabel
+ control={
+ <Switch
+ disabled={!Pro}
+ data-tid="changeWatchForChanges"
+ name="watchForChanges"
+ checked={this.state.watchForChanges}
+ onChange={this.handleInputChange}
+ />
+ }
+ label={i18n.t('core:watchForChangesInLocation') + (Pro ? '' : ' - ' + i18n.t('core:proFeature'))}
+ />
+ </FormGroup>
</DialogContent>
);
};
diff --git a/app/components/S3Form.js b/app/components/dialogs/ObjectStoreForm-old.js
similarity index 78%
rename from app/components/S3Form.js
rename to app/components/dialogs/ObjectStoreForm-old.js
index dc84ac34b..1b60874a7 100644
--- a/app/components/S3Form.js
+++ b/app/components/dialogs/ObjectStoreForm-old.js
@@ -36,16 +36,16 @@ import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { withStyles } from '@material-ui/core/styles';
// import styles from './SidePanels.css';
-import i18n from '../services/i18n';
-import { Pro } from '../pro';
+import i18n from '../../services/i18n';
+import { Pro } from '../../pro';
type Props = {
- classes: Object
+ state: Object,
+ handleChange: () => void,
+ handleInputChange: () => void
};
type State = {
- locationName?: string,
- accessKey?: string
};
const styles = {
@@ -56,6 +56,7 @@ const styles = {
input: {
display: 'flex',
padding: 0,
+ marginTop: 10
},
valueContainer: {
display: 'flex',
@@ -93,12 +94,7 @@ const styles = {
}
};
-class S3Form extends React.Component<Props, State> {
- state = {
- locationName: undefined,
- accessKey: undefined
- };
-
+class ObjectStoreFormOld extends React.Component<Props, State> {
suggestions = [
{ label: 'US East (Ohio)', value: 'us-east-2' },
{ label: 'US East (N. Virginia)', value: 'us-east-1' },
@@ -123,12 +119,6 @@ class S3Form extends React.Component<Props, State> {
label: suggestion.label,
}));
- handleChange = name => value => {
- this.setState({
- [name]: value,
- });
- };
-
NoOptionsMessage = (props) => (
<Typography
color="textSecondary"
@@ -218,8 +208,12 @@ class S3Form extends React.Component<Props, State> {
ValueContainer: this.ValueContainer,
};
+ handleChange = name => value => {
+ this.props.handleChange(name, value.value);
+ };
+
render() {
- // const { classes, theme } = this.props;
+ const { handleInputChange, state } = this.props;
const selectStyles = {
input: base => ({
...base,
@@ -230,31 +224,51 @@ class S3Form extends React.Component<Props, State> {
},
}),
};
+
return (
<Grid container spacing={24}>
<Grid item xs={12}>
<FormControl
fullWidth={true}
- error={this.state.errorTextPath}
+ error={state.errorTextPath}
>
- <InputLabel htmlFor="name">{i18n.t('core:createLocationName')}</InputLabel>
+ <InputLabel htmlFor="storeName">{i18n.t('core:createLocationName')}</InputLabel>
<Input
required
margin="dense"
- name="name"
+ name="storeName"
label={i18n.t('core:createLocationName')}
fullWidth={true}
data-tid="locationName"
- onChange={this.handleInputChange}
- value={this.state.locationName}
+ onChange={handleInputChange}
+ value={state.storeName}
+ />
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ </FormControl>
+ </Grid>
+ <Grid item xs={12}>
+ <FormControl
+ fullWidth={true}
+ error={state.errorTextPath}
+ >
+ <InputLabel htmlFor="path">{i18n.t('core:createLocationPath')}</InputLabel>
+ <Input
+ required
+ margin="dense"
+ name="storePath"
+ label={i18n.t('core:createLocationPath')}
+ fullWidth={true}
+ data-tid="locationPath"
+ onChange={handleInputChange}
+ value={state.storePath}
/>
- {this.state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
</FormControl>
</Grid>
<Grid item xs={12}>
<FormControl
fullWidth={true}
- error={this.state.errorTextPath}
+ error={state.errorTextPath}
>
<InputLabel htmlFor="accessKey">{i18n.t('core:accessKeyId')}</InputLabel>
<Input
@@ -264,16 +278,16 @@ class S3Form extends React.Component<Props, State> {
label={i18n.t('core:accessKeyId')}
fullWidth={true}
data-tid="accessKeyId"
- onChange={this.handleInputChange}
- value={this.state.accessKey}
+ onChange={handleInputChange}
+ value={state.accessKey}
/>
- {this.state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
</FormControl>
</Grid>
<Grid item xs={12}>
<FormControl
fullWidth={true}
- error={this.state.errorTextPath}
+ error={state.errorTextPath}
>
<InputLabel htmlFor="secretAccessKey">{i18n.t('core:secretAccessKey')}</InputLabel>
<Input
@@ -283,15 +297,15 @@ class S3Form extends React.Component<Props, State> {
label={i18n.t('core:secretAccessKey')}
fullWidth={true}
data-tid="secretAccessKey"
- onChange={this.handleInputChange}
- value={this.state.accessKey}
+ onChange={handleInputChange}
+ value={state.secretAccessKey}
/>
- {this.state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
</FormControl>
</Grid>
<Grid item xs={6}>
<FormControl
- error={this.state.errorTextPath}
+ error={state.errorTextPath}
>
<InputLabel htmlFor="bucketName">{i18n.t('core:bucketName')}</InputLabel>
<Input
@@ -301,10 +315,10 @@ class S3Form extends React.Component<Props, State> {
label={i18n.t('core:bucketName')}
fullWidth={true}
data-tid="bucketName"
- onChange={this.handleInputChange}
- value={this.state.accessKey}
+ onChange={handleInputChange}
+ value={state.bucketName}
/>
- {this.state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
</FormControl>
</Grid>
<Grid item xs={6}>
@@ -314,11 +328,11 @@ class S3Form extends React.Component<Props, State> {
styles={selectStyles}
fullWidth={true}
components={this.components}
- value={this.state.region}
+ value={state.region}
onChange={this.handleChange('region')}
- placeholder="Search a region"
+ // placeholder="Search a region"
/>
- {this.state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
</NoSsr>
</Grid>
</Grid>
@@ -338,8 +352,8 @@ class S3Form extends React.Component<Props, State> {
}, dispatch);
} */
-export default S3Form;
-/*export default withStyles(styles)(
+export default ObjectStoreFormOld;
+/* export default withStyles(styles)(
S3Form
// connect(mapStateToProps, mapDispatchToProps)(Search)
-);*/
+); */
diff --git a/app/components/dialogs/ObjectStoreForm.js b/app/components/dialogs/ObjectStoreForm.js
new file mode 100644
index 000000000..8d40d9eb4
--- /dev/null
+++ b/app/components/dialogs/ObjectStoreForm.js
@@ -0,0 +1,378 @@
+/* eslint-disable react/prop-types, react/jsx-handler-names */
+
+import React from 'react';
+// import PropTypes from 'prop-types';
+// import classNames from 'classnames';
+import Select from 'react-select';
+import { withStyles } from '@material-ui/core/styles';
+import Typography from '@material-ui/core/Typography';
+import NoSsr from '@material-ui/core/NoSsr';
+import TextField from '@material-ui/core/TextField';
+import Paper from '@material-ui/core/Paper';
+import Grid from '@material-ui/core/Grid';
+// import Chip from '@material-ui/core/Chip';
+import MenuItem from '@material-ui/core/MenuItem';
+import FormControl from '@material-ui/core/FormControl';
+import FormHelperText from '@material-ui/core/FormHelperText';
+import Input from '@material-ui/core/Input';
+import InputLabel from '@material-ui/core/InputLabel';
+// import CancelIcon from '@material-ui/icons/Cancel';
+// import { emphasize } from '@material-ui/core/styles/colorManipulator';
+import i18n from '../../services/i18n';
+
+const suggestions = [
+ { label: 'US East (Ohio)', value: 'us-east-2' },
+ { label: 'US East (N. Virginia)', value: 'us-east-1' },
+ { label: 'US West (N. California)', value: 'us-west-1' },
+ { label: 'US West (Oregon)', value: 'us-west-2' },
+ { label: 'Asia Pacific (Mumbai)', value: 'ap-south-1' },
+ { label: 'Asia Pacific (Osaka-Local)', value: 'ap-northeast-3' },
+ { label: 'Asia Pacific (Seoul)', value: 'ap-northeast-2' },
+ { label: 'Asia Pacific (Singapore)', value: 'ap-southeast-1' },
+ { label: 'Asia Pacific (Sydney)', value: 'ap-southeast-2' },
+ { label: 'Asia Pacific (Tokyo)', value: 'ap-northeast-1' },
+ { label: 'Canada (Central)', value: 'ca-central-1' },
+ { label: 'China (Beijing)', value: 'cn-north-1' },
+ { label: 'China (Ningxia)', value: 'cn-northwest-1' },
+ { label: 'EU (Frankfurt)', value: 'eu-central-1' },
+ { label: 'EU (Ireland)', value: 'eu-west-1' },
+ { label: 'EU (London)', value: 'eu-west-2' },
+ { label: 'EU (Paris)', value: 'eu-west-3' },
+ { label: 'South America (São Paulo)', value: 'sa-east-1' },
+].map(suggestion => ({
+ value: suggestion.value,
+ label: suggestion.label,
+}));
+
+const styles = theme => ({
+ root: {
+ flexGrow: 1,
+ height: 250,
+ },
+ input: {
+ display: 'flex',
+ padding: 0,
+ marginTop: 10
+ },
+ valueContainer: {
+ display: 'flex',
+ flexWrap: 'wrap',
+ flex: 1,
+ alignItems: 'center',
+ overflow: 'hidden',
+ },
+ /* chip: {
+ margin: `${theme.spacing.unit / 2}px ${theme.spacing.unit / 4}px`,
+ },
+ chipFocused: {
+ backgroundColor: emphasize(
+ theme.palette.type === 'light' ? theme.palette.grey[300] : theme.palette.grey[700],
+ 0.08,
+ ),
+ }, */
+ noOptionsMessage: {
+ padding: `${theme.spacing.unit}px ${theme.spacing.unit * 2}px`,
+ },
+ singleValue: {
+ fontSize: 16,
+ },
+ placeholder: {
+ position: 'absolute',
+ left: 2,
+ fontSize: 16,
+ },
+ paper: {
+ // position: 'absolute',
+ zIndex: 1,
+ marginTop: theme.spacing.unit,
+ left: 0,
+ right: 0,
+ },
+ divider: {
+ height: theme.spacing.unit * 2,
+ },
+});
+
+function NoOptionsMessage(props) {
+ return (
+ <Typography
+ color="textSecondary"
+ className={props.selectProps.classes.noOptionsMessage}
+ {...props.innerProps}
+ >
+ {props.children}
+ </Typography>
+ );
+}
+
+function inputComponent({ inputRef, ...props }) {
+ return <div ref={inputRef} {...props} />;
+}
+
+function Control(props) {
+ return (
+ <TextField
+ fullWidth
+ InputProps={{
+ inputComponent,
+ inputProps: {
+ className: props.selectProps.classes.input,
+ inputRef: props.innerRef,
+ children: props.children,
+ ...props.innerProps,
+ },
+ }}
+ {...props.selectProps.textFieldProps}
+ />
+ );
+}
+
+function Option(props) {
+ return (
+ <MenuItem
+ buttonRef={props.innerRef}
+ selected={props.isFocused}
+ component="div"
+ style={{
+ fontWeight: props.isSelected ? 500 : 400,
+ }}
+ {...props.innerProps}
+ >
+ {props.children}
+ </MenuItem>
+ );
+}
+
+function Placeholder(props) {
+ return (
+ <Typography
+ color="textSecondary"
+ className={props.selectProps.classes.placeholder}
+ {...props.innerProps}
+ >
+ {props.children}
+ </Typography>
+ );
+}
+
+function SingleValue(props) {
+ return (
+ <Typography className={props.selectProps.classes.singleValue} {...props.innerProps}>
+ {props.children}
+ </Typography>
+ );
+}
+
+function ValueContainer(props) {
+ return <div className={props.selectProps.classes.valueContainer}>{props.children}</div>;
+}
+
+/* function MultiValue(props) {
+ return (
+ <Chip
+ tabIndex={-1}
+ label={props.children}
+ className={classNames(props.selectProps.classes.chip, {
+ [props.selectProps.classes.chipFocused]: props.isFocused,
+ })}
+ onDelete={props.removeProps.onClick}
+ deleteIcon={<CancelIcon {...props.removeProps} />}
+ />
+ );
+} */
+
+function Menu(props) {
+ return (
+ <Paper square className={props.selectProps.classes.paper} {...props.innerProps}>
+ {props.children}
+ </Paper>
+ );
+}
+
+const components = {
+ Control,
+ Menu,
+ MultiValue: undefined,
+ NoOptionsMessage,
+ Option,
+ Placeholder,
+ SingleValue,
+ ValueContainer,
+};
+
+type Props = {
+ state: Object,
+ handleChange: () => void,
+ handleInputChange: () => void,
+ classes: Object,
+ theme: Object
+};
+
+class IntegrationReactSelect extends React.Component<Props> {
+ handleChange = name => value => {
+ this.props.handleChange(name, value);
+ };
+
+ render() {
+ const { classes, theme, handleInputChange, state } = this.props;
+
+ const selectStyles = {
+ input: base => ({
+ ...base,
+ color: theme.palette.text.primary,
+ '& input': {
+ font: 'inherit',
+ },
+ }),
+ };
+
+ return (
+ <Grid container spacing={24}>
+ <Grid item xs={12}>
+ <FormControl
+ fullWidth={true}
+ error={state.errorTextPath}
+ >
+ <InputLabel htmlFor="storeName">{i18n.t('core:createLocationName')}</InputLabel>
+ <Input
+ required
+ margin="dense"
+ name="storeName"
+ label={i18n.t('core:createLocationName')}
+ fullWidth={true}
+ data-tid="locationName"
+ onChange={handleInputChange}
+ value={state.storeName}
+ />
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ </FormControl>
+ </Grid>
+ <Grid item xs={12}>
+ <FormControl
+ fullWidth={true}
+ error={state.errorTextPath}
+ >
+ <InputLabel htmlFor="path">{i18n.t('core:createLocationPath')}</InputLabel>
+ <Input
+ required
+ margin="dense"
+ name="storePath"
+ label={i18n.t('core:createLocationPath')}
+ fullWidth={true}
+ data-tid="locationPath"
+ onChange={handleInputChange}
+ value={state.storePath}
+ />
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ </FormControl>
+ </Grid>
+ <Grid item xs={12}>
+ <FormControl
+ fullWidth={true}
+ error={state.errorTextPath}
+ >
+ <InputLabel htmlFor="accessKey">{i18n.t('core:accessKeyId')}</InputLabel>
+ <Input
+ required
+ margin="dense"
+ name="accessKey"
+ label={i18n.t('core:accessKeyId')}
+ fullWidth={true}
+ data-tid="accessKeyId"
+ onChange={handleInputChange}
+ value={state.accessKey}
+ />
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ </FormControl>
+ </Grid>
+ <Grid item xs={12}>
+ <FormControl
+ fullWidth={true}
+ error={state.errorTextPath}
+ >
+ <InputLabel htmlFor="secretAccessKey">{i18n.t('core:secretAccessKey')}</InputLabel>
+ <Input
+ required
+ margin="dense"
+ name="secretAccessKey"
+ label={i18n.t('core:secretAccessKey')}
+ fullWidth={true}
+ data-tid="secretAccessKey"
+ onChange={handleInputChange}
+ value={state.secretAccessKey}
+ />
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ </FormControl>
+ </Grid>
+ <Grid item xs={6}>
+ <FormControl
+ error={state.errorTextPath}
+ >
+ <InputLabel htmlFor="bucketName">{i18n.t('core:bucketName')}</InputLabel>
+ <Input
+ required
+ margin="dense"
+ name="bucketName"
+ label={i18n.t('core:bucketName')}
+ fullWidth={true}
+ data-tid="bucketName"
+ onChange={handleInputChange}
+ value={state.bucketName}
+ />
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ </FormControl>
+ </Grid>
+ <Grid item xs={6}>
+ <NoSsr>
+ <Select
+ classes={classes}
+ options={suggestions}
+ styles={selectStyles}
+ fullWidth={true}
+ components={components}
+ value={state.region}
+ onChange={this.handleChange('region')}
+ placeholder="Search a region"
+ />
+ {state.errorTextPath && <FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>}
+ </NoSsr>
+ </Grid>
+ </Grid>
+ );
+
+ /* return (
+ <div className={classes.root}>
+ <NoSsr>
+ <Select
+ classes={classes}
+ styles={selectStyles}
+ options={suggestions}
+ components={components}
+ value={this.state.single}
+ onChange={this.handleChange('single')}
+ placeholder="Search a country (start with a)"
+ />
+ {/!* <div className={classes.divider} />
+ <Select
+ classes={classes}
+ styles={selectStyles}
+ textFieldProps={{
+ label: 'Label',
+ InputLabelProps: {
+ shrink: true,
+ },
+ }}
+ options={suggestions}
+ components={components}
+ value={this.state.multi}
+ onChange={this.handleChange('multi')}
+ placeholder="Select multiple countries"
+ isMulti
+ /> *!/}
+ </NoSsr>
+ </div>
+ ); */
+ }
+}
+
+export default withStyles(styles, { withTheme: true })(IntegrationReactSelect);
diff --git a/app/reducers/locations.js b/app/reducers/locations.js
index bb9ef6b08..3c4b85440 100644
--- a/app/reducers/locations.js
+++ b/app/reducers/locations.js
@@ -33,6 +33,8 @@ export const types = {
export type Location = {
uuid: string,
name: string,
+ type: number,
+ awsKey: string, // TODO
paths: Array<string>,
perspective?: string, // id of the perspective
creationDate?: string,