From 644017cb3edd5b7a077a634ffd5daf2fee6bc088 Mon Sep 17 00:00:00 2001 From: az2497 Date: Thu, 10 Aug 2017 17:49:40 +0300 Subject: [SDC] OnBoard with enabled tests and features Change-Id: I4c1bbf6e1c854cf97a3561c736f83da44b58b7c0 Signed-off-by: az2497 [SDC] OnBoard with enabled tests and features. Change-Id: Icd52f039aee4dd393a1404d530bb9fdd0b20e604 Signed-off-by: az2497 --- .../src/nfvo-components/SubmitErrorResponse.jsx | 6 +-- .../fileupload/DraggableUploadFileBox.jsx | 46 ++++++++++++++++++++++ .../src/nfvo-components/input/ToggleInput.jsx | 1 + .../nfvo-components/listEditor/ListEditorView.jsx | 7 ++-- .../src/nfvo-components/modal/GlobalModal.js | 22 +++++++++-- .../nfvo-components/panel/NavigationSideBar.jsx | 1 + .../panel/versionController/VersionController.jsx | 2 +- .../nfvo-components/table/SelectActionTable.jsx | 6 ++- .../nfvo-components/table/SelectActionTableRow.jsx | 8 ++-- 9 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 openecomp-ui/src/nfvo-components/fileupload/DraggableUploadFileBox.jsx (limited to 'openecomp-ui/src/nfvo-components') diff --git a/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx b/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx index 5fe592a663..1488c6c0bb 100644 --- a/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx +++ b/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx @@ -17,7 +17,6 @@ import React, {Component} from 'react'; import ListGroupItem from 'react-bootstrap/lib/ListGroupItem.js'; import i18n from 'nfvo-utils/i18n/i18n.js'; import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js'; -import Icon from 'nfvo-components/icon/Icon.jsx'; import {Collapse} from 'react-bootstrap'; /** * parsing and showing the following Java Response object @@ -145,8 +144,7 @@ class ErrorBlock extends React.Component { const ErrorHeader = ({errorType, collapsed, onClick}) => { return(
- - {errorType} +
); }; @@ -154,7 +152,7 @@ const ErrorHeader = ({errorType, collapsed, onClick}) => { const ErrorMessage = ({error, warning}) => { return ( - + ); }; diff --git a/openecomp-ui/src/nfvo-components/fileupload/DraggableUploadFileBox.jsx b/openecomp-ui/src/nfvo-components/fileupload/DraggableUploadFileBox.jsx new file mode 100644 index 0000000000..629b9449a2 --- /dev/null +++ b/openecomp-ui/src/nfvo-components/fileupload/DraggableUploadFileBox.jsx @@ -0,0 +1,46 @@ +/*! + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ +/** + * The HTML structure here is aligned with bootstrap HTML structure for form elements. + * In this way we have proper styling and it is aligned with other form elements on screen. + * + * Select and MultiSelect options: + * + * label - the label to be shown which paired with the input + * + * all other "react-select" props - as documented on + * http://jedwatson.github.io/react-select/ + * or + * https://github.com/JedWatson/react-select + */ +import React, {Component} from 'react'; +import i18n from 'nfvo-utils/i18n/i18n.js'; +import Button from 'sdc-ui/lib/react/Button.js'; + +class DraggableUploadFileBox extends Component { + render() { + let {className, onClick, dataTestId, isReadOnlyMode} = this.props; + return ( +
+
{i18n('Drag & drop for upload')}
+
{i18n('or')}
+ +
+ ); + } +} +export default DraggableUploadFileBox; diff --git a/openecomp-ui/src/nfvo-components/input/ToggleInput.jsx b/openecomp-ui/src/nfvo-components/input/ToggleInput.jsx index 7bbafa3696..23af72a26a 100644 --- a/openecomp-ui/src/nfvo-components/input/ToggleInput.jsx +++ b/openecomp-ui/src/nfvo-components/input/ToggleInput.jsx @@ -41,6 +41,7 @@ class ToggleInput extends React.Component { render() { let {label, disabled} = this.props; let checked = this.status() === 'on'; + //TODO check onclick return (
{label}
diff --git a/openecomp-ui/src/nfvo-components/listEditor/ListEditorView.jsx b/openecomp-ui/src/nfvo-components/listEditor/ListEditorView.jsx index cc805e9ada..df7d69b4ff 100644 --- a/openecomp-ui/src/nfvo-components/listEditor/ListEditorView.jsx +++ b/openecomp-ui/src/nfvo-components/listEditor/ListEditorView.jsx @@ -14,6 +14,7 @@ * permissions and limitations under the License. */ import React from 'react'; +import Button from 'sdc-ui/lib/react/Button.js'; import classnames from 'classnames'; import ExpandableInput from 'nfvo-components/input/ExpandableInput.jsx'; @@ -21,11 +22,9 @@ const ListEditorHeader = ({onAdd, isReadOnlyMode, title, plusButtonTitle}) => { return (
{title &&
{title}
} -
+
{ onAdd && -
- {`+ ${plusButtonTitle}`} -
+ }
diff --git a/openecomp-ui/src/nfvo-components/modal/GlobalModal.js b/openecomp-ui/src/nfvo-components/modal/GlobalModal.js index 825cc609a8..e05c2ac616 100644 --- a/openecomp-ui/src/nfvo-components/modal/GlobalModal.js +++ b/openecomp-ui/src/nfvo-components/modal/GlobalModal.js @@ -31,21 +31,35 @@ const typeClass = { success: 'positive' }; +const type2HeaderColor = { + 'default': 'primary', + error: 'danger', + warning: 'warning', + success: 'success' +}; + -const ModalFooter = ({type, onConfirmed, onDeclined, onClose, confirmationButtonText, cancelButtonText}) => +const ModalFooter = ({type, onConfirmed, onDeclined, onClose, confirmationButtonText, cancelButtonText}) => { + let myPropsForNoConfirmed = {}; + if (onConfirmed) { + myPropsForNoConfirmed.btnType = 'outline'; + } + return (
{onConfirmed && } -
-
; + + ); +}; ModalFooter.defaultProps = { type: 'default', @@ -93,7 +107,7 @@ export class GlobalModalView extends React.Component { modalClassName, msg, onConfirmed, onDeclined, confirmationButtonText, cancelButtonText, onClose} = this.props; const ComponentToRender = modalContentComponents[modalComponentName]; return ( - + {title} diff --git a/openecomp-ui/src/nfvo-components/panel/NavigationSideBar.jsx b/openecomp-ui/src/nfvo-components/panel/NavigationSideBar.jsx index 3b89137090..fb3b71f0c8 100644 --- a/openecomp-ui/src/nfvo-components/panel/NavigationSideBar.jsx +++ b/openecomp-ui/src/nfvo-components/panel/NavigationSideBar.jsx @@ -109,6 +109,7 @@ function NavigationMenuItem(props) { function NavigationLink(props) { const {item, activeItemId, onClick} = props; + // todo should this be button return (
{tooltipText}}>
- +
); diff --git a/openecomp-ui/src/nfvo-components/table/SelectActionTable.jsx b/openecomp-ui/src/nfvo-components/table/SelectActionTable.jsx index 12e9a06623..3f8dbba53a 100644 --- a/openecomp-ui/src/nfvo-components/table/SelectActionTable.jsx +++ b/openecomp-ui/src/nfvo-components/table/SelectActionTable.jsx @@ -1,6 +1,7 @@ import React from 'react'; import i18n from 'nfvo-utils/i18n/i18n.js'; import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js'; +import Button from 'sdc-ui/lib/react/Button.js'; import uuid from 'uuid-js'; export default class SelectActionTable extends React.Component { @@ -10,13 +11,14 @@ export default class SelectActionTable extends React.Component { return (
- {onAdd && onAddItem &&
{onAddItem}
} + {onAdd && onAddItem && + }
{columns.map(column =>
{i18n(column)}
)} - {Array(numOfIcons).fill().map((e, i) => )} + {Array(numOfIcons).fill().map((e, i) => )}
{children} diff --git a/openecomp-ui/src/nfvo-components/table/SelectActionTableRow.jsx b/openecomp-ui/src/nfvo-components/table/SelectActionTableRow.jsx index 7df7d532e8..a03f8441a4 100644 --- a/openecomp-ui/src/nfvo-components/table/SelectActionTableRow.jsx +++ b/openecomp-ui/src/nfvo-components/table/SelectActionTableRow.jsx @@ -11,7 +11,7 @@ function tooltip (msg) { const IconWithOverlay = ({overlayMsg}) => ( - + ); @@ -21,10 +21,10 @@ function renderErrorOrCheck({hasError, overlayMsg}) { } if (hasError) { - return overlayMsg ? : ; + return overlayMsg ? : ; } - return ; + return ; } const SelectActionTableRow = ({children, onDelete, hasError, hasErrorIndication, overlayMsg, showDelete}) => ( @@ -32,7 +32,7 @@ const SelectActionTableRow = ({children, onDelete, hasError, hasErrorIndication,
{children}
- {onDelete && } + {onDelete && } {hasErrorIndication && renderErrorOrCheck({hasError, overlayMsg})}
); -- cgit 1.2.3-korg