summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/onboard
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
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')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/onboard/OnboardView.jsx20
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/onboard/filter/Filter.jsx10
-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
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/onboard/workspace/WorkspaceView.jsx39
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/onboard/workspace/WorkspaceViewWithFilter.jsx67
7 files changed, 42 insertions, 341 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/OnboardView.jsx b/openecomp-ui/src/sdc-app/onboarding/onboard/OnboardView.jsx
index 0fc64b328c..c5cf2926d4 100644
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/OnboardView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/onboard/OnboardView.jsx
@@ -16,9 +16,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import OnboardingCatalogView from './onboardingCatalog/OnboardingCatalogView.jsx';
-import OnboardingCatalogViewWithFilter from './onboardingCatalog/OnboardingCatalogViewWithFilter.jsx';
import WorkspaceView from './workspace/WorkspaceView.jsx';
-import WorkspaceViewWithFilter from './workspace/WorkspaceViewWithFilter.jsx';
import { tabsMapping } from './OnboardConstants.js';
import i18n from 'nfvo-utils/i18n/i18n.js';
import classnames from 'classnames';
@@ -27,8 +25,6 @@ import objectValues from 'lodash/values.js';
import { catalogItemTypes } from './onboardingCatalog/OnboardingCatalogConstants.js';
import NotificationsView from 'sdc-app/onboarding/userNotifications/NotificationsView.jsx';
import Filter from 'sdc-app/onboarding/onboard/filter/Filter.jsx';
-import featureToggle from 'sdc-app/features/featureToggle.js';
-import { featureToggleNames } from 'sdc-app/features/FeaturesConstants.js';
const OnboardHeaderTabs = ({ onTabClick, activeTab }) => (
<div className="onboard-header-tabs">
<div
@@ -50,16 +46,6 @@ const OnboardHeaderTabs = ({ onTabClick, activeTab }) => (
</div>
);
-const ToggledOnboardingCatalogView = featureToggle(featureToggleNames.FILTER)({
- OnComp: OnboardingCatalogViewWithFilter,
- OffComp: OnboardingCatalogView
-});
-
-const ToggledWorkspaceView = featureToggle(featureToggleNames.FILTER)({
- OnComp: WorkspaceViewWithFilter,
- OffComp: WorkspaceView
-});
-
const OnboardHeader = ({ onSearch, activeTab, onTabClick, searchValue }) => (
<div className="onboard-header">
<OnboardHeaderTabs activeTab={activeTab} onTabClick={onTabClick} />
@@ -98,11 +84,11 @@ class OnboardView extends React.Component {
renderViewByTab(activeTab) {
switch (activeTab) {
case tabsMapping.WORKSPACE:
- return <ToggledWorkspaceView {...this.props} />;
+ return <WorkspaceView {...this.props} />;
case tabsMapping.CATALOG:
- return <ToggledOnboardingCatalogView {...this.props} />;
+ return <OnboardingCatalogView {...this.props} />;
default:
- return <ToggledWorkspaceView {...this.props} />;
+ return <WorkspaceView {...this.props} />;
}
}
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/filter/Filter.jsx b/openecomp-ui/src/sdc-app/onboarding/onboard/filter/Filter.jsx
index a00357c7b9..dadbbfd720 100644
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/filter/Filter.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/onboard/filter/Filter.jsx
@@ -17,8 +17,6 @@
import { connect } from 'react-redux';
import React from 'react';
import PropTypes from 'prop-types';
-import featureToggle from 'sdc-app/features/featureToggle.js';
-import { featureToggleNames } from 'sdc-app/features/FeaturesConstants.js';
import { tabsMapping as onboardTabsMapping } from '../OnboardConstants.js';
import { actionTypes } from './FilterConstants.js';
@@ -69,10 +67,4 @@ Filter.PropTypes = {
activeTab: PropTypes.number
};
-export default featureToggle(featureToggleNames.FILTER)(
- connect(mapStateToProps, mapActionsToProps)(Filter)
-);
-
-export const ConnectedFilter = connect(mapStateToProps, mapActionsToProps)(
- Filter
-);
+export default connect(mapStateToProps, mapActionsToProps)(Filter);
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 && (
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/workspace/WorkspaceView.jsx b/openecomp-ui/src/sdc-app/onboarding/onboard/workspace/WorkspaceView.jsx
index 2f17867af1..bef88df14d 100644
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/workspace/WorkspaceView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/onboard/workspace/WorkspaceView.jsx
@@ -1,34 +1,35 @@
-/*!
- * 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 DetailsCatalogView from '../DetailsCatalogView.jsx';
import i18n from 'nfvo-utils/i18n/i18n.js';
import { tabsMapping } from 'sdc-app/onboarding/onboard/OnboardConstants.js';
+import { tabsMapping as catalogTabsMappping } from '../onboardingCatalog/OnboardingCatalogConstants.js';
const WorkspaceView = props => {
let {
- licenseModelList,
- softwareProductList,
onAddLicenseModelClick,
users,
onAddSoftwareProductClick,
onSelectLicenseModel,
onSelectSoftwareProduct,
searchValue,
- onMigrate
+ onMigrate,
+ catalogActiveTab,
+ filteredItems: { vspList, vlmList }
} = props;
return (
@@ -37,11 +38,19 @@ const WorkspaceView = props => {
{i18n('WORKSPACE')}
</div>
<DetailsCatalogView
- VLMList={licenseModelList}
- VSPList={softwareProductList}
+ VLMList={vlmList}
+ VSPList={vspList}
users={users}
- onAddVLM={onAddLicenseModelClick}
- onAddVSP={onAddSoftwareProductClick}
+ onAddVLM={
+ catalogActiveTab === catalogTabsMappping.ACTIVE
+ ? onAddLicenseModelClick
+ : undefined
+ }
+ onAddVSP={
+ catalogActiveTab === catalogTabsMappping.ACTIVE
+ ? onAddSoftwareProductClick
+ : undefined
+ }
onSelectVLM={(item, users) =>
onSelectLicenseModel(item, users, tabsMapping.WORKSPACE)
}
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/workspace/WorkspaceViewWithFilter.jsx b/openecomp-ui/src/sdc-app/onboarding/onboard/workspace/WorkspaceViewWithFilter.jsx
deleted file mode 100644
index bef88df14d..0000000000
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/workspace/WorkspaceViewWithFilter.jsx
+++ /dev/null
@@ -1,67 +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 DetailsCatalogView from '../DetailsCatalogView.jsx';
-import i18n from 'nfvo-utils/i18n/i18n.js';
-import { tabsMapping } from 'sdc-app/onboarding/onboard/OnboardConstants.js';
-import { tabsMapping as catalogTabsMappping } from '../onboardingCatalog/OnboardingCatalogConstants.js';
-
-const WorkspaceView = props => {
- let {
- onAddLicenseModelClick,
- users,
- onAddSoftwareProductClick,
- onSelectLicenseModel,
- onSelectSoftwareProduct,
- searchValue,
- onMigrate,
- catalogActiveTab,
- filteredItems: { vspList, vlmList }
- } = props;
-
- return (
- <div className="catalog-wrapper workspace-view">
- <div className="catalog-header workspace-header">
- {i18n('WORKSPACE')}
- </div>
- <DetailsCatalogView
- VLMList={vlmList}
- VSPList={vspList}
- users={users}
- onAddVLM={
- catalogActiveTab === catalogTabsMappping.ACTIVE
- ? onAddLicenseModelClick
- : undefined
- }
- onAddVSP={
- catalogActiveTab === catalogTabsMappping.ACTIVE
- ? onAddSoftwareProductClick
- : undefined
- }
- onSelectVLM={(item, users) =>
- onSelectLicenseModel(item, users, tabsMapping.WORKSPACE)
- }
- onSelectVSP={(item, users) =>
- onSelectSoftwareProduct(item, users, tabsMapping.WORKSPACE)
- }
- onMigrate={onMigrate}
- filter={searchValue}
- />
- </div>
- );
-};
-
-export default WorkspaceView;