Allow migration items with mirroring for GitHub

This commit is contained in:
Chongyi Zheng 2022-07-10 22:59:03 -04:00
parent 40c3b32ea5
commit 039e505ec9
No known key found for this signature in database
GPG Key ID: CC2953E050C19686
2 changed files with 2 additions and 9 deletions

View File

@ -161,14 +161,6 @@ func Migrate(ctx *context.APIContext) {
GitServiceType: gitServiceType,
MirrorInterval: form.MirrorInterval,
}
if opts.Mirror {
opts.Issues = false
opts.Milestones = false
opts.Labels = false
opts.Comments = false
opts.PullRequests = false
opts.Releases = false
}
repo, err := repo_module.CreateRepository(ctx.Doer, repoOwner, models.CreateRepoOptions{
Name: opts.RepoName,

View File

@ -44,7 +44,8 @@ function checkItems(tokenAuth) {
enableItems = $user.val() !== '' || $pass.val() !== '';
}
if (enableItems && $service.val() > 1) {
if ($mirror.is(':checked')) {
const allowedServices = [2]; // services that supports migration items with mirroring
if ($mirror.is(':checked') && !allowedServices.includes(Number($service.val()))) {
$items.not('[name="wiki"]').attr('disabled', true);
$items.filter('[name="wiki"]').attr('disabled', false);
return;