diff --git a/app/directives/remoteProjectManagerFormDirective.js b/app/directives/remoteProjectManagerFormDirective.js deleted file mode 100644 index 3ba818b..0000000 --- a/app/directives/remoteProjectManagerFormDirective.js +++ /dev/null @@ -1,91 +0,0 @@ -app.directive('remoteProjectManagerForm', function () { - return { - templateUrl: 'views/directives/remoteProjectManagerForm.html', - restrict: 'E', - replace: false, - scope: { - 'managementType': '<', - 'managementSettings': '=', - 'model': '=' - }, - link: function ($scope) { - - $scope.auth = { - useToken: false, - required: false - }; - - var originalType; - - var isAuthRequired = function () { - $scope.auth.useToken = false; - $scope.auth.required = false; - - for (var i in $scope.managementSettings) { - var key = $scope.managementSettings[i].key; - if (key === 'password') { - $scope.auth.required = true; - } - - if (key === 'token') { - $scope.auth.useToken = true; - } - } - }; - - var refreshAuth = function () { - if (originalType === undefined || originalType == $scope.managementType) { - if (originalType === undefined) { - isAuthRequired(); - - originalType = $scope.managementType; - } - - if ($scope.auth.required) { - $scope.auth.useToken = false; - - for (var key in $scope.model.settings) { - var value = $scope.model.settings[key]; - - if (key === 'token' && value != undefined && value.length > 0) { - $scope.auth.useToken = true; - } - } - } - } else { - isAuthRequired(); - - originalType = $scope.managementType; - } - }; - - $scope.inputSetting = function (setting) { - var display = true; - if ($scope.auth.useToken) { - if (setting.key === 'username' || setting.key === 'password') { - display = false; - } - } else { - if (setting.key === 'token') { - display = false; - } - } - return display; - }; - - $scope.clearAuthSettings = function () { - for (var key in $scope.model.settings) { - if (key === 'token' || key === 'username' || key === 'password') { - $scope.model.settings[key] = ''; - } - } - }; - - refreshAuth(); - - $scope.$watch('managementType', function() { - refreshAuth(); - }); - } - }; -}); diff --git a/app/index.html b/app/index.html index d3155db..d151a9b 100644 --- a/app/index.html +++ b/app/index.html @@ -193,7 +193,6 @@ - diff --git a/app/repo/remoteProjectManagerRepo.js b/app/repo/remoteProjectManagerRepo.js index 7a9e6ee..4a0e5f1 100644 --- a/app/repo/remoteProjectManagerRepo.js +++ b/app/repo/remoteProjectManagerRepo.js @@ -2,7 +2,9 @@ app.repo("RemoteProjectManagerRepo", function RemoteProjectManagerRepo($q, WsApi this.scaffold = { name: '', - type: '' + type: '', + url: '', + token: '' }; this.getTypes = function () { diff --git a/app/views/directives/remoteProjectManagerForm.html b/app/views/directives/remoteProjectManagerForm.html deleted file mode 100644 index 93d85db..0000000 --- a/app/views/directives/remoteProjectManagerForm.html +++ /dev/null @@ -1,13 +0,0 @@ -
- - -
-
- -
- -
-
diff --git a/app/views/management/remoteProjectManager.html b/app/views/management/remoteProjectManager.html index ed5c6e5..d6d3202 100644 --- a/app/views/management/remoteProjectManager.html +++ b/app/views/management/remoteProjectManager.html @@ -6,19 +6,12 @@ - + - +
Remote Project ManagerSettingsURL Actions
{{remoteProjectManager.name}} -
    -
  • - -  {{remoteProjectManager.settings[setting.key]}} -
  • -
-
{{remoteProjectManager.url}} diff --git a/app/views/modals/addRemoteProjectManagerModal.html b/app/views/modals/addRemoteProjectManagerModal.html index b2efdb0..2557d17 100644 --- a/app/views/modals/addRemoteProjectManagerModal.html +++ b/app/views/modals/addRemoteProjectManagerModal.html @@ -14,7 +14,9 @@ - + + +