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

@@ -27,11 +27,7 @@ class AddEntryToTableField extends React.Component<Props, State> {
isValid = () => {
const { validateEntry } = this.props;
if (
!this.state.entryToAdd ||
this.state.entryToAdd === "" ||
!validateEntry
) {
if (!this.state.entryToAdd || this.state.entryToAdd === "" || !validateEntry) {
return true;
} else {
return validateEntry(this.state.entryToAdd);
@@ -39,13 +35,7 @@ class AddEntryToTableField extends React.Component<Props, State> {
};
render() {
const {
disabled,
buttonLabel,
fieldLabel,
errorMessage,
helpText
} = this.props;
const { disabled, buttonLabel, fieldLabel, errorMessage, helpText } = this.props;
return (
<div className="field">
<InputField

View File

@@ -54,11 +54,7 @@ class AutocompleteAddEntryToTableField extends React.Component<Props, State> {
creatable={true}
/>
<AddButton
label={buttonLabel}
action={this.addButtonClicked}
disabled={disabled}
/>
<AddButton label={buttonLabel} action={this.addButtonClicked} disabled={disabled} />
</div>
);
}

View File

@@ -12,33 +12,14 @@ type Props = {
class DropDown extends React.Component<Props> {
render() {
const {
options,
optionValues,
preselectedOption,
className,
disabled
} = this.props;
const { options, optionValues, preselectedOption, className, disabled } = this.props;
return (
<div
className={classNames(className, "select", disabled ? "disabled" : "")}
>
<select
value={preselectedOption ? preselectedOption : ""}
onChange={this.change}
disabled={disabled}
>
<div className={classNames(className, "select", disabled ? "disabled" : "")}>
<select value={preselectedOption ? preselectedOption : ""} onChange={this.change} disabled={disabled}>
<option key="" />
{options.map((option, index) => {
return (
<option
key={option}
value={
optionValues && optionValues[index]
? optionValues[index]
: option
}
>
<option key={option} value={optionValues && optionValues[index] ? optionValues[index] : option}>
{option}
</option>
);

View File

@@ -47,22 +47,9 @@ class InputField extends React.Component<Props> {
};
render() {
const {
type,
placeholder,
value,
validationError,
errorMessage,
disabled,
label,
helpText
} = this.props;
const { type, placeholder, value, validationError, errorMessage, disabled, label, helpText } = this.props;
const errorView = validationError ? "is-danger" : "";
const helper = validationError ? (
<p className="help is-danger">{errorMessage}</p>
) : (
""
);
const helper = validationError ? <p className="help is-danger">{errorMessage}</p> : "";
return (
<div className="field">
<LabelWithHelpIcon label={label} helpText={helpText} />

View File

@@ -85,8 +85,7 @@ class PasswordConfirmation extends React.Component<Props, State> {
};
handlePasswordChange = (password: string) => {
const passwordConfirmationFailed =
password !== this.state.confirmedPassword;
const passwordConfirmationFailed = password !== this.state.confirmedPassword;
this.setState(
{

View File

@@ -33,11 +33,7 @@ export default class TagGroup extends React.Component<Props> {
return (
<div className="control" key={key}>
<div className="tags has-addons">
<Tag
color="info is-outlined"
label={item.displayName}
onRemove={() => this.removeEntry(item)}
/>
<Tag color="info is-outlined" label={item.displayName} onRemove={() => this.removeEntry(item)} />
</div>
</div>
);

View File

@@ -1,9 +1,7 @@
// @create-index
export { default as AddEntryToTableField } from "./AddEntryToTableField";
export {
default as AutocompleteAddEntryToTableField
} from "./AutocompleteAddEntryToTableField";
export { default as AutocompleteAddEntryToTableField } from "./AutocompleteAddEntryToTableField";
export { default as TagGroup } from "./TagGroup";
export { default as MemberNameTagGroup } from "./MemberNameTagGroup";
export { default as Checkbox } from "./Checkbox";