apply eslint and prettier rules

This commit is contained in:
Sebastian Sdorra
2019-10-21 10:57:56 +02:00
parent 85773186db
commit 4bb8e6153b
227 changed files with 1147 additions and 4076 deletions

View File

@@ -5,12 +5,7 @@ import classNames from "classnames";
import styled from "styled-components";
import { ExtensionPoint } from "@scm-manager/ui-extensions";
import { File, Repository } from "@scm-manager/ui-types";
import {
DateFromNow,
ErrorNotification,
FileSize,
Icon
} from "@scm-manager/ui-components";
import { DateFromNow, ErrorNotification, FileSize, Icon } from "@scm-manager/ui-components";
import { getSources } from "../modules/sources";
import FileButtonAddons from "../components/content/FileButtonAddons";
import SourcesView from "./SourcesView";
@@ -91,9 +86,7 @@ class Content extends React.Component<Props, State> {
<RightMarginFileButtonAddons
file={file}
historyIsSelected={showHistory}
showHistory={(changeShowHistory: boolean) =>
this.setShowHistoryState(changeShowHistory)
}
showHistory={(changeShowHistory: boolean) => this.setShowHistoryState(changeShowHistory)}
/>
) : null;
@@ -189,12 +182,7 @@ class Content extends React.Component<Props, State> {
showHistory && file._links.history ? (
<HistoryView file={file} repository={repository} />
) : (
<SourcesView
revision={revision}
file={file}
repository={repository}
path={path}
/>
<SourcesView revision={revision} file={file} repository={repository} path={path} />
);
const moreInformation = this.showMoreInformation();

View File

@@ -1,16 +1,6 @@
import React from "react";
import {
File,
Changeset,
Repository,
PagedCollection
} from "@scm-manager/ui-types";
import {
ErrorNotification,
Loading,
StatePaginator,
ChangesetList
} from "@scm-manager/ui-components";
import { File, Changeset, Repository, PagedCollection } from "@scm-manager/ui-types";
import { ErrorNotification, Loading, StatePaginator, ChangesetList } from "@scm-manager/ui-components";
import { getHistory } from "./history";
type Props = {
@@ -67,9 +57,7 @@ class HistoryView extends React.Component<Props, State> {
updatePage(page: number) {
const { file } = this.props;
const internalPage = page - 1;
this.updateHistory(
file._links.history.href + "?page=" + internalPage.toString()
);
this.updateHistory(file._links.history.href + "?page=" + internalPage.toString());
}
showHistory() {

View File

@@ -3,12 +3,7 @@ import { connect } from "react-redux";
import { withRouter } from "react-router-dom";
import { Branch, Repository } from "@scm-manager/ui-types";
import FileTree from "../components/FileTree";
import {
BranchSelector,
Breadcrumb,
ErrorNotification,
Loading
} from "@scm-manager/ui-components";
import { BranchSelector, Breadcrumb, ErrorNotification, Loading } from "@scm-manager/ui-components";
import { translate } from "react-i18next";
import {
fetchBranches,
@@ -55,13 +50,7 @@ class Sources extends React.Component<Props, State> {
}
componentDidMount() {
const {
fetchBranches,
repository,
revision,
path,
fetchSources
} = this.props;
const { fetchBranches, repository, revision, path, fetchSources } = this.props;
fetchBranches(repository);
fetchSources(repository, revision, path);
@@ -116,15 +105,7 @@ class Sources extends React.Component<Props, State> {
};
render() {
const {
repository,
baseUrl,
loading,
error,
revision,
path,
currentFileIsDirectory
} = this.props;
const { repository, baseUrl, loading, error, revision, path, currentFileIsDirectory } = this.props;
if (error) {
return <ErrorNotification error={error} />;
@@ -139,18 +120,11 @@ class Sources extends React.Component<Props, State> {
<div className="panel">
{this.renderBranchSelector()}
{this.renderBreadcrumb()}
<FileTree
repository={repository}
revision={revision}
path={path}
baseUrl={baseUrl}
/>
<FileTree repository={repository} revision={revision} path={path} baseUrl={baseUrl} />
</div>
);
} else {
return (
<Content repository={repository} revision={revision} path={path} />
);
return <Content repository={repository} revision={revision} path={path} />;
}
}
@@ -185,9 +159,7 @@ class Sources extends React.Component<Props, State> {
path={path}
baseUrl={baseUrl}
branch={selectedBranch}
defaultBranch={
branches && branches.filter(b => b.defaultBranch === true)[0]
}
defaultBranch={branches && branches.filter(b => b.defaultBranch === true)[0]}
branches={branches}
repository={repository}
/>

View File

@@ -10,7 +10,7 @@ describe("get content type", () => {
});
it("should return content", done => {
let headers = {
const headers = {
"Content-Type": "application/text",
"X-Programming-Language": "JAVA"
};