From 394f63d493c63cdea407d6950c62dcd6cf401d13 Mon Sep 17 00:00:00 2001 From: zenggang Date: Wed, 25 Oct 2023 02:12:17 +0000 Subject: [PATCH] * Fix create build --- module/build/js/create.ui.js | 18 +++++++++--------- module/build/zen.php | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/module/build/js/create.ui.js b/module/build/js/create.ui.js index e22f2031cc..bac5264498 100644 --- a/module/build/js/create.ui.js +++ b/module/build/js/create.ui.js @@ -125,7 +125,7 @@ function loadArtifactrepo(event) { const productID = $(event.target).val(); - var data = Object.values(productArtifactRepos[productID]); + var data = Object.values(artifactRepos[productID]); if(data.length > 0) { $('.artifactrepo').removeClass('hidden'); @@ -155,14 +155,14 @@ function onShowArtifactRepo() { var productID = $('[name=product]').val(); - var data = Object.values(productArtifactRepos[productID]); + var data = Object.values(artifactRepos[productID]); if(data.length > 0) { $('.artifactrepo-id').removeClass('hidden'); var items = []; - for(i in productArtifactRepos[productID]) + for(i in artifactRepos[productID]) { - items.push({'text': productArtifactRepos[productID][i].name, 'value': productArtifactRepos[productID][i].id}); + items.push({'text': artifactRepos[productID][i].name, 'value': artifactRepos[productID][i].id}); } $artifactRepo = $('#artifactRepoID').zui('picker'); $artifactRepo.render({items: items}); @@ -192,7 +192,7 @@ function onChangeArtifactRepo(event) const datePicker = $('#date').datePicker().zui(); var productID = $('[name=product]').val(); - var data = Object.values(productArtifactRepos[productID]); + var data = Object.values(artifactRepos[productID]); if(data.length == 0 || !repoID) { $('#filePath').val(''); @@ -200,12 +200,12 @@ function onChangeArtifactRepo(event) return; } - for(i in productArtifactRepos[productID]) + for(i in artifactRepos[productID]) { - if(productArtifactRepos[productID][i].id == repoID) + if(artifactRepos[productID][i].id == repoID) { - $('#filePath').val(productArtifactRepos[productID][i].url); - datePicker.$.setValue(productArtifactRepos[productID][i].createdDate.substr(0, 10)); + $('#filePath').val(artifactRepos[productID][i].url); + datePicker.$.setValue(artifactRepos[productID][i].createdDate.substr(0, 10)); } } } diff --git a/module/build/zen.php b/module/build/zen.php index 23156531f3..766fa4ce55 100644 --- a/module/build/zen.php +++ b/module/build/zen.php @@ -26,11 +26,11 @@ class buildZen extends build { $productGroups = $branchGroups = array(); $executions = $this->loadModel('execution')->getPairs($projectID, 'all', 'stagefilter|leaf|order_asc'); - $executionID = empty($executionID) ? (int)key($executions) : $executionID; - if($executionID) + $executionID = empty($executionID) && !empty($executions) ? (int)key($executions) : $executionID; + if($executionID || $projectID) { - $productGroups = $this->loadModel('product')->getProducts($executionID, $status); - $branchGroups = $this->loadModel('project')->getBranchesByProject($executionID); + $productGroups = $this->loadModel('product')->getProducts($executionID ? $executionID : $projectID, $status); + $branchGroups = $this->loadModel('project')->getBranchesByProject($executionID ? $executionID : $projectID); } $this->commonActions($projectID);