mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-24 08:19:10 +01:00
redirect collection urls to add trailing slashes so that pagination works
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
|
||||
import {Redirect, Route, Switch, withRouter} from "react-router-dom";
|
||||
import type {Links} from "@scm-manager/ui-types";
|
||||
import { Redirect, Route, Switch, withRouter } from "react-router-dom";
|
||||
import type { Links } from "@scm-manager/ui-types";
|
||||
|
||||
import Overview from "../repos/containers/Overview";
|
||||
import Users from "../users/containers/Users";
|
||||
import Login from "../containers/Login";
|
||||
import Logout from "../containers/Logout";
|
||||
|
||||
import {ProtectedRoute} from "@scm-manager/ui-components";
|
||||
import {binder, ExtensionPoint} from "@scm-manager/ui-extensions";
|
||||
import { ProtectedRoute } from "@scm-manager/ui-components";
|
||||
import { binder, ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||
|
||||
import CreateUser from "../users/containers/CreateUser";
|
||||
import SingleUser from "../users/containers/SingleUser";
|
||||
@@ -34,7 +34,7 @@ class Main extends React.Component<Props> {
|
||||
render() {
|
||||
const { authenticated, links } = this.props;
|
||||
const redirectUrlFactory = binder.getExtension("main.redirect", this.props);
|
||||
let url = "/repos";
|
||||
let url = "/repos/";
|
||||
if (redirectUrlFactory) {
|
||||
url = redirectUrlFactory(this.props);
|
||||
}
|
||||
@@ -44,9 +44,10 @@ class Main extends React.Component<Props> {
|
||||
<Redirect exact from="/" to={url} />
|
||||
<Route exact path="/login" component={Login} />
|
||||
<Route path="/logout" component={Logout} />
|
||||
<Redirect exact strict from="/repos" to={url} />
|
||||
<ProtectedRoute
|
||||
exact
|
||||
path="/repos"
|
||||
path="/repos/"
|
||||
component={Overview}
|
||||
authenticated={authenticated}
|
||||
/>
|
||||
@@ -67,9 +68,10 @@ class Main extends React.Component<Props> {
|
||||
component={RepositoryRoot}
|
||||
authenticated={authenticated}
|
||||
/>
|
||||
<Redirect exact strict from="/users" to="/users/" />
|
||||
<ProtectedRoute
|
||||
exact
|
||||
path="/users"
|
||||
path="/users/"
|
||||
component={Users}
|
||||
authenticated={authenticated}
|
||||
/>
|
||||
@@ -89,10 +91,10 @@ class Main extends React.Component<Props> {
|
||||
path="/user/:name"
|
||||
component={SingleUser}
|
||||
/>
|
||||
|
||||
<Redirect exact strict from="/groups" to="/groups/" />
|
||||
<ProtectedRoute
|
||||
exact
|
||||
path="/groups"
|
||||
path="/groups/"
|
||||
component={Groups}
|
||||
authenticated={authenticated}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user