You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2017/04/25 15:50:28 UTC
[1/2] incubator-trafficcontrol git commit: adds the ability to unlink
profiles from parameters
Repository: incubator-trafficcontrol
Updated Branches:
refs/heads/master bcf15e620 -> 8743b1beb
adds the ability to unlink profiles from parameters
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/87dda6e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/87dda6e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/87dda6e2
Branch: refs/heads/master
Commit: 87dda6e2c7d3aa5e5dee127943a77f1857a203c6
Parents: bcf15e6
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Mon Apr 24 21:38:49 2017 -0600
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Tue Apr 25 09:49:57 2017 -0600
----------------------------------------------------------------------
.../app/src/common/api/ProfileParameterService.js | 16 ++++++++++++----
.../experimental/ui/app/src/common/api/index.js | 1 +
.../TableParameterProfilesController.js | 13 +++++++++----
.../table.parameterProfiles.tpl.html | 2 +-
.../TableProfileParametersController.js | 13 +++++++++----
.../table.profileParameters.tpl.html | 2 +-
6 files changed, 33 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/87dda6e2/traffic_ops/experimental/ui/app/src/common/api/ProfileParameterService.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/api/ProfileParameterService.js b/traffic_ops/experimental/ui/app/src/common/api/ProfileParameterService.js
index fdb4341..bd24c1f 100644
--- a/traffic_ops/experimental/ui/app/src/common/api/ProfileParameterService.js
+++ b/traffic_ops/experimental/ui/app/src/common/api/ProfileParameterService.js
@@ -17,13 +17,21 @@
* under the License.
*/
-var ProfileParameterService = function(Restangular) {
+var ProfileParameterService = function(httpService, messageModel, ENV) {
- this.getProfileParameters = function(profileId) {
- return Restangular.one('profiles', profileId).getList('parameters')
+ this.unlinkProfileParameter = function(profileId, paramId) {
+ return httpService.delete(ENV.api['root'] + 'profileparameters/' + profileId + '/' + paramId)
+ .then(
+ function() {
+ messageModel.setMessages([ { level: 'success', text: 'Profile and parameter were unlinked.' } ], false);
+ },
+ function(fault) {
+ messageModel.setMessages(fault.data.alerts, true);
+ }
+ );
};
};
-ProfileParameterService.$inject = ['Restangular'];
+ProfileParameterService.$inject = ['httpService', 'messageModel', 'ENV'];
module.exports = ProfileParameterService;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/87dda6e2/traffic_ops/experimental/ui/app/src/common/api/index.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/api/index.js b/traffic_ops/experimental/ui/app/src/common/api/index.js
index c3cc2f7..042cd93 100644
--- a/traffic_ops/experimental/ui/app/src/common/api/index.js
+++ b/traffic_ops/experimental/ui/app/src/common/api/index.js
@@ -32,6 +32,7 @@ module.exports = angular.module('trafficOps.api', [])
.service('physLocationService', require('./PhysLocationService'))
.service('parameterService', require('./ParameterService'))
.service('profileService', require('./ProfileService'))
+ .service('profileParameterService', require('./ProfileParameterService'))
.service('roleService', require('./RoleService'))
.service('regionService', require('./RegionService'))
.service('serverService', require('./ServerService'))
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/87dda6e2/traffic_ops/experimental/ui/app/src/common/modules/table/parameterProfiles/TableParameterProfilesController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/parameterProfiles/TableParameterProfilesController.js b/traffic_ops/experimental/ui/app/src/common/modules/table/parameterProfiles/TableParameterProfilesController.js
index 92b6a0b..dfc1e38 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/table/parameterProfiles/TableParameterProfilesController.js
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/parameterProfiles/TableParameterProfilesController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TableParameterProfilesController = function(parameter, parameterProfiles, $scope, $state, locationUtils) {
+var TableParameterProfilesController = function(parameter, parameterProfiles, $scope, $state, locationUtils, profileParameterService) {
$scope.parameter = parameter;
@@ -27,8 +27,13 @@ var TableParameterProfilesController = function(parameter, parameterProfiles, $s
alert('not hooked up yet: add profile to parameter');
};
- $scope.removeProfile = function() {
- alert('not hooked up yet: remove profile from parameter');
+ $scope.removeProfile = function(profileId) {
+ profileParameterService.unlinkProfileParameter(profileId, parameter.id)
+ .then(
+ function() {
+ $scope.refresh();
+ }
+ );
};
$scope.refresh = function() {
@@ -47,5 +52,5 @@ var TableParameterProfilesController = function(parameter, parameterProfiles, $s
};
-TableParameterProfilesController.$inject = ['parameter', 'parameterProfiles', '$scope', '$state', 'locationUtils'];
+TableParameterProfilesController.$inject = ['parameter', 'parameterProfiles', '$scope', '$state', 'locationUtils', 'profileParameterService'];
module.exports = TableParameterProfilesController;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/87dda6e2/traffic_ops/experimental/ui/app/src/common/modules/table/parameterProfiles/table.parameterProfiles.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/parameterProfiles/table.parameterProfiles.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/table/parameterProfiles/table.parameterProfiles.tpl.html
index 2c94681..4a51870 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/table/parameterProfiles/table.parameterProfiles.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/parameterProfiles/table.parameterProfiles.tpl.html
@@ -44,7 +44,7 @@ under the License.
<tr ng-repeat="parameterProfile in parameterProfiles">
<td>{{parameterProfile.name}}</td>
<td>{{parameterProfile.description}}</td>
- <td><button type="button" class="btn btn-link" title="Remove Profile" ng-click="removeProfile()"><i class="fa fa-trash-o"></i></button></td>
+ <td><button type="button" class="btn btn-link" title="Remove Profile from Parameter" ng-click="removeProfile(parameterProfile.id)"><i class="fa fa-chain-broken"></i></button></td>
</tr>
</tbody>
</table>
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/87dda6e2/traffic_ops/experimental/ui/app/src/common/modules/table/profileParameters/TableProfileParametersController.js
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/profileParameters/TableProfileParametersController.js b/traffic_ops/experimental/ui/app/src/common/modules/table/profileParameters/TableProfileParametersController.js
index d35c696..7db062c 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/table/profileParameters/TableProfileParametersController.js
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/profileParameters/TableProfileParametersController.js
@@ -17,7 +17,7 @@
* under the License.
*/
-var TableProfileParametersController = function(profile, profileParameters, $scope, $state, locationUtils) {
+var TableProfileParametersController = function(profile, profileParameters, $scope, $state, locationUtils, profileParameterService) {
$scope.profile = profile;
@@ -27,8 +27,13 @@ var TableProfileParametersController = function(profile, profileParameters, $sco
alert('not hooked up yet: add parameter to profile');
};
- $scope.removeParameter = function() {
- alert('not hooked up yet: remove Parameter from profile');
+ $scope.removeParameter = function(paramId) {
+ profileParameterService.unlinkProfileParameter(profile.id, paramId)
+ .then(
+ function() {
+ $scope.refresh();
+ }
+ );
};
$scope.refresh = function() {
@@ -47,5 +52,5 @@ var TableProfileParametersController = function(profile, profileParameters, $sco
};
-TableProfileParametersController.$inject = ['profile', 'profileParameters', '$scope', '$state', 'locationUtils'];
+TableProfileParametersController.$inject = ['profile', 'profileParameters', '$scope', '$state', 'locationUtils', 'profileParameterService'];
module.exports = TableProfileParametersController;
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/87dda6e2/traffic_ops/experimental/ui/app/src/common/modules/table/profileParameters/table.profileParameters.tpl.html
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/app/src/common/modules/table/profileParameters/table.profileParameters.tpl.html b/traffic_ops/experimental/ui/app/src/common/modules/table/profileParameters/table.profileParameters.tpl.html
index 7db87be..14d42fe 100644
--- a/traffic_ops/experimental/ui/app/src/common/modules/table/profileParameters/table.profileParameters.tpl.html
+++ b/traffic_ops/experimental/ui/app/src/common/modules/table/profileParameters/table.profileParameters.tpl.html
@@ -48,7 +48,7 @@ under the License.
<td>{{parameter.name}}</td>
<td>{{parameter.configFile}}</td>
<td>{{parameter.value}}</td>
- <td><button type="button" class="btn btn-link" title="Remove Parameter" ng-click="removeParameter()"><i class="fa fa-trash-o"></i></button></td>
+ <td><button type="button" class="btn btn-link" title="Remove Parameter from Profile" ng-click="removeParameter(parameter.id)"><i class="fa fa-chain-broken"></i></button></td>
</tr>
</tbody>
</table>
[2/2] incubator-trafficcontrol git commit: This closes #509.
Posted by da...@apache.org.
This closes #509.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/8743b1be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/8743b1be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/8743b1be
Branch: refs/heads/master
Commit: 8743b1bebd733411506965c5887994ed17fb022e
Parents: 87dda6e
Author: Dan Kirkwood <da...@gmail.com>
Authored: Tue Apr 25 09:50:16 2017 -0600
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Tue Apr 25 09:50:16 2017 -0600
----------------------------------------------------------------------
----------------------------------------------------------------------