From 1801b24389baa8e3f7298ff2c41e2512b19c1290 Mon Sep 17 00:00:00 2001 From: Einav Weiss Keidar Date: Mon, 13 Aug 2018 16:19:46 +0300 Subject: react 16 upgrade Issue-ID: SDC-1762 Change-Id: I7701f12fc63bb09f8c985c7c893b984701dcbfab Signed-off-by: Einav Keidar --- .../softwareProduct/SoftwareProductActionHelper.js | 3 +- .../softwareProduct/attachments/setup/HeatSetup.js | 18 +- .../attachments/setup/HeatSetupActionHelper.js | 20 +- .../attachments/setup/HeatSetupConstants.js | 13 +- .../attachments/setup/HeatSetupReducer.js | 22 +- .../attachments/setup/HeatSetupView.jsx | 411 +-------------------- .../setup/components/AddOrDeleteVolumeFiles.js | 40 ++ .../setup/components/ArtifactOrNestedFileList.js | 82 ++++ .../setup/components/EmptyListContent.js | 29 ++ .../attachments/setup/components/ModuleFile.js | 152 ++++++++ .../attachments/setup/components/NameEditInput.js | 35 ++ .../setup/components/SelectWithFileType.js | 48 +++ .../setup/components/SortableListItem.js | 21 ++ .../setup/components/SortableModuleFileList.js | 126 +++++++ .../attachments/setup/components/UnassignedFile.js | 35 ++ .../setup/components/UnassignedFileList.js | 33 ++ .../components/SoftwareProductComponents.js | 18 +- .../compute/ComputeFlavorActionHelper.js | 17 +- .../computeFlavor/ComputeFlavorEditorView.jsx | 13 +- .../SoftwareProductComponentCreationView.jsx | 15 +- .../SoftwareProductComponentsImageActionHelper.js | 14 +- .../SoftwareProductComponentsImageEditorView.jsx | 13 +- .../network/NICCreation/NICCreationActionHelper.js | 18 +- .../network/NICCreation/NICCreationView.jsx | 9 +- .../network/SoftwareProductComponentsNICEditor.js | 12 +- .../SoftwareProductComponentsNICEditorView.jsx | 13 +- ...SoftwareProductComponentsNetworkActionHelper.js | 22 +- .../SoftwareProductComponentsNetworkList.js | 14 +- .../network/nicEditorComponents/NameAndPurpose.jsx | 8 +- .../network/nicEditorComponents/Network.jsx | 14 +- .../network/nicEditorComponents/PacketsBytes.jsx | 14 +- .../network/nicEditorComponents/Protocols.jsx | 16 +- ...oftwareProductComponentProcessesActionHelper.js | 45 ++- .../SoftwareProductComponentProcessesList.js | 39 +- .../SoftwareProductComponentsProcessesListView.jsx | 49 +-- .../creation/SoftwareProductCreationView.jsx | 2 + .../SoftwareProductDeploymentActionHelper.js | 17 +- .../editor/SoftwareProductDeploymentEditorView.jsx | 18 +- .../processes/SoftwareProductProcessListView.jsx | 14 +- .../processes/SoftwareProductProcesses.js | 27 +- .../SoftwareProductProcessesActionHelper.js | 44 ++- .../SoftwareProductProcessesEditorForm.jsx | 12 +- .../processes/SoftwareProductProcessesView.jsx | 41 +- .../vnfMarketPlace/VNFImportView.jsx | 4 +- 44 files changed, 953 insertions(+), 677 deletions(-) create mode 100644 openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/AddOrDeleteVolumeFiles.js create mode 100644 openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/ArtifactOrNestedFileList.js create mode 100644 openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/EmptyListContent.js create mode 100644 openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/ModuleFile.js create mode 100644 openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/NameEditInput.js create mode 100644 openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SelectWithFileType.js create mode 100644 openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SortableListItem.js create mode 100644 openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SortableModuleFileList.js create mode 100644 openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/UnassignedFile.js create mode 100644 openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/UnassignedFileList.js (limited to 'openecomp-ui/src/sdc-app/onboarding/softwareProduct') diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js index 877c7869bd..9a177b2a53 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js @@ -801,7 +801,7 @@ const SoftwareProductActionHelper = { }, /** for the next verision */ - addComponent(dispatch, { softwareProductId, modalClassName, version }) { + addComponent(dispatch, { softwareProductId, version }) { SoftwareProductComponentsActionHelper.clearComponentCreationData( dispatch ); @@ -813,7 +813,6 @@ const SoftwareProductActionHelper = { data: { modalComponentName: modalContentMapper.COMPONENT_CREATION, modalComponentProps: { softwareProductId, version }, - modalClassName, title: 'Create Virtual Function Component' } }); diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetup.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetup.js index d75d464f9e..6c0631963b 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetup.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetup.js @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import { connect } from 'react-redux'; import HeatSetupView from './HeatSetupView.jsx'; @@ -65,6 +65,12 @@ export const mapActionsToProps = (dispatch, {}) => { value, type }), + onToggleVolFilesDisplay: ({ module, value }) => { + HeatSetupActionHelper.toggleVolFilesDisplay(dispatch, { + module, + value + }); + }, onArtifactListChange: artifacts => HeatSetupActionHelper.changeArtifactList(dispatch, artifacts), onAddAllUnassigned: () => diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupActionHelper.js index 05ac408fbb..d2eb4e9eda 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupActionHelper.js @@ -1,26 +1,28 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import { actionTypes } from './HeatSetupConstants.js'; import isEqual from 'lodash/isEqual.js'; import cloneDeep from 'lodash/cloneDeep.js'; import SoftwareProductActionHelper from 'sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js'; -// import i18n from 'nfvo-utils/i18n/i18n.js'; -// import {actionTypes as modalActionTypes} from 'nfvo-components/modal/GlobalModalConstants.js'; export default { + toggleVolFilesDisplay(dispatch, data) { + dispatch({ type: actionTypes.TOGGLE_VOL_DISPLAY, data }); + }, + addModule(dispatch, isBase) { dispatch({ type: actionTypes.ADD_MODULE, data: { isBase } }); }, @@ -94,7 +96,7 @@ export default { dispatch({ type: modalActionTypes.GLOBAL_MODAL_WARNING, data:{ - msg: i18n(`You have uploaded a new HEAT. If you navigate away or Check-in without proceeding to validation, + msg: i18n(`You have uploaded a new HEAT. If you navigate away or Check-in without proceeding to validation, Old HEAT zip file will be in use. new HEAT will be ignored. Do you want to continue?`), confirmationButtonText: i18n('Continue'), onConfirmed: () => resolve(), diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupConstants.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupConstants.js index c87e9560f8..33bd7f639f 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupConstants.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupConstants.js @@ -1,17 +1,17 @@ -/*! +/* * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import keyMirror from 'nfvo-utils/KeyMirror.js'; @@ -30,7 +30,8 @@ export const actionTypes = keyMirror( MANIFEST_LOADED: null, GO_TO_VALIDATION: null, - IN_VALIDATION: null + IN_VALIDATION: null, + TOGGLE_VOL_DISPLAY: null }, 'heatSetup' ); diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupReducer.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupReducer.js index 8840a11c3e..06a7147ec9 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupReducer.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupReducer.js @@ -1,20 +1,21 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import { actionTypes } from './HeatSetupConstants.js'; import differenceWith from 'lodash/differenceWith.js'; +import cloneDeep from 'lodash/cloneDeep'; const emptyModule = (isBase, currentLength) => ({ name: `${isBase ? 'base_' : 'module_'}${currentLength + 1}`, @@ -65,6 +66,15 @@ function addDeletedModuleFilesToUnassigned(unassigned, deletedModule) { export default (state = {}, action) => { switch (action.type) { + case actionTypes.TOGGLE_VOL_DISPLAY: + let clonedState = cloneDeep(state); + const indexToModify = findModuleIndexByName( + clonedState.modules, + action.data.module.name + ); + let modToModify = clonedState.modules[indexToModify]; + modToModify.showVolFiles = action.data.value; + return clonedState; case actionTypes.MANIFEST_LOADED: return { ...state, diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupView.jsx index 1d4efd9104..d103d115f6 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupView.jsx @@ -1,415 +1,26 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import React, { Component } from 'react'; -import Button from 'sdc-ui/lib/react/Button.js'; -import Tooltip from 'react-bootstrap/lib/Tooltip.js'; -import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger.js'; -import FormControl from 'react-bootstrap/lib/FormControl.js'; import i18n from 'nfvo-utils/i18n/i18n.js'; -import SelectInput from 'nfvo-components/input/SelectInput.jsx'; -import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js'; -import { fileTypes } from './HeatSetupConstants.js'; import { tabsMapping } from '../SoftwareProductAttachmentsConstants.js'; -import { sortable } from 'react-sortable'; - -class ListItem extends Component { - render() { - return
  • {this.props.children}
  • ; - } -} - -const SortableListItem = sortable(ListItem); - -class SortableModuleFileList extends Component { - state = { - draggingIndex: null, - data: this.props.modules - }; - - componentWillReceiveProps(nextProps) { - this.setState({ data: nextProps.modules }); - } - - render() { - let { - unassigned, - onModuleRename, - onModuleDelete, - onModuleAdd, - onBaseAdd, - onModuleFileTypeChange, - isBaseExist, - isReadOnlyMode - } = this.props; - const childProps = module => ({ - module, - onModuleRename, - onModuleDelete, - onModuleFileTypeChange: (value, type) => - onModuleFileTypeChange({ module, value, type }), - files: unassigned - }); - let listItems = this.state.data.map(function(item, i) { - return ( - this.setState(data)} - items={this.state.data} - draggingIndex={this.state.draggingIndex} - sortId={i} - outline="list"> - - - ); - }, this); - - return ( -
    0 ? 'modules-list-wrapper-divider' : '' - }`}> -
    - {!isBaseExist && ( -
    - -
    - )} -
    - -
    -
    - {listItems.length > 0 &&
      {listItems}
    } -
    - ); - } -} - -const tooltip = name => {name}; -const UnassignedFileList = props => { - return ( -
    -
    -
    -
    - {i18n('UNASSIGNED FILES')} -
    -
    {props.children}
    -
    -
    - ); -}; - -const EmptyListContent = props => { - let { heatDataExist } = props; - let displayText = heatDataExist ? 'All Files Are Assigned' : ''; - return ( -
    -
    {i18n(displayText)}
    -
    - ); -}; -const UnassignedFile = props => ( - -
  • - {props.name} -
  • -
    -); - -const AddOrDeleteVolumeFiles = ({ - add = true, - onAdd, - onDelete, - isReadOnlyMode -}) => { - const displayText = add ? 'Add Volume Files' : 'Delete Volume Files'; - const action = add ? onAdd : onDelete; - return ( - - ); -}; - -const SelectWithFileType = ({ type, selected, files, onChange }) => { - let filteredFiledAccordingToType = files.filter( - file => file.label.search(type.regex) > -1 - ); - if (selected) { - filteredFiledAccordingToType = filteredFiledAccordingToType.concat({ - label: selected, - value: selected - }); - } - - return ( - - value !== selected && onChange(value, type.label) - } - disabled={filteredFiledAccordingToType.length === 0} - placeholder={ - filteredFiledAccordingToType.length === 0 ? '' : undefined - } - clearable={true} - options={filteredFiledAccordingToType} - /> - ); -}; - -class NameEditInput extends Component { - componentDidMount() { - this.input.focus(); - } - - render() { - return ( - (this.input = input)} - /> - ); - } -} - -class ModuleFile extends Component { - constructor(props) { - super(props); - this.state = { - isInNameEdit: false, - displayVolumes: Boolean(props.module.vol || props.module.volEnv) - }; - } - - handleSubmit(event, name) { - if (event.keyCode === 13) { - this.handleModuleRename(event, name); - } - } - - componentWillReceiveProps(nextProps) { - this.setState({ - displayVolumes: Boolean( - nextProps.module.vol || nextProps.module.volEnv - ) - }); - } - - handleModuleRename(event, name) { - this.setState({ isInNameEdit: false }); - this.props.onModuleRename(name, event.target.value); - } - - deleteVolumeFiles() { - const { onModuleFileTypeChange } = this.props; - onModuleFileTypeChange(null, fileTypes.VOL.label); - onModuleFileTypeChange(null, fileTypes.VOL_ENV.label); - this.setState({ displayVolumes: false }); - } - - renderNameAccordingToEditState() { - const { module: { name } } = this.props; - if (this.state.isInNameEdit) { - return ( - this.handleModuleRename(evt, name)} - onKeyDown={evt => this.handleSubmit(evt, name)} - /> - ); - } - return {name}; - } - - render() { - const { - module: { name, isBase, yaml, env, vol, volEnv }, - onModuleDelete, - files, - onModuleFileTypeChange, - isReadOnlyMode - } = this.props; - const { displayVolumes } = this.state; - const moduleType = isBase ? 'BASE' : 'MODULE'; - return ( -
    -
    -
    - - {`${moduleType}: `} -
    - {this.renderNameAccordingToEditState()} - {!this.state.isInNameEdit && ( - - this.setState({ isInNameEdit: true }) - } - data-test-id={ - isBase ? 'base-name' : 'module-name' - } - /> - )} -
    -
    - onModuleDelete(name)} - data-test-id="module-delete" - /> -
    -
    - - - {displayVolumes && ( - - )} - {displayVolumes && ( - - )} - this.setState({ displayVolumes: true })} - onDelete={() => this.deleteVolumeFiles()} - add={!displayVolumes} - /> -
    -
    - ); - } -} - -class ArtifactOrNestedFileList extends Component { - render() { - let { - type, - title, - selected, - options, - onSelectChanged, - onAddAllUnassigned, - isReadOnlyMode, - headerClassName - } = this.props; - return ( -
    -
    - - {type === 'artifact' && ( - - )} - {`${title}`} - - {type === 'artifact' && ( - - )} -
    - {type === 'nested' ? ( -
      - {selected.map(nested => ( -
    • - {nested} -
    • - ))} -
    - ) : ( - {})} - value={selected} - clearable={false} - placeholder={i18n('Add Artifact')} - multi - /> - )} -
    - ); - } -} +import SortableModuleFileList from './components/SortableModuleFileList'; +import UnassignedFile from './components/UnassignedFile'; +import UnassignedFileList from './components/UnassignedFileList'; +import EmptyListContent from './components/EmptyListContent'; +import ArtifactOrNestedFileList from './components/ArtifactOrNestedFileList'; const buildLabelValueObject = str => typeof str === 'string' ? { value: str, label: str } : str; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/AddOrDeleteVolumeFiles.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/AddOrDeleteVolumeFiles.js new file mode 100644 index 0000000000..92a07ae119 --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/AddOrDeleteVolumeFiles.js @@ -0,0 +1,40 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +import React from 'react'; +import Button from 'sdc-ui/lib/react/Button.js'; +import i18n from 'nfvo-utils/i18n/i18n.js'; + +const AddOrDeleteVolumeFiles = ({ + add = true, + onAdd, + onDelete, + isReadOnlyMode +}) => { + const displayText = add ? 'Add Volume Files' : 'Delete Volume Files'; + const action = add ? onAdd : onDelete; + return ( + + ); +}; + +export default AddOrDeleteVolumeFiles; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/ArtifactOrNestedFileList.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/ArtifactOrNestedFileList.js new file mode 100644 index 0000000000..c2bbde4c3d --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/ArtifactOrNestedFileList.js @@ -0,0 +1,82 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +import React from 'react'; +import i18n from 'nfvo-utils/i18n/i18n.js'; +import Button from 'sdc-ui/lib/react/Button.js'; +import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js'; +import SelectInput from 'nfvo-components/input/SelectInput.jsx'; + +const NestedList = ({ selected }) => ( +
      + {selected.map(nested => ( +
    • + {nested} +
    • + ))} +
    +); + +const ArtifactOrNestedFileList = ({ + type, + title, + selected, + options, + onSelectChanged, + onAddAllUnassigned, + isReadOnlyMode, + headerClassName +}) => ( +
    +
    + + {type === 'artifact' && ( + + )} + {`${title}`} + + {type === 'artifact' && ( + + )} +
    + {type === 'nested' ? ( + + ) : ( + {})} + value={selected} + clearable={false} + placeholder={i18n('Add Artifact')} + multi + /> + )} +
    +); + +export default ArtifactOrNestedFileList; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/EmptyListContent.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/EmptyListContent.js new file mode 100644 index 0000000000..f638d10998 --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/EmptyListContent.js @@ -0,0 +1,29 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +import React from 'react'; +import i18n from 'nfvo-utils/i18n/i18n.js'; + +const EmptyListContent = props => { + let { heatDataExist } = props; + let displayText = heatDataExist ? 'All Files Are Assigned' : ''; + return ( +
    +
    {i18n(displayText)}
    +
    + ); +}; + +export default EmptyListContent; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/ModuleFile.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/ModuleFile.js new file mode 100644 index 0000000000..5cc74e80df --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/ModuleFile.js @@ -0,0 +1,152 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +import React from 'react'; +import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js'; +import NameEditInput from './NameEditInput.js'; +import SelectWithFileType from './SelectWithFileType'; +import { fileTypes } from '../HeatSetupConstants.js'; +import AddOrDeleteVolumeFiles from './AddOrDeleteVolumeFiles'; + +class ModuleFile extends React.Component { + constructor(props) { + super(props); + this.state = { + isInNameEdit: false + }; + } + + handleSubmit(event, name) { + if (event.keyCode === 13) { + this.handleModuleRename(event, name); + } + } + + handleModuleRename(event, name) { + this.setState({ isInNameEdit: false }); + this.props.onModuleRename(name, event.target.value); + } + + deleteVolumeFiles() { + const { onModuleFileTypeChange, onToggleVolFilesDisplay } = this.props; + onModuleFileTypeChange(null, fileTypes.VOL.label); + onModuleFileTypeChange(null, fileTypes.VOL_ENV.label); + onToggleVolFilesDisplay(false); + } + + renderNameAccordingToEditState() { + const { module: { name } } = this.props; + if (this.state.isInNameEdit) { + return ( + this.handleModuleRename(evt, name)} + onKeyDown={evt => this.handleSubmit(evt, name)} + /> + ); + } + return {name}; + } + + render() { + const { + module: { name, isBase, yaml, env, vol, volEnv }, + onModuleDelete, + files, + onModuleFileTypeChange, + onToggleVolFilesDisplay, + isReadOnlyMode, + displayVolumes + } = this.props; + + //const { displayVolumes } = this.state; + + const moduleType = isBase ? 'BASE' : 'MODULE'; + return ( +
    +
    +
    + + {`${moduleType}: `} +
    + {this.renderNameAccordingToEditState()} + {!this.state.isInNameEdit && ( + + this.setState({ isInNameEdit: true }) + } + data-test-id={ + isBase ? 'base-name' : 'module-name' + } + /> + )} +
    +
    + onModuleDelete(name)} + data-test-id="module-delete" + /> +
    +
    + + + {displayVolumes && ( + + )} + {displayVolumes && ( + + )} + onToggleVolFilesDisplay(true)} + onDelete={() => this.deleteVolumeFiles()} + add={!displayVolumes} + /> +
    +
    + ); + } +} + +export default ModuleFile; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/NameEditInput.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/NameEditInput.js new file mode 100644 index 0000000000..36821e02c2 --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/NameEditInput.js @@ -0,0 +1,35 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +import React from 'react'; +import FormControl from 'react-bootstrap/lib/FormControl.js'; + +class NameEditInput extends React.Component { + componentDidMount() { + this.input.focus(); + } + + render() { + return ( + (this.input = input)} + /> + ); + } +} + +export default NameEditInput; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SelectWithFileType.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SelectWithFileType.js new file mode 100644 index 0000000000..050c91e431 --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SelectWithFileType.js @@ -0,0 +1,48 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +import React from 'react'; +import SelectInput from 'nfvo-components/input/SelectInput.jsx'; + +const SelectWithFileType = ({ type, selected, files, onChange }) => { + let filteredFiledAccordingToType = files.filter( + file => file.label.search(type.regex) > -1 + ); + if (selected) { + filteredFiledAccordingToType = filteredFiledAccordingToType.concat({ + label: selected, + value: selected + }); + } + + return ( + + value !== selected && onChange(value, type.label) + } + disabled={filteredFiledAccordingToType.length === 0} + placeholder={ + filteredFiledAccordingToType.length === 0 ? '' : undefined + } + clearable={true} + options={filteredFiledAccordingToType} + /> + ); +}; + +export default SelectWithFileType; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SortableListItem.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SortableListItem.js new file mode 100644 index 0000000000..57626438fb --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SortableListItem.js @@ -0,0 +1,21 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +import React from 'react'; +import { sortable } from 'react-sortable'; + +const ListItem = props =>
  • {props.children}
  • ; + +export default sortable(ListItem); diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SortableModuleFileList.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SortableModuleFileList.js new file mode 100644 index 0000000000..f52c251361 --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/SortableModuleFileList.js @@ -0,0 +1,126 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +import React from 'react'; +import isEqual from 'lodash/isEqual'; +import i18n from 'nfvo-utils/i18n/i18n.js'; +import SortableListItem from './SortableListItem.js'; +import { fileTypes } from '../HeatSetupConstants.js'; + +import Button from 'sdc-ui/lib/react/Button.js'; +import ModuleFile from './ModuleFile.js'; + +class SortableModuleFileList extends React.Component { + state = { + draggingIndex: null, + data: this.props.modules + }; + + componentDidUpdate() { + if (!isEqual(this.state.data, this.props.modules)) { + /* eslint-disable-next-line */ + this.setState({ + data: this.props.modules + }); + } + } + + render() { + let { + unassigned, + onModuleRename, + onModuleDelete, + onModuleAdd, + onBaseAdd, + onModuleFileTypeChange, + onToggleVolFilesDisplay, + isBaseExist, + isReadOnlyMode + } = this.props; + const childProps = module => ({ + module, + onModuleRename, + onModuleDelete, + onModuleFileTypeChange: (value, type) => { + if ( + type === fileTypes.VOL.label || + type === fileTypes.VOL_ENV.label + ) { + onToggleVolFilesDisplay({ module, value: false }); + } + onModuleFileTypeChange({ module, value, type }); + }, + + files: unassigned, + displayVolumes: Boolean( + module.vol || module.volEnv || module.showVolFiles + ), + onToggleVolFilesDisplay: value => + onToggleVolFilesDisplay({ module, value }) + }); + + let listItems = this.state.data.map(function(item, i) { + return ( + this.setState(data)} + items={this.state.data} + draggingIndex={this.state.draggingIndex} + sortId={i} + outline="list"> + + + ); + }, this); + + return ( +
    0 ? 'modules-list-wrapper-divider' : '' + }`}> +
    + {!isBaseExist && ( +
    + +
    + )} +
    + +
    +
    + {listItems.length > 0 &&
      {listItems}
    } +
    + ); + } +} + +export default SortableModuleFileList; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/UnassignedFile.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/UnassignedFile.js new file mode 100644 index 0000000000..770befc0e3 --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/UnassignedFile.js @@ -0,0 +1,35 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +import React from 'react'; +import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger.js'; +import Tooltip from 'react-bootstrap/lib/Tooltip.js'; + +const tooltip = name => {name}; + +const UnassignedFile = props => ( + +
  • + {props.name} +
  • +
    +); + +export default UnassignedFile; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/UnassignedFileList.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/UnassignedFileList.js new file mode 100644 index 0000000000..75fe7cdc8a --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/setup/components/UnassignedFileList.js @@ -0,0 +1,33 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ +import React from 'react'; +import i18n from 'nfvo-utils/i18n/i18n.js'; + +const UnassignedFileList = props => { + return ( +
    +
    +
    +
    + {i18n('UNASSIGNED FILES')} +
    +
    {props.children}
    +
    +
    + ); +}; + +export default UnassignedFileList; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/SoftwareProductComponents.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/SoftwareProductComponents.js index bffa9f7d25..8ba5a18229 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/SoftwareProductComponents.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/SoftwareProductComponents.js @@ -1,3 +1,18 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ import { connect } from 'react-redux'; import i18n from 'nfvo-utils/i18n/i18n.js'; @@ -44,8 +59,7 @@ const mapActionToProps = dispatch => { onAddComponent: (softwareProductId, version) => SoftwareProductActionHelper.addComponent(dispatch, { softwareProductId, - version, - modalClassName: 'create-vfc-modal' + version }), onDeleteComponent: (component, softwareProductId, version) => dispatch({ diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/compute/ComputeFlavorActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/compute/ComputeFlavorActionHelper.js index cd37c317af..6842d9448e 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/compute/ComputeFlavorActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/compute/ComputeFlavorActionHelper.js @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js'; import Configuration from 'sdc-app/config/Configuration.js'; @@ -120,12 +120,9 @@ const ComputeFlavorActionHelper = { data: { modalComponentName: modalContentMapper.COMPONENT_COMPUTE_FLAVOR_EDITOR, - modalClassName: `compute-flavor-editor-modal-${ - props.compute ? 'edit' : 'create' - }`, modalComponentProps: { ...props, - size: props.compute ? modalSizes.LARGE : undefined, + size: props.compute ? modalSizes.XLARGE : undefined, dialogClassName: 'compute-flavor-editor-modal' }, title: `${ diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/compute/computeComponents/computeFlavor/ComputeFlavorEditorView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/compute/computeComponents/computeFlavor/ComputeFlavorEditorView.jsx index 840f722bb2..7ea6f78a8c 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/compute/computeComponents/computeFlavor/ComputeFlavorEditorView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/compute/computeComponents/computeFlavor/ComputeFlavorEditorView.jsx @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import React from 'react'; import PropTypes from 'prop-types'; @@ -63,6 +63,7 @@ class ComputeEditorView extends React.Component { this.form = form; }} hasButtons={true} + btnClassName="sdc-modal__footer" onSubmit={() => onSubmit({ data, qdata })} onReset={() => onCancel()} labledButtons={true} diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/creation/SoftwareProductComponentCreationView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/creation/SoftwareProductComponentCreationView.jsx index 0b33b4017f..cb17813bae 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/creation/SoftwareProductComponentCreationView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/creation/SoftwareProductComponentCreationView.jsx @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import React from 'react'; @@ -47,7 +47,7 @@ class ComponentCreationView extends React.Component { onValidateForm={() => this.props.onValidateForm(forms.CREATE_FORM) } - className="entitlement-pools-form"> + btnClassName="sdc-modal__footer"> diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/images/SoftwareProductComponentsImageActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/images/SoftwareProductComponentsImageActionHelper.js index 3f661b76fe..38ee2ae610 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/images/SoftwareProductComponentsImageActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/images/SoftwareProductComponentsImageActionHelper.js @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js'; import i18n from 'nfvo-utils/i18n/i18n.js'; @@ -199,7 +199,7 @@ const SoftwareProductComponentImagesActionHelper = { modalComponentName: modalContentMapper.SOFTWARE_PRODUCT_COMPONENT_IMAGE_EDITOR, title: title, - modalClassName: className, + bodyClassName: className, modalComponentProps: { softwareProductId, componentId, diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/images/SoftwareProductComponentsImageEditorView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/images/SoftwareProductComponentsImageEditorView.jsx index 3670ab910d..e4eccc6a39 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/images/SoftwareProductComponentsImageEditorView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/images/SoftwareProductComponentsImageEditorView.jsx @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import React from 'react'; import PropTypes from 'prop-types'; @@ -55,6 +55,7 @@ class SoftwareProductComponentsImageEditorView extends React.Component { this.form = form; }} hasButtons={true} + btnClassName="sdc-modal__footer" onSubmit={() => this.submit()} onReset={() => onCancel()} labledButtons={true} diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/NICCreation/NICCreationActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/NICCreation/NICCreationActionHelper.js index 4f200ce33f..2595d9c2cb 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/NICCreation/NICCreationActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/NICCreation/NICCreationActionHelper.js @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import { actionTypes } from '../SoftwareProductComponentsNetworkConstants'; import i18n from 'nfvo-utils/i18n/i18n.js'; @@ -19,10 +19,7 @@ import { actionTypes as modalActionTypes } from 'nfvo-components/modal/GlobalMod import { modalContentMapper } from 'sdc-app/common/modal/ModalContentMapper.js'; export default { - open( - dispatch, - { softwareProductId, componentId, modalClassName, version } - ) { + open(dispatch, { softwareProductId, componentId, version }) { dispatch({ type: actionTypes.NICCreation.OPEN }); @@ -32,7 +29,6 @@ export default { data: { modalComponentName: modalContentMapper.NIC_CREATION, title: i18n('Create NEW NIC'), - modalClassName, modalComponentProps: { softwareProductId, componentId, version } } }); diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/NICCreation/NICCreationView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/NICCreation/NICCreationView.jsx index 6789ba4816..133703a8a8 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/NICCreation/NICCreationView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/NICCreation/NICCreationView.jsx @@ -4,9 +4,9 @@ * 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. @@ -59,7 +59,7 @@ class NICCreationView extends React.Component { } = this.props; let { name, description, networkDescription } = data; return ( -
    +
    {genericFieldInfo && (
    + formReady={formReady} + btnClassName="sdc-modal__footer"> this.submit()} onReset={() => onCancel()} labledButtons={true} diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkActionHelper.js index 58c816134b..3c09fae728 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkActionHelper.js @@ -1,24 +1,27 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js'; import Configuration from 'sdc-app/config/Configuration.js'; import i18n from 'nfvo-utils/i18n/i18n.js'; import { actionTypes } from './SoftwareProductComponentsNetworkConstants.js'; -import { actionTypes as GlobalModalActions } from 'nfvo-components/modal/GlobalModalConstants.js'; +import { + actionTypes as GlobalModalActions, + modalSizes +} from 'nfvo-components/modal/GlobalModalConstants.js'; import { modalContentMapper as modalPagesMapper } from 'sdc-app/common/modal/ModalContentMapper.js'; import ValidationHelper from 'sdc-app/common/helpers/ValidationHelper.js'; import { NIC_QUESTIONNAIRE } from 'sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkConstants.js'; @@ -125,7 +128,6 @@ const SoftwareProductComponentNetworkActionHelper = { softwareProductId, componentId, isReadOnlyMode, - modalClassName, version } ) { @@ -136,12 +138,12 @@ const SoftwareProductComponentNetworkActionHelper = { dispatch({ type: GlobalModalActions.GLOBAL_MODAL_SHOW, data: { - modalClassName, modalComponentProps: { softwareProductId, componentId, isReadOnlyMode, - version + version, + size: modalSizes.LARGE }, modalComponentName: modalPagesMapper.NIC_EDITOR, title: i18n('Edit NIC') diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkList.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkList.js index ac708524cf..db3c767c19 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkList.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkList.js @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import { connect } from 'react-redux'; import i18n from 'nfvo-utils/i18n/i18n.js'; @@ -71,7 +71,6 @@ const mapActionsToProps = ( NICCreationActionHelper.open(dispatch, { softwareProductId, componentId, - modalClassName: 'network-nic-modal-create', version }), onDeleteNic: nic => @@ -119,7 +118,6 @@ const mapActionsToProps = ( isReadOnlyMode, softwareProductId, componentId, - modalClassName: 'network-nic-modal-edit', version } ) diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/NameAndPurpose.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/NameAndPurpose.jsx index 634b43f616..1019e9488b 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/NameAndPurpose.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/NameAndPurpose.jsx @@ -4,9 +4,9 @@ * 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. @@ -56,9 +56,9 @@ const NameAndPurpose = ({ ); }; -NameAndPurpose.PropTypes = { +NameAndPurpose.propTypes = { name: PropTypes.string, - description: PropTypes.array, + description: PropTypes.string, onDataChanged: PropTypes.func, isReadOnlyMode: PropTypes.bool }; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/Network.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/Network.jsx index c440d2fbd3..904df4a856 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/Network.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/Network.jsx @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import React from 'react'; import PropTypes from 'prop-types'; @@ -83,7 +83,7 @@ const Network = ({ ); }; -Network.PropTypes = { +Network.propTypes = { networkValues: PropTypes.array }; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/PacketsBytes.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/PacketsBytes.jsx index 070ac816ad..8f8d143f32 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/PacketsBytes.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/PacketsBytes.jsx @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import React from 'react'; import PropTypes from 'prop-types'; @@ -43,7 +43,7 @@ const PointerInput = ({ ); }; -PointerInput.PropTypes = { +PointerInput.propTypes = { label: PropTypes.string, value: PropTypes.string }; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/Protocols.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/Protocols.jsx index eb762b11b2..b2cda4f649 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/Protocols.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/network/nicEditorComponents/Protocols.jsx @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import React from 'react'; import PropTypes from 'prop-types'; @@ -93,9 +93,9 @@ const Protocols = ({ ); }; -Protocols.PropTypes = { +Protocols.propTypes = { protocols: PropTypes.array, - onQDataChanged: PropTypes.function, + onQDataChanged: PropTypes.func, dataMap: PropTypes.object, qgenericFieldInfo: PropTypes.object }; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentProcessesActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentProcessesActionHelper.js index 52c5cdde3d..5422174f26 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentProcessesActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentProcessesActionHelper.js @@ -1,21 +1,27 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js'; import Configuration from 'sdc-app/config/Configuration.js'; import { actionTypes } from './SoftwareProductComponentProcessesConstants.js'; +import i18n from 'nfvo-utils/i18n/i18n.js'; +import { + actionTypes as modalActionTypes, + modalSizes +} from 'nfvo-components/modal/GlobalModalConstants.js'; +import { modalContentMapper } from 'sdc-app/common/modal/ModalContentMapper.js'; function baseUrl(softwareProductId, version, componentId) { const restPrefix = Configuration.get('restPrefix'); @@ -182,16 +188,39 @@ const SoftwareProductComponentProcessesActionHelper = { }); }, - openEditor(dispatch, process = {}) { + openEditor( + dispatch, + { process, softwareProductId, version, isReadOnlyMode, componentId } + ) { dispatch({ type: actionTypes.SOFTWARE_PRODUCT_PROCESS_COMPONENTS_EDITOR_OPEN, - process + process: process ? process : {} + }); + dispatch({ + type: modalActionTypes.GLOBAL_MODAL_SHOW, + data: { + modalComponentName: modalContentMapper.COMP_PROCESS_EDITOR, + modalComponentProps: { + version, + softwareProductId, + isReadOnlyMode, + componentId, + size: modalSizes.LARGE + }, + bodyClassName: 'edit-process-modal', + title: process + ? i18n('Edit Process Details') + : i18n('Create New Process Details') + } }); }, closeEditor(dispatch) { dispatch({ type: actionTypes.SOFTWARE_PRODUCT_PROCESS_COMPONENTS_EDITOR_CLOSE }); + dispatch({ + type: modalActionTypes.GLOBAL_MODAL_CLOSE + }); } }; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentProcessesList.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentProcessesList.js index cb6d25a6ac..3ab0b2045c 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentProcessesList.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentProcessesList.js @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import { connect } from 'react-redux'; import i18n from 'nfvo-utils/i18n/i18n.js'; @@ -28,15 +28,12 @@ export const mapStateToProps = ({ softwareProduct }) => { }, softwareProductComponents: { componentProcesses = {} } } = softwareProduct; - let { processesList = [], processesEditor = {} } = componentProcesses; - let { data } = processesEditor; + let { processesList = [] } = componentProcesses; return { currentSoftwareProduct, isValidityData, - processesList, - isDisplayModal: Boolean(data), - isModalInEditMode: Boolean(data && data.id) + processesList }; }; @@ -46,12 +43,20 @@ const mapActionsToProps = ( ) => { return { onAddProcess: () => - SoftwareProductComponentProcessesActionHelper.openEditor(dispatch), - onEditProcess: process => - SoftwareProductComponentProcessesActionHelper.openEditor( - dispatch, - process - ), + SoftwareProductComponentProcessesActionHelper.openEditor(dispatch, { + isReadOnlyMode: false, + componentId, + softwareProductId, + version + }), + onEditProcess: (process, isReadOnlyMode) => + SoftwareProductComponentProcessesActionHelper.openEditor(dispatch, { + process, + isReadOnlyMode, + componentId, + softwareProductId, + version + }), onDeleteProcess: process => dispatch({ type: modalActionTypes.GLOBAL_MODAL_WARNING, diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentsProcessesListView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentsProcessesListView.jsx index 8fa2bffb27..fe6b8a86de 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentsProcessesListView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/components/processes/SoftwareProductComponentsProcessesListView.jsx @@ -1,23 +1,21 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import React from 'react'; import PropTypes from 'prop-types'; import i18n from 'nfvo-utils/i18n/i18n.js'; -import Modal from 'nfvo-components/modal/Modal.jsx'; -import SoftwareProductProcessesEditor from './SoftwareProductComponentProcessesEditor.js'; import SoftwareProductProcessListView from 'sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessListView.jsx'; class SoftwareProductProcessesView extends React.Component { @@ -42,7 +40,6 @@ class SoftwareProductProcessesView extends React.Component {
    - {this.renderEditor()} ); } - - renderEditor() { - let { - softwareProductId, - version, - componentId, - isReadOnlyMode, - isDisplayModal, - isModalInEditMode - } = this.props; - return ( - - - - {isModalInEditMode - ? i18n('Edit Process Details') - : i18n('Create New Process Details')} - - - - - - - ); - } } export default SoftwareProductProcessesView; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/creation/SoftwareProductCreationView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/creation/SoftwareProductCreationView.jsx index c9693d4f93..e4a9893f61 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/creation/SoftwareProductCreationView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/creation/SoftwareProductCreationView.jsx @@ -81,6 +81,7 @@ class SoftwareProductCreationView extends React.Component { isValid={this.props.isFormValid} submitButtonText={i18n('Create')} formReady={this.props.formReady} + btnClassName="sdc-modal__footer" onValidateForm={() => this.validate()}> @@ -321,6 +322,7 @@ const OnboardingProcedure = ({ } type="radio" data-test-id="new-vsp-creation-procedure-manual" + groupClassName="no-bottom-margin" /> diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeploymentActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeploymentActionHelper.js index 44b25311e0..769596ea8d 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeploymentActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/SoftwareProductDeploymentActionHelper.js @@ -1,3 +1,18 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ import { actionTypes } from './SoftwareProductDeploymentConstants.js'; import { actionTypes as GlobalModalActions } from 'nfvo-components/modal/GlobalModalConstants.js'; import { modalContentMapper } from 'sdc-app/common/modal/ModalContentMapper.js'; @@ -171,7 +186,7 @@ const SoftwareProductDeploymentActionHelper = { data: { modalComponentName: modalContentMapper.DEPLOYMENT_FLAVOR_EDITOR, modalComponentProps: { softwareProductId, version }, - modalClassName, + bodyClassName: modalClassName, title: isEdit ? 'Edit Deployment Flavor' : 'Create a New Deployment Flavor' diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/editor/SoftwareProductDeploymentEditorView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/editor/SoftwareProductDeploymentEditorView.jsx index e44d2bd966..fd575693ac 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/editor/SoftwareProductDeploymentEditorView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/deployment/editor/SoftwareProductDeploymentEditorView.jsx @@ -1,3 +1,18 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * 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. + */ import React from 'react'; import i18n from 'nfvo-utils/i18n/i18n.js'; import Input from 'nfvo-components/input/validation/Input.jsx'; @@ -46,7 +61,8 @@ export default class SoftwareProductDeploymentEditorView extends React.Component onValidateForm={() => this.validate()} isValid={this.props.isFormValid} formReady={this.props.formReady} - className="vsp-deployment-editor"> + className="vsp-deployment-editor" + btnClassName="sdc-modal__footer"> onEditProcess(process)} + onSelect={() => onEditProcess(process, isReadOnlyMode)} onDelete={() => onDeleteProcess(process, version)}>
    {i18n('Name')}
    diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcesses.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcesses.js index fb44530dae..e00cafb64a 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcesses.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcesses.js @@ -1,17 +1,17 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import { connect } from 'react-redux'; import i18n from 'nfvo-utils/i18n/i18n.js'; @@ -38,9 +38,18 @@ export const mapStateToProps = ({ softwareProduct }) => { const mapActionsToProps = (dispatch, { softwareProductId, version }) => { return { onAddProcess: () => - SoftwareProductProcessesActionHelper.openEditor(dispatch), - onEditProcess: process => - SoftwareProductProcessesActionHelper.openEditor(dispatch, process), + SoftwareProductProcessesActionHelper.openEditor(dispatch, { + softwareProductId, + version, + isReadOnlyMode: false + }), + onEditProcess: (process, isReadOnlyMode) => + SoftwareProductProcessesActionHelper.openEditor(dispatch, { + process, + softwareProductId, + version, + isReadOnlyMode + }), onDeleteProcess: process => dispatch({ type: modalActionTypes.GLOBAL_MODAL_WARNING, diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesActionHelper.js index 7c72c5b892..0e586100b3 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesActionHelper.js @@ -1,21 +1,27 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +/* + * Copyright © 2016-2018 European Support Limited * * 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 + * 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. + * 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. */ import { actionTypes } from './SoftwareProductProcessesConstants.js'; import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js'; import Configuration from 'sdc-app/config/Configuration.js'; +import i18n from 'nfvo-utils/i18n/i18n.js'; +import { + actionTypes as modalActionTypes, + modalSizes +} from 'nfvo-components/modal/GlobalModalConstants.js'; +import { modalContentMapper } from 'sdc-app/common/modal/ModalContentMapper.js'; function baseUrl(vspId, version) { let { id: versionId } = version; @@ -73,10 +79,29 @@ const SoftwareProductActionHelper = { }); }); }, - openEditor(dispatch, process = {}) { + openEditor( + dispatch, + { process, softwareProductId, version, isReadOnlyMode } + ) { dispatch({ type: actionTypes.SOFTWARE_PRODUCT_PROCESS_EDITOR_OPEN, - process + process: process ? process : {} + }); + dispatch({ + type: modalActionTypes.GLOBAL_MODAL_SHOW, + data: { + modalComponentName: modalContentMapper.PROCESS_EDITOR, + modalComponentProps: { + version, + softwareProductId, + isReadOnlyMode, + size: modalSizes.LARGE + }, + bodyClassName: 'edit-process-modal', + title: process + ? i18n('Edit Process Details') + : i18n('Create New Process Details') + } }); }, @@ -95,6 +120,9 @@ const SoftwareProductActionHelper = { dispatch({ type: actionTypes.SOFTWARE_PRODUCT_PROCESS_EDITOR_CLOSE }); + dispatch({ + type: modalActionTypes.GLOBAL_MODAL_CLOSE + }); }, saveProcess( diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesEditorForm.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesEditorForm.jsx index 6e8254f65b..a858e0f07e 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesEditorForm.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesEditorForm.jsx @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * 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. @@ -70,7 +70,8 @@ class SoftwareProductProcessesEditorForm extends React.Component { isValid={this.props.isFormValid} formReady={this.props.formReady} onValidateForm={() => this.props.onValidateForm()} - className="vsp-processes-editor"> + className="vsp-processes-editor" + btnClassName="sdc-modal__footer">
    onDataChanged({ description }) } @@ -169,6 +170,7 @@ class SoftwareProductProcessesEditorForm extends React.Component { label={i18n('Process Type')} className="process-type" data-test-id="process-type" + groupClassName="no-bottom-margin" isValid={ genericFieldInfo.type.isValid } diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesView.jsx index 1357c31e12..50421bc824 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesView.jsx @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * 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. @@ -16,8 +16,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import i18n from 'nfvo-utils/i18n/i18n.js'; -import Modal from 'nfvo-components/modal/Modal.jsx'; -import SoftwareProductProcessesEditor from './SoftwareProductProcessesEditor.js'; import SoftwareProductProcessListView from './SoftwareProductProcessListView.jsx'; class SoftwareProductProcessesView extends React.Component { @@ -37,7 +35,6 @@ class SoftwareProductProcessesView extends React.Component { render() { return (
    - {this.renderEditor()} ); } - - renderEditor() { - let { - currentSoftwareProduct: { id }, - version, - isModalInEditMode, - isReadOnlyMode, - isDisplayEditor - } = this.props; - return ( - - - - {isModalInEditMode - ? i18n('Edit Process Details') - : i18n('Create New Process Details')} - - - - - - - ); - } } export default SoftwareProductProcessesView; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/vnfMarketPlace/VNFImportView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/vnfMarketPlace/VNFImportView.jsx index 3a90c8042f..a33e0ede10 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/vnfMarketPlace/VNFImportView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/vnfMarketPlace/VNFImportView.jsx @@ -245,7 +245,7 @@ class VNFImportView extends React.Component { -- cgit 1.2.3-korg