Merge pull request #103 from ragingpastry/add-mattermost-notification

Add mattermost notification
This commit is contained in:
Matthew Jones
2017-09-15 06:42:37 -07:00
committed by GitHub
7 changed files with 128 additions and 2 deletions

View File

@@ -333,6 +333,45 @@ export default ['i18n', function(i18n) {
subForm: 'typeSubForm',
ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)'
},
mattermost_url: {
label: i18n._('Target URL'),
type: 'text',
awRequiredWhen: {
reqExpression: "mattermost_required",
init: "false"
},
ngShow: "notification_type.value == 'mattermost' ",
subForm: 'typeSubForm',
ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)'
},
mattermost_username: {
label: i18n._('Username'),
type: 'text',
ngShow: "notification_type.value == 'mattermost' ",
subForm: 'typeSubForm',
ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)'
},
mattermost_channel: {
label: i18n._('Channel'),
type: 'text',
ngShow: "notification_type.value == 'mattermost' ",
subForm: 'typeSubForm',
ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)'
},
mattermost_icon_url: {
label: i18n._('Icon URL'),
type: 'text',
ngShow: "notification_type.value == 'mattermost' ",
subForm: 'typeSubForm',
ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)'
},
mattermost_no_verify_ssl: {
label: i18n._('Disable SSL Verification'),
type: 'checkbox',
ngShow: "notification_type.value == 'mattermost' ",
subForm: 'typeSubForm',
ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)'
},
server: {
label: i18n._('IRC Server Address'),
type: 'text',

View File

@@ -17,6 +17,7 @@ function (i18n) {
obj.irc_required = false;
obj.twilio_required = false;
obj.webhook_required = false;
obj.mattermost_required = false;
obj.token_required = false;
obj.port_required = false;
obj.password_required = false;
@@ -48,6 +49,9 @@ function (i18n) {
case 'webhook':
obj.webhook_required = true;
break;
case 'mattermost':
obj.mattermost_required = true;
break;
case 'pagerduty':
obj.tokenLabel = ' ' + i18n._('API Token');
obj.pagerduty_required = true;