mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
@@ -1,8 +1,13 @@
|
||||
// @flow
|
||||
|
||||
import React from "react";
|
||||
import {withRouter} from "react-router-dom";
|
||||
import type {Branch, Changeset, PagedCollection, Repository} from "@scm-manager/ui-types";
|
||||
import { withRouter } from "react-router-dom";
|
||||
import type {
|
||||
Branch,
|
||||
Changeset,
|
||||
PagedCollection,
|
||||
Repository
|
||||
} from "@scm-manager/ui-types";
|
||||
import {
|
||||
fetchChangesets,
|
||||
getChangesets,
|
||||
@@ -11,9 +16,15 @@ import {
|
||||
selectListAsCollection
|
||||
} from "../modules/changesets";
|
||||
|
||||
import {connect} from "react-redux";
|
||||
import {ErrorNotification, getPageFromMatch, LinkPaginator, ChangesetList, Loading} from "@scm-manager/ui-components";
|
||||
import {compose} from "redux";
|
||||
import { connect } from "react-redux";
|
||||
import {
|
||||
ErrorNotification,
|
||||
getPageFromMatch,
|
||||
LinkPaginator,
|
||||
ChangesetList,
|
||||
Loading
|
||||
} from "@scm-manager/ui-components";
|
||||
import { compose } from "redux";
|
||||
|
||||
type Props = {
|
||||
repository: Repository,
|
||||
@@ -64,13 +75,21 @@ class Changesets extends React.Component<Props> {
|
||||
|
||||
renderList = () => {
|
||||
const { repository, changesets } = this.props;
|
||||
return <ChangesetList repository={repository} changesets={changesets} />;
|
||||
return (
|
||||
<div className="panel-block">
|
||||
<ChangesetList repository={repository} changesets={changesets} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
renderPaginator = () => {
|
||||
const { page, list } = this.props;
|
||||
if (list) {
|
||||
return <LinkPaginator page={page} collection={list} />;
|
||||
return (
|
||||
<div className="panel-footer">
|
||||
<LinkPaginator page={page} collection={list} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -89,10 +89,12 @@ class BranchRoot extends React.Component<Props> {
|
||||
const changesets = <Changesets repository={repository} branch={branch} />;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="panel">
|
||||
<div className="panel-heading">
|
||||
{this.renderBranchSelector()}
|
||||
</div>
|
||||
<Route path={`${url}/:page?`} component={() => changesets} />
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,32 +108,34 @@ class FileTree extends React.Component<Props> {
|
||||
}
|
||||
|
||||
return (
|
||||
<table className="table table-hover table-sm is-fullwidth">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className={classes.iconColumn} />
|
||||
<th>{t("sources.file-tree.name")}</th>
|
||||
<th className="is-hidden-mobile">
|
||||
{t("sources.file-tree.length")}
|
||||
</th>
|
||||
<th className="is-hidden-mobile">
|
||||
{t("sources.file-tree.lastModified")}
|
||||
</th>
|
||||
<th className="is-hidden-mobile">
|
||||
{t("sources.file-tree.description")}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{files.map(file => (
|
||||
<FileTreeLeaf
|
||||
key={file.name}
|
||||
file={file}
|
||||
baseUrl={baseUrlWithRevision}
|
||||
/>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<div className="panel-block">
|
||||
<table className="table table-hover table-sm is-fullwidth">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className={classes.iconColumn} />
|
||||
<th>{t("sources.file-tree.name")}</th>
|
||||
<th className="is-hidden-mobile">
|
||||
{t("sources.file-tree.length")}
|
||||
</th>
|
||||
<th className="is-hidden-mobile">
|
||||
{t("sources.file-tree.lastModified")}
|
||||
</th>
|
||||
<th className="is-hidden-mobile">
|
||||
{t("sources.file-tree.description")}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{files.map(file => (
|
||||
<FileTreeLeaf
|
||||
key={file.name}
|
||||
file={file}
|
||||
baseUrl={baseUrlWithRevision}
|
||||
/>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,9 +29,6 @@ type State = {
|
||||
};
|
||||
|
||||
const styles = {
|
||||
toCenterContent: {
|
||||
display: "block"
|
||||
},
|
||||
pointer: {
|
||||
cursor: "pointer"
|
||||
},
|
||||
@@ -126,7 +123,6 @@ class Content extends React.Component<Props, State> {
|
||||
<div
|
||||
className={classNames(
|
||||
"panel-block",
|
||||
classes.toCenterContent,
|
||||
classes.hasBackground
|
||||
)}
|
||||
>
|
||||
@@ -161,7 +157,7 @@ class Content extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { file, revision, repository, path, classes } = this.props;
|
||||
const { file, revision, repository, path } = this.props;
|
||||
const { showHistory } = this.state;
|
||||
|
||||
const header = this.showHeader();
|
||||
@@ -180,13 +176,11 @@ class Content extends React.Component<Props, State> {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<nav className="panel">
|
||||
<article className="panel-heading">{header}</article>
|
||||
<div className="panel">
|
||||
<div className="panel-heading">{header}</div>
|
||||
{moreInformation}
|
||||
<div className={classNames("panel-block", classes.toCenterContent)}>
|
||||
{content}
|
||||
</div>
|
||||
</nav>
|
||||
{content}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -79,12 +79,16 @@ class HistoryView extends React.Component<Props, State> {
|
||||
const currentPage = page + 1;
|
||||
return (
|
||||
<>
|
||||
<ChangesetList repository={repository} changesets={changesets} />
|
||||
<StatePaginator
|
||||
page={currentPage}
|
||||
collection={pageCollection}
|
||||
updatePage={(newPage: number) => this.updatePage(newPage)}
|
||||
/>
|
||||
<div className="panel-block">
|
||||
<ChangesetList repository={repository} changesets={changesets} />
|
||||
</div>
|
||||
<div className="panel-footer">
|
||||
<StatePaginator
|
||||
page={currentPage}
|
||||
collection={pageCollection}
|
||||
updatePage={(newPage: number) => this.updatePage(newPage)}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -93,8 +93,10 @@ class Sources extends React.Component<Props> {
|
||||
|
||||
if (currentFileIsDirectory) {
|
||||
return (
|
||||
<div className={"has-border-around"}>
|
||||
{this.renderBranchSelector()}
|
||||
<div className="panel">
|
||||
<div className="panel-heading">
|
||||
{this.renderBranchSelector()}
|
||||
</div>
|
||||
<FileTree
|
||||
repository={repository}
|
||||
revision={revision}
|
||||
|
||||
@@ -90,7 +90,7 @@ class SourcesView extends React.Component<Props, State> {
|
||||
|
||||
const sources = this.showSources();
|
||||
|
||||
return <>{sources}</>;
|
||||
return <div className="panel-block">{sources}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user