@applica-software-guru/react-admin 1.5.323 → 1.5.324

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -107,5 +107,5 @@
107
107
  "type": "module",
108
108
  "types": "dist/index.d.ts",
109
109
  "typings": "dist/index.d.ts",
110
- "version": "1.5.323"
110
+ "version": "1.5.324"
111
111
  }
@@ -13,18 +13,22 @@ import {
13
13
  } from '@applica-software-guru/react-admin';
14
14
  import { Grid } from '@mui/material';
15
15
  import PropTypes from 'prop-types';
16
+ import { useRecordContext } from 'ra-core';
16
17
 
17
18
  function UserForm({ roles }) {
18
19
  const { spacing } = useThemeConfig();
20
+ const record = useRecordContext();
19
21
  return (
20
22
  <SimpleForm defaultValues={{ active: true }}>
21
23
  <Grid container spacing={spacing}>
22
24
  <Grid item lg={6} xs={12}>
23
25
  <TextInput source="email" fullWidth helperText="E-mail (ex. roob@applica.it)" />
24
26
  </Grid>
25
- <Grid item lg={6} xs={12}>
26
- <TextInput source="password" fullWidth type="password" />
27
- </Grid>
27
+ {record?.id ? (
28
+ <Grid item lg={6} xs={12}>
29
+ <TextInput source="password" fullWidth type="password" />
30
+ </Grid>
31
+ ) : null}
28
32
  <Grid item lg={12} xs={12}>
29
33
  <TextInput source="name" fullWidth />
30
34
  </Grid>