mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 14:05:44 +01:00
added sources overview
This commit is contained in:
@@ -1,26 +1,17 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import ChangesetRow from "./ChangesetRow";
|
import ChangesetRow from "./ChangesetRow";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import injectSheet from "react-jss";
|
|
||||||
import classNames from "classnames";
|
|
||||||
|
|
||||||
import type { Changeset, Repository } from "@scm-manager/ui-types";
|
import type { Changeset, Repository } from "@scm-manager/ui-types";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
repository: Repository,
|
repository: Repository,
|
||||||
changesets: Changeset[],
|
changesets: Changeset[]
|
||||||
classes: any
|
|
||||||
};
|
|
||||||
|
|
||||||
const styles = {
|
|
||||||
toCenterContent: {
|
|
||||||
display: "block"
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ChangesetList extends React.Component<Props> {
|
class ChangesetList extends React.Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { repository, changesets, classes } = this.props;
|
const { repository, changesets } = this.props;
|
||||||
const content = changesets.map(changeset => {
|
const content = changesets.map(changeset => {
|
||||||
return (
|
return (
|
||||||
<ChangesetRow
|
<ChangesetRow
|
||||||
@@ -31,11 +22,11 @@ class ChangesetList extends React.Component<Props> {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div className={classNames("panel-block", classes.toCenterContent)}>
|
<div className="panel-block">
|
||||||
{content}
|
{content}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default injectSheet(styles)(ChangesetList);
|
export default ChangesetList;
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ class FileTree extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div className="panel-block">
|
||||||
<table className="table table-hover table-sm is-fullwidth">
|
<table className="table table-hover table-sm is-fullwidth">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -134,6 +135,7 @@ class FileTree extends React.Component<Props> {
|
|||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,6 @@ type State = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
toCenterContent: {
|
|
||||||
display: "block"
|
|
||||||
},
|
|
||||||
pointer: {
|
pointer: {
|
||||||
cursor: "pointer"
|
cursor: "pointer"
|
||||||
},
|
},
|
||||||
@@ -126,7 +123,6 @@ class Content extends React.Component<Props, State> {
|
|||||||
<div
|
<div
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"panel-block",
|
"panel-block",
|
||||||
classes.toCenterContent,
|
|
||||||
classes.hasBackground
|
classes.hasBackground
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -93,15 +93,17 @@ class Sources extends React.Component<Props> {
|
|||||||
|
|
||||||
if (currentFileIsDirectory) {
|
if (currentFileIsDirectory) {
|
||||||
return (
|
return (
|
||||||
<div className="has-border-around is-round">
|
<nav className="panel">
|
||||||
|
<article className="panel-heading">
|
||||||
{this.renderBranchSelector()}
|
{this.renderBranchSelector()}
|
||||||
|
</article>
|
||||||
<FileTree
|
<FileTree
|
||||||
repository={repository}
|
repository={repository}
|
||||||
revision={revision}
|
revision={revision}
|
||||||
path={path}
|
path={path}
|
||||||
baseUrl={baseUrl}
|
baseUrl={baseUrl}
|
||||||
/>
|
/>
|
||||||
</div>
|
</nav>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -8,15 +8,12 @@ import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
|||||||
import { getContentType } from "./contentType";
|
import { getContentType } from "./contentType";
|
||||||
import type { File, Repository } from "@scm-manager/ui-types";
|
import type { File, Repository } from "@scm-manager/ui-types";
|
||||||
import { ErrorNotification, Loading } from "@scm-manager/ui-components";
|
import { ErrorNotification, Loading } from "@scm-manager/ui-components";
|
||||||
import injectSheet from "react-jss";
|
|
||||||
import classNames from "classnames";
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
repository: Repository,
|
repository: Repository,
|
||||||
file: File,
|
file: File,
|
||||||
revision: string,
|
revision: string,
|
||||||
path: string,
|
path: string
|
||||||
classes: any
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
@@ -26,12 +23,6 @@ type State = {
|
|||||||
error?: Error
|
error?: Error
|
||||||
};
|
};
|
||||||
|
|
||||||
const styles = {
|
|
||||||
toCenterContent: {
|
|
||||||
display: "block"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class SourcesView extends React.Component<Props, State> {
|
class SourcesView extends React.Component<Props, State> {
|
||||||
constructor(props: Props) {
|
constructor(props: Props) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -87,7 +78,7 @@ class SourcesView extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { file, classes } = this.props;
|
const { file } = this.props;
|
||||||
const { loaded, error } = this.state;
|
const { loaded, error } = this.state;
|
||||||
|
|
||||||
if (!file || !loaded) {
|
if (!file || !loaded) {
|
||||||
@@ -99,8 +90,8 @@ class SourcesView extends React.Component<Props, State> {
|
|||||||
|
|
||||||
const sources = this.showSources();
|
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
|
// multiline Columns
|
||||||
.columns.is-multiline {
|
.columns.is-multiline {
|
||||||
.column.is-half {
|
.column.is-half {
|
||||||
@@ -195,7 +186,12 @@ $fa-font-path: "webfonts";
|
|||||||
}
|
}
|
||||||
|
|
||||||
//panels
|
//panels
|
||||||
.panel-footer {
|
nav.panel {
|
||||||
|
.panel-block {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-footer {
|
||||||
background-color: whitesmoke;
|
background-color: whitesmoke;
|
||||||
border-radius: 0 0 4px 4px;
|
border-radius: 0 0 4px 4px;
|
||||||
color: #363636;
|
color: #363636;
|
||||||
@@ -210,6 +206,7 @@ $fa-font-path: "webfonts";
|
|||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom: 1px solid #dbdbdb;
|
border-bottom: 1px solid #dbdbdb;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// forms
|
// forms
|
||||||
|
|||||||
Reference in New Issue
Block a user