mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 22:07:36 -02:30
normalize http method choice values
This commit is contained in:
@@ -89,8 +89,8 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
|
|||||||
});
|
});
|
||||||
|
|
||||||
$scope.httpMethodChoices = [
|
$scope.httpMethodChoices = [
|
||||||
{'id': 'post', 'name': i18n._('POST')},
|
{'id': 'POST', 'name': i18n._('POST')},
|
||||||
{'id': 'put', 'name': i18n._('PUT')},
|
{'id': 'POST', 'name': i18n._('PUT')},
|
||||||
];
|
];
|
||||||
CreateSelect2({
|
CreateSelect2({
|
||||||
element: '#notification_template_http_method',
|
element: '#notification_template_http_method',
|
||||||
|
|||||||
@@ -140,8 +140,8 @@ export default ['Rest', 'Wait',
|
|||||||
});
|
});
|
||||||
|
|
||||||
$scope.httpMethodChoices = [
|
$scope.httpMethodChoices = [
|
||||||
{'id': 'post', 'name': i18n._('POST')},
|
{'id': 'POST', 'name': i18n._('POST')},
|
||||||
{'id': 'put', 'name': i18n._('PUT')},
|
{'id': 'PUT', 'name': i18n._('PUT')},
|
||||||
];
|
];
|
||||||
CreateSelect2({
|
CreateSelect2({
|
||||||
element: '#notification_template_http_method',
|
element: '#notification_template_http_method',
|
||||||
|
|||||||
@@ -68,8 +68,12 @@ angular.module('notifications', [
|
|||||||
var url = getBasePath('notification_templates') + notificationTemplateId + '/';
|
var url = getBasePath('notification_templates') + notificationTemplateId + '/';
|
||||||
rest.setUrl(url);
|
rest.setUrl(url);
|
||||||
return rest.get()
|
return rest.get()
|
||||||
.then(function(data) {
|
.then(function(res) {
|
||||||
return data.data;
|
if (_.get(res, ['data', 'notification_type'] === 'webhook') &&
|
||||||
|
_.get(res, ['data', 'notification_configuration', 'http_method'])) {
|
||||||
|
res.data.notification_configuration.http_method = res.data.notification_configuration.http_method.toUpperCase();
|
||||||
|
}
|
||||||
|
return res.data;
|
||||||
}).catch(function(response) {
|
}).catch(function(response) {
|
||||||
ProcessErrors(null, response.data, response.status, null, {
|
ProcessErrors(null, response.data, response.status, null, {
|
||||||
hdr: 'Error!',
|
hdr: 'Error!',
|
||||||
|
|||||||
@@ -429,7 +429,7 @@ export default ['i18n', function(i18n) {
|
|||||||
type: 'select',
|
type: 'select',
|
||||||
ngOptions: 'choice.id as choice.name for choice in httpMethodChoices',
|
ngOptions: 'choice.id as choice.name for choice in httpMethodChoices',
|
||||||
default: 'post',
|
default: 'post',
|
||||||
awPopOver: i18n._('Specify an HTTP method for the webhook. Acceptable choices are: POST or PATCH'),
|
awPopOver: i18n._('Specify an HTTP method for the webhook. Acceptable choices are: POST or PUT'),
|
||||||
awRequiredWhen: {
|
awRequiredWhen: {
|
||||||
reqExpression: "webhook_required",
|
reqExpression: "webhook_required",
|
||||||
init: "false"
|
init: "false"
|
||||||
|
|||||||
Reference in New Issue
Block a user