added sources overview

This commit is contained in:
Florian Scholdei
2019-02-01 10:12:45 +01:00
parent 6edc3d12c7
commit b5f392d73e
6 changed files with 59 additions and 80 deletions

View File

@@ -1,26 +1,17 @@
// @flow
import ChangesetRow from "./ChangesetRow";
import React from "react";
import injectSheet from "react-jss";
import classNames from "classnames";
import type { Changeset, Repository } from "@scm-manager/ui-types";
type Props = {
repository: Repository,
changesets: Changeset[],
classes: any
};
const styles = {
toCenterContent: {
display: "block"
}
changesets: Changeset[]
};
class ChangesetList extends React.Component<Props> {
render() {
const { repository, changesets, classes } = this.props;
const { repository, changesets } = this.props;
const content = changesets.map(changeset => {
return (
<ChangesetRow
@@ -31,11 +22,11 @@ class ChangesetList extends React.Component<Props> {
);
});
return (
<div className={classNames("panel-block", classes.toCenterContent)}>
<div className="panel-block">
{content}
</div>
);
}
}
export default injectSheet(styles)(ChangesetList);
export default ChangesetList;

View File

@@ -108,6 +108,7 @@ class FileTree extends React.Component<Props> {
}
return (
<div className="panel-block">
<table className="table table-hover table-sm is-fullwidth">
<thead>
<tr>
@@ -134,6 +135,7 @@ class FileTree extends React.Component<Props> {
))}
</tbody>
</table>
</div>
);
}
}

View File

@@ -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
)}
>

View File

@@ -93,15 +93,17 @@ class Sources extends React.Component<Props> {
if (currentFileIsDirectory) {
return (
<div className="has-border-around is-round">
<nav className="panel">
<article className="panel-heading">
{this.renderBranchSelector()}
</article>
<FileTree
repository={repository}
revision={revision}
path={path}
baseUrl={baseUrl}
/>
</div>
</nav>
);
} else {
return (

View File

@@ -8,15 +8,12 @@ import { ExtensionPoint } from "@scm-manager/ui-extensions";
import { getContentType } from "./contentType";
import type { File, Repository } from "@scm-manager/ui-types";
import { ErrorNotification, Loading } from "@scm-manager/ui-components";
import injectSheet from "react-jss";
import classNames from "classnames";
type Props = {
repository: Repository,
file: File,
revision: string,
path: string,
classes: any
path: string
};
type State = {
@@ -26,12 +23,6 @@ type State = {
error?: Error
};
const styles = {
toCenterContent: {
display: "block"
}
};
class SourcesView extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
@@ -87,7 +78,7 @@ class SourcesView extends React.Component<Props, State> {
}
render() {
const { file, classes } = this.props;
const { file } = this.props;
const { loaded, error } = this.state;
if (!file || !loaded) {
@@ -99,8 +90,8 @@ class SourcesView extends React.Component<Props, State> {
const sources = this.showSources();
return <div className={classNames("panel-block", classes.toCenterContent)}>{sources}</div>;
return <div className="panel-block">{sources}</div>;
}
}
export default injectSheet(styles)(SourcesView);
export default SourcesView;

View File

@@ -85,15 +85,6 @@ $fa-font-path: "webfonts";
}
}
//border around options
.has-border-around {
border: 1px solid #dbdbdb;
&.is-round {
border-radius: 4px;
}
}
// multiline Columns
.columns.is-multiline {
.column.is-half {
@@ -195,7 +186,12 @@ $fa-font-path: "webfonts";
}
//panels
.panel-footer {
nav.panel {
.panel-block {
display: block;
}
.panel-footer {
background-color: whitesmoke;
border-radius: 0 0 4px 4px;
color: #363636;
@@ -210,6 +206,7 @@ $fa-font-path: "webfonts";
&:last-child {
border-bottom: 1px solid #dbdbdb;
}
}
}
// forms