On 29/09/16 16:03, Michael Wood wrote:
Update the delete notifications to reflect feedback from design
review comments.

Signed-off-by: Michael Wood <[email protected]>
---
  bitbake/lib/toaster/toastergui/api.py                       | 2 +-
  bitbake/lib/toaster/toastergui/static/js/customrecipe.js    | 2 +-
  bitbake/lib/toaster/toastergui/static/js/layerdetails.js    | 2 ++
  bitbake/lib/toaster/toastergui/static/js/libtoaster.js      | 2 +-
  bitbake/lib/toaster/toastergui/templates/base.html          | 2 +-
  bitbake/lib/toaster/toastergui/templates/basebuildpage.html | 6 +++++-
  6 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/bitbake/lib/toaster/toastergui/api.py 
b/bitbake/lib/toaster/toastergui/api.py
index 3a05d66..d609ed9 100644
--- a/bitbake/lib/toaster/toastergui/api.py
+++ b/bitbake/lib/toaster/toastergui/api.py
@@ -221,7 +221,7 @@ class XhrLayer(View):
return JsonResponse({
              "error": "ok",
-            "gotoUrl": reverse('project', args=(kwargs['pid'],))
+            "gotoUrl": reverse('projectlayers', args=(kwargs['pid'],))
          })
diff --git a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
index 9ea9602..7bf79a0 100644
--- a/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
+++ b/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
@@ -303,7 +303,7 @@ function customRecipePageInit(ctx) {
              libtoaster.setNotification("custom-image-recipe-deleted",
                                         msg.html());
- window.location.replace(data.gotoUrl);
+            window.location.replace(data.gotoUrl + "?nocache=true");


Ah, this shouldn't have had a "nocache=true" that was set for debugging. Will re-send patches.


            }
          },
          error: function (data) {
diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js 
b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
index 4c0d042..9ead393 100644
--- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
+++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
@@ -392,6 +392,8 @@ function layerDetailsPageInit (ctx) {
$("#layer-delete-confirmed").click(function(){ + $("#delete-layer-modal button[data-dismiss='modal']").hide();
+
      var message = $('<span>You have deleted <strong>1</strong> layer from your project: <strong 
id="deleted-layer-name"></strong>');
      message.find("#deleted-layer-name").text(ctx.layerVersion.name);
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
index 0832ba4..86662b7 100644
--- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -342,7 +342,7 @@ var libtoaster = (function () {
    }
function _showChangeNotification(message){
-    $(".alert").fadeOut().promise().done(function(){
+    $(".alert-dismissible").fadeOut().promise().done(function(){
        var alertMsg = $("#change-notification-msg");
alertMsg.html(message);
diff --git a/bitbake/lib/toaster/toastergui/templates/base.html 
b/bitbake/lib/toaster/toastergui/templates/base.html
index c1b1417..496dd6e 100644
--- a/bitbake/lib/toaster/toastergui/templates/base.html
+++ b/bitbake/lib/toaster/toastergui/templates/base.html
@@ -74,7 +74,7 @@
      </div>
<div id="change-notification" class="alert alert-info alert-dismissible change-notification" style="display:none">
-      <button type="button" class="close" id="hide-alert" 
data-dismiss="alert">&times;</button>
+      <button type="button" class="close" id="hide-alert" 
data-toggle="alert">&times;</button>
        <span id="change-notification-msg"></span>
      </div>
diff --git a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
index 0b6ef56..f5eee96 100644
--- a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
+++ b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
@@ -28,6 +28,8 @@
              if (data.error !== "ok") {
                console.warn(data.error);
              } else {
+              libtoaster.setNotification("build-deleted",
+                $("#deleted-build-message").html());
               window.location.replace(data.gotoUrl);
              }
            },
@@ -61,7 +63,9 @@
    });
   </script>
-
+<span style="display:none" id="deleted-build-message">
+  You have deleted 1 build: <strong>{{build.get_sorted_target_list|field_values:"target"|join:", "}} 
{{build.machine}}</strong> completed on <strong>{{build.completed_on|date:"d/m/y H:i"}}</strong>
+</span>
<div class="modal fade" tabindex="-1" role="dialog" id="delete-build-modal" style="display: none;" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog">


--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Reply via email to