Skip to content

Commit 7258a2c

Browse files
committed
Remove username and password from migration of github/gitlab
1 parent 5978a03 commit 7258a2c

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

templates/repo/migrate/github.tmpl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@
1919
</span>
2020
</div>
2121

22-
<div class="inline field {{if .Err_Auth}}error{{end}}">
23-
<label for="auth_username">{{.i18n.Tr "username"}}</label>
24-
<input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}>
25-
</div>
26-
<input class="fake" type="password">
27-
<div class="inline field {{if .Err_Auth}}error{{end}}">
28-
<label for="auth_password">{{.i18n.Tr "password"}}</label>
29-
<input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}">
30-
</div>
3122
<div class="inline field {{if .Err_Auth}}error{{end}}">
3223
<label for="auth_token">{{.i18n.Tr "access_token"}}</label>
3324
<input id="auth_token" name="auth_token" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>

templates/repo/migrate/gitlab.tmpl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@
1919
</span>
2020
</div>
2121

22-
<div class="inline field {{if .Err_Auth}}error{{end}}">
23-
<label for="auth_username">{{.i18n.Tr "username"}}</label>
24-
<input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}>
25-
</div>
26-
<input class="fake" type="password">
27-
<div class="inline field {{if .Err_Auth}}error{{end}}">
28-
<label for="auth_password">{{.i18n.Tr "password"}}</label>
29-
<input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}">
30-
</div>
3122
<div class="inline field {{if .Err_Auth}}error{{end}}">
3223
<label for="auth_token">{{.i18n.Tr "access_token"}}</label>
3324
<input id="auth_token" name="auth_token" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>

web_src/js/features/migration.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const $items = $('#migrate_items').find('.field');
77
export default function initMigration() {
88
checkAuth();
99

10-
$service.on('change', checkAuth);
1110
$user.on('keyup', () => {checkItems(false)});
1211
$pass.on('keyup', () => {checkItems(false)});
1312
$token.on('keyup', () => {checkItems(true)});
@@ -23,19 +22,8 @@ export default function initMigration() {
2322

2423
function checkAuth() {
2524
const serviceType = $service.val();
26-
const tokenAuth = $(`#service-${serviceType}`).data('token');
2725

28-
if (tokenAuth) {
29-
$user.parent().addClass('disabled');
30-
$pass.parent().addClass('disabled');
31-
$token.parent().removeClass('disabled');
32-
} else {
33-
$user.parent().removeClass('disabled');
34-
$pass.parent().removeClass('disabled');
35-
$token.parent().addClass('disabled');
36-
}
37-
38-
checkItems(tokenAuth);
26+
checkItems(serviceType !== 1);
3927
}
4028

4129
function checkItems(tokenAuth) {

0 commit comments

Comments
 (0)