aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-07-02 14:05:17 +0300
committerEinav Keidar <einavw@amdocs.com>2018-07-03 07:44:48 +0000
commit8ae8f7eba59880eb81b985e98d87961e631013c7 (patch)
tree036a293b92bb8e45e4fef455cdde0f3c0fd8e0c4 /openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog
parent4cc66168639fc4448023b73c9e42363823dd4788 (diff)
archive fix & archive/filter toggle removed
Issue-ID: SDC-1383 Change-Id: I38548e5e0b5cce224e0d1324a97f9edce6dc0cfb Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogView.jsx94
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogViewWithFilter.jsx147
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorItem.jsx6
3 files changed, 14 insertions, 233 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogView.jsx b/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogView.jsx
index a416d36075..86c437d888 100644
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogView.jsx
@@ -15,64 +15,12 @@
*/
import React from 'react';
import i18n from 'nfvo-utils/i18n/i18n.js';
-import classnames from 'classnames';
import DetailsCatalogView from 'sdc-app/onboarding/onboard/DetailsCatalogView.jsx';
import VendorCatalogView from './VendorCatalogView.jsx';
import { tabsMapping } from './OnboardingCatalogConstants.js';
import { tabsMapping as WCTabsMapping } from 'sdc-app/onboarding/onboard/OnboardConstants.js';
-import featureToggle from 'sdc-app/features/featureToggle.js';
-import { featureToggleNames } from 'sdc-app/features/FeaturesConstants.js';
-const Separator = () => <div className="tab-separator" />;
-
-const Tab = ({ onTabPress, title, dataTestId, activeTab, tabMapping }) => (
- <div
- className={classnames('catalog-header-tab', {
- active: activeTab === tabMapping
- })}
- onClick={() => onTabPress(tabMapping)}
- data-test-id={dataTestId}>
- {title}
- </div>
-);
-
-const ArchiveTab = featureToggle(featureToggleNames.ARCHIVE_ITEM)(Tab);
-const ArchiveTabSeparator = featureToggle(featureToggleNames.ARCHIVE_ITEM)(
- Separator
-);
-
-const CatalogHeaderTabs = props => (
- <div className="catalog-header-tabs">
- <Tab
- {...props}
- title={i18n('ACTIVE')}
- dataTestId="catalog-all-tab"
- tabMapping={tabsMapping.ACTIVE}
- />
- <Separator />
- <Tab
- {...props}
- title={i18n('BY VENDOR')}
- dataTestId="catalog-header-tab"
- tabMapping={tabsMapping.BY_VENDOR}
- />
- <ArchiveTabSeparator />
- <ArchiveTab
- {...props}
- title={i18n('ARCHIVE')}
- dataTestId="catalog-archive-tab"
- tabMapping={tabsMapping.ARCHIVE}
- />
- </div>
-);
-
-const CatalogHeader = ({ activeTab, onTabPress }) => (
- <div className="catalog-header">
- <CatalogHeaderTabs activeTab={activeTab} onTabPress={onTabPress} />
- </div>
-);
-
-const FilterCatalogHeader = () => (
+const CatalogHeader = () => (
<div className="catalog-header">
<div className="catalog-header-tabs">
<div className="catalog-header-tab active">
@@ -82,19 +30,11 @@ const FilterCatalogHeader = () => (
</div>
);
-const FeaturedCatalogHeader = featureToggle(featureToggleNames.FILTER)({
- OnComp: FilterCatalogHeader,
- OffComp: CatalogHeader
-});
-
class OnboardingCatalogView extends React.Component {
renderViewByTab(activeTab) {
const {
- finalizedLicenseModelList: licenseModelList,
- fullLicenseModelList,
users,
vspOverlay,
- finalizedSoftwareProductList: softwareProductList,
onSelectLicenseModel,
onSelectSoftwareProduct,
onAddLicenseModelClick,
@@ -104,16 +44,17 @@ class OnboardingCatalogView extends React.Component {
selectedVendor,
searchValue,
onMigrate,
- archivedSoftwareProductList,
- archivedLicenseModelList
+ filteredItems
} = this.props;
+ const { vlmList, vspList } = filteredItems;
+
switch (activeTab) {
case tabsMapping.ARCHIVE:
return (
<DetailsCatalogView
- VLMList={archivedLicenseModelList}
- VSPList={archivedSoftwareProductList}
+ VLMList={vlmList}
+ VSPList={vspList}
users={users}
onSelectVLM={(item, users) =>
onSelectLicenseModel(
@@ -136,8 +77,8 @@ class OnboardingCatalogView extends React.Component {
case tabsMapping.ACTIVE:
return (
<DetailsCatalogView
- VLMList={licenseModelList}
- VSPList={softwareProductList}
+ VLMList={vlmList}
+ VSPList={vspList}
users={users}
onAddVLM={onAddLicenseModelClick}
onAddVSP={onAddSoftwareProductClick}
@@ -163,7 +104,7 @@ class OnboardingCatalogView extends React.Component {
default:
return (
<VendorCatalogView
- licenseModelList={fullLicenseModelList}
+ licenseModelList={vlmList}
users={users}
onAddVSP={onAddSoftwareProductClick}
onAddVLM={onAddLicenseModelClick}
@@ -193,23 +134,10 @@ class OnboardingCatalogView extends React.Component {
}
render() {
- const {
- selectedVendor,
- catalogActiveTab: activeTab,
- onCatalogTabClick,
- onSearch,
- searchValue
- } = this.props;
+ const { selectedVendor, catalogActiveTab: activeTab } = this.props;
return (
<div className="catalog-wrapper">
- {!selectedVendor && (
- <FeaturedCatalogHeader
- onSearch={event => onSearch(event.target.value)}
- activeTab={activeTab}
- onTabPress={tab => onCatalogTabClick(tab)}
- searchValue={searchValue}
- />
- )}
+ {!selectedVendor && <CatalogHeader />}
{this.renderViewByTab(activeTab)}
</div>
);
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogViewWithFilter.jsx b/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogViewWithFilter.jsx
deleted file mode 100644
index 86c437d888..0000000000
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogViewWithFilter.jsx
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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 DetailsCatalogView from 'sdc-app/onboarding/onboard/DetailsCatalogView.jsx';
-import VendorCatalogView from './VendorCatalogView.jsx';
-import { tabsMapping } from './OnboardingCatalogConstants.js';
-import { tabsMapping as WCTabsMapping } from 'sdc-app/onboarding/onboard/OnboardConstants.js';
-
-const CatalogHeader = () => (
- <div className="catalog-header">
- <div className="catalog-header-tabs">
- <div className="catalog-header-tab active">
- {i18n('ONBOARD CATALOG')}
- </div>
- </div>
- </div>
-);
-
-class OnboardingCatalogView extends React.Component {
- renderViewByTab(activeTab) {
- const {
- users,
- vspOverlay,
- onSelectLicenseModel,
- onSelectSoftwareProduct,
- onAddLicenseModelClick,
- onAddSoftwareProductClick,
- onVspOverlayChange,
- onVendorSelect,
- selectedVendor,
- searchValue,
- onMigrate,
- filteredItems
- } = this.props;
-
- const { vlmList, vspList } = filteredItems;
-
- switch (activeTab) {
- case tabsMapping.ARCHIVE:
- return (
- <DetailsCatalogView
- VLMList={vlmList}
- VSPList={vspList}
- users={users}
- onSelectVLM={(item, users) =>
- onSelectLicenseModel(
- item,
- users,
- WCTabsMapping.CATALOG
- )
- }
- onSelectVSP={(item, users) =>
- onSelectSoftwareProduct(
- item,
- users,
- WCTabsMapping.CATALOG
- )
- }
- filter={searchValue}
- onMigrate={onMigrate}
- />
- );
- case tabsMapping.ACTIVE:
- return (
- <DetailsCatalogView
- VLMList={vlmList}
- VSPList={vspList}
- users={users}
- onAddVLM={onAddLicenseModelClick}
- onAddVSP={onAddSoftwareProductClick}
- onSelectVLM={(item, users) =>
- onSelectLicenseModel(
- item,
- users,
- WCTabsMapping.CATALOG
- )
- }
- onSelectVSP={(item, users) =>
- onSelectSoftwareProduct(
- item,
- users,
- WCTabsMapping.CATALOG
- )
- }
- filter={searchValue}
- onMigrate={onMigrate}
- />
- );
- case tabsMapping.BY_VENDOR:
- default:
- return (
- <VendorCatalogView
- licenseModelList={vlmList}
- users={users}
- onAddVSP={onAddSoftwareProductClick}
- onAddVLM={onAddLicenseModelClick}
- onSelectVSP={(item, users) =>
- onSelectSoftwareProduct(
- item,
- users,
- WCTabsMapping.CATALOG
- )
- }
- onSelectVLM={(item, users) =>
- onSelectLicenseModel(
- item,
- users,
- WCTabsMapping.CATALOG
- )
- }
- vspOverlay={vspOverlay}
- onVendorSelect={onVendorSelect}
- selectedVendor={selectedVendor}
- onVspOverlayChange={onVspOverlayChange}
- onMigrate={onMigrate}
- filter={searchValue}
- />
- );
- }
- }
-
- render() {
- const { selectedVendor, catalogActiveTab: activeTab } = this.props;
- return (
- <div className="catalog-wrapper">
- {!selectedVendor && <CatalogHeader />}
- {this.renderViewByTab(activeTab)}
- </div>
- );
- }
-}
-
-export default OnboardingCatalogView;
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorItem.jsx b/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorItem.jsx
index aec8e9bdb1..fda47ef3e8 100644
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorItem.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorItem.jsx
@@ -68,9 +68,9 @@ class VendorItem extends React.Component {
onClick={e => this.handleVspCountClick(e)}
data-test-id="catalog-vsp-count"
disabled={!softwareProductList.length}>
- {i18n('{length} VSPs', {
- length: softwareProductList.length
- })}
+ {`${softwareProductList.length.toString()} ${i18n(
+ 'VSPs'
+ )}`}
</Button>
{shouldShowOverlay &&
softwareProductList.length > 0 && (