* Fix bug#37283

This commit is contained in:
zenggang
2023-08-15 09:14:01 +00:00
parent 77e775537d
commit 5e51568152
4 changed files with 25 additions and 5 deletions
+9 -4
View File
@@ -223,17 +223,22 @@ class job extends control
$this->view->repo = $this->loadModel('repo')->getByID($job->repo);
if($repo->SCM == 'Gitlab') $this->view->refList = $this->loadModel('gitlab')->getReferenceOptions($repo->gitService, $repo->project);
if($repo->SCM == 'Subversion')
if($repo->SCM == 'Subversion' && $job->triggerType == 'tag')
{
$dirs = array();
$path = empty($repo->prefix) ? '/' : $this->repo->decodePath('');
$tags = $this->loadModel('svn')->getRepoTags($repo, $path);
if($tags)
{
$path = empty($repo->prefix) ? '/' : $this->repo->decodePath('');
$dirs['/'] = $this->loadrepo->encodePath($path);
foreach($tags as $dirPath => $dirName) $dirs[$dirPath] = $this->repo->encodePath($dirPath);
$dirs['/'] = $path;
foreach($tags as $dirPath => $dirName) $dirs[$dirPath] = $dirPath;
}
$this->view->dirs = $dirs;
foreach($this->lang->job->triggerTypeList as $type => $name)
{
if($type == 'tag') $this->lang->job->triggerTypeList[$type] = $this->lang->job->dirChange;
}
}
$repoList = $this->repo->getList($this->projectID);
+7
View File
@@ -116,6 +116,13 @@ function changeRepo(event)
$('#svnDirBox').append(html);
})
}
var triggerOptions = $('#triggerType').zui('picker').options.items;
for(i in triggerOptions)
{
if(triggerOptions[i].value == 'tag') triggerOptions[i].text = data.type != 'subversion' ? buildTag : dirChange;
}
$('#triggerType').zui('picker').render({items: triggerOptions});
}
});
+8 -1
View File
@@ -108,6 +108,13 @@ function changeRepo(event)
$('#svnDirBox').append(html);
})
}
var triggerOptions = $('#triggerType').zui('picker').options.items;
for(i in triggerOptions)
{
if(triggerOptions[i].value == 'tag') triggerOptions[i].text = data.type != 'subversion' ? buildTag : dirChange;
}
$('#triggerType').zui('picker').render({items: triggerOptions});
}
});
@@ -165,7 +172,7 @@ function changeTriggerType(event)
{
var type = event;
}
$('.svn-fields').addClass('hidden');
dirs ? $('.svn-fields').removeClass('hidden') : $('.svn-fields').addClass('hidden');
$('.comment-fields').addClass('hidden');
$('.custom-fields').addClass('hidden');
if(type == 'commit') $('.comment-fields').removeClass('hidden');
+1
View File
@@ -17,6 +17,7 @@ jsVar('engine', $job->engine);
jsVar('job', $job);
jsVar('dirChange', $lang->job->dirChange);
jsVar('buildTag', $lang->job->buildTag);
jsVar('dirs', !empty($dirs) ? $dirs : '');
if($job->customParam)
{