diff options
Diffstat (limited to 'openecomp-ui')
24 files changed, 307 insertions, 171 deletions
diff --git a/openecomp-ui/package.json b/openecomp-ui/package.json index 82b5dea888..0d22c479db 100644 --- a/openecomp-ui/package.json +++ b/openecomp-ui/package.json @@ -2,7 +2,7 @@ "name": "dox-ui", "version": "1.0.0", "description": "", - "author": "OPENECOMP", + "author": "ECOMP", "license": "SEE LICENSE IN LICENSE", "scripts": { "start": "gulp dev && webpack-dev-server --progress", @@ -21,13 +21,12 @@ "dependencies": { "classnames": "^2.2.5", "core-js": "^2.4.0", - "d3": "^4.10.0", + "d3": "^3.5.16", "dox-sequence-diagram-ui": "file:../dox-sequence-diagram-ui", "intl": "^1.0.1", "intl-format-cache": "^2.0.5", "intl-messageformat": "^1.2.0", "intl-relativeformat": "^1.2.0", - "jquery": "^2.1.4", "lodash": "^4.13.1", "md5": "^2.1.0", "randomstring": "^1.1.5", @@ -36,7 +35,7 @@ "react-dom": "~15.3.2", "react-dropzone": "3.7.3", "react-redux": "^4.4.1", - "react-select": "^1.0.0-beta13", + "react-select": "1.0.0-rc.5", "react-sortable": "^1.2.0", "redux": "^3.3.1", "restful-js": "^0.7.0", diff --git a/openecomp-ui/pom.xml b/openecomp-ui/pom.xml index 026f129b93..2920832b17 100644 --- a/openecomp-ui/pom.xml +++ b/openecomp-ui/pom.xml @@ -1,5 +1,6 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.openecomp.sdc</groupId> @@ -14,11 +15,12 @@ <relativePath>../onboarding</relativePath> </parent> + <properties> + <maven.war.plugin.version>3.0.0</maven.war.plugin.version> + </properties> + <build> <plugins> - <!-- ============================================= --> - <!-- Clean dist folder --> - <!-- ============================================= --> <plugin> <artifactId>maven-clean-plugin</artifactId> <version>2.6.1</version> @@ -38,10 +40,12 @@ <directory>${basedir}/node_modules</directory> </fileset> <fileset> - <directory>${basedir}/../dox-sequence-diagram-ui/dist</directory> + <directory>${basedir}/../dox-sequence-diagram-ui/dist + </directory> </fileset> <fileset> - <directory>${basedir}/../dox-sequence-diagram-ui/node_modules</directory> + <directory>${basedir}/../dox-sequence-diagram-ui/node_modules + </directory> </fileset> </filesets> </configuration> @@ -58,8 +62,8 @@ <version>1.4</version> <configuration> - <installDirectory>${project.parent.parent.basedir}</installDirectory> - </configuration> + <installDirectory>${project.parent.parent.basedir}</installDirectory> + </configuration> <executions> @@ -75,13 +79,13 @@ </execution> <execution> - <id>npm set progress off</id> - <goals> - <goal>npm</goal> - </goals> - <configuration> - <arguments>set progress=false</arguments> - </configuration> + <id>npm set progress off</id> + <goals> + <goal>npm</goal> + </goals> + <configuration> + <arguments>set progress=false</arguments> + </configuration> </execution> <execution> @@ -90,11 +94,34 @@ <goal>npm</goal> </goals> <configuration> - <workingDirectory>${project.basedir}/../dox-sequence-diagram-ui</workingDirectory> + <workingDirectory>${project.basedir}/../dox-sequence-diagram-ui + </workingDirectory> <arguments>install</arguments> </configuration> </execution> + <!-- Fix jQuery dependency in restful-js --> + <execution> + <id>npm restful-js</id> + <goals> + <goal>npm</goal> + </goals> + <configuration> + <arguments>install restful-js</arguments> + </configuration> + </execution> + <execution> + <id>npm install restful-js dependencies</id> + <goals> + <goal>npm</goal> + </goals> + <configuration> + <workingDirectory>${project.basedir}/node_modules/restful-js + </workingDirectory> + <arguments>install --production</arguments> + </configuration> + </execution> + <execution> <id>npm install</id> <goals> @@ -143,11 +170,27 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> - <version>3.0.0</version> + <version>${maven.war.plugin.version}</version> + <configuration> + <webResources> + <resource> + <directory>${basedir}/target/dist</directory> + </resource> + </webResources> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>${maven.war.plugin.version}</version> <configuration> + <webXml>webapp-onboarding\WEB-INF\web.xml</webXml> <webResources> <resource> - <directory>${basedir}/target/dist</directory> + <directory>external-resources/healthcheck</directory> + <includes> + <include>v1.0/healthcheck</include> + </includes> </resource> </webResources> </configuration> diff --git a/openecomp-ui/resources/scss/components/_submitErrorResponse.scss b/openecomp-ui/resources/scss/components/_submitErrorResponse.scss index ac5dd278b0..cd5284059d 100644 --- a/openecomp-ui/resources/scss/components/_submitErrorResponse.scss +++ b/openecomp-ui/resources/scss/components/_submitErrorResponse.scss @@ -32,7 +32,7 @@ .collapse-right { .svg-icon { &.__chevronDown { - transform: rotate(270deg); + transform: rotate(270deg); } } } diff --git a/openecomp-ui/resources/scss/modules/_softwareProductAttachmentPage.scss b/openecomp-ui/resources/scss/modules/_softwareProductAttachmentPage.scss index bd47fbb334..c8d8cf4e0b 100644 --- a/openecomp-ui/resources/scss/modules/_softwareProductAttachmentPage.scss +++ b/openecomp-ui/resources/scss/modules/_softwareProductAttachmentPage.scss @@ -1,27 +1,27 @@ .vsp-attachments-view { position: relative; - #attachments-tabs { - .nav-tabs { - background-color: $tlv-gray; - box-shadow: none; - border-bottom: 1px solid $light-gray; - & > li { - & > a { - @extend .heading-2; - padding-left: 0; - padding-right: 0; - margin-right: 40px; - }; - &.active > a {color: $blue;}; - } - } - } + #attachments-tabs { + .nav-tabs { + background-color: $tlv-gray; + box-shadow: none; + border-bottom: 1px solid $light-gray; + & > li { + & > a { + @extend .heading-2; + padding-left: 0; + padding-right: 0; + margin-right: 40px; + }; + &.active > a {color: $blue;}; + } + } + } .attachments-view-controllers { position: absolute; right: 40px; top: 15px; - display: flex; + display: flex; .icon-component { diff --git a/openecomp-ui/resources/scss/modules/_softwareProductLandingPage.scss b/openecomp-ui/resources/scss/modules/_softwareProductLandingPage.scss index 9b0375d24a..28b54cc78f 100644 --- a/openecomp-ui/resources/scss/modules/_softwareProductLandingPage.scss +++ b/openecomp-ui/resources/scss/modules/_softwareProductLandingPage.scss @@ -164,27 +164,29 @@ color: $light-blue; } } - .software-product-landing-view-top-block-col-upl { - @extend .flex; - text-align: center; - flex-direction: column; - justify-content: center; - border: 2px dashed $light-gray; - margin-bottom: 20px; - @extend .body-1; - align-items: center; - .upload-btn { - padding: 15px 55px; + } - } - .drag-text { - color: $blue; - @extend .body-1-semibold; - } - .or-text { - margin-top: 10px; - margin-bottom: 10px; - } + .software-product-landing-view-top-block-col-upl { + @extend .flex; + height: 215px; + text-align: center; + flex-direction: column; + justify-content: center; + border: 2px dashed $light-gray; + margin-bottom: 20px; + @extend .body-1; + align-items: center; + .upload-btn { + padding: 15px 55px; + + } + .drag-text { + color: $blue; + @extend .body-1-semibold; + } + .or-text { + margin-top: 10px; + margin-bottom: 10px; } } } diff --git a/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx b/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx index 8d45d86a9d..40daeff9c5 100644 --- a/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx +++ b/openecomp-ui/src/nfvo-components/SubmitErrorResponse.jsx @@ -115,7 +115,7 @@ const UploadErrorList = ({items}) => { {item.list.map((error, i) => <ErrorMessage key={i} warning={error.level === 'WARNING'} error={error.message}/> )} </div> );} - + return ( <div> {errors} @@ -152,10 +152,10 @@ const ErrorHeader = ({errorType, collapsed, onClick}) => { const ErrorMessage = ({error, warning}) => { return ( <ListGroupItem className='error-code-list-item'> - <SVGIcon - name={warning ? 'exclamationTriangleLine' : 'error'} - color={warning ? 'warning' : 'negative'} /> - <span className='icon-label'>{error}</span> + <SVGIcon + name={warning ? 'exclamationTriangleLine' : 'error'} + color={warning ? 'warning' : 'negative'} /> + <span className='icon-label'>{error}</span> </ListGroupItem> ); }; diff --git a/openecomp-ui/src/nfvo-utils/i18n/i18n.js b/openecomp-ui/src/nfvo-utils/i18n/i18n.js index 2f63dfe605..ef97b8bab4 100644 --- a/openecomp-ui/src/nfvo-utils/i18n/i18n.js +++ b/openecomp-ui/src/nfvo-utils/i18n/i18n.js @@ -14,14 +14,16 @@ * permissions and limitations under the License. */ import IntlObj from 'intl'; +import IntlMessageFormatObj from 'intl-messageformat'; import IntlRelativeFormatObj from 'intl-relativeformat'; import createFormatCacheObj from 'intl-format-cache'; import i18nJson from 'i18nJson'; /* - Intl libs are using out dated transpailer from ecmascript6. -* TODO: As soon as they fix it, remove this assignments!!! -* */ + Intl libs are using out dated transpailer from ecmascript6. + * TODO: As soon as they fix it, remove this assignments!!! + * */ var Intl = window.Intl || IntlObj.default, + IntlMessageFormat = IntlMessageFormatObj.default, IntlRelativeFormat = IntlRelativeFormatObj.default, createFormatCache = createFormatCacheObj.default; @@ -68,11 +70,15 @@ var i18n = { dateRelative(date, options) { return createFormatCache(IntlRelativeFormat)(this._locale, options).format(date); }, - message(messageId) { + message(messageId, options) { + let messageTxt = null; if (i18nJson && i18nJson[messageId]) { - return i18nJson[messageId]; + messageTxt = i18nJson[messageId]; + } else { + messageTxt = String(messageId); } - return messageId; + return createFormatCache(IntlMessageFormat)(messageTxt, this._locale).format(options); + }, getLocale() { return this._locale; diff --git a/openecomp-ui/src/sdc-app/onboarding/OnboardingActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/OnboardingActionHelper.js index 24ba05e303..fc65083bff 100644 --- a/openecomp-ui/src/sdc-app/onboarding/OnboardingActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/OnboardingActionHelper.js @@ -31,11 +31,13 @@ import OnboardActionHelper from './onboard/OnboardActionHelper.js'; import SoftwareProductComponentsMonitoringAction from './softwareProduct/components/monitoring/SoftwareProductComponentsMonitoringActionHelper.js'; import {actionTypes, enums} from './OnboardingConstants.js'; import SoftwareProductComponentsImageActionHelper from './softwareProduct/components/images/SoftwareProductComponentsImageActionHelper.js'; -import {navigationItems as SoftwareProductNavigationItems, actionTypes as SoftwareProductActionTypes} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js'; +import {navigationItems as SoftwareProductNavigationItems, actionTypes as SoftwareProductActionTypes, onboardingOriginTypes} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js'; import ActivityLogActionHelper from 'sdc-app/common/activity-log/ActivityLogActionHelper.js'; import licenseModelOverviewActionHelper from 'sdc-app/onboarding/licenseModel/overview/licenseModelOverviewActionHelper.js'; import store from 'sdc-app/AppStore.js'; import {selectedButton as licenseModelOverviewSelectedButton} from 'sdc-app/onboarding/licenseModel/overview/LicenseModelOverviewConstants.js'; +import {tabsMapping as attachmentsTabsMapping} from 'sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsConstants.js'; +import SoftwareProductAttachmentsActionHelper from 'sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsActionHelper.js'; function setCurrentScreen(dispatch, screen, props = {}) { dispatch({ @@ -165,7 +167,9 @@ export default { SoftwareProductActionHelper.loadSoftwareProductDetailsData(dispatch, {licenseModelId, licensingVersion}); SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(dispatch, {softwareProductId, version: newVersion}); - SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {softwareProductId, version: newVersion}); + if(response[0].onboardingOrigin === onboardingOriginTypes.ZIP) { + SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {softwareProductId, version: newVersion}); + } setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE, {softwareProductId, licenseModelId, version: newVersion}); }); }, @@ -175,11 +179,19 @@ export default { setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DETAILS, {softwareProductId, version}); }, - navigateToSoftwareProductAttachments(dispatch, {softwareProductId, version}) { + navigateToSoftwareProductAttachmentsSetupTab(dispatch, {softwareProductId, version}) { SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {softwareProductId, version}); + SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {activeTab: attachmentsTabsMapping.SETUP}); setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {softwareProductId, version}); }, + navigateToSoftwareProductAttachmentsValidationTab(dispatch, {softwareProductId, version}) { + SoftwareProductActionHelper.processAndValidateHeatCandidate(dispatch, {softwareProductId, version}).then(() => { + SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {activeTab: attachmentsTabsMapping.VALIDATION}); + setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {softwareProductId, version}); + }); + }, + navigateToSoftwareProductProcesses(dispatch, {softwareProductId, version}) { if (softwareProductId) { SoftwareProductProcessesActionHelper.fetchProcessesList(dispatch, {softwareProductId, version}); diff --git a/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx b/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx index aea5fc6406..c1f3251281 100644 --- a/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx @@ -28,7 +28,6 @@ import Onboard from './onboard/Onboard.js'; import LicenseModel from './licenseModel/LicenseModel.js'; import LicenseModelOverview from './licenseModel/overview/LicenseModelOverview.js'; import ActivityLog from 'sdc-app/common/activity-log/ActivityLog.js'; -import {doesHeatDataExist} from './softwareProduct/attachments/SoftwareProductAttachmentsUtils.js'; import LicenseAgreementListEditor from './licenseModel/licenseAgreement/LicenseAgreementListEditor.js'; import FeatureGroupListEditor from './licenseModel/featureGroups/FeatureGroupListEditor.js'; @@ -55,7 +54,8 @@ import SoftwareProductComponentsMonitoring from './softwareProduct/components/mo import { navigationItems as SoftwareProductNavigationItems, onboardingMethod as onboardingMethodTypes, - actionTypes as SoftwareProductActionTypes + actionTypes as SoftwareProductActionTypes, + onboardingOriginTypes } from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js'; import {statusEnum as VCItemStatus} from 'nfvo-components/panel/versionController/VersionControllerConstants.js'; @@ -314,7 +314,12 @@ export default class OnboardingPunchOut { OnboardingActionHelper.navigateToSoftwareProductDetails(dispatch, {softwareProductId, version: currentSoftwareProductVersion}); break; case enums.BREADCRUMS.SOFTWARE_PRODUCT_ATTACHMENTS: - OnboardingActionHelper.navigateToSoftwareProductAttachments(dispatch, {softwareProductId, version: currentSoftwareProductVersion}); + if(softwareProduct.onboardingOrigin === onboardingOriginTypes.ZIP) { + OnboardingActionHelper.navigateToSoftwareProductAttachmentsSetupTab(dispatch, {softwareProductId, version: currentSoftwareProductVersion}); + } + else if(softwareProduct.onboardingOrigin === onboardingOriginTypes.CSAR) { + OnboardingActionHelper.navigateToSoftwareProductAttachmentsValidationTab(dispatch, {softwareProductId, version: currentSoftwareProductVersion}); + } break; case enums.BREADCRUMS.SOFTWARE_PRODUCT_PROCESSES: OnboardingActionHelper.navigateToSoftwareProductProcesses(dispatch, {softwareProductId, version: currentSoftwareProductVersion}); @@ -415,9 +420,9 @@ export default class OnboardingPunchOut { handleStoreChange() { let {currentScreen, licenseModelList, softwareProductList, softwareProduct: {softwareProductEditor: {data = {onboardingMethod: ''}}, - softwareProductComponents: {componentsList}, softwareProductAttachments: {heatSetup}}} = store.getState(); - let {onboardingMethod} = data; - let breadcrumbsData = {onboardingMethod, currentScreen, licenseModelList, softwareProductList, componentsList, heatSetup}; + softwareProductComponents: {componentsList}}} = store.getState(); + let {onboardingMethod, onboardingOrigin} = data; + let breadcrumbsData = {onboardingMethod, currentScreen, licenseModelList, softwareProductList, componentsList, onboardingOrigin}; if (currentScreen.forceBreadCrumbsUpdate || !isEqual(breadcrumbsData, this.prevBreadcrumbsData) || this.breadcrumbsPrefixSelected) { this.prevBreadcrumbsData = breadcrumbsData; this.breadcrumbsPrefixSelected = false; @@ -434,7 +439,7 @@ export default class OnboardingPunchOut { } } - buildBreadcrumbs({currentScreen: {screen, props}, onboardingMethod, licenseModelList, softwareProductList, componentsList, heatSetup}) { + buildBreadcrumbs({currentScreen: {screen, props}, onboardingMethod, licenseModelList, softwareProductList, componentsList, onboardingOrigin}) { let screenToBreadcrumb; switch (screen) { case enums.SCREEN.ONBOARDING_CATALOG: @@ -593,7 +598,7 @@ export default class OnboardingPunchOut { key: enums.BREADCRUMS.SOFTWARE_PRODUCT_COMPONENTS, displayText: i18n('Components') }].filter(item => { - let isHeatData = doesHeatDataExist(heatSetup); + let isHeatData = onboardingOrigin !== onboardingOriginTypes.NONE; let isManualMode = onboardingMethod === onboardingMethodTypes.MANUAL; switch (item.key) { case enums.BREADCRUMS.SOFTWARE_PRODUCT_ATTACHMENTS: diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProduct.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProduct.js index c9c95f359e..6426847cfc 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProduct.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProduct.js @@ -22,11 +22,10 @@ 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 {navigationItems, mapScreenToNavigationItem, onboardingMethod as onboardingMethodTypes, onboardingOriginTypes} 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'; @@ -86,7 +85,7 @@ const buildComponentNavigationBarGroups = ({componentId, meta}) => { const buildNavigationBarProps = ({softwareProduct, meta, screen, componentId, componentsList, mapOfExpandedIds}) => { const {softwareProductEditor: {data: currentSoftwareProduct = {}}} = softwareProduct; - const {id, name, onboardingMethod} = currentSoftwareProduct; + const {id, name, onboardingMethod, onboardingOrigin} = currentSoftwareProduct; const groups = [{ id: id, name: name, @@ -122,7 +121,7 @@ const buildNavigationBarProps = ({softwareProduct, meta, screen, componentId, co id: navigationItems.ATTACHMENTS, name: i18n('Attachments'), disabled: false, - hidden: !doesHeatDataExist(meta.heatSetup), + hidden: onboardingOrigin === onboardingOriginTypes.NONE, meta }, { id: navigationItems.ACTIVITY_LOG, @@ -175,7 +174,7 @@ const buildVersionControllerProps = (softwareProduct) => { function buildMeta({softwareProduct, componentId, softwareProductDependencies}) { const {softwareProductEditor, softwareProductComponents, softwareProductQuestionnaire, softwareProductAttachments} = softwareProduct; const {data: currentSoftwareProduct = {}} = softwareProductEditor; - const {version} = currentSoftwareProduct; + const {version, onboardingOrigin} = currentSoftwareProduct; const isReadOnlyMode = VersionControllerUtils.isReadOnly(currentSoftwareProduct); const {qdata} = softwareProductQuestionnaire; const {heatSetup, heatSetupCache} = softwareProductAttachments; @@ -184,7 +183,7 @@ function buildMeta({softwareProduct, componentId, softwareProductDependencies}) const {componentEditor: {data: componentData = {} , qdata: componentQdata}} = softwareProductComponents; currentComponentMeta = {componentData, componentQdata}; } - const meta = {softwareProduct: currentSoftwareProduct, qdata, version, heatSetup, heatSetupCache, isReadOnlyMode, currentComponentMeta, softwareProductDependencies}; + const meta = {softwareProduct: currentSoftwareProduct, qdata, version, onboardingOrigin, heatSetup, heatSetupCache, isReadOnlyMode, currentComponentMeta, softwareProductDependencies}; return meta; } @@ -280,7 +279,7 @@ const mapActionsToProps = (dispatch, {currentScreen: {screen, props: {softwarePr }, onToggle: (groups, itemIdToExpand) => groups.map(({items}) => SoftwareProductActionHelper.toggleNavigationItems(dispatch, {items, itemIdToExpand})), onNavigate: ({id, meta, version}) => { - let {heatSetup, heatSetupCache} = meta; + let {onboardingOrigin, heatSetup, heatSetupCache} = meta; let heatSetupPopupPromise = screen === enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS ? HeatSetupActionHelper.heatSetupLeaveConfirmation(dispatch, {softwareProductId, heatSetup, heatSetupCache}) : Promise.resolve(); @@ -307,7 +306,12 @@ const mapActionsToProps = (dispatch, {currentScreen: {screen, props: {softwarePr OnboardingActionHelper.navigateToSoftwareProductDependencies(dispatch, {softwareProductId, version}); break; case navigationItems.ATTACHMENTS: - OnboardingActionHelper.navigateToSoftwareProductAttachments(dispatch, {softwareProductId, version}); + if(onboardingOrigin === onboardingOriginTypes.ZIP) { + OnboardingActionHelper.navigateToSoftwareProductAttachmentsSetupTab(dispatch, {softwareProductId, version}); + } + else if(onboardingOrigin === onboardingOriginTypes.CSAR) { + OnboardingActionHelper.navigateToSoftwareProductAttachmentsValidationTab(dispatch, {softwareProductId, version}); + } break; case navigationItems.COMPONENTS: OnboardingActionHelper.navigateToSoftwareProductComponents(dispatch, {softwareProductId, version}); @@ -334,9 +338,7 @@ const mapActionsToProps = (dispatch, {currentScreen: {screen, props: {softwarePr 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(); - }; + props.onSave = () => Promise.resolve(); break; default: props.onSave = ({softwareProduct, qdata}) => SoftwareProductActionHelper.updateSoftwareProduct(dispatch, {softwareProduct, qdata}); diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js index d4bee0a876..41306a1c1a 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js @@ -20,7 +20,7 @@ import LicenseModelActionHelper from 'sdc-app/onboarding/licenseModel/LicenseMod import LicenseAgreementActionHelper from 'sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js'; import FeatureGroupsActionHelper from 'sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsActionHelper.js'; -import {actionTypes} from './SoftwareProductConstants.js'; +import {actionTypes, onboardingOriginTypes, PRODUCT_QUESTIONNAIRE, forms} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js'; import OnboardingActionHelper from 'sdc-app/onboarding/OnboardingActionHelper.js'; import SoftwareProductComponentsActionHelper from './components/SoftwareProductComponentsActionHelper.js'; import {actionsEnum as VersionControllerActionsEnum} from 'nfvo-components/panel/versionController/VersionControllerConstants.js'; @@ -29,10 +29,10 @@ import {actionTypes as featureGroupsActionConstants} from 'sdc-app/onboarding/li import {actionTypes as licenseAgreementActionTypes} from 'sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementConstants.js'; import {actionTypes as componentActionTypes} from './components/SoftwareProductComponentsConstants.js'; import ValidationHelper from 'sdc-app/common/helpers/ValidationHelper.js'; -import {PRODUCT_QUESTIONNAIRE} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js'; import {actionTypes as modalActionTypes} from 'nfvo-components/modal/GlobalModalConstants.js'; import {modalContentMapper} from 'sdc-app/common/modal/ModalContentMapper.js'; import {statusEnum} from 'nfvo-components/panel/versionController/VersionControllerConstants.js'; +import {actionTypes as commonActionTypes} from 'sdc-app/common/reducers/PlainDataReducerConstants.js'; function baseUrl() { const restPrefix = Configuration.get('restPrefix'); @@ -59,7 +59,9 @@ function putSoftwareProduct(softwareProduct) { licensingVersion: softwareProduct.licensingVersion && softwareProduct.licensingVersion.id ? softwareProduct.licensingVersion : {} , icon: softwareProduct.icon, licensingData: softwareProduct.licensingData, - onboardingMethod: softwareProduct.onboardingMethod + onboardingMethod: softwareProduct.onboardingMethod, + networkPackageName: softwareProduct.networkPackageName, + onboardingOrigin: softwareProduct.onboardingOrigin }); } @@ -267,7 +269,19 @@ const SoftwareProductActionHelper = { .then(() => uploadFile(softwareProductId, formData, version)) .then(response => { if (response.status === 'Success') { - OnboardingActionHelper.navigateToSoftwareProductAttachments(dispatch, {softwareProductId, version}); + dispatch({ + type: commonActionTypes.DATA_CHANGED, + deltaData: {onboardingOrigin: response.onboardingOrigin}, + formName: forms.VENDOR_SOFTWARE_PRODUCT_DETAILS + }); + switch(response.onboardingOrigin){ + case onboardingOriginTypes.ZIP: + OnboardingActionHelper.navigateToSoftwareProductAttachmentsSetupTab(dispatch, {softwareProductId, version}); + break; + case onboardingOriginTypes.CSAR: + OnboardingActionHelper.navigateToSoftwareProductAttachmentsValidationTab(dispatch, {softwareProductId, version}); + break; + } } else { throw new Error(parseUploadErrorMsg(response.errors)); diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js index 0379ee5d4a..2c094ac36a 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js @@ -39,7 +39,7 @@ export const navigationItems = keyMirror({ GENERAL: 'general', PROCESS_DETAILS: 'process-details', DEPLOYMENT_FLAVORS: 'deployment-flavor', - NETWORKS: 'networks', + NETWORKS: 'networks', IMAGES: 'images', ATTACHMENTS: 'attachments', ACTIVITY_LOG: 'activity-log', @@ -54,7 +54,13 @@ export const navigationItems = keyMirror({ export const onboardingMethod = { MANUAL: 'Manual', - HEAT: 'HEAT' + NETWORK_PACKAGE: 'NetworkPackage' +}; + +export const onboardingOriginTypes = { + NONE: 'none', + ZIP: 'zip', + CSAR: 'csar' }; export const forms = keyMirror({ diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductReducer.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductReducer.js index 977a76ac69..d7a6c2ef5c 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductReducer.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductReducer.js @@ -15,6 +15,7 @@ */ import {combineReducers} from 'redux'; import {actionTypes, PRODUCT_QUESTIONNAIRE} from './SoftwareProductConstants.js'; +import SoftwareProductAttachmentsReducer from './attachments/SoftwareProductAttachmentsReducer.js'; import HeatValidationReducer from './attachments/validation/HeatValidationReducer.js'; import HeatSetupReducer from './attachments/setup/HeatSetupReducer.js'; import {actionTypes as heatSetupActionTypes} from './attachments/setup/HeatSetupConstants.js'; @@ -48,6 +49,7 @@ import {IMAGE_QUESTIONNAIRE} from 'sdc-app/onboarding/softwareProduct/components export default combineReducers({ softwareProductAttachments: combineReducers({ + attachmentsDetails: SoftwareProductAttachmentsReducer, heatValidation: HeatValidationReducer, heatSetup: HeatSetupReducer, heatSetupCache: (state = {}, action) => action.type === heatSetupActionTypes.FILL_HEAT_SETUP_CACHE ? action.payload : state diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachments.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachments.js index 945de4fc36..f14c988866 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachments.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachments.js @@ -23,6 +23,7 @@ import {errorLevels} from 'sdc-app/onboarding/softwareProduct/attachments/valida import OnboardingActionHelper from 'sdc-app/onboarding/OnboardingActionHelper.js'; import HeatSetup from './setup/HeatSetup.js'; import {doesHeatDataExist} from './SoftwareProductAttachmentsUtils.js'; +import SoftwareProductAttachmentsActionHelper from './SoftwareProductAttachmentsActionHelper.js'; import VersionControllerUtils from 'nfvo-components/panel/versionController/VersionControllerUtils.js'; @@ -30,7 +31,7 @@ export const mapStateToProps = (state) => { let { softwareProduct: { softwareProductEditor:{data: currentSoftwareProduct = {}}, - softwareProductAttachments: {heatSetup, heatSetupCache, heatValidation : {errorList}} + softwareProductAttachments: {attachmentsDetails: {activeTab}, heatSetup, heatSetupCache, heatValidation : {errorList}} } } = state; @@ -47,7 +48,7 @@ export const mapStateToProps = (state) => { let isReadOnlyMode = currentSoftwareProduct && currentSoftwareProduct.version ? VersionControllerUtils.isReadOnly(currentSoftwareProduct) : false; - let {version} = currentSoftwareProduct; + let {version, onboardingOrigin} = currentSoftwareProduct; return { isValidationAvailable: unassigned.length === 0 && modules.length > 0, heatSetup, @@ -56,7 +57,9 @@ export const mapStateToProps = (state) => { goToOverview, HeatSetupComponent: HeatSetup, isReadOnlyMode, - version + version, + onboardingOrigin, + activeTab }; }; @@ -83,7 +86,8 @@ export const mapActionsToProps = (dispatch, {softwareProductId}) => { onProcessAndValidate: ({heatData, heatDataCache, isReadOnlyMode, version}) => { return HeatSetupActionHelper.processAndValidateHeat(dispatch, {softwareProductId, heatData, heatDataCache, isReadOnlyMode, version}); - } + }, + setActiveTab: ({activeTab}) => SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {activeTab}) }; }; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsActionHelper.js new file mode 100644 index 0000000000..ae4a615a40 --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsActionHelper.js @@ -0,0 +1,26 @@ +/*! + * 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 {actionTypes} from './SoftwareProductAttachmentsConstants'; + +export default { + setActiveTab(dispatch, {activeTab}) { + dispatch({ + type: actionTypes.SET_ACTIVE_TAB, + activeTab + }); + } +}; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsConstants.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsConstants.js index b0410d1566..67265909d7 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsConstants.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsConstants.js @@ -13,7 +13,13 @@ * or implied. See the License for the specific language governing * permissions and limitations under the License. */ +import keyMirror from 'nfvo-utils/KeyMirror.js'; + export const tabsMapping = { SETUP: 1, VALIDATION: 2 }; + +export const actionTypes = keyMirror({ + SET_ACTIVE_TAB: null +}); diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsReducer.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsReducer.js new file mode 100644 index 0000000000..5f6538ab7e --- /dev/null +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsReducer.js @@ -0,0 +1,25 @@ +/*! + * 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 {actionTypes} from './SoftwareProductAttachmentsConstants.js'; + +export default (state = [], action) => { + switch (action.type) { + case actionTypes.SET_ACTIVE_TAB: + return {activeTab: action.activeTab}; + default: + return state; + } +}; diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx index 3da26cc20f..8c59b2b1cc 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx @@ -20,34 +20,34 @@ import {tabsMapping} from './SoftwareProductAttachmentsConstants.js'; import i18n from 'nfvo-utils/i18n/i18n.js'; import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js'; import HeatValidation from './validation/HeatValidation.js'; +import {onboardingOriginTypes} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js'; class HeatScreenView extends Component { static propTypes = { isValidationAvailable: PropTypes.bool, - goToOverview: PropTypes.bool - }; - - state = { - activeTab: tabsMapping.SETUP + goToOverview: PropTypes.bool, + setActiveTab: PropTypes.function }; render() { - let {isValidationAvailable, isReadOnlyMode, heatDataExist, onDownload, softwareProductId, onProcessAndValidate, heatSetup, HeatSetupComponent, onGoToOverview, version, ...other} = this.props; + let {isValidationAvailable, isReadOnlyMode, heatDataExist, onDownload, softwareProductId, onProcessAndValidate, + heatSetup, HeatSetupComponent, onGoToOverview, version, onboardingOrigin, activeTab, setActiveTab, ...other} = this.props; + return ( <div className='vsp-attachments-view'> <div className='attachments-view-controllers'> - {(this.state.activeTab === tabsMapping.SETUP) && + {(activeTab === tabsMapping.SETUP) && <SVGIcon disabled={heatDataExist ? false : true} name='download' className='icon-component' - label={i18n('Download HEAT')} + label={i18n('Export Validation')} labelPosition='right' color='secondary' onClick={heatDataExist ? () => onDownload({heatCandidate: heatSetup, isReadOnlyMode, version}) : undefined} data-test-id='download-heat'/>} - {(this.state.activeTab === tabsMapping.VALIDATION && softwareProductId) && + {(activeTab === tabsMapping.VALIDATION && softwareProductId) && <SVGIcon disabled={this.props.goToOverview !== true} onClick={this.props.goToOverview ? () => onGoToOverview({version}) : undefined} @@ -60,7 +60,7 @@ class HeatScreenView extends Component { <SVGIcon name='upload' className='icon-component' - label={i18n('Upload New HEAT')} + label={i18n('Upload New File')} labelPosition='right' color='secondary' disabled={isReadOnlyMode} @@ -70,20 +70,20 @@ class HeatScreenView extends Component { ref='hiddenImportFileInput' type='file' name='fileInput' - accept='.zip' + accept='.zip, .csar' onChange={evt => this.handleImport(evt)}/> </div> - <Tabs id='attachments-tabs' activeKey={this.state.activeTab} onSelect={key => this.handleTabPress(key)}> - <Tab eventKey={tabsMapping.SETUP} title='HEAT Setup'> + <Tabs id='attachments-tabs' activeKey={activeTab} onSelect={key => this.handleTabPress(key)}> + <Tab eventKey={tabsMapping.SETUP} title='Setup' disabled={onboardingOrigin === onboardingOriginTypes.CSAR}> <HeatSetupComponent heatDataExist={heatDataExist} - changeAttachmentsTab={tab => this.setState({activeTab: tab})} + changeAttachmentsTab={tab => setActiveTab({activeTab: tab})} onProcessAndValidate={onProcessAndValidate} softwareProductId={softwareProductId} isReadOnlyMode={isReadOnlyMode} version={version}/> </Tab> - <Tab eventKey={tabsMapping.VALIDATION} title='Heat Validation' disabled={!isValidationAvailable}> + <Tab eventKey={tabsMapping.VALIDATION} title='Validation' disabled={!isValidationAvailable}> <HeatValidation {...other}/> </Tab> </Tabs> @@ -92,15 +92,15 @@ class HeatScreenView extends Component { } handleTabPress(key) { - let {heatSetup, heatSetupCache, onProcessAndValidate, isReadOnlyMode, version} = this.props; + let {heatSetup, heatSetupCache, onProcessAndValidate, isReadOnlyMode, version, setActiveTab} = this.props; switch (key) { case tabsMapping.VALIDATION: onProcessAndValidate({heatData: heatSetup, heatDataCache: heatSetupCache, isReadOnlyMode, version}).then( - () => this.setState({activeTab: tabsMapping.VALIDATION}) + () => setActiveTab({activeTab: tabsMapping.VALIDATION}) ); return; case tabsMapping.SETUP: - this.setState({activeTab: tabsMapping.SETUP}); + setActiveTab({activeTab: tabsMapping.SETUP}); return; } } @@ -112,11 +112,13 @@ class HeatScreenView extends Component { formData.append('upload', this.refs.hiddenImportFileInput.files[0]); this.refs.hiddenImportFileInput.value = ''; this.props.onUpload(formData, version); - this.setState({activeTab: tabsMapping.SETUP}); } save() { - return this.props.onSave(this.props.heatSetup, this.props.version); + + return this.props.onboardingOrigin === onboardingOriginTypes.ZIP ? + this.props.onSave(this.props.heatSetup, this.props.version) : + Promise.resolve(); } } diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidationReducer.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidationReducer.js index f0c10ed457..1d11bdd6b7 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidationReducer.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidationReducer.js @@ -89,16 +89,16 @@ function createErrorList(node, parent, deep = 0, errorList = []) { return errorList; } -const mapValidationDataToTree = validationData => { - let {heat, volume, network, artifacts, other} = validationData.importStructure || {}; +const mapValidationDataToTree = (validationData, packageName) => { + let {heat, nested, volume, network, artifacts, other} = validationData.importStructure || {}; return { children: [ { - name: 'HEAT', + name: packageName, expanded: true, type: 'heat', header: true, - children: (heat ? heat.map(mapHeatData) : []) + children: (heat ? heat.map(mapHeatData) : nested ? nested.map(mapHeatData) : []) }, ...(artifacts ? [{ name: 'artifacts', @@ -165,7 +165,8 @@ export default (state = {attachmentsTree: {}}, action) => { switch (action.type) { case softwareProductsActionTypes.SOFTWARE_PRODUCT_LOADED: let currentSoftwareProduct = action.response; - let attachmentsTree = currentSoftwareProduct.validationData ? mapValidationDataToTree(currentSoftwareProduct.validationData) : {}; + const packageName = currentSoftwareProduct.networkPackageName; + let attachmentsTree = currentSoftwareProduct.validationData ? mapValidationDataToTree(currentSoftwareProduct.validationData, packageName) : {}; let errorList = createErrorList(attachmentsTree); return { ...state, diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidationView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidationView.jsx index 2a2f4ac291..80d74b2964 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidationView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidationView.jsx @@ -93,9 +93,9 @@ function HeatFileTreeHeader(props) { <div onClick={() => props.selectNode(nodeFilters.ALL)} className={classNames({'attachments-tree-header': true, 'header-selected' : props.selectedNode === nodeFilters.ALL})} data-test-id='validation-tree-header'> <div className='tree-header-title' > - <SVGIcon name='zip' color={props.selectedNode === nodeFilters.ALL ? 'primary' : ''} iconClassName='header-icon' /> + {/*<SVGIcon name='zip' color={props.selectedNode === nodeFilters.ALL ? 'primary' : ''} iconClassName='header-icon' />*/} <span className={classNames({'tree-header-title-text' : true, - 'tree-header-title-selected' : props.selectedNode === nodeFilters.ALL})}>{i18n(`HEAT${hasErrors ? ' (Draft)' : ''}`)}</span> + 'tree-header-title-selected' : props.selectedNode === nodeFilters.ALL})}>{i18n(`${props.headerTitle} ${hasErrors ? '(Draft)' : ''}`)}</span> </div> <ErrorsAndWarningsCount errorList={props.errorList} size='large' /> </div>); @@ -134,7 +134,7 @@ class HeatFileTree extends React.Component { <div key={node.name + rand} className={classNames({'tree-block-inside' : !node.header})}> { node.header ? - <HeatFileTreeHeader selectedNode={selectedNode} errorList={this.props.errorList} selectNode={(nodeName) => this.selectNode(nodeName)} /> : + <HeatFileTreeHeader headerTitle={node.name} selectedNode={selectedNode} errorList={this.props.errorList} selectNode={(nodeName) => this.selectNode(nodeName)} /> : <HeatFileTreeRow toggleExpanded={this.props.toggleExpanded} node={node} path={path} selectedNode={selectedNode} selectNode={() => this.selectNode(node.name)} /> } { 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 11f3543e39..c7ab3e644c 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/creation/SoftwareProductCreationView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/creation/SoftwareProductCreationView.jsx @@ -186,12 +186,12 @@ const OnboardingProcedure = ({onboardingMethod, onDataChanged, genericFieldInfo} <GridSection title={i18n('Onboarding procedure')}> <GridItem colSpan={4}> <Input - label={i18n('HEAT file')} + label={i18n('Network Package')} overlayPos='top' isValid={genericFieldInfo.onboardingMethod.isValid} - checked={onboardingMethod === onboardingMethodConst.HEAT} + checked={onboardingMethod === onboardingMethodConst.NETWORK_PACKAGE} errorText={genericFieldInfo.onboardingMethod.errorText} - onChange={() => onDataChanged({onboardingMethod:'HEAT'},SP_CREATION_FORM_NAME)} + onChange={() => onDataChanged({onboardingMethod: onboardingMethodConst.NETWORK_PACKAGE},SP_CREATION_FORM_NAME)} type='radio' data-test-id='new-vsp-creation-procedure-heat' /> </GridItem> @@ -202,7 +202,7 @@ const OnboardingProcedure = ({onboardingMethod, onDataChanged, genericFieldInfo} checked={onboardingMethod === onboardingMethodConst.MANUAL} isValid={genericFieldInfo.onboardingMethod.isValid} errorText={genericFieldInfo.onboardingMethod.errorText} - onChange={() => onDataChanged({onboardingMethod:'Manual'},SP_CREATION_FORM_NAME)} + onChange={() => onDataChanged({onboardingMethod: onboardingMethodConst.MANUAL},SP_CREATION_FORM_NAME)} type='radio' data-test-id='new-vsp-creation-procedure-manual' /> </GridItem> diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js index 8806ffd0bf..a13e742006 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js @@ -53,7 +53,7 @@ export const mapStateToProps = ({softwareProduct, licenseModel: {licenseAgreemen fullCategoryDisplayName }, isReadOnlyMode, - componentsList, + componentsList, isManual: currentSoftwareProduct.onboardingMethod === onboardingMethod.MANUAL }; }; @@ -65,7 +65,6 @@ const mapActionsToProps = (dispatch, {version}) => { licenseModelId, version }), - onAttachmentsSelect: ({id: softwareProductId}) => OnboardingActionHelper.navigateToSoftwareProductAttachments(dispatch, {softwareProductId, version}), onUpload: (softwareProductId, formData) => SoftwareProductActionHelper.uploadFile(dispatch, { softwareProductId, @@ -98,7 +97,7 @@ const mapActionsToProps = (dispatch, {version}) => { data: { title: i18n('Upload Failed'), confirmationButtonText: i18n('Continue'), - msg: i18n('no zip file was uploaded or zip file doesn\'t exist') + msg: i18n('no zip or csar file was uploaded or expected file doesn\'t exist') } }), onComponentSelect: ({id: softwareProductId, componentId}) => { diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx index 7ffbeda4dc..72a416473c 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx @@ -57,7 +57,6 @@ class SoftwareProductLandingPageView extends React.Component { isReadOnlyMode: React.PropTypes.bool, componentsList: React.PropTypes.arrayOf(ComponentPropType), onDetailsSelect: React.PropTypes.func, - onAttachmentsSelect: React.PropTypes.func, onUpload: React.PropTypes.func, onUploadConfirmation: React.PropTypes.func, onInvalidFileSizeUpload: React.PropTypes.func, @@ -78,15 +77,13 @@ class SoftwareProductLandingPageView extends React.Component { disableClick={true} ref='fileInput' name='fileInput' - accept='.zip' + accept='.zip, .csar' disabled> <div className='draggable-wrapper'> <div className='software-product-landing-view-top'> <div className='row'> <ProductSummary currentSoftwareProduct={currentSoftwareProduct} onDetailsSelect={onDetailsSelect} /> - {isManual ? - <div className='details-panel'/> - : this.renderProductDetails(currentSoftwareProduct, isReadOnlyMode)} + {this.renderProductDetails(isManual, isReadOnlyMode)} </div> </div> </div> @@ -106,34 +103,18 @@ class SoftwareProductLandingPageView extends React.Component { } } - renderProductDetails(currentSoftwareProduct, isReadOnlyMode) { - let {validationData} = currentSoftwareProduct; - let {onAttachmentsSelect} = this.props; - let details = { - heatTemplates: validationData ? '1' : '0', - images: '0', - otherArtifacts: '0' - }; - + renderProductDetails(isManual, isReadOnlyMode) { return ( <div className='details-panel'> - <div className='software-product-landing-view-heading-title'>{i18n('Software Product Attachments')}</div> - <div className='software-product-landing-view-top-block'> - <div - className='software-product-landing-view-top-block-col' - onClick={() => onAttachmentsSelect(currentSoftwareProduct)}> - <div> - <div className='attachment-details'>{i18n('HEAT Templates')} (<span - className='attachment-details-count'>{details.heatTemplates}</span>) - </div> - </div> + { !isManual && <div> + <div className='software-product-landing-view-heading-title'>{i18n('Software Product Attachments')}</div> + <DraggableUploadFileBox + dataTestId='upload-btn' + isReadOnlyMode={isReadOnlyMode} + className={classnames('software-product-landing-view-top-block-col-upl', {'disabled': isReadOnlyMode})} + onClick={() => this.refs.fileInput.open()}/> </div> - <DraggableUploadFileBox - dataTestId='upload-btn' - isReadOnlyMode={isReadOnlyMode} - className={classnames('software-product-landing-view-top-block-col-upl', {'disabled': isReadOnlyMode})} - onClick={() => this.refs.fileInput.open()}/> - </div> + } </div> ); } diff --git a/openecomp-ui/test/softwareProduct/attachments/SoftwareProductAttachmentsView.test.js b/openecomp-ui/test/softwareProduct/attachments/SoftwareProductAttachmentsView.test.js index 5dfe98f273..355a3162b1 100644 --- a/openecomp-ui/test/softwareProduct/attachments/SoftwareProductAttachmentsView.test.js +++ b/openecomp-ui/test/softwareProduct/attachments/SoftwareProductAttachmentsView.test.js @@ -36,13 +36,13 @@ describe('SoftwareProduct Attachments - View: ', function () { let versionControllerData = VersionControllerUtilsFactory.build(); let softwareProductAttachments = { + attachmentsDetails: {activeTab: tabsMapping.SETUP}, heatSetup: {}, heatValidation: { attachmentsTree, errorList }, - heatSetupCache: {}, - activeTab: tabsMapping.SETUP + heatSetupCache: {} }; let data = defaultStoreFactory.build({softwareProduct: {softwareProductAttachments, softwareProductEditor: {data: {...versionControllerData}}}}); var result = mapStateToProps(data); @@ -57,6 +57,7 @@ describe('SoftwareProduct Attachments - View: ', function () { let versionControllerData = VersionControllerUtilsFactory.build(); let softwareProductAttachments = { + attachmentsDetails: {}, heatSetup: {}, heatValidation: { attachmentsTree, |