From 2a8037fe4e95f2197f1123e43e5c626de9826eb8 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Tue, 4 Jun 2019 14:36:09 -0500 Subject: [PATCH] Migration Tweaks (#6260) * Adds auto-name if repo name is blank Adds error checking before sanitization in migration Signed-off-by: jolheiser * Changed err from sanitization to a different variable Signed-off-by: jolheiser * Remove handleCreatePost and implement separately Signed-off-by: jolheiser * Make fmt Signed-off-by: jolheiser --- public/js/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/js/index.js b/public/js/index.js index 96a56a424..ed3198594 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2160,6 +2160,14 @@ $(document).ready(function () { break; } } + + var $cloneAddr = $('#clone_addr'); + $cloneAddr.change(function() { + var $repoName = $('#repo_name'); + if ($cloneAddr.val().length > 0 && $repoName.val().length === 0) { // Only modify if repo_name input is blank + $repoName.val($cloneAddr.val().match(/^(.*\/)?((.+?)(\.git)?)$/)[3]); + } + }); }); function changeHash(hash) {