Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ElaadF committed Jun 24, 2020
1 parent 9c416c8 commit 98993af
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions builder/js/ncf.js
Expand Up @@ -456,6 +456,7 @@ function toTechUI (technique) {
} );
technique.method_calls = calls;
}
console.log(technique)
return technique;
};
// Transform a ui technique into a valid ncf technique by removint original_index param
Expand Down Expand Up @@ -700,14 +701,14 @@ $scope.exportTechnique = function(){
for (var i = 0; i < $scope.selectedTechnique['method_calls'].length; i++) {
var call = $scope.selectedTechnique['method_calls'][i]
calls[i] = {
args: call["args"],
parameters: call["parameters"],
class_context: call["class_context"],
method_name: call["method_name"],
component: call["component"]
}
}
var exportedTechnique = {
type: 'ncf_technique', version: 1.0,
type: 'ncf_technique', version: 2.0,
data: {
bundle_name : $scope.selectedTechnique["bundle_name"],
description : $scope.selectedTechnique["description"],
Expand Down Expand Up @@ -746,9 +747,18 @@ $scope.onImportFileChange = function (fileEl) {
var importedTechnique = JSON.parse(evt.target.result);
if(importedTechnique['type'] == 'ncf_technique' && importedTechnique['version'] == 1.0) {
var technique = toTechUI(importedTechnique['data']);
$scope.checkSelect(technique, $scope.selectTechnique);
$scope.ui.editForm.$setDirty();
$scope.suppressFlag = true;
$scope.ui.editForm.$pending || ui.editForm.$invalid
$scope.checkSelect(technique, $scope.selectTechnique);
$scope.ui.editForm.$setDirty();
$scope.suppressFlag = true;

else {
alert("toto")
}




} else {
alert("Unsupported file type ! This version of Rudder only support import of ncf techniques files in format 1.0");
}
Expand Down

0 comments on commit 98993af

Please sign in to comment.