1 /* eslint-disable max-len,max-len,max-len,max-len,max-len,max-len */
3 * ============LICENSE_START===================================================
4 * SPARKY (AAI UI service)
5 * ============================================================================
6 * Copyright © 2017 AT&T Intellectual Property.
7 * Copyright © 2017 Amdocs
9 * ============================================================================
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 * ============LICENSE_END=====================================================
23 * ECOMP and OpenECOMP are trademarks
24 * and service marks of AT&T Intellectual Property.
27 import React, {Component} from 'react';
28 import {connect} from 'react-redux';
39 import i18n from 'utils/i18n/i18n';
41 import {CHART_ORCH_STATUS} from 'app/vnfSearch/VnfSearchConstants.js';
42 import {COLOR_BLUE} from 'utils/GlobalConstants.js';
45 let mapStateToProps = ({vnfSearch}) => {
47 processedOrchStatusCountChartData = CHART_ORCH_STATUS.emptyData
51 processedOrchStatusCountChartData
55 class VnfSearchOrchStatusVisualizations extends Component {
59 processedOrchStatusCountChartData
62 let visualizationClass = 'visualizations';
63 if (processedOrchStatusCountChartData.values ===
65 processedOrchStatusCountChartData.values.size <=
67 visualizationClass = 'visualizations hidden';
69 const xAxisAttrName = 'x';
70 const yAxisAttrName = 'y';
73 <div id='audit-visualizations' className={visualizationClass}>
74 <div className='visualization-charts'>
76 <h3>{i18n(CHART_ORCH_STATUS.title)}</h3>
77 <ResponsiveContainer width='100%' height={300}>
78 <BarChart data={processedOrchStatusCountChartData.values}>
79 <XAxis dataKey={xAxisAttrName}/>
81 <CartesianGrid strokeDasharray='3 3'/>
83 <Bar name={i18n(CHART_ORCH_STATUS.yAxisLabel)}
84 dataKey={yAxisAttrName} fill={COLOR_BLUE}/>
86 </ResponsiveContainer>
94 export default connect(mapStateToProps)(
95 VnfSearchOrchStatusVisualizations);