add custom notification message input fields

This commit is contained in:
Keith Grant
2019-06-03 09:56:27 -07:00
committed by Jim Ladd
parent 2eaf62a62d
commit adf25c61a2
4 changed files with 66 additions and 2 deletions

View File

@@ -186,6 +186,14 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
"name": $scope.name, "name": $scope.name,
"description": $scope.description, "description": $scope.description,
"organization": $scope.organization, "organization": $scope.organization,
"messages": $scope.customize_messages ? {
start_message: $scope.start_message,
start_body: $scope.start_body,
success_message: $scope.success_message,
success_body: $scope.success_body,
error_message: $scope.error_message,
error_body: $scope.error_body,
} : null,
"notification_type": v, "notification_type": v,
"notification_configuration": {} "notification_configuration": {}
}; };

View File

@@ -269,6 +269,14 @@ export default ['Rest', 'Wait',
"name": $scope.name, "name": $scope.name,
"description": $scope.description, "description": $scope.description,
"organization": $scope.organization, "organization": $scope.organization,
"messages": $scope.customize_messages ? {
start_message: $scope.start_message,
start_body: $scope.start_body,
success_message: $scope.success_message,
success_body: $scope.success_body,
error_message: $scope.error_message,
error_body: $scope.error_body,
} : null,
"notification_type": v, "notification_type": v,
"notification_configuration": {} "notification_configuration": {}
}; };

View File

@@ -581,7 +581,55 @@ export default ['i18n', function(i18n) {
ngShow: "notification_type.value == 'slack' ", ngShow: "notification_type.value == 'slack' ",
ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)', ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)',
awPopOver: i18n._('Specify a notification color. Acceptable colors are hex color code (example: #3af or #789abc) .') awPopOver: i18n._('Specify a notification color. Acceptable colors are hex color code (example: #3af or #789abc) .')
} },
customize_messages: {
label: i18n._('Customize messages…'),
type: 'checkbox',
class: 'Form-formGroup--fullWidth',
default: false,
},
start_message: {
label: i18n._('Start Message'),
class: 'Form-formGroup--fullWidth',
type: 'text',
default: '',
ngShow: "customize_messages",
},
start_body: {
label: i18n._('Start Body'),
class: 'Form-formGroup--fullWidth',
type: 'textarea',
default: '',
ngShow: "customize_messages && notification_type.value == 'email'",
},
success_message: {
label: i18n._('Success Message'),
class: 'Form-formGroup--fullWidth',
type: 'text',
default: '',
ngShow: "customize_messages",
},
success_body: {
label: i18n._('Success Body'),
class: 'Form-formGroup--fullWidth',
type: 'textarea',
default: '',
ngShow: "customize_messages && notification_type.value == 'email'",
},
error_message: {
label: i18n._('Error Message'),
class: 'Form-formGroup--fullWidth',
type: 'text',
default: '',
ngShow: "customize_messages",
},
error_body: {
label: i18n._('Error Body'),
class: 'Form-formGroup--fullWidth',
type: 'textarea',
default: '',
ngShow: "customize_messages && notification_type.value == 'email'",
},
}, },
buttons: { //for now always generates <button> tags buttons: { //for now always generates <button> tags

View File

@@ -697,7 +697,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
html += `<div id='${form.name}_${fld}_group' class='form-group Form-formGroup `; html += `<div id='${form.name}_${fld}_group' class='form-group Form-formGroup `;
html += (field.disabled) ? `Form-formGroup--disabled ` : ``; html += (field.disabled) ? `Form-formGroup--disabled ` : ``;
html += (field.type === "checkbox") ? "Form-formGroup--checkbox" : ""; html += (field.type === "checkbox") ? "Form-formGroup--checkbox " : "";
html += (field['class']) ? (field['class']) : ""; html += (field['class']) ? (field['class']) : "";
html += "'"; html += "'";
html += (field.ngShow) ? this.attr(field, 'ngShow') : ""; html += (field.ngShow) ? this.attr(field, 'ngShow') : "";