mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 00:38:45 -03:30
Merge pull request #92 from marshmalien/ux/fix/notifications
[UX] Fix Notification radio buttons and add close button to Toaster alert
This commit is contained in:
@@ -151,7 +151,8 @@ var awApp = angular.module('awApp', [
|
|||||||
.config(['ngToastProvider', function(ngToastProvider) {
|
.config(['ngToastProvider', function(ngToastProvider) {
|
||||||
ngToastProvider.configure({
|
ngToastProvider.configure({
|
||||||
animation: 'slide',
|
animation: 'slide',
|
||||||
dismissOnTimeout: true,
|
dismissOnTimeout: false,
|
||||||
|
dismissButton: true,
|
||||||
timeout: 4000
|
timeout: 4000
|
||||||
});
|
});
|
||||||
}])
|
}])
|
||||||
|
|||||||
@@ -134,10 +134,22 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
|
|||||||
|
|
||||||
$scope.emailOptionsChange = function () {
|
$scope.emailOptionsChange = function () {
|
||||||
if ($scope.email_options === 'use_ssl') {
|
if ($scope.email_options === 'use_ssl') {
|
||||||
|
if ($scope.use_ssl) {
|
||||||
|
$scope.email_options = null;
|
||||||
|
$scope.use_ssl = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$scope.use_ssl = true;
|
$scope.use_ssl = true;
|
||||||
$scope.use_tls = false;
|
$scope.use_tls = false;
|
||||||
}
|
}
|
||||||
else if ($scope.email_options === 'use_tls') {
|
else if ($scope.email_options === 'use_tls') {
|
||||||
|
if ($scope.use_tls) {
|
||||||
|
$scope.email_options = null;
|
||||||
|
$scope.use_tls = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$scope.use_ssl = false;
|
$scope.use_ssl = false;
|
||||||
$scope.use_tls = true;
|
$scope.use_tls = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,10 +205,22 @@ export default ['Rest', 'Wait',
|
|||||||
|
|
||||||
$scope.emailOptionsChange = function () {
|
$scope.emailOptionsChange = function () {
|
||||||
if ($scope.email_options === 'use_ssl') {
|
if ($scope.email_options === 'use_ssl') {
|
||||||
|
if ($scope.use_ssl) {
|
||||||
|
$scope.email_options = null;
|
||||||
|
$scope.use_ssl = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$scope.use_ssl = true;
|
$scope.use_ssl = true;
|
||||||
$scope.use_tls = false;
|
$scope.use_tls = false;
|
||||||
}
|
}
|
||||||
else if ($scope.email_options === 'use_tls') {
|
else if ($scope.email_options === 'use_tls') {
|
||||||
|
if ($scope.use_tls) {
|
||||||
|
$scope.email_options = null;
|
||||||
|
$scope.use_tls = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$scope.use_ssl = false;
|
$scope.use_ssl = false;
|
||||||
$scope.use_tls = true;
|
$scope.use_tls = true;
|
||||||
}
|
}
|
||||||
@@ -263,7 +275,7 @@ export default ['Rest', 'Wait',
|
|||||||
Rest.setUrl(url + id + '/');
|
Rest.setUrl(url + id + '/');
|
||||||
Rest.put(params)
|
Rest.put(params)
|
||||||
.success(function() {
|
.success(function() {
|
||||||
$state.go($state.current, null, { reload: true });
|
$state.go('notifications', {}, { reload: true });
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
})
|
})
|
||||||
.error(function(data, status) {
|
.error(function(data, status) {
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ export default ['i18n', function(i18n) {
|
|||||||
type: 'radio_group',
|
type: 'radio_group',
|
||||||
subForm: 'typeSubForm',
|
subForm: 'typeSubForm',
|
||||||
ngShow: "notification_type.value == 'email'",
|
ngShow: "notification_type.value == 'email'",
|
||||||
ngChange: "emailOptionsChange()",
|
ngClick: "emailOptionsChange()",
|
||||||
ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)',
|
ngDisabled: '!(notification_template.summary_fields.user_capabilities.edit || canAdd)',
|
||||||
options: [{
|
options: [{
|
||||||
value: 'use_tls',
|
value: 'use_tls',
|
||||||
|
|||||||
@@ -25,3 +25,25 @@
|
|||||||
.NotificationsForm-radioButtons{
|
.NotificationsForm-radioButtons{
|
||||||
display:block!important;
|
display:block!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#notification_templates_table .name-column {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notificationsList {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ng-toast {
|
||||||
|
.alert {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.close {
|
||||||
|
position: absolute;
|
||||||
|
right: 5px;
|
||||||
|
top: 0px;
|
||||||
|
color: white;
|
||||||
|
opacity: 1;
|
||||||
|
text-shadow: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1287,6 +1287,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
html += "value=\"" + field.options[i].value + "\" ";
|
html += "value=\"" + field.options[i].value + "\" ";
|
||||||
html += "ng-model=\"" + fld + "\" ";
|
html += "ng-model=\"" + fld + "\" ";
|
||||||
html += (field.ngChange) ? this.attr(field, 'ngChange') : "";
|
html += (field.ngChange) ? this.attr(field, 'ngChange') : "";
|
||||||
|
html += (field.ngClick) ? this.attr(field, 'ngClick') : "";
|
||||||
html += (field.ngDisabled) ? `ng-disabled="${field.ngDisabled}"` : "";
|
html += (field.ngDisabled) ? `ng-disabled="${field.ngDisabled}"` : "";
|
||||||
html += (field.readonly) ? "disabled " : "";
|
html += (field.readonly) ? "disabled " : "";
|
||||||
html += (field.required) ? "required " : "";
|
html += (field.required) ? "required " : "";
|
||||||
|
|||||||
Reference in New Issue
Block a user