Created
January 7, 2016 16:50
-
-
Save tbruno/687895a24ee44fec3bd4 to your computer and use it in GitHub Desktop.
My snippet
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
function refreshPolicyTemplates(policyTemplates) { | |
$scope.policyTemplates = policyTemplates; | |
$scope.characteristics = {}; | |
initFakeData (); | |
initCharacteristicsMap(); | |
initVisualizationMode(); | |
updateSortablePoliciesMap(); | |
// TODO remove. Fake data for tests | |
function initFakeData() { | |
var CORS_ORDER = 100; | |
var RL_ORDER = 101; | |
policies.forEach(function (policy, index) { | |
policy.order = index; | |
}); | |
policyTemplates.forEach(function (policyTemplate) { | |
if (policyTemplate.id === 'cors') { | |
policyTemplate.fixedOrder = CORS_ORDER; | |
} else if (policyTemplate.id === 'rate-limiting') { | |
policyTemplate.fixedOrder = RL_ORDER; | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment