Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cori committed Nov 2, 2020
2 parents e935d32 + c722304 commit c88218c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 79 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ The following configuration parameters are available:
| GROUP_V5_API_URL | URL of the v5 Groups API |
| LOOKUP_V5_API_URL | URL of the v5 Devices API |
| TERMS_V5_API_URL | URL of the v5 Terms API |
| AGREEABILITY_TYPES | List of Agreeable types and its UUID from Database |
| AGREE_FOR_DOCUSIGN_TEMPLATE | UUID from Database of the `"DocuSign Template"` Agreeable type |
| AGREE_ELECTRONICALLY | UUID from Database of the `Electronically` Agreeable Type |
| DEFAULT_TERMS_TYPE_ID | The default terms type id |
Expand Down
72 changes: 0 additions & 72 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,6 @@
"GROUP_V5_API_URL": "http://localhost:3000/v5",
"LOOKUP_V5_API_URL": "http://localhost:3000/v5",
"TERMS_V5_API_URL": "http://localhost:3000/v5",
"AGREEABILITY_TYPES": [
{
"id": "f3cb81fa-d1ed-4231-b6c6-770f4f1ce8a4",
"name": "Non-agreeable"
},
{
"id": "208779bf-72ce-4e97-a398-13fa62c0414a",
"name": "Non-electronically-agreeable"
},
{
"id": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
"name": "Electronically-agreeable"
},
{
"id": "999a26ad-b334-453c-8425-165d4cf496d7",
"name": "Docusign-template"
}
],
"AGREE_FOR_DOCUSIGN_TEMPLATE": "999a26ad-b334-453c-8425-165d4cf496d7",
"AGREE_ELECTRONICALLY": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
"DEFAULT_TERMS_TYPE_ID": 5
Expand All @@ -53,24 +35,6 @@
"GROUP_V5_API_URL": "https://api.topcoder-dev.com/v5",
"LOOKUP_V5_API_URL": "https://api.topcoder-dev.com/v5",
"TERMS_V5_API_URL": "https://api.topcoder-dev.com/v5",
"AGREEABILITY_TYPES": [
{
"id": "f3cb81fa-d1ed-4231-b6c6-770f4f1ce8a4",
"name": "Non-agreeable"
},
{
"id": "208779bf-72ce-4e97-a398-13fa62c0414a",
"name": "Non-electronically-agreeable"
},
{
"id": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
"name": "Electronically-agreeable"
},
{
"id": "999a26ad-b334-453c-8425-165d4cf496d7",
"name": "Docusign-template"
}
],
"AGREE_FOR_DOCUSIGN_TEMPLATE": "999a26ad-b334-453c-8425-165d4cf496d7",
"AGREE_ELECTRONICALLY": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
"DEFAULT_TERMS_TYPE_ID": 5
Expand All @@ -91,24 +55,6 @@
"GROUP_V5_API_URL": "http://localhost:9000",
"LOOKUP_V5_API_URL": "http://localhost:3000/v5",
"TERMS_V5_API_URL": "http://localhost:3000/v5",
"AGREEABILITY_TYPES": [
{
"id": "f3cb81fa-d1ed-4231-b6c6-770f4f1ce8a4",
"name": "Non-agreeable"
},
{
"id": "208779bf-72ce-4e97-a398-13fa62c0414a",
"name": "Non-electronically-agreeable"
},
{
"id": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
"name": "Electronically-agreeable"
},
{
"id": "999a26ad-b334-453c-8425-165d4cf496d7",
"name": "Docusign-template"
}
],
"AGREE_FOR_DOCUSIGN_TEMPLATE": "999a26ad-b334-453c-8425-165d4cf496d7",
"AGREE_ELECTRONICALLY": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
"DEFAULT_TERMS_TYPE_ID": 5
Expand All @@ -129,24 +75,6 @@
"GROUP_V5_API_URL": "https://api.topcoder.com/v5",
"LOOKUP_V5_API_URL": "https://api.topcoder.com/v5",
"TERMS_V5_API_URL": "https://api.topcoder.com/v5",
"AGREEABILITY_TYPES": [
{
"id": "f3cb81fa-d1ed-4231-b6c6-770f4f1ce8a4",
"name": "Non-agreeable"
},
{
"id": "208779bf-72ce-4e97-a398-13fa62c0414a",
"name": "Non-electronically-agreeable"
},
{
"id": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
"name": "Electronically-agreeable"
},
{
"id": "999a26ad-b334-453c-8425-165d4cf496d7",
"name": "Docusign-template"
}
],
"AGREE_FOR_DOCUSIGN_TEMPLATE": "999a26ad-b334-453c-8425-165d4cf496d7",
"AGREE_ELECTRONICALLY": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
"DEFAULT_TERMS_TYPE_ID": 5
Expand Down
13 changes: 10 additions & 3 deletions src/app/terms/terms.edit.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,25 @@ var module = angular.module('supportAdminApp');
/**
* Controller for edit terms of use view
*/
module.controller('terms.EditTermsController', ['$scope', '$rootScope', 'AGREEABILITY_TYPES', 'AGREE_FOR_DOCUSIGN_TEMPLATE', '$log',
module.controller('terms.EditTermsController', ['$scope', '$rootScope', 'AGREE_FOR_DOCUSIGN_TEMPLATE', '$log',
'TermsService', 'Alert', '$state', '$stateParams', 'AGREE_ELECTRONICALLY',
function ($scope, $rootScope, agreeabilityTypeList, docusignTypeId, $log, TermsService, $alert, $state, $stateParams, electronicallyAgreeableId) {
function ($scope, $rootScope, docusignTypeId, $log, TermsService, $alert, $state, $stateParams, electronicallyAgreeableId) {
// init variables
$scope.processing = false;
$scope.editTerms = { };
$scope.agreeabilityTypes = agreeabilityTypeList;
$scope.agreeabilityTypes = [];
$scope.isDocuSignFieldEnabled = false;
$scope.isUrlEnabled = false;
$scope.termTypes = [];
$scope.signedUsers = { total: 0, deleteDisabled: true };

// gets the agreeability types
TermsService.getAgreeabilityTypes().then(function (data) {
$scope.agreeabilityTypes = data;
}).catch(function (error) {
$alert.error(error.error, $rootScope);
});

/**
* handles the agreebility type change.
* @param {string} agreeabilityTypeId the agreebility type id.
Expand Down
13 changes: 10 additions & 3 deletions src/app/terms/terms.new.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@
var module = angular.module('supportAdminApp');

module.controller('terms.NewTermsController', ['$rootScope', '$scope', 'TermsService', 'Alert',
'AGREEABILITY_TYPES', 'AGREE_FOR_DOCUSIGN_TEMPLATE', 'AGREE_ELECTRONICALLY', '$state', 'DEFAULT_TERMS_TYPE_ID',
function ($rootScope, $scope, TermsService, $alert, agreeabilityTypeList, docusignTypeId, electronicallyAgreeableId, $state, defaultTermTypeId) {
'AGREE_FOR_DOCUSIGN_TEMPLATE', 'AGREE_ELECTRONICALLY', '$state', 'DEFAULT_TERMS_TYPE_ID',
function ($rootScope, $scope, TermsService, $alert, docusignTypeId, electronicallyAgreeableId, $state, defaultTermTypeId) {
// init variables
$scope.newTerms = {};
$scope.processing = false;
$scope.agreeabilityTypes = agreeabilityTypeList;
$scope.agreeabilityTypes = [];
$scope.isDocuSignFieldEnabled = false;
$scope.isUrlEnabled = false;
$scope.termTypes = [];

// clear the alert
$alert.clear();

// gets the agreeability types
TermsService.getAgreeabilityTypes().then(function (data) {
$scope.agreeabilityTypes = data;
}).catch(function (error) {
$alert.error(error.error, $rootScope);
});

// get term types
TermsService.getTypes().then(function (response) {
$scope.termTypes = response;
Expand Down
18 changes: 18 additions & 0 deletions src/app/terms/terms.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,23 @@ angular.module('supportAdminApp')
return deferred.promise;
};

/**
* gets all agreeability types.
* @returns {Promise} the agreeability types.
*/
TermsService.getAgreeabilityTypes = function () {
var deferred = $q.defer();
var request = $http({
method: 'GET',
url: TermsService.getBasePath() + '/terms/agreeability-types'
});
request.then(function (response) {
deferred.resolve(response.data);
}).catch(function (error) {
TermsService.handleError(error, deferred);
})
return deferred.promise;
};

return TermsService;
}]);

0 comments on commit c88218c

Please sign in to comment.