mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
apply eslint and prettier rules
This commit is contained in:
@@ -47,9 +47,7 @@ class NavLink extends React.Component<Props> {
|
||||
render() {
|
||||
const { to, activeOnlyWhenExact } = this.props;
|
||||
|
||||
return (
|
||||
<Route path={to} exact={activeOnlyWhenExact} children={this.renderLink} />
|
||||
);
|
||||
return <Route path={to} exact={activeOnlyWhenExact} children={this.renderLink} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, {ReactNode} from "react";
|
||||
import React, { ReactNode } from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import PrimaryNavigationLink from "./PrimaryNavigationLink";
|
||||
import { Links } from "@scm-manager/ui-types";
|
||||
@@ -18,14 +18,7 @@ class PrimaryNavigation extends React.Component<Props> {
|
||||
return (to: string, match: string, label: string, linkName: string) => {
|
||||
const link = links[linkName];
|
||||
if (link) {
|
||||
const navigationItem = (
|
||||
<PrimaryNavigationLink
|
||||
to={to}
|
||||
match={match}
|
||||
label={t(label)}
|
||||
key={linkName}
|
||||
/>
|
||||
);
|
||||
const navigationItem = <PrimaryNavigationLink to={to} match={match} label={t(label)} key={linkName} />;
|
||||
navigationItems.push(navigationItem);
|
||||
}
|
||||
};
|
||||
@@ -41,11 +34,7 @@ class PrimaryNavigation extends React.Component<Props> {
|
||||
|
||||
if (binder.hasExtension("primary-navigation.logout", props)) {
|
||||
navigationItems.push(
|
||||
<ExtensionPoint
|
||||
key="primary-navigation.logout"
|
||||
name="primary-navigation.logout"
|
||||
props={props}
|
||||
/>
|
||||
<ExtensionPoint key="primary-navigation.logout" name="primary-navigation.logout" props={props} />
|
||||
);
|
||||
} else {
|
||||
append("/logout", "/logout", "primary-navigation.logout", "logout");
|
||||
@@ -64,26 +53,12 @@ class PrimaryNavigation extends React.Component<Props> {
|
||||
const append = this.createNavigationAppender(navigationItems);
|
||||
if (binder.hasExtension("primary-navigation.first-menu", props)) {
|
||||
navigationItems.push(
|
||||
<ExtensionPoint
|
||||
key="primary-navigation.first-menu"
|
||||
name="primary-navigation.first-menu"
|
||||
props={props}
|
||||
/>
|
||||
<ExtensionPoint key="primary-navigation.first-menu" name="primary-navigation.first-menu" props={props} />
|
||||
);
|
||||
}
|
||||
append(
|
||||
"/repos/",
|
||||
"/(repo|repos)",
|
||||
"primary-navigation.repositories",
|
||||
"repositories"
|
||||
);
|
||||
append("/repos/", "/(repo|repos)", "primary-navigation.repositories", "repositories");
|
||||
append("/users/", "/(user|users)", "primary-navigation.users", "users");
|
||||
append(
|
||||
"/groups/",
|
||||
"/(group|groups)",
|
||||
"primary-navigation.groups",
|
||||
"groups"
|
||||
);
|
||||
append("/groups/", "/(group|groups)", "primary-navigation.groups", "groups");
|
||||
append("/admin", "/admin", "primary-navigation.admin", "config");
|
||||
|
||||
navigationItems.push(
|
||||
|
||||
@@ -21,13 +21,7 @@ class PrimaryNavigationLink extends React.Component<Props> {
|
||||
render() {
|
||||
const { to, match, activeOnlyWhenExact } = this.props;
|
||||
const path = match ? match : to;
|
||||
return (
|
||||
<Route
|
||||
path={path}
|
||||
exact={activeOnlyWhenExact}
|
||||
children={this.renderLink}
|
||||
/>
|
||||
);
|
||||
return <Route path={path} exact={activeOnlyWhenExact} children={this.renderLink} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,17 +48,11 @@ class SubNavigation extends React.Component<Props> {
|
||||
const { to, activeOnlyWhenExact } = this.props;
|
||||
|
||||
// removes last part of url
|
||||
let parents = to.split("/");
|
||||
const parents = to.split("/");
|
||||
parents.splice(-1, 1);
|
||||
let parent = parents.join("/");
|
||||
const parent = parents.join("/");
|
||||
|
||||
return (
|
||||
<Route
|
||||
path={parent}
|
||||
exact={activeOnlyWhenExact}
|
||||
children={this.renderLink}
|
||||
/>
|
||||
);
|
||||
return <Route path={parent} exact={activeOnlyWhenExact} children={this.renderLink} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user