chache result in onboarding
[sdc.git] / openecomp-ui / src / sdc-app / onboarding / onboard / workspace / WorkspaceView.jsx
1 /*
2  * Copyright © 2016-2018 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 import React from 'react';
17 import DetailsCatalogView from '../DetailsCatalogView.jsx';
18 import i18n from 'nfvo-utils/i18n/i18n.js';
19 import { tabsMapping } from 'sdc-app/onboarding/onboard/OnboardConstants.js';
20
21 const WorkspaceView = props => {
22     let {
23         onAddLicenseModelClick,
24         users,
25         onAddSoftwareProductClick,
26         onSelectLicenseModel,
27         onSelectSoftwareProduct,
28         searchValue,
29         onMigrate,
30         filteredItems: { vspList, vlmList },
31         isArchived,
32         activeTabName
33     } = props;
34     const handleSelectVSP = (item, users) =>
35         onSelectSoftwareProduct(item, users, tabsMapping.WORKSPACE);
36     const handleSelectVLM = (item, users) =>
37         onSelectLicenseModel(item, users, tabsMapping.WORKSPACE);
38     return (
39         <div className="catalog-wrapper workspace-view">
40             <div className="catalog-header workspace-header">
41                 {i18n('WORKSPACE')}
42             </div>
43             <DetailsCatalogView
44                 VLMList={vlmList}
45                 VSPList={vspList}
46                 users={users}
47                 onAddVLM={!isArchived ? onAddLicenseModelClick : undefined}
48                 onAddVSP={!isArchived ? onAddSoftwareProductClick : undefined}
49                 onSelectVLM={handleSelectVLM}
50                 onSelectVSP={handleSelectVSP}
51                 onMigrate={onMigrate}
52                 filter={searchValue}
53                 activeTabName={activeTabName}
54             />
55         </div>
56     );
57 };
58
59 export default WorkspaceView;