mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +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>
|
<h2>
|
||||||
<span className={classNames("is-size-4", "has-cursor-pointer")} onClick={this.toggleCollapse}>
|
<span className={classNames("is-size-4", "has-cursor-pointer")} onClick={this.toggleCollapse}>
|
||||||
<i className={classNames("fa", icon)} />
|
<i className={classNames("fa", icon)} />
|
||||||
</span>{" "}
|
</span>{" "}
|
||||||
<Link to={url} className={"has-text-dark"}>{name}</Link>
|
{url ? (
|
||||||
</h2>
|
<Link to={url} className={"has-text-dark"}>
|
||||||
|
{name}
|
||||||
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<h2>
|
name
|
||||||
<span className={classNames("is-size-4", "has-cursor-pointer")} onClick={this.toggleCollapse}>
|
)}
|
||||||
<i className={classNames("fa", icon)} /> {name}
|
|
||||||
</span>
|
|
||||||
</h2>
|
</h2>
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Container>
|
|
||||||
{header}
|
|
||||||
<hr />
|
<hr />
|
||||||
<Wrapper className={classNames("columns", "card-columns", "is-multiline")}>{content}</Wrapper>
|
<Wrapper className={classNames("columns", "card-columns", "is-multiline")}>{content}</Wrapper>
|
||||||
<div className="is-clearfix" />
|
<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 = {
|
export type RepositoryGroup = {
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class Overview extends React.Component<Props> {
|
|||||||
getReposLink = () => {
|
getReposLink = () => {
|
||||||
const { namespace, namespaces, reposLink } = this.props;
|
const { namespace, namespaces, reposLink } = this.props;
|
||||||
if (namespace) {
|
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 {
|
} else {
|
||||||
return reposLink;
|
return reposLink;
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ class Overview extends React.Component<Props> {
|
|||||||
|
|
||||||
const link = namespace ? `repos/${namespace}` : "repos";
|
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 (
|
return (
|
||||||
<Page title={t("overview.title")} subtitle={t("overview.subtitle")} loading={loading} error={error}>
|
<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) => {
|
const reducerForNamespaces = (state: object, namespaces: NamespaceCollection) => {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
namespaces: namespaces._embedded
|
namespaces: namespaces
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -467,7 +467,7 @@ export function getRepositoryCollection(state: object) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getNamespaceCollection(state: object) {
|
export function getNamespaceCollection(state: object) {
|
||||||
return state.repos.namespaces?.namespaces;
|
return state.repos.namespaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isFetchReposPending(state: object) {
|
export function isFetchReposPending(state: object) {
|
||||||
|
|||||||
Reference in New Issue
Block a user