apply prettier, removed flow related config and added tsconfig

This commit is contained in:
Sebastian Sdorra
2019-10-20 18:02:52 +02:00
parent 0e017dcadd
commit 490418d06e
231 changed files with 5771 additions and 30386 deletions

View File

@@ -1,18 +1,18 @@
import React from 'react';
import BranchView from '../components/BranchView';
import { connect } from 'react-redux';
import { Redirect, Route, Switch, withRouter } from 'react-router-dom';
import { Repository, Branch } from '@scm-manager/ui-types';
import React from "react";
import BranchView from "../components/BranchView";
import { connect } from "react-redux";
import { Redirect, Route, Switch, withRouter } from "react-router-dom";
import { Repository, Branch } from "@scm-manager/ui-types";
import {
fetchBranch,
getBranch,
getFetchBranchFailure,
isFetchBranchPending,
} from '../modules/branches';
import { ErrorNotification, Loading } from '@scm-manager/ui-components';
import { History } from 'history';
import { NotFoundError } from '@scm-manager/ui-components';
import queryString from 'query-string';
isFetchBranchPending
} from "../modules/branches";
import { ErrorNotification, Loading } from "@scm-manager/ui-components";
import { History } from "history";
import { NotFoundError } from "@scm-manager/ui-components";
import queryString from "query-string";
type Props = {
repository: Repository;
@@ -38,7 +38,7 @@ class BranchRoot extends React.Component<Props> {
}
stripEndingSlash = (url: string) => {
if (url.endsWith('/')) {
if (url.endsWith("/")) {
return url.substring(0, url.length - 1);
}
return url;
@@ -56,7 +56,7 @@ class BranchRoot extends React.Component<Props> {
if (error) {
if (
error instanceof NotFoundError &&
queryString.parse(location.search).create === 'true'
queryString.parse(location.search).create === "true"
) {
return (
<Redirect
@@ -97,7 +97,7 @@ const mapStateToProps = (state, ownProps) => {
branchName,
branch,
loading,
error,
error
};
};
@@ -105,13 +105,13 @@ const mapDispatchToProps = dispatch => {
return {
fetchBranch: (repository: Repository, branchName: string) => {
dispatch(fetchBranch(repository, branchName));
},
}
};
};
export default withRouter(
connect(
mapStateToProps,
mapDispatchToProps,
)(BranchRoot),
mapDispatchToProps
)(BranchRoot)
);

View File

@@ -1,25 +1,25 @@
import React from 'react';
import React from "react";
import {
fetchBranches,
getBranches,
getFetchBranchesFailure,
isFetchBranchesPending,
isPermittedToCreateBranches,
} from '../modules/branches';
import { orderBranches } from '../util/orderBranches';
import { connect } from 'react-redux';
import { Branch, Repository } from '@scm-manager/ui-types';
import { compose } from 'redux';
import { translate } from 'react-i18next';
import { withRouter } from 'react-router-dom';
isPermittedToCreateBranches
} from "../modules/branches";
import { orderBranches } from "../util/orderBranches";
import { connect } from "react-redux";
import { Branch, Repository } from "@scm-manager/ui-types";
import { compose } from "redux";
import { translate } from "react-i18next";
import { withRouter } from "react-router-dom";
import {
CreateButton,
ErrorNotification,
Loading,
Notification,
Subtitle,
} from '@scm-manager/ui-components';
import BranchTable from '../components/BranchTable';
Subtitle
} from "@scm-manager/ui-components";
import BranchTable from "../components/BranchTable";
type Props = {
repository: Repository;
@@ -57,7 +57,7 @@ class BranchesOverview extends React.Component<Props> {
return (
<>
<Subtitle subtitle={t('branches.overview.title')} />
<Subtitle subtitle={t("branches.overview.title")} />
{this.renderBranchesTable()}
{this.renderCreateButton()}
</>
@@ -72,7 +72,7 @@ class BranchesOverview extends React.Component<Props> {
}
return (
<Notification type="info">
{t('branches.overview.noBranches')}
{t("branches.overview.noBranches")}
</Notification>
);
}
@@ -82,7 +82,7 @@ class BranchesOverview extends React.Component<Props> {
if (showCreateButton) {
return (
<CreateButton
label={t('branches.overview.createButton')}
label={t("branches.overview.createButton")}
link="./create"
/>
);
@@ -103,7 +103,7 @@ const mapStateToProps = (state, ownProps) => {
loading,
error,
branches,
showCreateButton,
showCreateButton
};
};
@@ -111,15 +111,15 @@ const mapDispatchToProps = dispatch => {
return {
fetchBranches: (repository: Repository) => {
dispatch(fetchBranches(repository));
},
}
};
};
export default compose(
translate('repos'),
translate("repos"),
withRouter,
connect(
mapStateToProps,
mapDispatchToProps,
),
mapDispatchToProps
)
)(BranchesOverview);

View File

@@ -1,12 +1,12 @@
import React from 'react';
import React from "react";
import {
ErrorNotification,
Loading,
Subtitle,
} from '@scm-manager/ui-components';
import { translate } from 'react-i18next';
import BranchForm from '../components/BranchForm';
import { Repository, Branch, BranchRequest } from '@scm-manager/ui-types';
Subtitle
} from "@scm-manager/ui-components";
import { translate } from "react-i18next";
import BranchForm from "../components/BranchForm";
import { Repository, Branch, BranchRequest } from "@scm-manager/ui-types";
import {
fetchBranches,
getBranches,
@@ -16,12 +16,12 @@ import {
isCreateBranchPending,
getCreateBranchFailure,
isFetchBranchesPending,
getFetchBranchesFailure,
} from '../modules/branches';
import { History } from 'history';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import queryString from 'query-string';
getFetchBranchesFailure
} from "../modules/branches";
import { History } from "history";
import { connect } from "react-redux";
import { withRouter } from "react-router-dom";
import queryString from "query-string";
type Props = {
loading?: boolean;
@@ -37,7 +37,7 @@ type Props = {
createLink: string,
repository: Repository,
branch: BranchRequest,
callback?: (p: Branch) => void,
callback?: (p: Branch) => void
) => void;
resetForm: (p: Repository) => void;
@@ -59,7 +59,7 @@ class CreateBranch extends React.Component<Props> {
history.push(
`/repo/${repository.namespace}/${
repository.name
}/branch/${encodeURIComponent(branch.name)}/info`,
}/branch/${encodeURIComponent(branch.name)}/info`
);
};
@@ -68,7 +68,7 @@ class CreateBranch extends React.Component<Props> {
this.props.createBranchesLink,
this.props.repository,
branch,
newBranch => this.branchCreated(newBranch),
newBranch => this.branchCreated(newBranch)
);
};
@@ -85,7 +85,7 @@ class CreateBranch extends React.Component<Props> {
repository,
branches,
createBranchesLink,
location,
location
} = this.props;
if (error) {
@@ -98,7 +98,7 @@ class CreateBranch extends React.Component<Props> {
return (
<>
<Subtitle subtitle={t('branches.create.title')} />
<Subtitle subtitle={t("branches.create.title")} />
<BranchForm
submitForm={branchRequest => this.createBranch(branchRequest)}
loading={loading}
@@ -121,13 +121,13 @@ const mapDispatchToProps = dispatch => {
createLink: string,
repository: Repository,
branchRequest: BranchRequest,
callback?: (newBranch: Branch) => void,
callback?: (newBranch: Branch) => void
) => {
dispatch(createBranch(createLink, repository, branchRequest, callback));
},
resetForm: (repository: Repository) => {
dispatch(createBranchReset(repository));
},
}
};
};
@@ -145,13 +145,13 @@ const mapStateToProps = (state, ownProps) => {
loading,
error,
branches,
createBranchesLink,
createBranchesLink
};
};
export default withRouter(
connect(
mapStateToProps,
mapDispatchToProps,
)(translate('repos')(CreateBranch)),
mapDispatchToProps
)(translate("repos")(CreateBranch))
);