mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-22 16:29:51 +01:00
apply eslint and prettier rules
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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} />
|
||||
|
||||
@@ -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(
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user