Make the hip chat setup field show more help information if the user enters a room name instead of a number

This commit is contained in:
Joseph Schorr 2015-02-26 12:35:28 -05:00
parent 258e879d11
commit d8048b09d2
4 changed files with 48 additions and 6 deletions

View file

@ -38,6 +38,23 @@ angular.module('quay').directive('createExternalNotificationDialog', function ()
$scope.unauthorizedEmail = false;
};
$scope.hasRegexMismatch = function(err, fieldName) {
if (!err.pattern) {
return;
}
for (var i = 0; i < err.pattern.length; ++i) {
var current = err.pattern[i];
var value = current.$viewValue;
var elem = $element.find('#' + fieldName);
if (value == elem[0].value) {
return true;
}
}
return false;
};
$scope.createNotification = function() {
if (!$scope.currentConfig.email) {
$scope.performCreateNotification();