mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
apply prettier, removed flow related config and added tsconfig
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Repository, Branch } from '@scm-manager/ui-types';
|
||||
import { ButtonAddons, Button } from '@scm-manager/ui-components';
|
||||
import { translate } from 'react-i18next';
|
||||
import React from "react";
|
||||
import { Repository, Branch } from "@scm-manager/ui-types";
|
||||
import { ButtonAddons, Button } from "@scm-manager/ui-components";
|
||||
import { translate } from "react-i18next";
|
||||
|
||||
type Props = {
|
||||
repository: Repository;
|
||||
@@ -27,13 +27,13 @@ class BranchButtonGroup extends React.Component<Props> {
|
||||
<Button
|
||||
link={changesetLink}
|
||||
icon="exchange-alt"
|
||||
label={t('branch.commits')}
|
||||
label={t("branch.commits")}
|
||||
reducedMobile={true}
|
||||
/>
|
||||
<Button
|
||||
link={sourcesLink}
|
||||
icon="code"
|
||||
label={t('branch.sources')}
|
||||
label={t("branch.sources")}
|
||||
reducedMobile={true}
|
||||
/>
|
||||
</ButtonAddons>
|
||||
@@ -41,4 +41,4 @@ class BranchButtonGroup extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate('repos')(BranchButtonGroup);
|
||||
export default translate("repos")(BranchButtonGroup);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { Repository, Branch } from '@scm-manager/ui-types';
|
||||
import { translate } from 'react-i18next';
|
||||
import BranchButtonGroup from './BranchButtonGroup';
|
||||
import DefaultBranchTag from './DefaultBranchTag';
|
||||
import React from "react";
|
||||
import { Repository, Branch } from "@scm-manager/ui-types";
|
||||
import { translate } from "react-i18next";
|
||||
import BranchButtonGroup from "./BranchButtonGroup";
|
||||
import DefaultBranchTag from "./DefaultBranchTag";
|
||||
|
||||
type Props = {
|
||||
repository: Repository;
|
||||
@@ -18,7 +18,7 @@ class BranchDetail extends React.Component<Props> {
|
||||
return (
|
||||
<div className="media">
|
||||
<div className="media-content subtitle">
|
||||
<strong>{t('branch.name')}</strong> {branch.name}{' '}
|
||||
<strong>{t("branch.name")}</strong> {branch.name}{" "}
|
||||
<DefaultBranchTag defaultBranch={branch.defaultBranch} />
|
||||
</div>
|
||||
<div className="media-right">
|
||||
@@ -29,4 +29,4 @@ class BranchDetail extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate('repos')(BranchDetail);
|
||||
export default translate("repos")(BranchDetail);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import React from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import { Repository, Branch, BranchRequest } from '@scm-manager/ui-types';
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import { Repository, Branch, BranchRequest } from "@scm-manager/ui-types";
|
||||
import {
|
||||
Select,
|
||||
InputField,
|
||||
SubmitButton,
|
||||
validation as validator,
|
||||
} from '@scm-manager/ui-components';
|
||||
import { orderBranches } from '../util/orderBranches';
|
||||
validation as validator
|
||||
} from "@scm-manager/ui-components";
|
||||
import { orderBranches } from "../util/orderBranches";
|
||||
|
||||
type Props = {
|
||||
submitForm: (p: BranchRequest) => void;
|
||||
@@ -31,7 +31,7 @@ class BranchForm extends React.Component<Props, State> {
|
||||
|
||||
this.state = {
|
||||
nameValidationError: false,
|
||||
name: props.transmittedName,
|
||||
name: props.transmittedName
|
||||
};
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class BranchForm extends React.Component<Props, State> {
|
||||
if (this.isValid()) {
|
||||
this.props.submitForm({
|
||||
name: this.state.name,
|
||||
parent: this.state.source,
|
||||
parent: this.state.source
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -64,7 +64,7 @@ class BranchForm extends React.Component<Props, State> {
|
||||
orderBranches(branches);
|
||||
const options = branches.map(branch => ({
|
||||
label: branch.name,
|
||||
value: branch.name,
|
||||
value: branch.name
|
||||
}));
|
||||
|
||||
return (
|
||||
@@ -74,7 +74,7 @@ class BranchForm extends React.Component<Props, State> {
|
||||
<div className="column">
|
||||
<Select
|
||||
name="source"
|
||||
label={t('branches.create.source')}
|
||||
label={t("branches.create.source")}
|
||||
options={options}
|
||||
onChange={this.handleSourceChange}
|
||||
loading={loading}
|
||||
@@ -82,11 +82,11 @@ class BranchForm extends React.Component<Props, State> {
|
||||
/>
|
||||
<InputField
|
||||
name="name"
|
||||
label={t('branches.create.name')}
|
||||
label={t("branches.create.name")}
|
||||
onChange={this.handleNameChange}
|
||||
value={name ? name : ''}
|
||||
value={name ? name : ""}
|
||||
validationError={this.state.nameValidationError}
|
||||
errorMessage={t('validation.branch.nameInvalid')}
|
||||
errorMessage={t("validation.branch.nameInvalid")}
|
||||
disabled={!!transmittedName || disabled}
|
||||
/>
|
||||
</div>
|
||||
@@ -96,7 +96,7 @@ class BranchForm extends React.Component<Props, State> {
|
||||
<SubmitButton
|
||||
disabled={disabled || !this.isValid()}
|
||||
loading={loading}
|
||||
label={t('branches.create.submit')}
|
||||
label={t("branches.create.submit")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -108,7 +108,7 @@ class BranchForm extends React.Component<Props, State> {
|
||||
handleSourceChange = (source: string) => {
|
||||
this.setState({
|
||||
...this.state,
|
||||
source,
|
||||
source
|
||||
});
|
||||
};
|
||||
|
||||
@@ -116,9 +116,9 @@ class BranchForm extends React.Component<Props, State> {
|
||||
this.setState({
|
||||
nameValidationError: !validator.isNameValid(name),
|
||||
...this.state,
|
||||
name,
|
||||
name
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default translate('repos')(BranchForm);
|
||||
export default translate("repos")(BranchForm);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Branch } from '@scm-manager/ui-types';
|
||||
import DefaultBranchTag from './DefaultBranchTag';
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Branch } from "@scm-manager/ui-types";
|
||||
import DefaultBranchTag from "./DefaultBranchTag";
|
||||
|
||||
type Props = {
|
||||
baseUrl: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import BranchRow from './BranchRow';
|
||||
import { Branch } from '@scm-manager/ui-types';
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import BranchRow from "./BranchRow";
|
||||
import { Branch } from "@scm-manager/ui-types";
|
||||
|
||||
type Props = {
|
||||
baseUrl: string;
|
||||
@@ -16,7 +16,7 @@ class BranchTable extends React.Component<Props> {
|
||||
<table className="card-table table is-hoverable is-fullwidth">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{t('branches.table.branches')}</th>
|
||||
<th>{t("branches.table.branches")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{this.renderRow()}</tbody>
|
||||
@@ -36,4 +36,4 @@ class BranchTable extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate('repos')(BranchTable);
|
||||
export default translate("repos")(BranchTable);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import BranchDetail from './BranchDetail';
|
||||
import { ExtensionPoint } from '@scm-manager/ui-extensions';
|
||||
import { Repository, Branch } from '@scm-manager/ui-types';
|
||||
import React from "react";
|
||||
import BranchDetail from "./BranchDetail";
|
||||
import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||
import { Repository, Branch } from "@scm-manager/ui-types";
|
||||
|
||||
type Props = {
|
||||
repository: Repository;
|
||||
@@ -22,7 +22,7 @@ class BranchView extends React.Component<Props> {
|
||||
renderAll={true}
|
||||
props={{
|
||||
repository,
|
||||
branch,
|
||||
branch
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import styled from 'styled-components';
|
||||
import { Tag } from '@scm-manager/ui-components';
|
||||
import React from "react";
|
||||
import { translate } from "react-i18next";
|
||||
import styled from "styled-components";
|
||||
import { Tag } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = {
|
||||
defaultBranch?: boolean;
|
||||
@@ -20,10 +20,10 @@ class DefaultBranchTag extends React.Component<Props> {
|
||||
const { defaultBranch, t } = this.props;
|
||||
|
||||
if (defaultBranch) {
|
||||
return <LeftMarginTag color="dark" label={t('branch.defaultTag')} />;
|
||||
return <LeftMarginTag color="dark" label={t("branch.defaultTag")} />;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export default translate('repos')(DefaultBranchTag);
|
||||
export default translate("repos")(DefaultBranchTag);
|
||||
|
||||
Reference in New Issue
Block a user