diff options
Diffstat (limited to 'moon_gui/static/app/services/gui')
-rwxr-xr-x | moon_gui/static/app/services/gui/alert.service.js | 39 | ||||
-rwxr-xr-x | moon_gui/static/app/services/gui/browser.service.js | 47 | ||||
-rwxr-xr-x | moon_gui/static/app/services/gui/form.service.js | 47 | ||||
-rwxr-xr-x | moon_gui/static/app/services/gui/menu.service.js | 49 | ||||
-rwxr-xr-x | moon_gui/static/app/services/gui/security.pipeline.service.js | 29 | ||||
-rwxr-xr-x | moon_gui/static/app/services/gui/util.service.js | 66 | ||||
-rwxr-xr-x | moon_gui/static/app/services/gui/version.service.js | 27 |
7 files changed, 0 insertions, 304 deletions
diff --git a/moon_gui/static/app/services/gui/alert.service.js b/moon_gui/static/app/services/gui/alert.service.js deleted file mode 100755 index 8435eab1..00000000 --- a/moon_gui/static/app/services/gui/alert.service.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @author arnaud marhin<arnaud.marhin@orange.com> - */ - -(function() { - - 'use strict'; - - angular - .module('moon') - .factory('alertService', alertService); - - alertService.$inject = [ 'toaster']; - - function alertService( toaster) { - - var service = {}; - - service.alertError = alertError; - service.alertSuccess = alertSuccess; - service.alertInfo = alertInfo; - - return service; - - function alertError(msg){ - toaster.pop('error', null, msg, 5000); - } - - function alertSuccess(msg){ - toaster.pop('success', null, msg, 5000); - } - - function alertInfo(msg){ - toaster.pop('note', null, msg, 5000); - } - - } - -})(); diff --git a/moon_gui/static/app/services/gui/browser.service.js b/moon_gui/static/app/services/gui/browser.service.js deleted file mode 100755 index 88c693a8..00000000 --- a/moon_gui/static/app/services/gui/browser.service.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @author arnaud marhin<arnaud.marhin@orange.com> - */ - -(function() { - - 'use strict'; - - angular - .module('moon') - .factory('browserService', browserService); - - function browserService() { - - var service = {}; - - service.sayWho = sayWho; - - return service; - - function sayWho() { - - var ua= navigator.userAgent, tem, - - M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; - - if(/trident/i.test(M[1])){ - tem= /\brv[ :]+(\d+)/g.exec(ua) || []; - return 'IE '+(tem[1] || ''); - } - - if(M[1]=== 'Chrome'){ - tem= ua.match(/\bOPR\/(\d+)/); - if(tem!= null){ return 'Opera '+tem[1];} - } - - M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?']; - - if((tem= ua.match(/version\/(\d+)/i))!= null) M.splice(1, 1, tem[1]); - - return M.join(' '); - - }; - - }; - -})(); diff --git a/moon_gui/static/app/services/gui/form.service.js b/moon_gui/static/app/services/gui/form.service.js deleted file mode 100755 index e436593c..00000000 --- a/moon_gui/static/app/services/gui/form.service.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @author arnaud marhin<arnaud.marhin@orange.com> - */ - -(function() { - - 'use strict'; - - angular - .module('moon') - .factory('formService', formService); - - function formService() { - - var service = {}; - - service.isInvalid = isInvalid; - service.checkFieldsValidity = checkFieldsValidity; - - return service; - - function isInvalid(form) { - return form.$invalid; - } - - function checkFieldsValidity(form) { - - var validationErrorKeys = _.keys(form.$error); - - _(validationErrorKeys).each(function(anErrorKey) { - - var formFields = _.values(form.$error[anErrorKey]); - - _(formFields).each(function(aFormField) { - - aFormField.$dirty = true; - aFormField.$setValidity(anErrorKey, false); - - }); - - }); - - } - - } - -})(); diff --git a/moon_gui/static/app/services/gui/menu.service.js b/moon_gui/static/app/services/gui/menu.service.js deleted file mode 100755 index fd90a2fa..00000000 --- a/moon_gui/static/app/services/gui/menu.service.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @author arnaud marhin<arnaud.marhin@orange.com> - */ - -(function() { - - 'use strict'; - - angular - .module('moon') - .factory('menuService', menuService); - - menuService.$inject = ['$state']; - - function menuService($state) { - - var service = {}; - - service.isProjectTabActive = isProjectTabActive; - service.isPDPTabActive = isPDPTabActive; - service.isPolicyTabActive = isPolicyTabActive; - service.isLogsTabActive = isLogsTabActive; - service.isModelTabActive = isModelTabActive; - - return service; - - function isProjectTabActive() { - return $state.includes('moon.project'); - } - - function isPDPTabActive() { - return $state.includes('moon.pdp'); - } - - function isPolicyTabActive(){ - return $state.includes('moon.policy'); - } - - function isLogsTabActive(){ - return $state.includes('moon.logs'); - } - - function isModelTabActive(){ - return $state.includes('moon.model'); - } - - } - -})(); diff --git a/moon_gui/static/app/services/gui/security.pipeline.service.js b/moon_gui/static/app/services/gui/security.pipeline.service.js deleted file mode 100755 index 3831e487..00000000 --- a/moon_gui/static/app/services/gui/security.pipeline.service.js +++ /dev/null @@ -1,29 +0,0 @@ -(function() { - - 'use strict'; - - angular - .module('moon') - .factory('securityPipelineService', securityPipelineService); - - securityPipelineService.$inject = ['SECURITY_PIPELINE_CST','policyService']; - - function securityPipelineService(SECURITY_PIPELINE_CST, policyService) { - var service = {}; - - service.findAll = findAll; - - return service; - - function findAll(type){ - switch(type){ - case SECURITY_PIPELINE_CST.TYPE.POLICY : - return policyService.findAll(); - default : - return policyService.findAll(); - } - - } - } - -})(); diff --git a/moon_gui/static/app/services/gui/util.service.js b/moon_gui/static/app/services/gui/util.service.js deleted file mode 100755 index 7274244a..00000000 --- a/moon_gui/static/app/services/gui/util.service.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author arnaud marhin<arnaud.marhin@orange.com> - */ - -(function() { - - 'use strict'; - - angular - .module('moon') - .factory('utilService', utilService); - - utilService.$inject = []; - - function utilService() { - - return { - - - /** - * Transforms an answer from server and return an array of objects instead the @param data - - * @param data object : { - * 'typeOfTheRreturnedObject' : { - * 'idObject1' : {....}, - * 'idObject2' : {....} - * } - * } - * @param typeOfObject - * @returns {Array} - */ - transform : function(data, typeOfObject){ - - var result = []; - - _.each(data[typeOfObject],function(item, key){ - item.id = key; - result.push(item); - }); - - return result; - }, - - /** - * same as transform but with only one object - * @param data - * @param typeOfObject the first elem of the dictonnary - */ - transformOne : function(data, typeOfObject){ - - var result = []; - - _.each(data[typeOfObject], function (item, key) { - item.id = key; - result.push(item); - }); - - return result[0]; - - } - - }; - - } - -})(); diff --git a/moon_gui/static/app/services/gui/version.service.js b/moon_gui/static/app/services/gui/version.service.js deleted file mode 100755 index 5f9f2786..00000000 --- a/moon_gui/static/app/services/gui/version.service.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @author arnaud marhin<arnaud.marhin@orange.com> - */ - -(function() { - - 'use strict'; - - angular - .module('moon') - .factory('versionService', versionService); - - versionService.$inject = ['$resource']; - - function versionService($resource) { - - return { - - version: $resource('version.json', {}, { - get: {method: 'GET', isArray: false} - }) - - }; - - } - -})(); |