Skip to content

Commit

Permalink
Remove Tags from Network Topology View and others
Browse files Browse the repository at this point in the history
  • Loading branch information
Hilda Stastna committed Oct 30, 2019
1 parent 28a2178 commit 12e8e50
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ angular.module('ManageIQ').controller('cloudTopologyController', ['$scope', 'top
case 'CloudManager':
return { x: -20, y: -20, r: 28 };
case 'AvailabilityZone':
case 'Tag':
return { x: defaultDimensions.x, y: defaultDimensions.y, r: 13 };
case 'CloudTenant':
return { x: defaultDimensions.x, y: defaultDimensions.y, r: 19 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ angular.module('ManageIQ').controller('infraTopologyController', ['$scope', 'top
return { x: defaultDimensions.x, y: defaultDimensions.y, r: defaultDimensions.r };
case 'Host':
return { x: defaultDimensions.x, y: defaultDimensions.y, r: defaultDimensions.r };
case 'Tag':
return { x: defaultDimensions.x, y: defaultDimensions.y, r: 13 };
default:
return defaultDimensions;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ angular.module('ManageIQ').controller('networkTopologyController', ['$scope', 't
case 'NetworkManager':
return { x: -20, y: -20, r: 28 };
case 'FloatingIp':
case 'Tag':
return { x: defaultDimensions.x, y: defaultDimensions.y, r: 13 };
case 'NetworkRouter':
return { x: defaultDimensions.x, y: defaultDimensions.y, r: defaultDimensions.r };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ angular.module('ManageIQ').controller('physicalInfraTopologyController', ['$scop
return { x: defaultDimensions.x, y: defaultDimensions.y, r: defaultDimensions.r };
case 'Host':
return { x: defaultDimensions.x, y: defaultDimensions.y, r: defaultDimensions.r };
case 'Tag':
return { x: defaultDimensions.x, y: defaultDimensions.y, r: 13 };
default:
return defaultDimensions;
}
Expand Down
18 changes: 3 additions & 15 deletions app/assets/javascripts/services/topology_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ ManageIQ.angular.app.service('topologyService', ['$location', '$http', 'miqServi
__('Status: ') + d.item.status,
];

if (d.item.kind === 'Tag') {
status = [
d.item.name,
__('Type: ') + d.item.display_kind,
];
}

if (d.item.kind === 'Host' || d.item.kind === 'Vm') {
status.push(__('Provider: ') + d.item.provider);
}
Expand Down Expand Up @@ -60,11 +53,9 @@ ManageIQ.angular.app.service('topologyService', ['$location', '$http', 'miqServi
.style('top', mousePosition[1] + 'px');
popup.append('h5').text('Actions on ' + data.item.display_kind);

if (data.item.kind !== 'Tag') {
popup.append('p').text(__('Go to summary page')).on('click', function() {
vm.dblclick(data);
});
}
popup.append('p').text(__('Go to summary page')).on('click', function() {
vm.dblclick(data);
});

var canvasSize = [
canvas.node().offsetWidth,
Expand All @@ -90,9 +81,6 @@ ManageIQ.angular.app.service('topologyService', ['$location', '$http', 'miqServi
};

vm.dblclick = function dblclick(d) {
if (d.item.kind === 'Tag') {
return false;
}
$window.location.assign(topologyService.geturl(d));
};

Expand Down
16 changes: 6 additions & 10 deletions app/services/network_topology_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,20 @@ class NetworkTopologyService < TopologyService
@provider_class = ManageIQ::Providers::NetworkManager

@included_relations = [
:writable_classification_tags,
:availability_zones => [
:vms => [
:writable_classification_tags,
:floating_ips => :writable_classification_tags,
:cloud_tenant => :writable_classification_tags,
:security_groups => :writable_classification_tags,
:floating_ips => nil,
:cloud_tenant => nil,
:security_groups => nil,
]
],
:cloud_subnets => [
:parent_cloud_subnet,
:writable_classification_tags,
:vms,
:cloud_network => :writable_classification_tags,
:cloud_network => nil,
:network_router => [
:writable_classification_tags,
:cloud_network => [
:floating_ips => :writable_classification_tags
:floating_ips => nil
]
]
],
Expand All @@ -35,7 +31,7 @@ class NetworkTopologyService < TopologyService
]
]

@kinds = %i[NetworkRouter CloudSubnet Vm NetworkManager FloatingIp CloudNetwork NetworkPort CloudTenant SecurityGroup LoadBalancer Tag AvailabilityZone]
@kinds = %i[NetworkRouter CloudSubnet Vm NetworkManager FloatingIp CloudNetwork NetworkPort CloudTenant SecurityGroup LoadBalancer AvailabilityZone]

def entity_type(entity)
if entity.kind_of?(CloudNetwork) || entity.kind_of?(CloudSubnet)
Expand Down
7 changes: 1 addition & 6 deletions app/services/topology_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ def entity_id(entity)
end

def entity_name(entity)
if entity.kind_of?(Tag)
cls = entity.classification
[cls.parent, cls].map(&:description).join(': ')
else
entity.name
end
entity.name
end

# If needed, implemented this on its subclasses
Expand Down
4 changes: 0 additions & 4 deletions app/views/network_topology/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
%label
%i.pficon.pficon-cloud-tenant
= _("Cloud Tenants")
%kubernetes-topology-icon{tooltipOptions, :kind => "Tag"}
%label
%i.fa.fa-tag
= _("Tags")

.alert.alert-info.alert-dismissable
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"}
Expand Down

0 comments on commit 12e8e50

Please sign in to comment.