fix an i18n-related bug that affects non-English hipchat users

see: https://github.com/ansible/tower/issues/951
This commit is contained in:
Ryan Petrello 2018-06-04 15:02:27 -04:00
parent 899084fa75
commit 581756527e
3 changed files with 17 additions and 3 deletions

View File

@ -75,7 +75,14 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
multiple: false
});
$scope.hipchatColors = [i18n._('Gray'), i18n._('Green'), i18n._('Purple'), i18n._('Red'), i18n._('Yellow'), i18n._('Random')];
$scope.hipchatColors = [
{'id': 'gray', 'name': i18n._('Gray')},
{'id': 'green', 'name': i18n._('Green')},
{'id': 'purple', 'name': i18n._('Purple')},
{'id': 'red', 'name': i18n._('Red')},
{'id': 'yellow', 'name': i18n._('Yellow')},
{'id': 'random', 'name': i18n._('Random')}
];
CreateSelect2({
element: '#notification_template_color',
multiple: false

View File

@ -122,7 +122,14 @@ export default ['Rest', 'Wait',
multiple: false
});
$scope.hipchatColors = [i18n._('Gray'), i18n._('Green'), i18n._('Purple'), i18n._('Red'), i18n._('Yellow'), i18n._('Random')];
$scope.hipchatColors = [
{'id': 'gray', 'name': i18n._('Gray')},
{'id': 'green', 'name': i18n._('Green')},
{'id': 'purple', 'name': i18n._('Purple')},
{'id': 'red', 'name': i18n._('Red')},
{'id': 'yellow', 'name': i18n._('Yellow')},
{'id': 'random', 'name': i18n._('Random')}
];
CreateSelect2({
element: '#notification_template_color',
multiple: false

View File

@ -288,7 +288,7 @@ export default ['i18n', function(i18n) {
label: i18n._('Notification Color'),
dataTitle: i18n._('Notification Color'),
type: 'select',
ngOptions: 'color for color in hipchatColors track by color',
ngOptions: 'color.id as color.name for color in hipchatColors',
awPopOver: i18n._('Specify a notification color. Acceptable colors are: yellow, green, red purple, gray or random.'),
awRequiredWhen: {
reqExpression: "hipchat_required",