From 7fdf733a64670fceefc3ded35cfa581e1c458179 Mon Sep 17 00:00:00 2001 From: Einav Weiss Keidar Date: Tue, 20 Mar 2018 14:45:40 +0200 Subject: Adding Prettier and fixing up eslint version Issue-ID: SDC-1094 Change-Id: Ie83ad95a03899345dd90235daf0323cbe3bc6afd Signed-off-by: Einav Weiss Keidar --- .../nfvo-components/table/SelectActionTable.jsx | 75 ++++++++++++++------- .../table/SelectActionTableCell.jsx | 36 ++++++---- .../nfvo-components/table/SelectActionTableRow.jsx | 77 +++++++++++++++------- 3 files changed, 127 insertions(+), 61 deletions(-) (limited to 'openecomp-ui/src/nfvo-components/table') diff --git a/openecomp-ui/src/nfvo-components/table/SelectActionTable.jsx b/openecomp-ui/src/nfvo-components/table/SelectActionTable.jsx index 3f8dbba53a..ee8a9dca45 100644 --- a/openecomp-ui/src/nfvo-components/table/SelectActionTable.jsx +++ b/openecomp-ui/src/nfvo-components/table/SelectActionTable.jsx @@ -5,26 +5,57 @@ import Button from 'sdc-ui/lib/react/Button.js'; import uuid from 'uuid-js'; export default class SelectActionTable extends React.Component { - - render() { - let {columns, onAdd, isReadOnlyMode, children, onAddItem, numOfIcons} = this.props; - return ( -
-
- {onAdd && onAddItem && - } - -
-
-
- {columns.map(column =>
{i18n(column)}
)} - {Array(numOfIcons).fill().map((e, i) => )} -
-
- {children} -
-
-
- ); - } + render() { + let { + columns, + onAdd, + isReadOnlyMode, + children, + onAddItem, + numOfIcons + } = this.props; + return ( +
+
+ {onAdd && + onAddItem && ( + + )} + +
+
+
+ {columns.map(column => ( +
+ {i18n(column)} +
+ ))} + {Array(numOfIcons) + .fill() + .map((e, i) => ( + + ))} +
+
{children}
+
+
+ ); + } } diff --git a/openecomp-ui/src/nfvo-components/table/SelectActionTableCell.jsx b/openecomp-ui/src/nfvo-components/table/SelectActionTableCell.jsx index 2664c8e944..20e4f2413c 100644 --- a/openecomp-ui/src/nfvo-components/table/SelectActionTableCell.jsx +++ b/openecomp-ui/src/nfvo-components/table/SelectActionTableCell.jsx @@ -1,20 +1,28 @@ import React from 'react'; import SelectInput from 'nfvo-components/input/SelectInput.jsx'; -const SelectActionTableCell = ({options, selected, disabled, onChange, clearable = true, placeholder}) => { - return ( -
- onChange(option ? option.value : null)} - clearable={clearable} - options={options} /> -
- ); +const SelectActionTableCell = ({ + options, + selected, + disabled, + onChange, + clearable = true, + placeholder +}) => { + return ( +
+ onChange(option ? option.value : null)} + clearable={clearable} + options={options} + /> +
+ ); }; export default SelectActionTableCell; diff --git a/openecomp-ui/src/nfvo-components/table/SelectActionTableRow.jsx b/openecomp-ui/src/nfvo-components/table/SelectActionTableRow.jsx index 260d39d31c..1c2c1529f2 100644 --- a/openecomp-ui/src/nfvo-components/table/SelectActionTableRow.jsx +++ b/openecomp-ui/src/nfvo-components/table/SelectActionTableRow.jsx @@ -3,38 +3,65 @@ import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js'; import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger.js'; import Tooltip from 'react-bootstrap/lib/Tooltip.js'; -function tooltip (msg) { - return ( - {msg} - ); -}; +function tooltip(msg) { + return ( + + {msg} + + ); +} -const IconWithOverlay = ({overlayMsg}) => ( - - - +const IconWithOverlay = ({ overlayMsg }) => ( + + + ); -function renderErrorOrCheck({hasError, overlayMsg}) { - if (hasError === undefined) { - return ; - } +function renderErrorOrCheck({ hasError, overlayMsg }) { + if (hasError === undefined) { + return ; + } - if (hasError) { - return overlayMsg ? : ; - } + if (hasError) { + return overlayMsg ? ( + + ) : ( + + ); + } - return ; + return ; } -const SelectActionTableRow = ({children, actionIcon, onAction, showAction, hasError, hasErrorIndication, overlayMsg}) => ( -
-
- {children} -
- {onAction && } - {hasErrorIndication && renderErrorOrCheck({hasError, overlayMsg})} -
+const SelectActionTableRow = ({ + children, + actionIcon, + onAction, + showAction, + hasError, + hasErrorIndication, + overlayMsg +}) => ( +
+
+ {children} +
+ {onAction && ( + + )} + {hasErrorIndication && renderErrorOrCheck({ hasError, overlayMsg })} +
); export default SelectActionTableRow; -- cgit 1.2.3-korg