From 29e31cb048318e7d65bbe2efe4cb5a0af75b287e Mon Sep 17 00:00:00 2001 From: ebb-tide Date: Thu, 22 Mar 2018 11:29:30 -0700 Subject: [PATCH] Fix linter errors in sometsx files --- .../GraphOptionsCustomizableColumn.tsx | 4 +- .../components/GraphOptionsFixFirstColumn.tsx | 3 +- .../components/GraphOptionsTimeFormat.tsx | 10 +-- .../data_explorer/components/CustomCell.tsx | 12 +--- ui/src/kapacitor/components/KapacitorForm.tsx | 14 ++-- .../components/KapacitorFormInput.tsx | 7 +- ui/src/shared/components/ConfirmButtons.tsx | 66 +++++++++-------- ui/src/shared/components/DatabaseList.tsx | 4 +- ui/src/shared/components/DatabaseListItem.tsx | 3 +- ui/src/shared/components/InputClickToEdit.tsx | 71 ++++++++++--------- ui/src/shared/components/MeasurementList.tsx | 57 ++++++++------- .../components/MeasurementListFilter.tsx | 3 +- .../shared/components/MeasurementListItem.tsx | 27 +++---- ui/src/shared/components/Tabs.tsx | 30 +++----- ui/src/shared/components/TagList.tsx | 4 +- 15 files changed, 157 insertions(+), 158 deletions(-) diff --git a/ui/src/dashboards/components/GraphOptionsCustomizableColumn.tsx b/ui/src/dashboards/components/GraphOptionsCustomizableColumn.tsx index fd882eef39..1400a82e5e 100644 --- a/ui/src/dashboards/components/GraphOptionsCustomizableColumn.tsx +++ b/ui/src/dashboards/components/GraphOptionsCustomizableColumn.tsx @@ -30,9 +30,7 @@ class GraphOptionsCustomizableColumn extends PureComponent { return (
-
- {internalName} -
+
{internalName}
= ({ fixed, onToggleFixFirstColumn, -}) => +}) => (
= ({
+) export default GraphOptionsFixFirstColumn diff --git a/ui/src/dashboards/components/GraphOptionsTimeFormat.tsx b/ui/src/dashboards/components/GraphOptionsTimeFormat.tsx index aa40e1b58f..08dd026cde 100644 --- a/ui/src/dashboards/components/GraphOptionsTimeFormat.tsx +++ b/ui/src/dashboards/components/GraphOptionsTimeFormat.tsx @@ -57,11 +57,12 @@ class GraphOptionsTimeFormat extends PureComponent {
{ className="dropdown-stretch" onChoose={this.handleChooseFormat} /> - {showCustom && + {showCustom && (
{ placeholder="Enter custom format..." appearAsNormalInput={true} /> -
} +
+ )}
) } diff --git a/ui/src/data_explorer/components/CustomCell.tsx b/ui/src/data_explorer/components/CustomCell.tsx index adb04bb54d..bf69463662 100644 --- a/ui/src/data_explorer/components/CustomCell.tsx +++ b/ui/src/data_explorer/components/CustomCell.tsx @@ -11,18 +11,10 @@ const CustomCell: SFC = ({data, columnName}) => { if (columnName === 'time') { const date = moment(new Date(data)).format('MM/DD/YY hh:mm:ssA') - return ( - - {date} - - ) + return {date} } - return ( - - {data} - - ) + return {data} } export default CustomCell diff --git a/ui/src/kapacitor/components/KapacitorForm.tsx b/ui/src/kapacitor/components/KapacitorForm.tsx index 573859c0fb..8f758f3498 100644 --- a/ui/src/kapacitor/components/KapacitorForm.tsx +++ b/ui/src/kapacitor/components/KapacitorForm.tsx @@ -42,14 +42,14 @@ const KapacitorForm: SFC = ({ source, hash, notify, -}) => +}) => (
-

{`${exists - ? 'Configure' - : 'Add a New'} Kapacitor Connection`}

+

{`${ + exists ? 'Configure' : 'Add a New' + } Kapacitor Connection`}

@@ -95,7 +95,7 @@ const KapacitorForm: SFC = ({ inputType="password" />
- {url.startsWith('https') && + {url.startsWith('https') && (
= ({ -
} +
+ )}
+) export default KapacitorForm diff --git a/ui/src/kapacitor/components/KapacitorFormInput.tsx b/ui/src/kapacitor/components/KapacitorFormInput.tsx index 4868e32dc8..fe5439a832 100644 --- a/ui/src/kapacitor/components/KapacitorFormInput.tsx +++ b/ui/src/kapacitor/components/KapacitorFormInput.tsx @@ -18,11 +18,9 @@ const KapacitorFormInput: SFC = ({ onChange, maxLength, inputType, -}) => +}) => (
- + = ({ type={inputType} />
+) KapacitorFormInput.defaultProps = { inputType: '', diff --git a/ui/src/shared/components/ConfirmButtons.tsx b/ui/src/shared/components/ConfirmButtons.tsx index 9feef8b1d3..21606044f2 100644 --- a/ui/src/shared/components/ConfirmButtons.tsx +++ b/ui/src/shared/components/ConfirmButtons.tsx @@ -36,7 +36,7 @@ export const Confirm: SFC = ({ onConfirm, icon, title, -}) => +}) => ( +) -export const Cancel: SFC = ({buttonSize, onCancel, icon}) => +export const Cancel: SFC = ({buttonSize, onCancel, icon}) => ( +) class ConfirmButtons extends PureComponent { public static defaultProps: Partial = { @@ -86,35 +88,37 @@ class ConfirmButtons extends PureComponent { public render() { const {item, buttonSize, isDisabled, confirmLeft, confirmTitle} = this.props - return confirmLeft - ?
- - -
- :
- - -
+ return confirmLeft ? ( +
+ + +
+ ) : ( +
+ + +
+ ) } } diff --git a/ui/src/shared/components/DatabaseList.tsx b/ui/src/shared/components/DatabaseList.tsx index 729f0fadc5..130e6fcf8c 100644 --- a/ui/src/shared/components/DatabaseList.tsx +++ b/ui/src/shared/components/DatabaseList.tsx @@ -112,14 +112,14 @@ class DatabaseList extends PureComponent {
DB.RetentionPolicy
- {this.state.namespaces.map(namespace => + {this.state.namespaces.map(namespace => ( - )} + ))}
diff --git a/ui/src/shared/components/DatabaseListItem.tsx b/ui/src/shared/components/DatabaseListItem.tsx index 020db387cc..22db6de542 100644 --- a/ui/src/shared/components/DatabaseListItem.tsx +++ b/ui/src/shared/components/DatabaseListItem.tsx @@ -15,7 +15,7 @@ const DatabaseListItem: SFC = ({ namespace, namespace: {database, retentionPolicy}, onChooseNamespace, -}) => +}) => (
= ({ > {database}.{retentionPolicy}
+) export default DatabaseListItem diff --git a/ui/src/shared/components/InputClickToEdit.tsx b/ui/src/shared/components/InputClickToEdit.tsx index 9c4fbddc93..2445d9dbdc 100644 --- a/ui/src/shared/components/InputClickToEdit.tsx +++ b/ui/src/shared/components/InputClickToEdit.tsx @@ -103,42 +103,47 @@ class InputClickToEdit extends PureComponent { appearAsNormalInput, } = this.props - const wrapperClass = `${wrapper}${appearAsNormalInput - ? ' input-cte__normal' - : ''}` + const wrapperClass = `${wrapper}${ + appearAsNormalInput ? ' input-cte__normal' : '' + }` const defaultStyle = value ? 'input-cte' : 'input-cte__empty' - return disabled - ?
-
- {value} + return disabled ? ( +
+
+ {value} +
+
+ ) : ( +
+ {isEditing ? ( + + ) : ( +
+ {value || placeholder} + {appearAsNormalInput || ( + + )}
-
- :
- {isEditing - ? - :
- {value || placeholder} - {appearAsNormalInput || - } -
} -
+ )} +
+ ) } } diff --git a/ui/src/shared/components/MeasurementList.tsx b/ui/src/shared/components/MeasurementList.tsx index 5471c52ce2..77fe9bdd93 100644 --- a/ui/src/shared/components/MeasurementList.tsx +++ b/ui/src/shared/components/MeasurementList.tsx @@ -123,38 +123,41 @@ class MeasurementList extends PureComponent {
Measurements & Tags - {database && + {database && ( } + /> + )}
- {database - ?
- - {filtered.map(measurement => - - )} - -
- :
- - No Database selected - -
} + {database ? ( +
+ + {filtered.map(measurement => ( + + ))} + +
+ ) : ( +
+ + No Database selected + +
+ )}
) } diff --git a/ui/src/shared/components/MeasurementListFilter.tsx b/ui/src/shared/components/MeasurementListFilter.tsx index e437f59628..48a5357fa8 100644 --- a/ui/src/shared/components/MeasurementListFilter.tsx +++ b/ui/src/shared/components/MeasurementListFilter.tsx @@ -10,7 +10,7 @@ const MeasurementListFilter: SFC = ({ onEscape, onFilterText, filterText, -}) => +}) => (
= ({ />
+) export default MeasurementListFilter diff --git a/ui/src/shared/components/MeasurementListItem.tsx b/ui/src/shared/components/MeasurementListItem.tsx index 4d42a1b588..7eac26777b 100644 --- a/ui/src/shared/components/MeasurementListItem.tsx +++ b/ui/src/shared/components/MeasurementListItem.tsx @@ -30,7 +30,7 @@ const MeasurementListItem: SFC = ({ onAcceptReject, areTagsAccepted, onChooseMeasurement, -}) => +}) => (
= ({ {measurement} {isActive && - numTagsActive >= 1 && -
-
-
!=
-
=
+ numTagsActive >= 1 && ( +
+
+
!=
+
=
+
-
} + )}
- {isActive && + {isActive && ( } + /> + )}
+) export default MeasurementListItem diff --git a/ui/src/shared/components/Tabs.tsx b/ui/src/shared/components/Tabs.tsx index cf222a962d..2135407e8b 100644 --- a/ui/src/shared/components/Tabs.tsx +++ b/ui/src/shared/components/Tabs.tsx @@ -82,18 +82,12 @@ export const TabList: SFC = ({ if (customClass) { return (
-
- {kids} -
+
{kids}
) } - return ( -
- {kids} -
- ) + return
{kids}
} TabList.defaultProps = { @@ -110,20 +104,18 @@ export const TabPanels: SFC = ({ children, activeIndex, customClass, -}) => +}) => ( // if only 1 child, children array index lookup will fail -
- {children[activeIndex]} -
+
{children[activeIndex]}
+) interface TabPanelProps { children: JSX.Element[] | JSX.Element } -export const TabPanel: SFC = ({children}) => -
- {children} -
+export const TabPanel: SFC = ({children}) => ( +
{children}
+) interface TabsProps { children: JSX.Element[] | JSX.Element @@ -178,10 +170,6 @@ export class Tabs extends PureComponent { return child }) - return ( -
- {kids} -
- ) + return
{kids}
} } diff --git a/ui/src/shared/components/TagList.tsx b/ui/src/shared/components/TagList.tsx index a4b1f68a7c..016c6586ea 100644 --- a/ui/src/shared/components/TagList.tsx +++ b/ui/src/shared/components/TagList.tsx @@ -110,7 +110,7 @@ class TagList extends PureComponent { return (
- {_.map(this.state.tags, (tagValues: string[], tagKey: string) => + {_.map(this.state.tags, (tagValues: string[], tagKey: string) => ( { selectedTagValues={query.tags[tagKey] || []} isUsingGroupBy={query.groupBy.tags.indexOf(tagKey) > -1} /> - )} + ))}
) }