Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds to TP the ability to assign ORG servers to topology-based delivery services #38

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ var TableDeliveryServiceServersController = function(deliveryService, servers, f
return deliveryService;
},
servers: function(serverService) {
return serverService.getEligibleDeliveryServiceServers(deliveryService.id);
if (deliveryService.topology) {
// topology-based ds's can only have ORG servers from the same CDN directly assigned
return serverService.getServers({ type: 'ORG', cdn: deliveryService.cdnId });
} else {
return serverService.getEligibleDeliveryServiceServers(deliveryService.id);
}
},
assignedServers: function() {
return servers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<div class="modal-header">
<button type="button" class="close" ng-click="cancel()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h3 class="modal-title">Assign Servers to {{::deliveryService.xmlId}}</h3>
<h3 class="modal-title">Assign {{(deliveryService.topology) ? 'ORG ' : ''}}Servers to {{::deliveryService.xmlId}}</h3>
</div>
<div class="modal-body">
<table id="dsServersUnassignedTable" class="table responsive-utilities jambo_table" style="table-layout:fixed; width:100%;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ol class="breadcrumb pull-left">
<li><a href="#!/delivery-services">Delivery Services</a></li>
<li><a name="dsLink" ng-href="{{'#!/delivery-services/' + deliveryService.id + '?type=' + deliveryService.type}}">{{::deliveryService.xmlId}}</a></li>
<li class="active">Servers <small ng-if="deliveryService.topology">[via {{deliveryService.topology}} Topology]</small></li>
<li class="active">Servers <small ng-if="deliveryService.topology">[via <a href="#!/topologies/edit?name={{deliveryService.topology}}">{{deliveryService.topology}}</a> Topology]</small></li>
</ol>
<div class="pull-right">
<div class="form-inline" role="search">
Expand Down Expand Up @@ -53,7 +53,7 @@
</button>
<ul class="dropdown-menu-right dropdown-menu" uib-dropdown-menu>
<li role="menuitem">
<button type="button" name="selectServersMenuItem" title="{{(!deliveryService.topology) ? 'Assign servers to delivery service' : 'Servers cannot be manually assigned to topology-based delivery services'}}" ng-disabled="deliveryService.topology" ng-click="selectServers()">Assign Servers</button>
<button type="button" name="selectServersMenuItem" title="Assign {{(deliveryService.topology) ? 'ORG ' : ''}}servers to delivery service" ng-click="selectServers()">Assign {{(deliveryService.topology) ? 'ORG ' : ''}}Servers</button>
</li>
<li class="divider"></li>
<li role="menuitem"><button class="menu-item-button" type="button" ng-click="clearColFilters()">Clear Column Filters</button></li>
Expand All @@ -76,7 +76,8 @@
</li>
<hr class="divider"/>
<li role="menuitem">
<button type="button" ng-click="confirmRemoveServer(server, $event)" ng-disabled="deliveryService.topology || (!isEdge(server) && !isOrigin(server))">Remove Server from Delivery Service</button>
<button type="button" ng-if="!deliveryService.topology" ng-click="confirmRemoveServer(server, $event)" ng-disabled="(!isEdge(server) && !isOrigin(server))">Remove {{server.type}} Server</button>
<button type="button" ng-if="deliveryService.topology" ng-click="confirmRemoveServer(server, $event)" ng-disabled="!isOrigin(server)">Remove {{server.type}} Server</button>
</li>
<hr class="divider"/>
<li role="menuitem">
Expand Down Expand Up @@ -105,7 +106,7 @@
</li>
<hr class="divider"/>
<li role="menuitem" ng-show="isCache(server)">
<a ng-href="#!/servers/{{server.id}}/capabilities">Manage Capabilities</a>
<a ng-href="#!/servers/{{server.id}}/capabilities">Manage Server Capabilities</a>
</li>
<li role="menuitem" ng-show="isEdge(server) || isOrigin(server)">
<a ng-href="#!/servers/{{server.id}}/delivery-services">Manage Delivery Services</a>
Expand Down
2 changes: 1 addition & 1 deletion traffic_portal/test/end_to_end/conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"login/login-spec.js",
"CDNs/cdns-spec.js",
"cacheGroups/cache-groups-spec.js",
"topologies/topologies-spec.js",
"profiles/profiles-spec.js",
"divisions/divisions-spec.js",
"regions/regions-spec.js",
"physLocations/phys-locations-spec.js",
"serverCapabilities/server-capabilities-spec.js",
"servers/servers-spec.js",
"topologies/topologies-spec.js",
"deliveryServices/delivery-services-spec.js",
"jobs/jobs-spec.js"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ describe('Traffic Portal Delivery Services Suite', function() {
pageData.manageServersMenuItem.click();
expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toMatch(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/servers");
pageData.moreBtn.click();
expect(pageData.selectServersMenuItem.isEnabled()).toBe(true);
expect(pageData.selectServersMenuItem.getText() === 'Assign Servers');
pageData.selectServersMenuItem.click();
browser.wait(ec.presenceOf(pageData.selectAllCB), 5000);
pageData.selectAllCB.click();
Expand Down Expand Up @@ -363,8 +365,9 @@ describe('Traffic Portal Delivery Services Suite', function() {
pageData.moreBtn.click();
pageData.manageServersMenuItem.click();
expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toMatch(commonFunctions.urlPath(browser.baseUrl)+"#!/delivery-services/[0-9]+/servers");
console.log('The ability to assign servers is disabled for ' + mockVals.httpXmlId);
expect(pageData.selectServersMenuItem.isEnabled()).toBe(false);
console.log('The ability to assign ORG servers is enabled for ' + mockVals.httpXmlId);
expect(pageData.selectServersMenuItem.isEnabled()).toBe(true);
expect(pageData.selectServersMenuItem.getText() === 'Assign ORG Servers');
});

// Steering delivery service
Expand Down