activate navLink of history if changesets are shown

This commit is contained in:
Maren Süwer
2018-09-27 09:59:52 +02:00
parent a1e0e790ad
commit 2a684ec0a6

View File

@@ -71,6 +71,11 @@ class RepositoryRoot extends React.Component<Props> {
this.props.deleteRepo(repository, this.deleted);
};
matchChangeset = (route: any) => {
const url = this.matchedUrl();
return route.location.pathname.match(`${url}/changeset/`);
};
render() {
const { loading, error, repository, t } = this.props;
@@ -127,6 +132,7 @@ class RepositoryRoot extends React.Component<Props> {
activeOnlyWhenExact={false}
to={`${url}/history`}
label={t("repository-root.history")}
otherLocation={this.matchChangeset}
/>
<EditNavLink repository={repository} editUrl={`${url}/edit`} />
</Section>