|
@@ -176,6 +176,8 @@ function importLayerPageInit (ctx) {
|
|
|
success: function (data) {
|
|
|
if (data.error != "ok") {
|
|
|
console.log(data.error);
|
|
|
+ /* let the user know why nothing happened */
|
|
|
+ alert(data.error)
|
|
|
} else {
|
|
|
createImportedNotification(data);
|
|
|
window.location.replace(libtoaster.ctx.projectPageUrl);
|
|
@@ -244,9 +246,18 @@ function importLayerPageInit (ctx) {
|
|
|
enable_import_btn(true);
|
|
|
}
|
|
|
|
|
|
- if ($("#git-repo-radio").prop("checked") &&
|
|
|
- vcsURLInput.val().length > 0 && gitRefInput.val().length > 0) {
|
|
|
- enable_import_btn(true);
|
|
|
+ if ($("#git-repo-radio").prop("checked")) {
|
|
|
+ if (gitRefInput.val().length > 0 &&
|
|
|
+ gitRefInput.val() == 'HEAD') {
|
|
|
+ $('#invalid-layer-revision-hint').show();
|
|
|
+ $('#layer-revision-ctrl').addClass('has-error');
|
|
|
+ enable_import_btn(false);
|
|
|
+ } else if (vcsURLInput.val().length > 0 &&
|
|
|
+ gitRefInput.val().length > 0) {
|
|
|
+ $('#invalid-layer-revision-hint').hide();
|
|
|
+ $('#layer-revision-ctrl').removeClass('has-error');
|
|
|
+ enable_import_btn(true);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|