13146-Change header notifications styles

This commit is contained in:
Pablo Aragon 2024-03-25 13:29:49 +01:00
parent 3e5ecb6574
commit c2d00123e5
4 changed files with 106 additions and 78 deletions

View File

@ -599,21 +599,12 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
function filter_notification() { function filter_notification() {
let notification_type = ''; let notification_type = '';
$('.notification-item').hide(); $('.notification-item').hide();
$(".checkbox_filter_notifications:checkbox:checked").each(function() { notification_type = $("#notifications_filter_options").val()
notification_type = $(this).val();
console.log(notification_type); if (notification_type === 'All') {
$('.notification-item').show();
} else {
$('.notification-item[value='+notification_type+']').show(); $('.notification-item[value='+notification_type+']').show();
if (notification_type == 'All'){
$('.notification-item').show();
}
});
if (notification_type == 'All'){
$('.notification-item').show();
}
if (notification_type == ''){
$('.notification-item').hide();
} }
} }

View File

@ -1066,39 +1066,39 @@ function notification_filter()
} }
$types_list = array_unique($types_list); $types_list = array_unique($types_list);
$notification_filter = "<ul id='menu-filter_notification'>"; $notification_filter = '';
$filter_options = [];
$notification_filter .= "<li>
<input type='checkbox' name='filter_menu' id='filter_menu'>
<label for='filter_menu' id='filter_menu_label'>".__('Filter').'</label>';
$notification_filter .= "<ul class='sublevel-filter_notification'>";
foreach ($types_list as $type) { foreach ($types_list as $type) {
if ($type === 'All') { if ($type === 'All') {
$checked = 'checked'; $checked = 'All';
} else { } else {
$checked = ''; $checked = '';
} }
switch ($type) { switch ($type) {
case 'All':
$type_name = __('Show all');
break;
case 'HISTORYDB': case 'HISTORYDB':
$type_name = 'HISTORY DB'; $type_name = __('History DB');
break; break;
case 'PANDORADB': case 'PANDORADB':
$type_name = 'PANDORA DB'; $type_name = __('Pandora DB');
break; break;
case 'UPDATEMANAGER': case 'UPDATEMANAGER':
$type_name = 'WARP UPDATE'; $type_name = __('Warp update');
break; break;
case 'ALLOWOVERRIDE': case 'ALLOWOVERRIDE':
$type_name = 'ALLOW OVERRIDE'; $type_name = __('Allow override');
break; break;
case 'DISCOVERYTASK': case 'DISCOVERYTASK':
$type_name = 'DISCOVERY TASK'; $type_name = __('Discovery task');
break; break;
default: default:
@ -1106,29 +1106,31 @@ function notification_filter()
break; break;
} }
$notification_filter .= "<li><div class='item-filter'> $filter_options[$type] = $type_name;
<input type='checkbox'
class='checkbox_filter_notifications'
value=".$type."
name='filter_".$type."'
".$checked."
id='filter_".$type."'>
<label for='filter_".$type."'>".$type_name.'</label>
</div>
</li>';
} }
$notification_filter .= "<li><div class='item-filter'>"; $filter_select = html_print_select(
$filter_options,
'notifications_filter_options',
$checked,
'',
'',
0,
true,
false,
false,
'w150px'
);
$notification_filter .= html_print_div( $notification_filter .= html_print_div(
[ [
'class' => 'action-buttons w100p', 'class' => 'action-buttons w100p',
'content' => html_print_submit_button( 'content' => $filter_select.html_print_submit_button(
__('Filter'), __('Apply filter'),
'btn_submit', 'btn_submit',
false, false,
[ [
'class' => 'mini sub filter', 'class' => 'link font_14px link-bold text-nowrap',
'icon' => 'search mini',
'onClick' => 'filter_notification()', 'onClick' => 'filter_notification()',
], ],
true true
@ -1137,14 +1139,6 @@ function notification_filter()
true true
); );
$notification_filter .= '</div>
</li>';
$notification_filter .= '</ul>';
$notification_filter .= '</li>';
$notification_filter .= '</ul>';
return $notification_filter; return $notification_filter;
} }
@ -1161,19 +1155,23 @@ function notifications_print_dropdown()
$mess = []; $mess = [];
} }
$redirection_notifications = html_print_menu_button( $redirection_notifications = html_print_button(
__('See all notifications'),
'see_all_notifications',
false,
'window.location="'.ui_get_full_url('index.php?sec=message_list&sec2=operation/messages/message_list').'"',
[ [
'href' => 'javascript:', 'mode' => 'secondary',
'class' => 'notification_menu_actions', 'class' => 'bolder',
'text' => __('View all messages'), 'icon' => 'unset',
'onClick' => "window.location='".ui_get_full_url('index.php?sec=message_list&sec2=operation/messages/message_list')."'",
], ],
true true
); );
$notification_menu = html_print_menu_button( $notification_menu = html_print_menu_button(
[ [
'href' => 'javascript:', 'href' => 'javascript:',
'class' => 'notification_menu_actions', 'class' => 'notification_menu_actions link-bold font_14px',
'text' => __('Mark all as read'), 'text' => __('Mark all as read'),
'onClick' => 'mark_all_notification_as_read()', 'onClick' => 'mark_all_notification_as_read()',
], ],
@ -1187,10 +1185,14 @@ function notifications_print_dropdown()
<div class='notificaion_menu_container'> <div class='notificaion_menu_container'>
<div class='menu_tab filter_notification'>%s</div> <div class='menu_tab filter_notification'>%s</div>
<div class='menu_tab notification_menu'>%s</div> <div class='menu_tab notification_menu'>%s</div>
<div class='menu_tab notification_menu'>%s</div>
</div> </div>
<div class='notifications-div'>
%s %s
</div> </div>
<center>
<div class='mrgn_top_10px mrgn_btn_10px'>%s</div>
</center>
</div>
</div> </div>
<div <div
id='notification-wrapper-shadow' id='notification-wrapper-shadow'
@ -1200,14 +1202,14 @@ function notifications_print_dropdown()
", ",
$notification_filter, $notification_filter,
$notification_menu, $notification_menu,
$redirection_notifications,
array_reduce( array_reduce(
$mess, $mess,
function ($carry, $message) { function ($carry, $message) {
return $carry.notifications_print_dropdown_element($message); return $carry.notifications_print_dropdown_element($message);
}, },
'' ''
) ),
$redirection_notifications
); );
} }

View File

@ -4976,14 +4976,14 @@ div#dialog_messages table th:last-child {
#notification-wrapper { #notification-wrapper {
background: white; background: white;
border: #a5a5a5 solid 1px; border: 1px solid #e5e9ed;
z-index: 900000; z-index: 900000;
position: absolute; position: absolute;
width: 550px; width: 550px;
margin-top: 55px; margin-top: 55px;
border-radius: 5px; border-radius: 8px;
max-height: 530px;
position: fixed; position: fixed;
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.13);
} }
#notification-wrapper::before { #notification-wrapper::before {
@ -4991,29 +4991,38 @@ div#dialog_messages table th:last-child {
display: block; display: block;
position: absolute; position: absolute;
width: 0px; width: 0px;
height: 0; height: 16px;
border-color: transparent; width: 16px;
border-width: 12px; bottom: calc(100% - 8px);
border-style: solid;
bottom: 100%;
left: calc(58% - 7px); left: calc(58% - 7px);
margin-left: -12px; margin-left: -9px;
border-bottom-color: white; border-left: 1px solid #e5e9ed;
transform: rotate(45deg);
border-left: 1px solid #e5e9ed;
border-top: 1px solid #e5e9ed;
background-color: var(--secondary-color);
transform: rotate(45deg);
} }
#notification-wrapper-inner { #notification-wrapper-inner center {
max-height: 400px; border-top: 1px solid #e5e9ed;
}
.notifications-div {
max-height: calc(100vh - 200px);
overflow: auto; overflow: auto;
} }
.notifications-div::-webkit-scrollbar {
display: none;
}
#notification-wrapper-shadow { #notification-wrapper-shadow {
height: 100%; height: 100%;
width: 100%; width: 100%;
background: #111;
position: fixed; position: fixed;
z-index: 9009; z-index: 9009;
top: 0; top: 0;
opacity: 0.3;
} }
.notification-item { .notification-item {
@ -5026,6 +5035,10 @@ div#dialog_messages table th:last-child {
padding: 5px; padding: 5px;
} }
.notification-item:last-child {
border-bottom: 0;
}
.notification-item > * { .notification-item > * {
padding-left: 7px; padding-left: 7px;
pointer-events: none; pointer-events: none;
@ -10571,7 +10584,7 @@ button.submitButton:active {
border: 2px solid #57ea82; border: 2px solid #57ea82;
} }
button.buttonButton > div, button.buttonButton > div:not(.unset),
button.submitButton > div { button.submitButton > div {
background-color: #fff; background-color: #fff;
width: 2rem; width: 2rem;
@ -12660,11 +12673,12 @@ form.cfv_status_agent input:checked + label:before {
.notificaion_menu_container { .notificaion_menu_container {
display: flex; display: flex;
padding-top: 10px; padding: 10px 15px;
padding-left: 15px; flex-direction: row;
} flex-wrap: nowrap;
.notification_menu { align-items: center;
width: 100px; justify-content: space-between;
border-bottom: 1px solid #e5e9ed;
} }
.filter_notification { .filter_notification {
@ -13847,3 +13861,18 @@ button.disabled {
.tabs-show { .tabs-show {
display: list-item; display: list-item;
} }
.link-bold {
color: var(--primary-color);
text-decoration: none;
font-weight: bold;
}
.link-bold:hover {
opacity: 0.9;
color: var(--primary-color);
}
.text-nowrap {
text-wrap: nowrap;
}

View File

@ -1885,3 +1885,9 @@ a.pandora_pagination,
#score-bar .labels-bar div { #score-bar .labels-bar div {
color: white; color: white;
} }
a.link-bold {
color: var(--primary-color) !important;
text-decoration: none;
font-weight: bold;
}