Merge pull request #8110 from prssanna/energy-point-notifications

fix: Improvements to Energy Point Notifications
This commit is contained in:
mergify[bot] 2019-08-08 06:41:11 +00:00 committed by GitHub
commit 41fbdc5fb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -13,6 +13,7 @@ frappe.ui.EnergyPointsNotifications = class {
this.get_energy_points_list(this.max_length).then(user_points_list => {
this.dropdown_items = user_points_list;
this.render_energy_points_dropdown();
this.setup_view_full_log();
if (this.$dropdown_list.find('.unseen').length) {
this.$notification_indicator.show();
}
@ -106,7 +107,7 @@ frappe.ui.EnergyPointsNotifications = class {
let item_html = this.get_dropdown_item_html(field);
if (item_html) body_html += item_html;
});
view_full_log_html = `<li><a href="#List/Energy%20Point%20Log/List" class="text-muted text-center">${__('View Full Log')}</a></li>`;
view_full_log_html = `<li><a class="text-muted text-center full-log-btn">${__('View Full Log')}</a></li>`;
} else {
body_html += `<li><a href="#" onclick = "return false" class="text-muted text-center">${__('No activity')}</a></li>`;
}
@ -163,4 +164,10 @@ frappe.ui.EnergyPointsNotifications = class {
return message_html;
}
setup_view_full_log() {
this.$dropdown_list.find('.full-log-btn').on('click', () => {
frappe.set_route('List', 'Energy Point Log', {user: frappe.session.user});
});
}
};

View file

@ -309,7 +309,9 @@
.points-updates-header {
background: @navbar-bg;
padding: 9px;
padding: 10px;
position: sticky;
top: 0;
}
.points-date-range {