From 65fb8387780443a571baccc19d258da416f43564 Mon Sep 17 00:00:00 2001 From: Filip Barl Date: Fri, 17 Mar 2017 12:25:35 +0100 Subject: [PATCH] Renamed and moved resource view components --- .../scripts/components/cachable-zoom-wrapper.js | 1 - .../{charts => components}/nodes-resources.js | 6 +++--- .../node-resources-layer-labels-overlay.js} | 8 ++++---- .../node-resources-layer-topology.js} | 4 ++-- .../nodes-resources/node-resources-layer.js} | 14 +++++++------- .../node-resources-metric-box-info.js} | 4 ++-- .../nodes-resources/node-resources-metric-box.js} | 4 ++-- client/app/scripts/components/nodes.js | 2 +- client/app/scripts/decorators/node.js | 2 +- .../app/scripts/selectors/resource-view/layers.js | 2 -- 10 files changed, 22 insertions(+), 25 deletions(-) rename client/app/scripts/{charts => components}/nodes-resources.js (85%) rename client/app/scripts/{charts/layer-labels-overlay.js => components/nodes-resources/node-resources-layer-labels-overlay.js} (85%) rename client/app/scripts/{charts/layer-topology-name.js => components/nodes-resources/node-resources-layer-topology.js} (87%) rename client/app/scripts/{charts/nodes-resources-layer.js => components/nodes-resources/node-resources-layer.js} (79%) rename client/app/scripts/{charts/node-resource-info.js => components/nodes-resources/node-resources-metric-box-info.js} (78%) rename client/app/scripts/{charts/node-resource-box.js => components/nodes-resources/node-resources-metric-box.js} (91%) diff --git a/client/app/scripts/components/cachable-zoom-wrapper.js b/client/app/scripts/components/cachable-zoom-wrapper.js index 86aa674845..e0f6668d05 100644 --- a/client/app/scripts/components/cachable-zoom-wrapper.js +++ b/client/app/scripts/components/cachable-zoom-wrapper.js @@ -147,7 +147,6 @@ class CachableZoomWrapper extends React.Component { zoomed() { if (!this.props.disabled) { - console.log('Current zoom', d3Event.transform.x, d3Event.transform.k); const updatedState = this.cachableState({ scaleX: d3Event.transform.k, scaleY: d3Event.transform.k, diff --git a/client/app/scripts/charts/nodes-resources.js b/client/app/scripts/components/nodes-resources.js similarity index 85% rename from client/app/scripts/charts/nodes-resources.js rename to client/app/scripts/components/nodes-resources.js index 474dfc92fa..c0c11a4e36 100644 --- a/client/app/scripts/charts/nodes-resources.js +++ b/client/app/scripts/components/nodes-resources.js @@ -1,10 +1,10 @@ import React from 'react'; import { connect } from 'react-redux'; -import Logo from '../components/logo'; +import Logo from './logo'; import { layersTopologyIdsSelector } from '../selectors/resource-view/layers'; -import CachableZoomWrapper from '../components/cachable-zoom-wrapper'; -import NodesResourcesLayer from './nodes-resources-layer'; +import CachableZoomWrapper from './cachable-zoom-wrapper'; +import NodesResourcesLayer from './nodes-resources/node-resources-layer'; class NodesResources extends React.Component { diff --git a/client/app/scripts/charts/layer-labels-overlay.js b/client/app/scripts/components/nodes-resources/node-resources-layer-labels-overlay.js similarity index 85% rename from client/app/scripts/charts/layer-labels-overlay.js rename to client/app/scripts/components/nodes-resources/node-resources-layer-labels-overlay.js index 1163d570b8..3f9d0e1885 100644 --- a/client/app/scripts/charts/layer-labels-overlay.js +++ b/client/app/scripts/components/nodes-resources/node-resources-layer-labels-overlay.js @@ -1,13 +1,13 @@ import React from 'react'; import { fromJS } from 'immutable'; -import NodeResourceInfo from './node-resource-info'; -import { applyTransformX, applyTransformY } from '../utils/transform-utils'; +import NodeResourcesMetricBoxInfo from './node-resources-metric-box-info'; +import { applyTransformX, applyTransformY } from '../../utils/transform-utils'; import { RESOURCES_LAYER_TITLE_WIDTH, RESOURCES_LABEL_MIN_SIZE, RESOURCES_LABEL_PADDING, -} from '../constants/styles'; +} from '../../constants/styles'; export default class LayerLabelsOverlay extends React.Component { @@ -39,7 +39,7 @@ export default class LayerLabelsOverlay extends React.Component { return ( {this.positionedLabels().map(label => ( - ( @@ -23,7 +23,7 @@ class NodesResourcesLayer extends React.Component { {nodes.toIndexedSeq().map(node => ( - ))} - - {!nodes.isEmpty() && node.get('parentNodeId') || index === 0) .filter(node => node.get('width')); - // console.log('Max width', filteredTopologyNodes.map(n => n.get('width')).max()); - // console.log('Min width', filteredTopologyNodes.map(n => n.get('width')).min()); nodesByTopology = nodesByTopology.set(layerTopologyId, filteredTopologyNodes); lastLayerTopologyId = layerTopologyId; });