muffin-admin 9.4.1 → 9.4.2
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/dist/MuffinAdmin.d.ts +2 -1
- package/dist/MuffinAdmin.js +14 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/MuffinAdmin.tsx +23 -6
- package/src/index.tsx +1 -1
package/dist/MuffinAdmin.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AdminProps, AppBarProps, LayoutProps } from "react-admin";
|
|
1
|
+
import { AdminProps, AppBarProps, LayoutProps, LoginProps } from "react-admin";
|
|
2
2
|
export declare function MuffinAdmin(props: AdminProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare function MuffinAdminLayout(props: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare function MuffinAppBar(props: AppBarProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function MuffinLogin(props: LoginProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/MuffinAdmin.js
CHANGED
|
@@ -4,6 +4,7 @@ import SvgIcon from "@mui/material/SvgIcon";
|
|
|
4
4
|
import Tooltip from "@mui/material/Tooltip";
|
|
5
5
|
import Typography from "@mui/material/Typography";
|
|
6
6
|
import { AdminContext, AdminUI, AppBar, Layout, localStorageStore, Login, } from "react-admin";
|
|
7
|
+
import { useEffect } from "react";
|
|
7
8
|
import { ConfirmationProvider } from "./common";
|
|
8
9
|
import { useMuffinAdminOpts } from "./hooks";
|
|
9
10
|
import { buildProvider, muffinTranslations } from "./i18n";
|
|
@@ -36,5 +37,17 @@ export function MuffinAppBar(props) {
|
|
|
36
37
|
} }), appBarLinks.map((info) => (_jsx(Tooltip, { title: info.title, children: _jsx(IconButton, { color: "inherit", href: info.url, children: _jsx(SvgIcon, { component: findIcon(info.icon) }) }) }, info.url)))] })));
|
|
37
38
|
}
|
|
38
39
|
setupAdmin(["appbar"], MuffinAppBar);
|
|
40
|
+
export function MuffinLogin(props) {
|
|
41
|
+
const { auth: { loginURL }, } = useMuffinAdminOpts();
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (loginURL) {
|
|
44
|
+
const { pathname, search } = window.location;
|
|
45
|
+
const url = new URL(loginURL);
|
|
46
|
+
url.searchParams.set("redirect", pathname + search);
|
|
47
|
+
window.location.replace(url.toString());
|
|
48
|
+
}
|
|
49
|
+
}, [loginURL]);
|
|
50
|
+
return _jsx(Login, Object.assign({}, props));
|
|
51
|
+
}
|
|
39
52
|
// Initialize login page
|
|
40
|
-
setupAdmin(["loginpage"],
|
|
53
|
+
setupAdmin(["loginpage"], MuffinLogin);
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED