diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/importlayer.js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/importlayer.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js index e2bc1ab607..15830dded5 100644 --- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js +++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js | |||
@@ -78,8 +78,14 @@ function importLayerPageInit (ctx) { | |||
78 | }); | 78 | }); |
79 | 79 | ||
80 | importAndAddBtn.click(function(){ | 80 | importAndAddBtn.click(function(){ |
81 | /* This is a list of the names from layerDeps for the layer deps | ||
82 | * modal dialog body | ||
83 | */ | ||
84 | var depNames = []; | ||
85 | |||
81 | /* arrray of all layer dep ids includes parent and child deps */ | 86 | /* arrray of all layer dep ids includes parent and child deps */ |
82 | var allDeps = []; | 87 | var allDeps = []; |
88 | |||
83 | /* temporary object to use to do a reduce on the dependencies for each | 89 | /* temporary object to use to do a reduce on the dependencies for each |
84 | * layer dependency added | 90 | * layer dependency added |
85 | */ | 91 | */ |
@@ -96,6 +102,7 @@ function importLayerPageInit (ctx) { | |||
96 | depDeps[layer.id] = layer; | 102 | depDeps[layer.id] = layer; |
97 | } | 103 | } |
98 | } | 104 | } |
105 | depNames.push(layerDeps[key].name); | ||
99 | allDeps.push(layerDeps[key].id); | 106 | allDeps.push(layerDeps[key].id); |
100 | } | 107 | } |
101 | 108 | ||
@@ -106,10 +113,14 @@ function importLayerPageInit (ctx) { | |||
106 | 113 | ||
107 | if (depDepsArray.length > 0) { | 114 | if (depDepsArray.length > 0) { |
108 | var layer = { name: layerNameInput.val(), url: "#", id: -1 }; | 115 | var layer = { name: layerNameInput.val(), url: "#", id: -1 }; |
109 | show_layer_deps_modal(ctx.projectId, layer, depDepsArray, function(selected){ | 116 | var title = "Layer"; |
117 | var body = "<strong>"+layer.name+"</strong>'s dependencies ("+ | ||
118 | depNames.join(", ")+"</span>) require some layers that are not added to your project. Select the ones you want to add:</p>"; | ||
119 | |||
120 | show_layer_deps_modal(ctx.projectId, layer, depDepsArray, title, body, false, function(selected){ | ||
110 | /* Add the accepted dependencies to the allDeps array */ | 121 | /* Add the accepted dependencies to the allDeps array */ |
111 | if (selected.length > 0){ | 122 | if (selected.length > 0){ |
112 | allDeps.concat (selected); | 123 | allDeps = allDeps.concat (selected); |
113 | } | 124 | } |
114 | import_and_add (); | 125 | import_and_add (); |
115 | }); | 126 | }); |
@@ -141,8 +152,10 @@ function importLayerPageInit (ctx) { | |||
141 | show_error_message(data, layerData); | 152 | show_error_message(data, layerData); |
142 | console.log(data.error); | 153 | console.log(data.error); |
143 | } else { | 154 | } else { |
155 | layerData.layersAdded = data.layers_added; | ||
144 | /* Success layer import now go to the project page */ | 156 | /* Success layer import now go to the project page */ |
145 | window.location.replace(ctx.projectPageUrl+'#/layerimported='+layerData.name); | 157 | $.cookie('layer-imported-alert', JSON.stringify(layerData), { path: '/'}); |
158 | window.location.replace(ctx.projectPageUrl+'#/layerimported'); | ||
146 | } | 159 | } |
147 | }, | 160 | }, |
148 | error: function (data) { | 161 | error: function (data) { |