mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
Heed peer review
This commit is contained in:
@@ -88,24 +88,20 @@ export default class CardColumnGroup extends React.Component<Props, State> {
|
||||
});
|
||||
}
|
||||
|
||||
const header = url ? (
|
||||
return (
|
||||
<Container>
|
||||
<h2>
|
||||
<span className={classNames("is-size-4", "has-cursor-pointer")} onClick={this.toggleCollapse}>
|
||||
<i className={classNames("fa", icon)} />
|
||||
</span>{" "}
|
||||
<Link to={url} className={"has-text-dark"}>{name}</Link>
|
||||
</h2>
|
||||
{url ? (
|
||||
<Link to={url} className={"has-text-dark"}>
|
||||
{name}
|
||||
</Link>
|
||||
) : (
|
||||
<h2>
|
||||
<span className={classNames("is-size-4", "has-cursor-pointer")} onClick={this.toggleCollapse}>
|
||||
<i className={classNames("fa", icon)} /> {name}
|
||||
</span>
|
||||
name
|
||||
)}
|
||||
</h2>
|
||||
);
|
||||
|
||||
return (
|
||||
<Container>
|
||||
{header}
|
||||
<hr />
|
||||
<Wrapper className={classNames("columns", "card-columns", "is-multiline")}>{content}</Wrapper>
|
||||
<div className="is-clearfix" />
|
||||
|
||||
@@ -50,7 +50,11 @@ export type RepositoryCollection = PagedCollection & {
|
||||
};
|
||||
};
|
||||
|
||||
export type NamespaceCollection = Namespace[];
|
||||
export type NamespaceCollection = {
|
||||
_embedded: {
|
||||
namespaces: Namespace[];
|
||||
};
|
||||
};
|
||||
|
||||
export type RepositoryGroup = {
|
||||
name: string;
|
||||
|
||||
@@ -95,7 +95,7 @@ class Overview extends React.Component<Props> {
|
||||
getReposLink = () => {
|
||||
const { namespace, namespaces, reposLink } = this.props;
|
||||
if (namespace) {
|
||||
return namespaces?.find(n => n.namespace === namespace)?._links?.repositories?.href;
|
||||
return namespaces?._embedded.namespaces.find(n => n.namespace === namespace)?._links?.repositories?.href;
|
||||
} else {
|
||||
return reposLink;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ class Overview extends React.Component<Props> {
|
||||
|
||||
const link = namespace ? `repos/${namespace}` : "repos";
|
||||
|
||||
const namespacesToRender = namespaces?["", ...namespaces.map(n => n.namespace).sort()]:[];
|
||||
const namespacesToRender = namespaces ? ["", ...namespaces._embedded.namespaces.map(n => n.namespace).sort()] : [];
|
||||
|
||||
return (
|
||||
<Page title={t("overview.title")} subtitle={t("overview.subtitle")} loading={loading} error={error}>
|
||||
|
||||
@@ -422,7 +422,7 @@ const reducerByNames = (state: object, repository: Repository) => {
|
||||
const reducerForNamespaces = (state: object, namespaces: NamespaceCollection) => {
|
||||
return {
|
||||
...state,
|
||||
namespaces: namespaces._embedded
|
||||
namespaces: namespaces
|
||||
};
|
||||
};
|
||||
|
||||
@@ -467,7 +467,7 @@ export function getRepositoryCollection(state: object) {
|
||||
}
|
||||
|
||||
export function getNamespaceCollection(state: object) {
|
||||
return state.repos.namespaces?.namespaces;
|
||||
return state.repos.namespaces;
|
||||
}
|
||||
|
||||
export function isFetchReposPending(state: object) {
|
||||
|
||||
Reference in New Issue
Block a user