Fix footer links (#1882)

Fix footer links. Before each personal link were redirected to the theme page.
This commit is contained in:
Eduard Heimbuch
2021-12-03 08:50:37 +01:00
committed by GitHub
parent 4aee350c02
commit f7d8636b35
4 changed files with 11 additions and 10 deletions

View File

@@ -0,0 +1,2 @@
- type: fixed
description: Personal footer links ([#1882](https://github.com/scm-manager/scm-manager/pull/1882))

View File

@@ -1388,7 +1388,7 @@ exports[`Storyshots Footer Default 1`] = `
<a
className=""
data-testid="footer-user-profile"
href="/me"
href="/me/settings/theme"
onClick={[Function]}
>
footer.user.profile
@@ -1505,7 +1505,7 @@ exports[`Storyshots Footer Full 1`] = `
<a
className=""
data-testid="footer-user-profile"
href="/me"
href="/me/settings/theme"
onClick={[Function]}
>
footer.user.profile
@@ -1661,7 +1661,7 @@ exports[`Storyshots Footer With Avatar 1`] = `
<a
className=""
data-testid="footer-user-profile"
href="/me"
href="/me/settings/theme"
onClick={[Function]}
>
footer.user.profile
@@ -1770,7 +1770,7 @@ exports[`Storyshots Footer With Plugin Links 1`] = `
<a
className=""
data-testid="footer-user-profile"
href="/me"
href="/me/settings/theme"
onClick={[Function]}
>
footer.user.profile

View File

@@ -97,7 +97,7 @@ const Footer: FC<Props> = ({ me, version, links }) => {
<div className="columns is-size-7">
{me ? (
<FooterSection title={meSectionTile}>
<NavLink to="/me" label={t("footer.user.profile")} testId="footer-user-profile" />
<NavLink to="/me/settings/theme" label={t("footer.user.profile")} testId="footer-user-profile" />
{me?._links?.password && (
<NavLink to="/me/settings/password" label={t("profile.changePasswordNavLink")} />
)}

View File

@@ -22,7 +22,7 @@
* SOFTWARE.
*/
import React, { FC } from "react";
import { Redirect, Route, useRouteMatch } from "react-router-dom";
import { Route, useRouteMatch } from "react-router-dom";
import { useTranslation } from "react-i18next";
import {
CustomQueryFlexWrappedColumns,
@@ -34,7 +34,7 @@ import {
SecondaryNavigationColumn,
StateMenuContextProvider,
SubNavigation,
urls,
urls
} from "@scm-manager/ui-components";
import ChangeUserPassword from "./ChangeUserPassword";
import ProfileInfo from "./ProfileInfo";
@@ -63,7 +63,7 @@ const Profile: FC = () => {
subtitle={t("profile.error-subtitle")}
error={{
name: t("profile.error"),
message: t("profile.error-message"),
message: t("profile.error-message")
}}
/>
);
@@ -71,7 +71,7 @@ const Profile: FC = () => {
const extensionProps = {
me,
url,
url
};
return (
@@ -82,7 +82,6 @@ const Profile: FC = () => {
<Route path={url} exact>
<ProfileInfo me={me} />
</Route>
<Redirect exact from={`${url}/settings/`} to={`${url}/settings/theme`} />
<Route path={`${url}/settings/theme`} exact>
<Theme />
</Route>