Skip to contentSkip to conversation

Correctly disable build button

PATCH New Elliot Smith 1 participant 3 messages Sep 3, 2015

lore
Share & tools
lore
#0 lore raw

cover Correctly disable build button

The 'build' button is enabled after project selection, and whenever a valid project is selected. This means you could start a build without specifying a target.

These patches ensure that the build button is correctly disabled and fixes how the incomplete configuration warning is shown.

The following changes since commit c80b582212336044c55052ad0d39f9da06d71438:

debianutils: create package for run-parts (2015-09-03 12:43:33 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib elliot/submit/bbarrosp/build-button
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/submit/bbarrosp/build-button

Belen Barros Pena (2):
toaster: disable build button as needed
toaster: show incomplete configuration warning

 lib/toaster/toastergui/static/css/default.css | 1 +
 lib/toaster/toastergui/static/js/base.js      | 2 --
 lib/toaster/toastergui/templates/base.html    | 8 +++++---
 3 files changed, 6 insertions(+), 5 deletions(-)

--
1.9.3

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#1 lore raw

PATCH 1/2 toaster: disable build button as needed

From: Belen Barros Pena <[email protected]>

Make sure that the 'build' button in the 'new build' form is disabled whenever the 'recipe(s)' text field is empty.

---
 lib/toaster/toastergui/static/js/base.js | 2 --
 1 file changed, 2 deletions(-)
lib/toaster/toastergui/static/js/base.js +0 -2
index eba9c16..e0df463 100644
@@ -82,7 +82,6 @@ function basePageInit(ctx) {
     return;
   }
 
-
   /* Hide the change project icon when there is only one project */
   if (ctx.numProjects === 1) {
     $('#project .icon-pencil').hide();
@@ -140,7 +139,6 @@ function basePageInit(ctx) {
 
           /* we can build this project; enable input fields */
           newBuildTargetInput.removeAttr("disabled");
-          newBuildTargetBuildBtn.removeAttr("disabled");
        }
       }, null);
   }
Signature · 12 lines
1.9.3

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
#2 lore raw

PATCH 2/2 toaster: show incomplete configuration warning

From: Belen Barros Pena <[email protected]>

In the new build button form, make sure we show a warning when you select a project with an incomplete configuration that cannot be built.

---
 lib/toaster/toastergui/static/css/default.css | 1 +
 lib/toaster/toastergui/templates/base.html    | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
lib/toaster/toastergui/static/css/default.css +1 -0
index e252dc1..9723db3 100644
@@ -216,6 +216,7 @@ dl textarea { resize: vertical; }
 .tooltip-inner { max-width: 250px; }
 .new-build { padding: 20px; }
 .new-build li { line-height: 30px; }
+.new-build li .alert { line-height: 20px; width: 200px; white-space: normal; }
 .new-build h6 { margin: 10px 0 0 0; color: #5a5a5a; }
 .new-build h3 { margin: 0; color: #5a5a5a; }
 .new-build form { margin: 5px 0 0; }
lib/toaster/toastergui/templates/base.html +5 -3
index 0b93bb3..640bc47 100644
@@ -148,9 +148,11 @@
                   <p><a id="view-all-projects" href="{% url 'all-projects' %}">View all projects</a></p>
                 </form>
               </li>
-              <li style="display: none">
-                This project's configuration is incomplete,<br/>so you cannot run builds.<br/>
-                <p><a href="{% if project.id %}{% url 'project' project.id %}{% endif %}">View project configuration</a></p>
+              <li>
+                <div class="alert" style="display:none;">
+                  <p>This project configuration is incomplete, so you cannot run builds.</p>
+                  <p><a href="{% if project.id %}{% url 'project' project.id %}{% endif %}">View project configuration</a></p>
+                </div>
               </li>
               <li id="targets-form">
                 <h6>Recipe(s):</h6>
Signature · 12 lines
1.9.3

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.