TagSpaces is an offline, open source, document manager with tagging support
chore: optimizing dialog for creating/editing locations
Ilian Sapundshiev6f1dd9e826ee
diff --git a/app/components/dialogs/CreateEditLocationDialog.tsx b/app/components/dialogs/CreateEditLocationDialog.tsxindex 8dddac223..1ba1dbfd7 100644--- a/app/components/dialogs/CreateEditLocationDialog.tsx+++ b/app/components/dialogs/CreateEditLocationDialog.tsx@@ -485,13 +485,13 @@ function CreateEditLocationDialog(props: Props) {}}><Accordion defaultExpanded>- <AccordionSummary+ {/* <AccordionSummaryexpandIcon={<ExpandMoreIcon />}aria-controls="panelGeneral-content"id="panelGeneral-header"><Typography>{i18n.t('core:switchGeneral')}</Typography>- </AccordionSummary>+ </AccordionSummary> */}<AccordionDetails><FormGroup><FormControl disabled={disableLocationTypeSwitch} fullWidth>@@ -877,15 +877,6 @@ function CreateEditLocationDialog(props: Props) {</Accordion></DialogContent><DialogActions>- {/* <Button- data-tid="switchAdvancedModeTID"- onClick={() => setShowAdvancedMode(!showAdvancedMode)}- style={{ marginLeft: 10 }}- >- {showAdvancedMode- ? i18n.t('core:switchSimpleMode')- : i18n.t('core:switchAdvancedMode')}- </Button> */}<Button onClick={() => onClose()}>{i18n.t('core:cancel')}</Button><Buttondisabled={disableConfirmButton()}diff --git a/app/components/dialogs/LocalForm.tsx b/app/components/dialogs/LocalForm.tsxindex 153230948..b62644652 100644--- a/app/components/dialogs/LocalForm.tsx+++ b/app/components/dialogs/LocalForm.tsx@@ -18,9 +18,10 @@import React from 'react';-import InputAdornment from '@mui/material/InputAdornment';import FormControl from '@mui/material/FormControl';-import Input from '@mui/material/Input';+import TextField from '@mui/material/TextField';+import InputAdornment from '@mui/material/InputAdornment';+import OutlinedInput from '@mui/material/OutlinedInput';import InputLabel from '@mui/material/InputLabel';import IconButton from '@mui/material/IconButton';import FolderIcon from '@mui/icons-material/Folder';@@ -63,14 +64,12 @@ function LocalForm(props: Props) {};return (- <Grid container spacing={2}>+ <Grid container><Grid item xs={12}><FormControl fullWidth={true} error={errorTextName}>- <InputLabel htmlFor="path">- {i18n.t('core:createLocationName')}- </InputLabel>- <Input+ <TextFieldrequired+ autoFocusmargin="dense"name="name"inputProps={{ autoCorrect: 'off' }}@@ -78,17 +77,15 @@ function LocalForm(props: Props) {value={name}data-tid="locationName"fullWidth={true}+ // helperText="Please enter location name"+ label={i18n.t('core:createLocationName')}/></FormControl></Grid><Grid item xs={12}><FormControl fullWidth={true} error={errorTextPath}>- <InputLabel htmlFor="path">- {i18n.t('core:createLocationPath')}- </InputLabel>- <Input+ <TextFieldrequired- autoFocusmargin="dense"name="path"fullWidth={true}@@ -96,14 +93,17 @@ function LocalForm(props: Props) {data-tid="locationPath"onChange={event => setPath(event.target.value)}value={path}- placeholder="Enter a folder path or select it with the button on the right"- endAdornment={- <InputAdornment position="end" style={{ height: 32 }}>- <IconButton onClick={openDirectory} size="large">- <FolderIcon />- </IconButton>- </InputAdornment>- }+ // placeholder="Enter a folder path or select it with the button on the right"+ InputProps={{+ endAdornment: (+ <InputAdornment position="end" style={{ height: 32 }}>+ <IconButton onClick={openDirectory} size="large">+ <FolderIcon />+ </IconButton>+ </InputAdornment>+ )+ }}+ label={i18n.t('core:createLocationPath')}/>{AppConfig.isCordovaAndroid && (<FormHelperText>diff --git a/app/locales/en/core.json b/app/locales/en/core.jsonindex 651e01925..4764a5d2a 100644--- a/app/locales/en/core.json+++ b/app/locales/en/core.json@@ -516,7 +516,7 @@"goforward": "Go Forward","switchSimpleMode": "Simple Mode","switchAdvancedMode": "Advanced Mode",- "switchAdvanced": "Advanced",+ "switchAdvanced": "More properties","switchGeneral": "General","userName": "User","openLink": "Open Link",