restyled branches overview tabled, fixed en/decoded branch name

This commit is contained in:
Florian Scholdei
2019-04-01 15:13:44 +02:00
parent 5420884f5a
commit 7f1aeb0492
3 changed files with 5 additions and 7 deletions

View File

@@ -19,19 +19,19 @@ class BranchDetailTable extends React.Component<Props> {
<table className="table">
<tbody>
<tr>
<td className="has-text-weight-semibold">{t("branch.name")}</td>
<th>{t("branch.name")}</th>
<td>
{branch.name} {this.renderDefaultBranch()}
</td>
</tr>
<tr>
<td className="has-text-weight-semibold">
<th>
{t("branch.repository")}
</td>
</th>
<td>{repository.name}</td>
</tr>
<tr>
<td className="has-text-weight-semibold">{t("branch.actions")}</td>
<th>{t("branch.actions")}</th>
<td>
<BranchButtonGroup repository={repository} branch={branch} />
</td>

View File

@@ -72,7 +72,6 @@ const mapStateToProps = (state, ownProps) => {
const { repository } = ownProps;
const branchName = decodeURIComponent(ownProps.match.params.branch);
const branch = getBranchByName(state, branchName);
console.log(branchName + " Branch:",branch);
const loading = isFetchBranchPending(state, branchName);
const error = getFetchBranchFailure(state, branchName);
return {

View File

@@ -22,7 +22,7 @@ export const FETCH_BRANCH_FAILURE = `${FETCH_BRANCH}_${FAILURE_SUFFIX}`;
// Fetching branches
export function fetchBranchByName(link: string, name: string) {
const branchUrl = link.endsWith("/") ? link + name : link + "/" + name;
const branchUrl = link.endsWith("/") ? link + encodeURIComponent(name) : link + "/" + encodeURIComponent(name);
return fetchBranch(branchUrl, name);
}
@@ -68,7 +68,6 @@ export function fetchBranch(link: string, name: string) {
}
export function getBranchByName(state: Object, name: string) {
console.log("State:", state);
if (state.branches) {
return state.branches[name];
}