@applica-software-guru/react-admin 1.5.322 → 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.322"
110
+ "version": "1.5.324"
111
111
  }
@@ -49,7 +49,10 @@ type EmptyProps = {
49
49
  };
50
50
 
51
51
  const StyledToolbar = styled('div')(({ theme }) => ({
52
- padding: theme.spacing(2)
52
+ padding: theme.spacing(2),
53
+ display: 'flex',
54
+ justifyContent: 'center',
55
+ gap: theme.spacing(2)
53
56
  }));
54
57
 
55
58
  const PREFIX = 'ApplicaEmpty';
@@ -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>
@@ -19,7 +19,7 @@ import {
19
19
 
20
20
  function CategoryAddButton() {
21
21
  return (
22
- <CreateInDialogButton maxWidth="sm" redirect="list" size="medium" variant="text">
22
+ <CreateInDialogButton maxWidth="sm" redirect="list" size="medium" variant="contained" color="primary">
23
23
  <CategoryForm />
24
24
  </CreateInDialogButton>
25
25
  );
@@ -30,7 +30,15 @@ function CategorySubmitButton() {
30
30
  console.log(values);
31
31
  }
32
32
  return (
33
- <CreateInDialogButton onSubmit={handleSubmit} redirect="list" label="Submit" size="medium">
33
+ <CreateInDialogButton
34
+ onSubmit={handleSubmit}
35
+ redirect="list"
36
+ label="Submit"
37
+ size="medium"
38
+ variant="contained"
39
+ color="primary"
40
+ maxWidth="xs"
41
+ >
34
42
  <SimpleForm>
35
43
  <TextInput source="description" validate={required()} fullWidth />
36
44
  </SimpleForm>
@@ -51,7 +59,16 @@ function CategoryList() {
51
59
  </ActionsMenu>
52
60
  </>
53
61
  }
54
- empty={<Empty actions={<CategoryAddButton />} />}
62
+ empty={
63
+ <Empty
64
+ actions={
65
+ <>
66
+ <CategoryAddButton />
67
+ <CategorySubmitButton />
68
+ </>
69
+ }
70
+ />
71
+ }
55
72
  >
56
73
  <Datagrid>
57
74
  <LocalizedTextField source="description" />
@@ -2,6 +2,7 @@ import {
2
2
  ActionsField,
3
3
  BooleanField,
4
4
  Datagrid,
5
+ DeleteWithConfirmButton,
5
6
  List,
6
7
  RecordInput,
7
8
  SearchInput,
@@ -15,8 +16,7 @@ function I18nMessageList() {
15
16
  <TextField source="lang" />
16
17
  <RecordInput source="code" />
17
18
  <RecordInput source="text" />
18
- <BooleanField source="translated" />
19
- <ActionsField />
19
+ <DeleteWithConfirmButton />
20
20
  </Datagrid>
21
21
  </List>
22
22
  );