1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

bitbake: toaster: Modify "New build" button behaviour for cli builds project

The "New build" button should only be displayed if there are
user-generated projects, not if there is only the command-line
builds project. (Toaster can't run builds on behalf of the
command-line builds project.)

The "New build" form should also display as if no project has
been set (i.e. show the project and recipe text entries).

Add a variable which tracks the number of non-command-line projects,
then use this to hide the button when appropriate.

Also track whether the current project is the default one, and
use this to add extra conditions to when the "New build" text
entries are shown.

[YOCTO #8231]

(Bitbake rev: 07e7bc29a7d976941eeae997f78a25ed6edddfc8)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Elliot Smith
2015-10-05 16:39:36 +01:00
committed by Richard Purdie
parent 56d4c84cec
commit 2517987f8d
3 changed files with 59 additions and 51 deletions
@@ -121,14 +121,14 @@ function basePageInit(ctx) {
});
function _checkProjectBuildable() {
if (selectedProject.projectId === undefined) {
if (selectedProject.projectId === undefined || selectedProject.projectIsDefault) {
return;
}
libtoaster.getProjectInfo(selectedProject.projectPageUrl,
function (data) {
if (data.machine === null || data.machine.name === undefined || data.layers.length === 0) {
/* we can't build anything with out a machine and some layers */
/* we can't build anything without a machine and some layers */
$("#new-build-button #targets-form").hide();
$("#new-build-button .alert").show();
} else {
@@ -147,7 +147,7 @@ function basePageInit(ctx) {
/* If we don't have a current project then present the set project
* form.
*/
if (selectedProject.projectId === undefined) {
if (selectedProject.projectId === undefined || selectedProject.projectIsDefault) {
$('#change-project-form').show();
$('#project .icon-pencil').hide();
}