-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix 32 broken agreement link (#42)
* introduce a configurationSvc that can be used in front end to customize behavior of Quepid. In this case, to customize showing the terms and conditions checkbox and link * remove old keys that aren't in heroku, but add new ones that need to be * let folks know these exist by adding to example * Fixes #44
- Loading branch information
Showing
12 changed files
with
92 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
angular.module('UtilitiesModule') | ||
.service('configurationSvc', [ | ||
'$window', '$log', | ||
function ConfigurationSvc() { | ||
var termsAndConditionsUrl; | ||
|
||
this.setTermsAndConditionsUrl = function (url) { | ||
termsAndConditionsUrl = url; | ||
}; | ||
this.hasTermsAndConditions = function () { | ||
if (angular.isUndefined(termsAndConditionsUrl) || termsAndConditionsUrl === ''){ | ||
return false; | ||
} | ||
else { | ||
return true; | ||
} | ||
|
||
}; | ||
|
||
this.getTermsAndConditionsUrl = function () { | ||
return termsAndConditionsUrl; | ||
}; | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
spec/javascripts/angular/services/configurationSvc_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use strict'; | ||
|
||
describe('Service: ConfigurationSvc', function () { | ||
|
||
// load the service's module | ||
beforeEach(module('UtilitiesModule')); | ||
|
||
// instantiate service | ||
var configurationSvc, windowMocker; | ||
beforeEach(function(){ | ||
inject(function (_configurationSvc_) { | ||
configurationSvc = _configurationSvc_; | ||
}); | ||
}); | ||
|
||
it('exists', function () { | ||
expect(!!configurationSvc).toBe(true); | ||
}); | ||
|
||
it('reports if terms and conditions url was set', function () { | ||
configurationSvc.setTermsAndConditionsUrl('https://quepid.com/agreement'); | ||
expect(configurationSvc.hasTermsAndConditions()).toBe(true); | ||
expect(configurationSvc.getTermsAndConditionsUrl()).toEqual('https://quepid.com/agreement'); | ||
}); | ||
|
||
it('reports it doesnt have terms and conditions if not set, or blank', function () { | ||
|
||
expect(configurationSvc.hasTermsAndConditions()).toBe(false); | ||
configurationSvc.setTermsAndConditionsUrl(''); | ||
expect(configurationSvc.hasTermsAndConditions()).toBe(false); | ||
|
||
}); | ||
|
||
}); |