- |
{user.login} |
@@ -184,7 +184,7 @@ export const UserManagement = () => {
user.authorities ? (
user.authorities.map((authority, j) => (
- {authority}
+ {authority}
))) : null
}
@@ -202,14 +202,20 @@ export const UserManagement = () => {
<%_ } _%>
-
- View
+
+
+ View
+
-
- Edit
+
+
+ Edit
+
-
- Delete
+
+
+ Delete
+
|
diff --git a/generators/react/templates/src/main/webapp/app/modules/home/home.tsx.ejs b/generators/react/templates/src/main/webapp/app/modules/home/home.tsx.ejs
index 838a0dd..c44c092 100644
--- a/generators/react/templates/src/main/webapp/app/modules/home/home.tsx.ejs
+++ b/generators/react/templates/src/main/webapp/app/modules/home/home.tsx.ejs
@@ -1,5 +1,5 @@
<%#
- Copyright 2013-2023 the original author or authors from the JHipster project.
+ Copyright 2013-2021 the original author or authors from the JHipster project.
This file is part of the JHipster project, see https://www.jhipster.tech/
for more information.
@@ -18,11 +18,7 @@
-%>
import './home.scss';
-<%_ if (authenticationTypeOauth2) { _%>
import React, { useEffect } from 'react';
-<%_ } else { _%>
-import React from 'react';
-<%_ } _%>
import { Link } from 'react-router-dom';
import { Translate } from 'react-jhipster';
import { Row, Col, Alert } from 'antd';
@@ -50,79 +46,41 @@ export const Home = () => {
- Welcome, <%= backendName %> Hipster!
+ Welcome, <%= backendType %> Hipster!
This is your homepage
{
- (account?.login) ? (
+ (account && account.login) ? (
-
You are logged in as user {account.login}.} />
+
) : (
-
If you want to
+ If you want to
<% if (!enableTranslation) { %> <% } %>
<%_ if (authenticationTypeOauth2) { _%>
- sign in
+ sign in
<%_ } else { _%>
sign in
<%_ } _%>
- , you can try the default accounts:
+ , you can try the default accounts:
- Administrator (login="admin" and password="admin")
- User (login="user" and password="user").
- >} />
+ >} />
-<%_ if (generateUserManagement) { _%>
-
- You do not have an account yet?
- Register a new account
-
+<%_ if (!skipUserManagement) { _%>
+ Register a new account
+ ]}/>
<%_ } _%>
)
}
-
- If you have any question on JHipster:
-
-
-
-
-
- If you like JHipster, do not forget to give us a star on
- {' '}
- GitHub!
-
+ Import the home page here!
);
};
export default Home;
-
diff --git a/generators/react/templates/src/main/webapp/app/modules/login/login-modal.tsx.ejs b/generators/react/templates/src/main/webapp/app/modules/login/login-modal.tsx.ejs
index 9742b80..17d1673 100644
--- a/generators/react/templates/src/main/webapp/app/modules/login/login-modal.tsx.ejs
+++ b/generators/react/templates/src/main/webapp/app/modules/login/login-modal.tsx.ejs
@@ -18,7 +18,7 @@
-%>
import React from 'react';
import { Translate, translate, ValidatedField } from 'react-jhipster';
-import { Modal, Form, Input, Checkbox, notification, Button } from 'antd';
+import { Modal, Form, Input, Checkbox, notification, Button, Alert, Row, Col } from 'antd';
import { Link } from 'react-router-dom';
import { type FieldError, useForm } from 'react-hook-form';
@@ -47,82 +47,66 @@ const LoginModal = (props: ILoginModalProps) => {
};
return (
-
-
);
diff --git a/generators/react/templates/src/main/webapp/app/modules/login/logout.tsx.ejs b/generators/react/templates/src/main/webapp/app/modules/login/logout.tsx.ejs
index 4655743..ebc04e3 100644
--- a/generators/react/templates/src/main/webapp/app/modules/login/logout.tsx.ejs
+++ b/generators/react/templates/src/main/webapp/app/modules/login/logout.tsx.ejs
@@ -21,6 +21,7 @@ import React, { useLayoutEffect } from 'react';
import { useAppDispatch, useAppSelector } from 'app/config/store';
import { logout } from 'app/shared/reducers/authentication';
import { Button, Result } from 'antd';
+import {Link} from "react-router-dom";
export const Logout = () => {
const logoutUrl = useAppSelector(state => state.authentication.logoutUrl);
diff --git a/generators/react/templates/src/main/webapp/app/shared/layout/header/header-components.tsx.ejs b/generators/react/templates/src/main/webapp/app/shared/layout/header/header-components.tsx.ejs
index c74e474..ba12092 100644
--- a/generators/react/templates/src/main/webapp/app/shared/layout/header/header-components.tsx.ejs
+++ b/generators/react/templates/src/main/webapp/app/shared/layout/header/header-components.tsx.ejs
@@ -20,9 +20,7 @@ import React from 'react';
import { Translate } from 'react-jhipster';
import { NavLink as Link } from 'react-router-dom';
-import appConfig from 'app/config/constants';
-
-export const BrandIcon = () => (
+export const BrandIcon = () => (
);
@@ -30,9 +28,9 @@ export const Brand = () => (
- 1stsportscards
+ Brand
- {appConfig.VERSION}
+ {VERSION}
);
diff --git a/generators/react/templates/src/main/webapp/app/shared/layout/header/header.tsx.ejs b/generators/react/templates/src/main/webapp/app/shared/layout/header/header.tsx.ejs
index 394c636..77e5687 100644
--- a/generators/react/templates/src/main/webapp/app/shared/layout/header/header.tsx.ejs
+++ b/generators/react/templates/src/main/webapp/app/shared/layout/header/header.tsx.ejs
@@ -18,95 +18,20 @@
-%>
import './header.scss';
-import React, { useState<% if (enableI18nRTL) { %>, useEffect<% } %> } from 'react';
-import { Translate<% if (enableTranslation) { %>, Storage<% } %> } from 'react-jhipster';
-import {
- Navbar,
- Nav,
- NavbarToggler,
- Collapse
-} from 'reactstrap';
+import React from 'react';
import LoadingBar from 'react-redux-loading-bar';
-
-<%_ if (enableTranslation && enableI18nRTL) { _%>
-import { isRTL } from 'app/config/translation';
-<%_ } _%>
-import { Home, Brand } from './header-components';
-import { AdminMenu, EntitiesMenu, AccountMenu<%_ if (enableTranslation) { _%>, LocaleMenu<%_ } _%>} from '../menus';
-<%_ if (enableTranslation) { _%>
-import { useAppDispatch } from 'app/config/store';
-import { setLocale } from 'app/shared/reducers/locale';
-<%_ } _%>
-
-export interface IHeaderProps {
- isAuthenticated: boolean;
- isAdmin: boolean;
- ribbonEnv: string;
- isInProduction: boolean;
- isOpenAPIEnabled: boolean;
-<%_ if (enableTranslation) { _%>
- currentLocale: string;
-<%_ } _%>
-}
-
-
-const Header = (props: IHeaderProps) => {
- const [menuOpen, setMenuOpen] = useState(false);
-<%_ if (enableI18nRTL) { _%>
- useEffect(() => document.querySelector('html').setAttribute('dir', isRTL(Storage.session.get('locale')) ? 'rtl' : 'ltr'));
-<%_ } _%>
-
-<%_ if (enableTranslation) { _%>
- const dispatch = useAppDispatch();
-
- const handleLocaleChange = event => {
- const langKey = event.target.value;
- Storage.session.set('locale', langKey);
- dispatch(setLocale(langKey));
- <%_ if (enableI18nRTL) { _%>
- document.querySelector('html').setAttribute('dir', isRTL(langKey) ? 'rtl' : 'ltr');
- <%_ } _%>
- }
-<%_ } _%>
-
- const renderDevRibbon = () => props.isInProduction === false ? (
-
- ) : null;
-
- const toggleMenu = () => setMenuOpen(!menuOpen);
-
- /* jhipster-needle-add-element-to-menu - JHipster will add new menu items here */
-
- return (
-
- );
+import { Layout } from 'antd';
+import { Brand } from './header-components';
+
+const Header = () => {
+ /* jhipster-needle-add-element-to-menu - JHipster will add new menu items here */
+
+ return (
+
+
+
+
+ );
};
export default Header;
diff --git a/generators/react/templates/src/main/webapp/app/shared/layout/menus/menu-item.tsx.ejs b/generators/react/templates/src/main/webapp/app/shared/layout/menus/menu-item.tsx.ejs
index a19f800..d624bf1 100644
--- a/generators/react/templates/src/main/webapp/app/shared/layout/menus/menu-item.tsx.ejs
+++ b/generators/react/templates/src/main/webapp/app/shared/layout/menus/menu-item.tsx.ejs
@@ -38,6 +38,8 @@ const MenuItem = (props: IMenuItem) => {
{children}
);
+
+ return null;
};
export default MenuItem;
diff --git a/generators/react/templates/src/main/webapp/app/shared/layout/sider/sider.tsx.ejs b/generators/react/templates/src/main/webapp/app/shared/layout/sider/sider.tsx.ejs
new file mode 100644
index 0000000..8a80169
--- /dev/null
+++ b/generators/react/templates/src/main/webapp/app/shared/layout/sider/sider.tsx.ejs
@@ -0,0 +1,100 @@
+import React, { useState<% if (enableI18nRTL) { %>, useEffect<% } %> } from 'react';
+import { translate<% if (enableTranslation) { %>, Storage<% } %> } from 'react-jhipster';
+
+<%_ if (enableTranslation && enableI18nRTL) { _%>
+ import { isRTL } from 'app/config/translation';
+<%_ } _%>
+
+import LoadingBar from 'react-redux-loading-bar';
+import { Layout, Menu } from 'antd';
+import { Home } from '../header/header-components';
+import { AdminMenu, EntitiesMenu, AccountMenu<%_ if (enableTranslation) { _%>, LocaleMenu<%_ } _%> } from '../menus';
+import { ApartmentOutlined, ClusterOutlined, GlobalOutlined, HomeOutlined, UserOutlined } from '@ant-design/icons';
+import { languages } from 'app/config/translation';
+
+<%_ if (enableTranslation) { _%>
+ import { useAppDispatch } from 'app/config/store';
+ import { setLocale } from 'app/shared/reducers/locale';
+<%_ } _%>
+
+export interface IHeaderProps {
+ isAuthenticated: boolean;
+ isAdmin: boolean;
+ ribbonEnv: string;
+ isInProduction: boolean;
+ isOpenAPIEnabled: boolean;
+ <%_ if (enableTranslation) { _%>
+ currentLocale: string;
+ <%_ } _%>
+}
+
+const { SubMenu } = Menu;
+const rootSubmenuKeys = ['entities', 'admin', 'lang', 'account'];
+
+const Sider = (props: IHeaderProps) => {
+ const [menuOpen, setMenuOpen] = useState(false);
+
+ const [openKeys, setOpenKeys] = React.useState([]);
+
+ const onOpenChange = keys => {
+ const latestOpenKey = keys.find(key => openKeys.indexOf(key) === -1);
+ if (rootSubmenuKeys.indexOf(latestOpenKey) === -1) {
+ setOpenKeys(keys);
+ } else {
+ setOpenKeys(latestOpenKey ? [latestOpenKey] : []);
+ }
+ };
+ <%_ if (enableI18nRTL) { _%>
+ useEffect(() => document.querySelector('html').setAttribute('dir', isRTL(Storage.session.get('locale')) ? 'rtl' : 'ltr'));
+ <%_ } _%>
+
+ <%_ if (enableTranslation) { _%>
+ const dispatch = useAppDispatch();
+
+ const handleLocaleChange = event => {
+ const langKey = event.target.value;
+ Storage.session.set('locale', langKey);
+ dispatch(setLocale(langKey));
+ <%_ if (enableI18nRTL) { _%>
+ document.querySelector('html').setAttribute('dir', isRTL(langKey) ? 'rtl' : 'ltr');
+ <%_ } _%>
+ }
+ <%_ } _%>
+
+ const toggleMenu = () => setMenuOpen(!menuOpen);
+
+ const [selectedKeys, setSelectedKeys] = useState(['home']);
+
+ const onSelect = ({ key }) => {
+ setSelectedKeys([key]);
+ };
+
+ /* jhipster-needle-add-element-to-menu - JHipster will add new menu items here */
+
+ return (
+
+
+
+
+ );
+};
+
+export default Sider;