@applica-software-guru/react-admin 1.1.97 → 1.1.99

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applica-software-guru/react-admin",
3
- "version": "1.1.97",
3
+ "version": "1.1.99",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -83,6 +83,10 @@ export type ApplicaAdminProps = AdminProps & {
83
83
  * Nome dell'applicazione da mostrare nell'header.
84
84
  */
85
85
  name: string;
86
+ /**
87
+ * Testo da mostrare nel footer. Default: '© Applica Software Guru for'.
88
+ */
89
+ copy: string;
86
90
  /**
87
91
  * Versione dell'applicazione da mostrare nel footer.
88
92
  */
@@ -180,6 +184,7 @@ const ApplicaAdmin = ({
180
184
  loginPage,
181
185
  menu,
182
186
  name,
187
+ copy,
183
188
  version,
184
189
  dataProvider,
185
190
  authProvider,
@@ -244,6 +249,7 @@ const ApplicaAdmin = ({
244
249
  <Layout
245
250
  {...props}
246
251
  name={name}
252
+ copy={copy}
247
253
  version={version}
248
254
  logoMain={_logoMain}
249
255
  logoIcon={_logoIcon}
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types';
5
5
  type IFooterProps = {
6
6
  name: string;
7
7
  version: string;
8
+ copy?: string;
8
9
  };
9
10
 
10
11
  function Footer(props: IFooterProps) {
@@ -12,7 +13,7 @@ function Footer(props: IFooterProps) {
12
13
  return (
13
14
  <Stack direction="row" justifyContent="space-between" alignItems="center" sx={{ p: '24px 16px 0px', mt: 'auto' }}>
14
15
  <Typography variant="caption">
15
- &copy; Applica Software Guru for {name} - {version}
16
+ <span dangerouslySetInnerHTML={{ __html: props?.copy || '' }} /> {name} - {version}
16
17
  </Typography>
17
18
  </Stack>
18
19
  );
@@ -20,7 +21,11 @@ function Footer(props: IFooterProps) {
20
21
 
21
22
  Footer.propTypes = {
22
23
  name: PropTypes.string.isRequired,
23
- version: PropTypes.string.isRequired
24
+ version: PropTypes.string.isRequired,
25
+ copy: PropTypes.string
26
+ };
27
+ Footer.defaultProps = {
28
+ copy: '&copy; Applica Software Guru for'
24
29
  };
25
30
 
26
31
  export { Footer };
@@ -1,18 +1,20 @@
1
- import { LoadingIndicator } from 'ra-ui-materialui';
2
1
  import { Header, HeaderNotification, HeaderProfile, HeaderSpacer, ResponsiveSection } from './Header';
3
- import { withLayoutProvider } from './Provider';
4
- import { LayoutWrapper } from './Wrapper';
5
- import { LayoutContent } from './Content';
6
- import { Footer } from './Footer';
7
- import { useBreadcrumbs } from '../../hooks';
2
+
8
3
  import { Breadcrumbs } from '../@extended';
9
- import { Outlet } from 'react-router-dom';
4
+ import { Footer } from './Footer';
5
+ import { LayoutContent } from './Content';
6
+ import { LayoutWrapper } from './Wrapper';
7
+ import { LoadingIndicator } from 'ra-ui-materialui';
10
8
  import { NavMenu } from './NavMenu';
11
9
  import { Navigation } from './Navigation';
10
+ import { Outlet } from 'react-router-dom';
11
+ import { useBreadcrumbs } from '../../hooks';
12
+ import { withLayoutProvider } from './Provider';
12
13
 
13
14
  type ILayoutProps = React.PropsWithChildren<{
14
15
  name: string;
15
16
  version: string;
17
+ copy?: string;
16
18
  }>;
17
19
 
18
20
  const Layout = withLayoutProvider(function Layout(props: ILayoutProps) {
@@ -49,7 +51,7 @@ const Layout = withLayoutProvider(function Layout(props: ILayoutProps) {
49
51
  )}
50
52
  {props.children}
51
53
  <Outlet />
52
- <Footer name={name} version={version} />
54
+ <Footer name={name} version={version} copy={props?.copy} />
53
55
  </LayoutContent>
54
56
  </LayoutWrapper>
55
57
  );
@@ -12,14 +12,14 @@ import {
12
12
  Typography
13
13
  } from '@mui/material';
14
14
  import { Dot, Transitions } from '../../@extended';
15
- import { useEffect, useMemo, useState } from 'react';
16
15
  import { styled, useTheme } from '@mui/material/styles';
16
+ import { useEffect, useMemo, useState } from 'react';
17
17
  import { useLocation, useNavigate } from 'react-router-dom';
18
- import { useMenuConfig } from '../../../hooks';
19
18
 
20
19
  import NavItem from './NavItem';
21
20
  import PropTypes from 'prop-types';
22
21
  import { useLayoutMediaState } from '../Provider';
22
+ import { useMenuConfig } from '../../../hooks';
23
23
 
24
24
  const PopperStyled = styled(Popper)(({ theme }) => ({
25
25
  overflow: 'visible',
@@ -1,12 +1,12 @@
1
1
  import { Avatar, Chip, ListItemButton, ListItemIcon, ListItemText, Typography } from '@mui/material';
2
2
  import { Link, useLocation } from 'react-router-dom';
3
3
  import { forwardRef, useEffect } from 'react';
4
- import { useMenuConfig } from '../../../hooks';
5
4
 
6
5
  import { Dot } from '../../@extended';
7
6
  import PropTypes from 'prop-types';
8
- import { useTheme } from '@mui/material/styles';
9
7
  import { useLayoutMediaState } from '../Provider';
8
+ import { useMenuConfig } from '../../../hooks';
9
+ import { useTheme } from '@mui/material/styles';
10
10
 
11
11
  const NavItem = ({ item, level }) => {
12
12
  const theme = useTheme();
@@ -33,7 +33,7 @@ const NavItem = ({ item, level }) => {
33
33
 
34
34
  // active menu item on page load
35
35
  useEffect(() => {
36
- if (pathname.includes(item.url)) {
36
+ if (pathname.endsWith(item.url)) {
37
37
  activeItem([item.id]);
38
38
  }
39
39
  // eslint-disable-next-line
@@ -11,6 +11,7 @@ import ScrollTop from './ScrollTop';
11
11
  import ScrollX from './ScrollX';
12
12
  import SmallIcon from './SmallIcon';
13
13
  export { MainIcon, ActionsMenu, Loadable, Loader, Layout, Logo, MainCard, ScrollTop, ScrollX, MenuPopover, Notification, SmallIcon };
14
+ export * from './Layout';
14
15
 
15
16
  export * from './@extended';
16
17
  export * from './third-party';
@@ -88,7 +88,7 @@ const CreateInDialogContent = ({
88
88
  },
89
89
  [onClose, onSuccess, queryClient, resource, notify, redirect, _redirect]
90
90
  );
91
- const { save, isLoading } = useCreateController({
91
+ const { save, ...createProps } = useCreateController({
92
92
  mutationOptions: {
93
93
  onSuccess: handleSuccess,
94
94
  onError: onError
@@ -110,7 +110,7 @@ const CreateInDialogContent = ({
110
110
  {
111
111
  record: record,
112
112
  save: handleSave,
113
- saving: isLoading,
113
+ saving: createProps?.saving,
114
114
  redirect: _redirect
115
115
  } as CreateControllerResult
116
116
  }
@@ -119,8 +119,8 @@ const CreateInDialogContent = ({
119
119
  ...children.props,
120
120
  toolbar: (
121
121
  <Toolbar>
122
- <Button variant="text" size="medium" label="ra.action.cancel" onClick={onClose} />
123
- <SaveButton />
122
+ <Button variant="text" size="medium" label="ra.action.cancel" onClick={onClose} disabled={createProps?.saving} />
123
+ <SaveButton disabled={createProps?.saving} />
124
124
  </Toolbar>
125
125
  )
126
126
  })}