Added navigational link to repo's history

This commit is contained in:
Philipp Czora
2018-09-17 16:51:09 +02:00
parent c5da25a1b4
commit 2af345bba0
4 changed files with 11 additions and 3 deletions

View File

@@ -22,7 +22,8 @@
"actions-label": "Actions",
"back-label": "Back",
"navigation-label": "Navigation",
"information": "Information"
"information": "Information",
"history": "History"
},
"create": {
"title": "Create Repository",

View File

@@ -12,6 +12,7 @@ class DropDown extends React.Component<Props> {
render() {
const {options, preselectedOption} = this.props;
return <select value={preselectedOption} onChange={this.change}>
<option key=""> </option>
{options.map(option => {
return <option key={option}
value={option}>{option}</option>

View File

@@ -112,7 +112,7 @@ function extractChangesetsByIds(data: any, oldChangesetsByIds: any) {
//selectors
export function getChangesetsForNamespaceAndNameFromState(namespace: string, name: string, state: Object) {
const key = namespace + "/" + name;
const key = createItemId(namespace, name);
if (!state.changesets[key]) {
return null;
}
@@ -121,7 +121,6 @@ export function getChangesetsForNamespaceAndNameFromState(namespace: string, nam
export function getChangesets(namespace: string, name: string, branch: string, state: Object) {
const key = createItemId(namespace, name, branch);
console.log("getChangesets for key " + key);
if (!state.changesets[key]) {
return null;
}

View File

@@ -103,6 +103,12 @@ class RepositoryRoot extends React.Component<Props> {
component={() => <Edit repository={repository}/>}
/>
<Route
exact
path={`${url}/history`}
component={() => <Changesets repository={repository}/>}
/>
<Route
exact
path={`${url}/history/:branch`}
component={() => <Changesets repository={repository}/>}
/>
@@ -111,6 +117,7 @@ class RepositoryRoot extends React.Component<Props> {
<Navigation>
<Section label={t("repository-root.navigation-label")}>
<NavLink to={url} label={t("repository-root.information")}/>
<NavLink activeOnlyWhenExact={false} to={`${url}/history`} label={t("repository-root.history")}/>
<EditNavLink repository={repository} editUrl={`${url}/edit`}/>
</Section>
<Section label={t("repository-root.actions-label")}>