mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 05:55:44 +01:00
added sources overview
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user