aboutsummaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Expand)AuthorFilesLines
2018-05-30Merge "Support multiple customer instantiation"Gary Wu6-307/+367
2018-05-30Support multiple customer instantiationKang Xi6-307/+367
2018-05-29Merge "Fixed errors"Gary Wu2-4/+4
2018-05-29Merge "Correction in created message."Gary Wu3-23/+36
2018-05-28Correction in created message.Pawel Kadlubanski3-23/+36
2018-05-28Fix integration: remove deploy propertiesehautot2-4/+4
2018-05-28Fixed errorsMariusz Wagner2-4/+4
2018-05-25Merge "Correction in pom."Gary Wu1-1/+3
2018-05-25Correction of testplan.txt Init PRH testcasewejs1-1/+1
2018-05-25Correction in pom.Pawel Kadlubanski1-1/+3
2018-05-25Initial testcase with docker-compose for PRHwejs9-0/+2186
2018-05-24Clean up deprecated DCAE parameters from R2Gary Wu4-148/+1
2018-05-24Update APPC CSIT credentials for robot test casesAaron Hay3-6/+6
2018-05-24Merge "Add docker hub address."Gary Wu1-1/+1
2018-05-24Initial commit with robotframeworkMariusz Wagner8-0/+323
2018-05-24Add docker hub address.Pawel Kadlubanski1-1/+1
2018-05-23Clean up heat template env filesGary Wu4-16/+0
2018-05-23Update to support new SO NBI APIKang Xi2-16/+53
2018-05-23Merge "Update in pnfsimulator code."Gary Wu15-332/+189
2018-05-23Update in pnfsimulator code.Pawel Kadlubanski15-332/+189
2018-05-22Update appc image version to next versionPatrick Brady1-1/+1
2018-05-22Merge "Clean up HEAT health check script"Helen Chen1-2/+4
2018-05-22Merge "Fix integration tests: string truncated by robotf"Anaƫl Closson1-1/+1
2018-05-22Fix integration tests: string truncated by robotfehautot1-1/+1
2018-05-22Update HEAT env to match template changesGary Wu4-4/+4
2018-05-21Clean up HEAT health check scriptGary Wu1-2/+4
2018-05-18Fix AAI mocking call for Multicloud HPA CSITVictor Morales1-2/+7
2018-05-18Use OAM network for Robot public_net in TLAB HEATGary Wu1-0/+1
2018-05-17Update deploy scripts to use new boot artifactsGary Wu4-8/+14
2018-05-17Merge "Correction problem with license."Gary Wu15-6/+301
2018-05-17Correction problem with license.Pawel Kadlubanski15-6/+301
2018-05-16Add xtesting to official ONAP repomrichomme4-0/+261
2018-05-15Fix integration tests: removed eventNameehautot1-1/+1
2018-05-14Correct ExternalAPI-NBI CSITEric Debeau1-0/+3
2018-05-11Correction problem in pom.xml in pnf simulatorPawel Kadlubanski1-25/+27
2018-05-11Add pnf simulatorPawel Kadlubanski18-0/+931
2018-05-10Merge "CSIT for Multicloud-Ocata HPA"
/*!
 * 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.
 */
import {connect} from 'react-redux';

import i18n from 'nfvo-utils/i18n/i18n.js';
import VersionControllerUtils from 'nfvo-components/panel/versionController/VersionControllerUtils.js';
import TabulatedEditor from 'src/nfvo-components/editor/TabulatedEditor.jsx';

import {enums} from 'sdc-app/onboarding/OnboardingConstants.js';
import OnboardingActionHelper from 'sdc-app/onboarding/OnboardingActionHelper.js';

import {navigationItems, mapScreenToNavigationItem, onboardingMethod as onboardingMethodTypes} from './SoftwareProductConstants.js';
import SoftwareProductActionHelper from './SoftwareProductActionHelper.js';
import SoftwareProductComponentsActionHelper from './components/SoftwareProductComponentsActionHelper.js';
import SoftwareProductDependenciesActionHelper from './dependencies/SoftwareProductDependenciesActionHelper.js';
import {doesHeatDataExist} from './attachments/SoftwareProductAttachmentsUtils.js';

import HeatSetupActionHelper from './attachments/setup/HeatSetupActionHelper.js';
import { actionsEnum as versionControllerActions } from 'nfvo-components/panel/versionController/VersionControllerConstants.js';

function getActiveNavigationId(
9-82/+0
2018-05-07Update CCSDK image used by APPC CSITAaron Hay1-1/+1
2018-05-07Merge "CSIT tests for SO vCPE/OOF/HPA"Gary Wu4-41/+250
2018-05-04Clean up obsolete rc filesGary Wu9-82/+0
2018-05-03Adding heat based deployment for smsGary Wu2-0/+2
2018-05-03Merge "Fix nbi container init error"Gary Wu1-4/+19
2018-05-03Add output values for k8s IP addressesGary Wu1-3/+3
class="nx">id: navigationItems.IMAGES + '|' + componentId, name: i18n('Images'), disabled: false, meta }, { id: navigationItems.PROCESS_DETAILS + '|' + componentId, name: i18n('Process Details'), disabled: false, meta }, { id: navigationItems.MONITORING + '|' + componentId, name: i18n('Monitoring'), disabled: false, meta } ]); return groups; }; const buildNavigationBarProps = ({softwareProduct, meta, screen, componentId, componentsList, mapOfExpandedIds}) => { const {softwareProductEditor: {data: currentSoftwareProduct = {}}} = softwareProduct; const {id, name, onboardingMethod} = currentSoftwareProduct; const groups = [{ id: id, name: name, items: [ { id: navigationItems.VENDOR_SOFTWARE_PRODUCT, name: i18n('Overview'), disabled: false, meta }, { id: navigationItems.GENERAL, name: i18n('General'), disabled: false, meta }, { id: navigationItems.DEPLOYMENT_FLAVORS, name: i18n('Deployment Flavors'), disabled: false, hidden: onboardingMethod !== onboardingMethodTypes.MANUAL, meta }, { id: navigationItems.PROCESS_DETAILS, name: i18n('Process Details'), disabled: false, meta }, { id: navigationItems.NETWORKS, name: i18n('Networks'), disabled: false, meta }, { id: navigationItems.ATTACHMENTS, name: i18n('Attachments'), disabled: false, hidden: !doesHeatDataExist(meta.heatSetup), meta }, { id: navigationItems.ACTIVITY_LOG, name: i18n('Activity Log'), disabled: false, meta }, { id: navigationItems.DEPENDENCIES, name: i18n('Component Dependencies'), hidden: componentsList.length <= 1, disabled: false, meta }, { id: navigationItems.COMPONENTS, name: i18n('Components'), hidden: componentsList.length <= 0, meta, expanded: mapOfExpandedIds[navigationItems.COMPONENTS] === true && screen !== enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE, items: [ ...componentsList.map(({id, displayName}) => ({ id: navigationItems.COMPONENTS + '|' + id, name: displayName, meta, expanded: mapOfExpandedIds[navigationItems.COMPONENTS + '|' + id] === true && screen !== enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE, items: buildComponentNavigationBarGroups({componentId: id, meta}) })) ] } ] }]; let activeItemId = getActiveNavigationId(screen, componentId); return { activeItemId, groups }; }; const buildVersionControllerProps = (softwareProduct) => { const {softwareProductEditor} = softwareProduct; const {data: currentSoftwareProduct = {}, isValidityData = true} = softwareProductEditor; const {version, viewableVersions, status: currentStatus, lockingUser} = currentSoftwareProduct; const {status, isCheckedOut} = VersionControllerUtils.getCheckOutStatusKindByUserID(currentStatus, lockingUser); return { status, isCheckedOut, version, viewableVersions, isFormDataValid: isValidityData }; }; function buildMeta({softwareProduct, componentId, softwareProductDependencies}) { const {softwareProductEditor, softwareProductComponents, softwareProductQuestionnaire, softwareProductAttachments} = softwareProduct; const {data: currentSoftwareProduct = {}} = softwareProductEditor; const {version} = currentSoftwareProduct; const isReadOnlyMode = VersionControllerUtils.isReadOnly(currentSoftwareProduct); const {qdata} = softwareProductQuestionnaire; const {heatSetup, heatSetupCache} = softwareProductAttachments; let currentComponentMeta = {}; if(componentId) { const {componentEditor: {data: componentData = {} , qdata: componentQdata}} = softwareProductComponents; currentComponentMeta = {componentData, componentQdata}; } const meta = {softwareProduct: currentSoftwareProduct, qdata, version, heatSetup, heatSetupCache, isReadOnlyMode, currentComponentMeta, softwareProductDependencies}; return meta; } const mapStateToProps = ({softwareProduct}, {currentScreen: {screen, props: {componentId}}}) => { const {softwareProductEditor, softwareProductComponents, softwareProductDependencies} = softwareProduct; const {mapOfExpandedIds = []} = softwareProductEditor; const {componentsList = []} = softwareProductComponents; const meta = buildMeta({softwareProduct, componentId, softwareProductDependencies}); return { versionControllerProps: buildVersionControllerProps(softwareProduct), navigationBarProps: buildNavigationBarProps({softwareProduct, meta, screen, componentId, componentsList, mapOfExpandedIds}), meta }; }; const autoSaveBeforeNavigate = ({dispatch, screen, softwareProductId, componentId, meta: {isReadOnlyMode, softwareProduct, version, qdata, softwareProductDependencies, currentComponentMeta: {componentData, componentQdata}}}) => { let promise; if (isReadOnlyMode) { promise = Promise.resolve(); } else { switch(screen) { case enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES: promise = SoftwareProductDependenciesActionHelper.saveDependencies(dispatch,{softwareProductId, version, dependenciesList: softwareProductDependencies}); case enums.SCREEN.SOFTWARE_PRODUCT_DETAILS: promise = SoftwareProductActionHelper.updateSoftwareProduct(dispatch, {softwareProduct, qdata}); break; case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_GENERAL: promise = SoftwareProductComponentsActionHelper.updateSoftwareProductComponent(dispatch, {softwareProductId, version, vspComponentId: componentId, componentData, qdata: componentQdata}); break; case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_COMPUTE: case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_STORAGE: case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_NETWORK: case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_IMAGES: case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING: promise = SoftwareProductComponentsActionHelper.updateSoftwareProductComponentQuestionnaire(dispatch, {softwareProductId, version, vspComponentId: componentId, qdata: componentQdata}); break; default: promise = Promise.resolve(); break; } } return promise; }; const onComponentNavigate = (dispatch, {id, softwareProductId, version, currentComponentId}) => { const [nextScreen, nextComponentId] = id.split('|'); switch(nextScreen) { case navigationItems.COMPONENTS: if(nextComponentId === currentComponentId) { OnboardingActionHelper.navigateToSoftwareProductComponents(dispatch, {softwareProductId}); } else { OnboardingActionHelper.navigateToSoftwareProductComponentGeneral(dispatch, {softwareProductId, componentId: nextComponentId, version}); } break; case navigationItems.GENERAL: OnboardingActionHelper.navigateToSoftwareProductComponentGeneral(dispatch, {softwareProductId, componentId: nextComponentId, version}); break; case navigationItems.COMPUTE: OnboardingActionHelper.navigateToComponentCompute(dispatch, {softwareProductId, componentId: nextComponentId, version}); break; case navigationItems.LOAD_BALANCING: OnboardingActionHelper.navigateToComponentLoadBalancing(dispatch, {softwareProductId, componentId: nextComponentId, version}); break; case navigationItems.NETWORKS: OnboardingActionHelper.navigateToComponentNetwork(dispatch, {softwareProductId, componentId: nextComponentId, version}); break; case navigationItems.IMAGES: OnboardingActionHelper.navigateToComponentImages(dispatch, {softwareProductId, componentId: nextComponentId, version}); break; case navigationItems.STORAGE: OnboardingActionHelper.navigateToComponentStorage(dispatch, {softwareProductId, componentId: nextComponentId, version}); break; case navigationItems.PROCESS_DETAILS: OnboardingActionHelper.navigateToSoftwareProductComponentProcesses(dispatch, {softwareProductId, componentId: nextComponentId, version}); break; case navigationItems.MONITORING: OnboardingActionHelper.navigateToSoftwareProductComponentMonitoring(dispatch, {softwareProductId, componentId: nextComponentId, version}); break; } }; const mapActionsToProps = (dispatch, {currentScreen: {screen, props: {softwareProductId, componentId: currentComponentId}}}) => { const props = { onVersionSwitching: (version, meta) => { SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {softwareProductId, version}); props.onNavigate({id: getActiveNavigationId(screen, currentComponentId), meta, version}); }, onToggle: (groups, itemIdToExpand) => groups.map(({items}) => SoftwareProductActionHelper.toggleNavigationItems(dispatch, {items, itemIdToExpand})), onNavigate: ({id, meta, version}) => { let {heatSetup, heatSetupCache} = meta; let heatSetupPopupPromise = screen === enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS ? HeatSetupActionHelper.heatSetupLeaveConfirmation(dispatch, {softwareProductId, heatSetup, heatSetupCache}) : Promise.resolve(); let preNavigate = meta ? autoSaveBeforeNavigate({dispatch, screen, meta, softwareProductId, componentId: currentComponentId}) : Promise.resolve(); version = version || (meta ? meta.version : undefined); Promise.all([preNavigate, heatSetupPopupPromise]).then(() => { switch(id) { case navigationItems.VENDOR_SOFTWARE_PRODUCT: OnboardingActionHelper.navigateToSoftwareProductLandingPage(dispatch, {softwareProductId, version}); break; case navigationItems.GENERAL: OnboardingActionHelper.navigateToSoftwareProductDetails(dispatch, {softwareProductId, version}); break; case navigationItems.DEPLOYMENT_FLAVORS: OnboardingActionHelper.navigateToSoftwareProductDeployment(dispatch, {softwareProductId, version}); break; case navigationItems.PROCESS_DETAILS: OnboardingActionHelper.navigateToSoftwareProductProcesses(dispatch, {softwareProductId, version}); break; case navigationItems.NETWORKS: OnboardingActionHelper.navigateToSoftwareProductNetworks(dispatch, {softwareProductId, version}); break; case navigationItems.DEPENDENCIES: OnboardingActionHelper.navigateToSoftwareProductDependencies(dispatch, {softwareProductId, version}); break; case navigationItems.ATTACHMENTS: OnboardingActionHelper.navigateToSoftwareProductAttachments(dispatch, {softwareProductId, version}); break; case navigationItems.COMPONENTS: OnboardingActionHelper.navigateToSoftwareProductComponents(dispatch, {softwareProductId, version}); break; case navigationItems.ACTIVITY_LOG: OnboardingActionHelper.navigateToSoftwareProductActivityLog(dispatch, {softwareProductId, version}); break; default: onComponentNavigate(dispatch, {id, softwareProductId, version, screen, currentComponentId}); break; } }).catch((e) => {console.error(e);}); } }; switch (screen) { case enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE: case enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS: case enums.SCREEN.SOFTWARE_PRODUCT_PROCESSES: case enums.SCREEN.SOFTWARE_PRODUCT_NETWORKS: case enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES: case enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG: case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS: case enums.SCREEN.SOFTWARE_PRODUCT_DEPLOYMENT: case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_PROCESSES: case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_MONITORING: props.onSave = () => { return Promise.resolve(); }; break; default: props.onSave = ({softwareProduct, qdata}) => SoftwareProductActionHelper.updateSoftwareProduct(dispatch, {softwareProduct, qdata}); break; } props.onVersionControllerAction = (action, version, meta) => { let {heatSetup, heatSetupCache} = meta; let heatSetupPopupPromise = screen === enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS && action === versionControllerActions.CHECK_IN ? HeatSetupActionHelper.heatSetupLeaveConfirmation(dispatch, {softwareProductId, heatSetup, heatSetupCache}) : Promise.resolve(); heatSetupPopupPromise.then(() => { return SoftwareProductActionHelper.performVCAction(dispatch, {softwareProductId, action, version}).then(({newVersion}) => { //props.onNavigate({id: getActiveNavigationId(screen, currentComponentId), version}); if(screen === enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG) { OnboardingActionHelper.navigateToSoftwareProductActivityLog(dispatch, {softwareProductId, version: newVersion}); } }); }).catch((e) => {console.error(e);}); }; return props; }; export default connect(mapStateToProps, mapActionsToProps)(TabulatedEditor);