mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
fixed sources and changeset view for svn repos
This commit is contained in:
@@ -304,17 +304,22 @@ const reduceByBranchesSuccess = (state, payload) => {
|
|||||||
const byName = repoState.byName || {};
|
const byName = repoState.byName || {};
|
||||||
repoState.byName = byName;
|
repoState.byName = byName;
|
||||||
|
|
||||||
const branches = response._embedded.branches;
|
if(response._embedded) {
|
||||||
const names = branches.map(b => b.name);
|
const branches = response._embedded.branches;
|
||||||
response._embedded.branches = names;
|
const names = branches.map(b => b.name);
|
||||||
for (let branch of branches) {
|
response._embedded.branches = names;
|
||||||
byName[branch.name] = branch;
|
for (let branch of branches) {
|
||||||
|
byName[branch.name] = branch;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
[key]: {
|
||||||
|
list: response,
|
||||||
|
byName
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
[key]: {
|
[key]: []
|
||||||
list: response,
|
|
||||||
byName
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -80,19 +80,17 @@ class ChangesetsRoot extends React.Component<Props> {
|
|||||||
return <Loading />;
|
return <Loading />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!repository || !branches) {
|
if (!repository) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = this.stripEndingSlash(match.url);
|
const url = this.stripEndingSlash(match.url);
|
||||||
const branch = this.findSelectedBranch();
|
const branch = branches ? this.findSelectedBranch() : null;
|
||||||
const changesets = <Changesets repository={repository} branch={branch} />;
|
const changesets = <Changesets repository={repository} branch={branch} />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="panel">
|
<div className="panel">
|
||||||
<div className="panel-heading">
|
|
||||||
{this.renderBranchSelector()}
|
{this.renderBranchSelector()}
|
||||||
</div>
|
|
||||||
<Route path={`${url}/:page?`} component={() => changesets} />
|
<Route path={`${url}/:page?`} component={() => changesets} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -102,14 +100,16 @@ class ChangesetsRoot extends React.Component<Props> {
|
|||||||
const { repository, branches, selected, t } = this.props;
|
const { repository, branches, selected, t } = this.props;
|
||||||
if (repository._links.branches) {
|
if (repository._links.branches) {
|
||||||
return (
|
return (
|
||||||
<BranchSelector
|
<div className="panel-heading">
|
||||||
label={t("changesets.branchSelectorLabel")}
|
<BranchSelector
|
||||||
branches={branches}
|
label={t("changesets.branchSelectorLabel")}
|
||||||
selectedBranch={selected}
|
branches={branches}
|
||||||
selected={(b: Branch) => {
|
selectedBranch={selected}
|
||||||
this.branchSelected(b);
|
selected={(b: Branch) => {
|
||||||
}}
|
this.branchSelected(b);
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class Sources extends React.Component<Props> {
|
|||||||
if (currentFileIsDirectory) {
|
if (currentFileIsDirectory) {
|
||||||
return (
|
return (
|
||||||
<div className="panel">
|
<div className="panel">
|
||||||
<div className="panel-heading">{this.renderBranchSelector()}</div>
|
{this.renderBranchSelector()}
|
||||||
<FileTree
|
<FileTree
|
||||||
repository={repository}
|
repository={repository}
|
||||||
revision={revision}
|
revision={revision}
|
||||||
@@ -115,14 +115,16 @@ class Sources extends React.Component<Props> {
|
|||||||
|
|
||||||
if (branches) {
|
if (branches) {
|
||||||
return (
|
return (
|
||||||
<BranchSelector
|
<div className="panel-heading">
|
||||||
branches={branches}
|
<BranchSelector
|
||||||
selectedBranch={revision}
|
branches={branches}
|
||||||
label={t("changesets.branchSelectorLabel")}
|
selectedBranch={revision}
|
||||||
selected={(b: Branch) => {
|
label={t("changesets.branchSelectorLabel")}
|
||||||
this.branchSelected(b);
|
selected={(b: Branch) => {
|
||||||
}}
|
this.branchSelected(b);
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user