Move repo notification create to its own page

Also fixes a bug around Slack setup

Fixes #1834
This commit is contained in:
Joseph Schorr 2016-09-14 16:06:52 -04:00
parent 58641cbf4f
commit 0dce935c40
12 changed files with 390 additions and 255 deletions

View file

@ -52,8 +52,12 @@ function(Config, Features, VulnerabilityService) {
{
'name': 'level',
'type': 'enum',
'title': 'Minimum Priority Level',
'title': 'Minimum Severity Level',
'values': VulnerabilityService.LEVELS,
'help_text': 'A vulnerability must have a severity of the chosen level (or higher) ' +
'for this notification to fire. Defcon 1 is a special severity level ' +
'manually tagged by the ' + Config.REGISTRY_TITLE_SHORT + ' team for ' +
'above-critical issues',
}
]
});
@ -68,7 +72,8 @@ function(Config, Features, VulnerabilityService) {
{
'name': 'target',
'type': 'entity',
'title': 'Recipient'
'title': 'Recipient',
'help_text': 'The ' + Config.REGISTRY_TITLE_SHORT + ' user to notify'
}
]
},
@ -117,11 +122,11 @@ function(Config, Features, VulnerabilityService) {
'fields': [
{
'name': 'room_id',
'type': 'regex',
'type': 'pattern',
'title': 'Room ID #',
'regex': '^[0-9]+$',
'pattern': '^[0-9]+$',
'help_url': 'https://hipchat.com/admin/rooms',
'regex_fail_message': 'We require the HipChat room <b>number</b>, not name.'
'pattern_fail_message': 'We require the HipChat room <b>number</b>, not name.'
},
{
'name': 'notification_token',
@ -138,9 +143,9 @@ function(Config, Features, VulnerabilityService) {
'fields': [
{
'name': 'url',
'type': 'regex',
'type': 'pattern',
'title': 'Webhook URL',
'regex': '^https://hooks\\.slack\\.com/services/[A-Z0-9]+/[A-Z0-9]+/[a-zA-Z0-9]+$',
'pattern': '^https://hooks\\.slack\\.com/services/[A-Z0-9]+/[A-Z0-9]+/[a-zA-Z0-9]+$',
'help_url': 'https://slack.com/services/new/incoming-webhook',
'placeholder': 'https://hooks.slack.com/service/{some}/{token}/{here}'
}