Modify Hipchat input field to behave like a dropdown

* Fixed UX issues
This commit is contained in:
Marliana Lara
2017-07-31 13:21:21 -04:00
parent 9d1853f6df
commit 4bcd72b1ed
10 changed files with 40 additions and 22 deletions

View File

@@ -9,14 +9,14 @@ export default ['Rest', 'Wait',
'GenerateForm',
'notification_template',
'$scope', '$state', 'GetChoices', 'CreateSelect2', 'Empty',
'NotificationsTypeChange', 'ParseTypeChange',
'NotificationsTypeChange', 'ParseTypeChange', 'i18n',
function(
Rest, Wait,
NotificationsFormObject, ProcessErrors, GetBasePath,
GenerateForm,
notification_template,
$scope, $state, GetChoices, CreateSelect2, Empty,
NotificationsTypeChange, ParseTypeChange
NotificationsTypeChange, ParseTypeChange, i18n
) {
var generator = GenerateForm,
id = notification_template.id,
@@ -121,6 +121,12 @@ export default ['Rest', 'Wait',
element: '#notification_template_notification_type',
multiple: false
});
$scope.hipchatColors = [i18n._('Gray'), i18n._('Green'), i18n._('Purple'), i18n._('Red'), i18n._('Yellow'), i18n._('Random')];
CreateSelect2({
element: '#notification_template_color',
multiple: false
});
NotificationsTypeChange.getDetailFields($scope.notification_type.value).forEach(function(field) {
$scope[field[0]] = field[1];
});