mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 14:38:00 -03:30
normalize http method choice values
This commit is contained in:
parent
7580491f1a
commit
1fe18dc588
@ -89,8 +89,8 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
|
||||
});
|
||||
|
||||
$scope.httpMethodChoices = [
|
||||
{'id': 'post', 'name': i18n._('POST')},
|
||||
{'id': 'put', 'name': i18n._('PUT')},
|
||||
{'id': 'POST', 'name': i18n._('POST')},
|
||||
{'id': 'POST', 'name': i18n._('PUT')},
|
||||
];
|
||||
CreateSelect2({
|
||||
element: '#notification_template_http_method',
|
||||
|
||||
@ -140,8 +140,8 @@ export default ['Rest', 'Wait',
|
||||
});
|
||||
|
||||
$scope.httpMethodChoices = [
|
||||
{'id': 'post', 'name': i18n._('POST')},
|
||||
{'id': 'put', 'name': i18n._('PUT')},
|
||||
{'id': 'POST', 'name': i18n._('POST')},
|
||||
{'id': 'PUT', 'name': i18n._('PUT')},
|
||||
];
|
||||
CreateSelect2({
|
||||
element: '#notification_template_http_method',
|
||||
|
||||
@ -68,8 +68,12 @@ angular.module('notifications', [
|
||||
var url = getBasePath('notification_templates') + notificationTemplateId + '/';
|
||||
rest.setUrl(url);
|
||||
return rest.get()
|
||||
.then(function(data) {
|
||||
return data.data;
|
||||
.then(function(res) {
|
||||
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) {
|
||||
ProcessErrors(null, response.data, response.status, null, {
|
||||
hdr: 'Error!',
|
||||
|
||||
@ -429,7 +429,7 @@ export default ['i18n', function(i18n) {
|
||||
type: 'select',
|
||||
ngOptions: 'choice.id as choice.name for choice in httpMethodChoices',
|
||||
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: {
|
||||
reqExpression: "webhook_required",
|
||||
init: "false"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user