mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
move route to editor-plugin
This commit is contained in:
@@ -10,6 +10,7 @@ type Props = {
|
|||||||
revision: string,
|
revision: string,
|
||||||
path: string,
|
path: string,
|
||||||
baseUrl: string,
|
baseUrl: string,
|
||||||
|
branch: string,
|
||||||
classes: any
|
classes: any
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -59,7 +60,7 @@ class Breadcrumb extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { classes, baseUrl, revision } = this.props;
|
const { classes, baseUrl, revision, path } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -73,7 +74,7 @@ class Breadcrumb extends React.Component<Props> {
|
|||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<ExtensionPoint
|
<ExtensionPoint
|
||||||
name="sourceView.actionbar.right"
|
name="sourceView.actionbar.right"
|
||||||
props={{baseUrl, revision}}
|
props={{ baseUrl, revision, path }}
|
||||||
renderAll={true}
|
renderAll={true}
|
||||||
/>
|
/>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|||||||
@@ -1,89 +0,0 @@
|
|||||||
// @flow
|
|
||||||
import React from "react";
|
|
||||||
import Dropzone from "react-dropzone";
|
|
||||||
import { translate } from "react-i18next";
|
|
||||||
import injectSheet from "react-jss";
|
|
||||||
import classNames from "classnames";
|
|
||||||
|
|
||||||
const styles = {
|
|
||||||
dropzone: {
|
|
||||||
width: "100%",
|
|
||||||
height: "20rem",
|
|
||||||
border: "solid 1px #eeeeee",
|
|
||||||
borderRadius: "2px"
|
|
||||||
},
|
|
||||||
innerBorder: {
|
|
||||||
margin: "2rem",
|
|
||||||
height: "16rem",
|
|
||||||
alignSelf: "center",
|
|
||||||
border: "dashed 3px #f5f5f5",
|
|
||||||
display: "flex",
|
|
||||||
justifyContent: "center"
|
|
||||||
},
|
|
||||||
description : {
|
|
||||||
display: "flex",
|
|
||||||
flexDirection: "column",
|
|
||||||
justifyContent: "center",
|
|
||||||
alignItems: "center"
|
|
||||||
},
|
|
||||||
icon : {
|
|
||||||
margin: "1rem 0rem"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
// context props
|
|
||||||
t: string => string,
|
|
||||||
classes: any
|
|
||||||
}
|
|
||||||
|
|
||||||
type State = {
|
|
||||||
acceptedFiles: any
|
|
||||||
}
|
|
||||||
|
|
||||||
class FileUploadDropzone extends React.Component<Props, State> {
|
|
||||||
|
|
||||||
constructor(props: Props) {
|
|
||||||
super(props);
|
|
||||||
this.state = {
|
|
||||||
acceptedFiles: null
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
onDrop = (acceptedFiles ) => {
|
|
||||||
this.setState({ acceptedFiles });
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { t, classes } = this.props;
|
|
||||||
const { acceptedFiles } = this.state;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Dropzone onDrop={this.onDrop}>
|
|
||||||
{({getRootProps, getInputProps}) => (
|
|
||||||
<section>
|
|
||||||
<div {...getRootProps()}>
|
|
||||||
<input {...getInputProps()} />
|
|
||||||
<div className={classes.dropzone}>
|
|
||||||
<div className={classes.innerBorder}>
|
|
||||||
<div className={classNames(classes.description, "has-text-grey-light")}>
|
|
||||||
{t("fileUpload.clickHere")}
|
|
||||||
<i className={classNames("fas fa-plus-circle fa-2x has-text-grey-lighter", classes.icon)}/>
|
|
||||||
{t("fileUpload.dragAndDrop")}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
)}
|
|
||||||
</Dropzone>
|
|
||||||
<div>
|
|
||||||
<p>{acceptedFiles && acceptedFiles[0].name}</p>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default injectSheet(styles)(translate("repos")(FileUploadDropzone));
|
|
||||||
@@ -36,7 +36,6 @@ export { default as ErrorBoundary } from "./ErrorBoundary";
|
|||||||
export { default as OverviewPageActions } from "./OverviewPageActions.js";
|
export { default as OverviewPageActions } from "./OverviewPageActions.js";
|
||||||
export { default as CardColumnGroup } from "./CardColumnGroup";
|
export { default as CardColumnGroup } from "./CardColumnGroup";
|
||||||
export { default as CardColumn } from "./CardColumn";
|
export { default as CardColumn } from "./CardColumn";
|
||||||
export { default as FileUploadDropzone } from "./FileUploadDropzone";
|
|
||||||
|
|
||||||
export { apiClient } from "./apiclient.js";
|
export { apiClient } from "./apiclient.js";
|
||||||
export * from "./errors";
|
export * from "./errors";
|
||||||
|
|||||||
@@ -158,17 +158,6 @@ class RepositoryRoot extends React.Component<Props> {
|
|||||||
<Sources repository={repository} baseUrl={`${url}/sources`} />
|
<Sources repository={repository} baseUrl={`${url}/sources`} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Route
|
|
||||||
path={`${url}/sources/upload/:revision`}
|
|
||||||
exact={true}
|
|
||||||
render={() => (
|
|
||||||
<ExtensionPoint
|
|
||||||
name="repo.branch.fileUpload"
|
|
||||||
props={{}}
|
|
||||||
renderAll={false}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<Route
|
<Route
|
||||||
path={`${url}/sources/:revision/:path*`}
|
path={`${url}/sources/:revision/:path*`}
|
||||||
render={() => (
|
render={() => (
|
||||||
|
|||||||
Reference in New Issue
Block a user