mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Heed peer review remarks
This commit is contained in:
@@ -26,17 +26,18 @@ import { Link } from "react-router-dom";
|
||||
import { CardColumnGroup, RepositoryEntry } from "@scm-manager/ui-components";
|
||||
import { RepositoryGroup } from "@scm-manager/ui-types";
|
||||
import { Icon } from "@scm-manager/ui-components";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
|
||||
type Props = {
|
||||
type Props = WithTranslation & {
|
||||
group: RepositoryGroup;
|
||||
};
|
||||
|
||||
class RepositoryGroupEntry extends React.Component<Props> {
|
||||
render() {
|
||||
const { group } = this.props;
|
||||
const { group, t } = this.props;
|
||||
const settingsLink = group.namespace?._links?.permissions && (
|
||||
<Link to={`/namespace/${group.name}/settings`}>
|
||||
<Icon color={"is-link"} name={"cog"} />
|
||||
<Icon color={"is-link"} name={"cog"} title={t("repositoryOverview.settings.tooltip")} />
|
||||
</Link>
|
||||
);
|
||||
const namespaceHeader = (
|
||||
@@ -54,4 +55,4 @@ class RepositoryGroupEntry extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default RepositoryGroupEntry;
|
||||
export default withTranslation("namespaces")(RepositoryGroupEntry);
|
||||
|
||||
@@ -65,5 +65,5 @@ function sortByName(a, b) {
|
||||
}
|
||||
|
||||
function findNamespace(namespaces: NamespaceCollection, namespaceToFind: string) {
|
||||
return namespaces._embedded.namespaces.filter(namespace => namespace.namespace === namespaceToFind)[0];
|
||||
return namespaces._embedded.namespaces.find(namespace => namespace.namespace === namespaceToFind);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,8 @@ import {
|
||||
CustomQueryFlexWrappedColumns,
|
||||
ErrorPage,
|
||||
Loading,
|
||||
Page, PrimaryContentColumn,
|
||||
Page,
|
||||
PrimaryContentColumn,
|
||||
SecondaryNavigation,
|
||||
SecondaryNavigationColumn,
|
||||
StateMenuContextProvider,
|
||||
@@ -49,6 +50,7 @@ type Props = RouteComponentProps &
|
||||
namespaceName: string;
|
||||
namespacesLink: string;
|
||||
namespace: Namespace;
|
||||
error: Error;
|
||||
|
||||
// dispatch functions
|
||||
fetchNamespace: (link: string, namespace: string) => void;
|
||||
|
||||
Reference in New Issue
Block a user