TagSpaces is an offline, open source, document manager with tagging support
chore: fixing ui glitches in connection with the mui 5 upgrade
Ilian Sapundshievaaea8a4e8e48
diff --git a/app/components/dialogs/CreateEditLocationDialog.tsx b/app/components/dialogs/CreateEditLocationDialog.tsxindex 1ba1dbfd7..624a055da 100644--- a/app/components/dialogs/CreateEditLocationDialog.tsx+++ b/app/components/dialogs/CreateEditLocationDialog.tsx@@ -34,6 +34,7 @@ import List from '@mui/material/List';import ListItem from '@mui/material/ListItem';import ListItemIcon from '@mui/material/ListItemIcon';import ListItemText from '@mui/material/ListItemText';+import TextField from '@mui/material/TextField';import Input from '@mui/material/Input';import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';import ToggleButton from '@mui/material/ToggleButton';@@ -492,7 +493,7 @@ function CreateEditLocationDialog(props: Props) {><Typography>{i18n.t('core:switchGeneral')}</Typography></AccordionSummary> */}- <AccordionDetails>+ <AccordionDetails style={{ paddingTop: 16 }}><FormGroup><FormControl disabled={disableLocationTypeSwitch} fullWidth><InputLabel id="locationLabelID">@@ -619,10 +620,7 @@ function CreateEditLocationDialog(props: Props) {<AccordionDetails><FormGroup style={{ width: '100%' }}><FormControl fullWidth={true}>- <InputLabel htmlFor="newuuid">- {i18n.t('core:locationId')}- </InputLabel>- <Input+ <TextFieldrequiredmargin="dense"name="newuuid"@@ -631,6 +629,7 @@ function CreateEditLocationDialog(props: Props) {placeholder="Unique location identifier"onChange={event => setNewUuid(event.target.value)}value={newuuid}+ label={i18n.t('core:locationId')}/></FormControl><FormControlLabeldiff --git a/app/components/dialogs/LocalForm.tsx b/app/components/dialogs/LocalForm.tsxindex b62644652..acb33180d 100644--- a/app/components/dialogs/LocalForm.tsx+++ b/app/components/dialogs/LocalForm.tsx@@ -21,8 +21,6 @@ import React from 'react';import FormControl from '@mui/material/FormControl';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';import FormHelperText from '@mui/material/FormHelperText';diff --git a/app/components/dialogs/ObjectStoreForm.tsx b/app/components/dialogs/ObjectStoreForm.tsxindex 61d05b934..83afd2252 100644--- a/app/components/dialogs/ObjectStoreForm.tsx+++ b/app/components/dialogs/ObjectStoreForm.tsx@@ -19,12 +19,10 @@import React from 'react';import withStyles from '@mui/styles/withStyles';import Autocomplete from '@mui/material/Autocomplete';-import TextField from '@mui/material/TextField';import Grid from '@mui/material/Grid';import FormControl from '@mui/material/FormControl';import IconButton from '@mui/material/IconButton';-import Input from '@mui/material/Input';-import InputLabel from '@mui/material/InputLabel';+import TextField from '@mui/material/TextField';import InputAdornment from '@mui/material/InputAdornment';import Visibility from '@mui/icons-material/Visibility';import VisibilityOff from '@mui/icons-material/VisibilityOff';@@ -147,13 +145,10 @@ function ObjectStoreForm(props: Props) {}return (- <Grid container spacing={2}>+ <Grid container><Grid item xs={12}><FormControl fullWidth={true} error={cloudErrorTextName}>- <InputLabel htmlFor="storeName">- {i18n.t('core:createLocationName')}- </InputLabel>- <Input+ <TextFieldrequiredautoFocusmargin="dense"@@ -163,6 +158,7 @@ function ObjectStoreForm(props: Props) {data-tid="locationName"onChange={event => setStoreName(event.target.value)}value={storeName}+ label={i18n.t('core:createLocationName')}/>{/* {state.cloudErrorTextName && (<FormHelperText>{i18n.t('core:invalidName')}</FormHelperText>@@ -171,10 +167,7 @@ function ObjectStoreForm(props: Props) {</Grid><Grid item xs={12}><FormControl fullWidth={true} error={cloudErrorTextPath}>- <InputLabel htmlFor="path">- {i18n.t('core:createLocationPath')}- </InputLabel>- <Input+ <TextFieldmargin="dense"name="storePath"fullWidth={true}@@ -182,6 +175,7 @@ function ObjectStoreForm(props: Props) {data-tid="locationPath"onChange={event => setStorePath(event.target.value)}value={storePath}+ label={i18n.t('core:createLocationPath')}/>{/* {state.cloudErrorTextPath && (<FormHelperText>{i18n.t('core:invalidPath')}</FormHelperText>@@ -190,10 +184,7 @@ function ObjectStoreForm(props: Props) {</Grid><Grid item xs={12}><FormControl fullWidth={true} error={cloudErrorAccessKey}>- <InputLabel htmlFor="accessKeyId">- {i18n.t('core:accessKeyId')}- </InputLabel>- <Input+ <TextFieldmargin="dense"name="accessKeyId"fullWidth={true}@@ -201,6 +192,7 @@ function ObjectStoreForm(props: Props) {inputProps={{ autoCorrect: 'off', autoCapitalize: 'none' }}onChange={event => setAccessKeyId(event.target.value)}value={accessKeyId}+ label={i18n.t('core:accessKeyId')}/>{/* {state.cloudErrorAccessKey && (<FormHelperText>{i18n.t('core:invalidAccessKey')}</FormHelperText>@@ -209,10 +201,7 @@ function ObjectStoreForm(props: Props) {</Grid><Grid item xs={12}><FormControl fullWidth={true} error={cloudErrorSecretAccessKey}>- <InputLabel htmlFor="secretAccessKey">- {i18n.t('core:secretAccessKey')}- </InputLabel>- <Input+ <TextFieldmargin="dense"name="secretAccessKey"type={showSecretAccessKey ? 'text' : 'password'}@@ -221,17 +210,20 @@ function ObjectStoreForm(props: Props) {inputProps={{ autoCorrect: 'off', autoCapitalize: 'none' }}onChange={event => setSecretAccessKey(event.target.value)}value={secretAccessKey}- endAdornment={- <InputAdornment position="end">- <IconButton- aria-label="toggle password visibility"- onClick={() => setShowSecretAccessKey(!showSecretAccessKey)}- size="large"- >- {showSecretAccessKey ? <Visibility /> : <VisibilityOff />}- </IconButton>- </InputAdornment>- }+ label={i18n.t('core:secretAccessKey')}+ InputProps={{+ endAdornment: (+ <InputAdornment position="end">+ <IconButton+ aria-label="toggle password visibility"+ onClick={() => setShowSecretAccessKey(!showSecretAccessKey)}+ size="large"+ >+ {showSecretAccessKey ? <Visibility /> : <VisibilityOff />}+ </IconButton>+ </InputAdornment>+ )+ }}/>{/* {state.cloudErrorSecretAccessKey && (<FormHelperText>@@ -242,10 +234,7 @@ function ObjectStoreForm(props: Props) {</Grid><Grid item xs={12}><FormControl fullWidth={true}>- <InputLabel htmlFor="sessionToken">- {i18n.t('core:sessionToken')}- </InputLabel>- <Input+ <TextFieldmargin="dense"name="sessionToken"fullWidth={true}@@ -253,15 +242,13 @@ function ObjectStoreForm(props: Props) {inputProps={{ autoCorrect: 'off', autoCapitalize: 'none' }}onChange={event => setSessionToken(event.target.value)}value={sessionToken}+ label={i18n.t('core:sessionToken')}/></FormControl></Grid><Grid item xs={12}><FormControl fullWidth={true} error={cloudErrorBucketName}>- <InputLabel htmlFor="bucketName">- {i18n.t('core:bucketName')}- </InputLabel>- <Input+ <TextFieldmargin="dense"name="bucketName"fullWidth={true}@@ -269,6 +256,7 @@ function ObjectStoreForm(props: Props) {inputProps={{ autoCorrect: 'off', autoCapitalize: 'none' }}onChange={event => setBucketName(event.target.value)}value={bucketName}+ label={i18n.t('core:bucketName')}/>{/* {state.cloudErrorBucketName && (<FormHelperText>@@ -279,10 +267,7 @@ function ObjectStoreForm(props: Props) {</Grid><Grid item xs={12}><FormControl fullWidth={true}>- <InputLabel htmlFor="endpointURL">- {i18n.t('core:endpointURL')}- </InputLabel>- <Input+ <TextFieldmargin="dense"name="endpointURL"fullWidth={true}@@ -290,6 +275,7 @@ function ObjectStoreForm(props: Props) {placeholder={i18n.t('s3serviceURL')}onChange={event => setEndpointURL(event.target.value)}value={endpointURL}+ label={i18n.t('core:endpointURL')}/>{/* {state.cloudErrorId && (<FormHelperText>{i18n.t('core:missingId')}</FormHelperText>