From 2cb6076b59b99ad0a2d732b99374792afbd72a01 Mon Sep 17 00:00:00 2001 From: Maharshi Patel Date: Wed, 20 Sep 2023 16:35:30 +0530 Subject: [PATCH] fix: cypress, dark mode, grid search, timeline fixes for Espresso * due to have fixed height of the grid heading, the search bar was not visible now added class that will double the height of the grid heading row if filter row is present. * dark mode fixes: button active state, Awesomeplete dropdown, Quill editor. * timeline style fixes --- .../public/js/frappe/form/controls/comment.js | 2 +- frappe/public/js/frappe/form/controls/link.js | 4 ++-- .../js/frappe/form/footer/form_timeline.js | 24 +++++++++---------- frappe/public/js/frappe/form/grid.js | 6 +++++ .../js/frappe/form/sidebar/attachments.js | 2 +- .../form/templates/timeline_message_box.html | 2 +- .../js/frappe/ui/alt_keyboard_shortcuts.js | 1 + frappe/public/scss/common/awesomeplete.scss | 3 ++- frappe/public/scss/common/buttons.scss | 13 +++++++++- frappe/public/scss/common/grid.scss | 14 ++++++++++- frappe/public/scss/common/quill.scss | 2 ++ frappe/public/scss/desk/dark.scss | 4 ++-- frappe/public/scss/desk/global.scss | 2 +- frappe/public/scss/desk/page.scss | 3 +++ frappe/public/scss/desk/timeline.scss | 3 --- 15 files changed, 59 insertions(+), 26 deletions(-) diff --git a/frappe/public/js/frappe/form/controls/comment.js b/frappe/public/js/frappe/form/controls/comment.js index 150b317728..a12da9c895 100644 --- a/frappe/public/js/frappe/form/controls/comment.js +++ b/frappe/public/js/frappe/form/controls/comment.js @@ -15,7 +15,7 @@ frappe.ui.form.ControlComment = class ControlComment extends frappe.ui.form.Cont ${frappe.avatar(frappe.session.user, "avatar-medium")}
- diff --git a/frappe/public/js/frappe/form/controls/link.js b/frappe/public/js/frappe/form/controls/link.js index e910bf8159..3daaeaf09b 100644 --- a/frappe/public/js/frappe/form/controls/link.js +++ b/frappe/public/js/frappe/form/controls/link.js @@ -285,7 +285,7 @@ frappe.ui.form.ControlLink = class ControlLink extends frappe.ui.form.ControlDat // new item r.results.push({ html: - "" + + "" + " " + __("Create a new {0}", [__(me.get_options())]) + "", @@ -309,7 +309,7 @@ frappe.ui.form.ControlLink = class ControlLink extends frappe.ui.form.ControlDat // not applicable in web forms r.results.push({ html: - "" + + "" + " " + __("Advanced Search") + "", diff --git a/frappe/public/js/frappe/form/footer/form_timeline.js b/frappe/public/js/frappe/form/footer/form_timeline.js index d9961e9977..0be26409a1 100644 --- a/frappe/public/js/frappe/form/footer/form_timeline.js +++ b/frappe/public/js/frappe/form/footer/form_timeline.js @@ -55,15 +55,16 @@ class FormTimeline extends BaseTimeline { }; let me = this; this.timeline_wrapper.remove(this.timeline_actions_wrapper); - this.timeline_wrapper - .prepend(` + this.timeline_wrapper.prepend(`

${__("Activity")}

- `) + `); if (has_communications()) { - this.timeline_wrapper.find(".timeline-item.activity-title") - .append(` + this.timeline_wrapper + .find(".timeline-item.activity-title") + .append( + `
Show all activity
- `) + ` + ) .find("input[type=checkbox]") .prop("checked", !me.only_communication) .on("click", function (e) { @@ -80,7 +82,9 @@ class FormTimeline extends BaseTimeline { $(this).tab("show"); }); } - this.timeline_wrapper.find(".timeline-item.activity-title").append(this.timeline_actions_wrapper); + this.timeline_wrapper + .find(".timeline-item.activity-title") + .append(this.timeline_actions_wrapper); } setup_document_email_link() { @@ -100,7 +104,7 @@ class FormTimeline extends BaseTimeline { `); - this.timeline_actions_wrapper.append(this.document_email_link_wrapper); + this.timeline_items_wrapper.before(this.document_email_link_wrapper); this.document_email_link_wrapper.find(".document-email-link").on("click", (e) => { let text = $(e.target).text(); @@ -153,9 +157,7 @@ class FormTimeline extends BaseTimeline { this.timeline_items.push(this.get_modified_message()); this.timeline_items.push(...this.get_communication_timeline_contents()); this.timeline_items.push(...this.get_comment_timeline_contents()); - this.timeline_wrapper.addClass("only_communication_timeline"); if (!this.only_communication) { - this.timeline_wrapper.removeClass("only_communication_timeline"); this.timeline_items.push(...this.get_view_timeline_contents()); this.timeline_items.push(...this.get_energy_point_timeline_contents()); this.timeline_items.push(...this.get_version_timeline_contents()); @@ -168,8 +170,6 @@ class FormTimeline extends BaseTimeline { this.timeline_items.push(...this.get_info_timeline_contents()); this.timeline_items.push(...this.get_milestone_timeline_contents()); } - - } get_view_timeline_contents() { diff --git a/frappe/public/js/frappe/form/grid.js b/frappe/public/js/frappe/form/grid.js index b3ec30a8c3..f9941d5010 100644 --- a/frappe/public/js/frappe/form/grid.js +++ b/frappe/public/js/frappe/form/grid.js @@ -362,6 +362,12 @@ export default class Grid { grid: this, show_search: true, }); + this.header_search.row.addClass("filter-row") + if (this.header_search.show_search || this.header_search.show_search_row()){ + $(this.parent).find(".grid-heading-row").addClass("with-filter"); + } else{ + $(this.parent).find(".grid-heading-row").removeClass("with-filter"); + } this.filter_applied && this.update_search_columns(); } diff --git a/frappe/public/js/frappe/form/sidebar/attachments.js b/frappe/public/js/frappe/form/sidebar/attachments.js index c8785a97c8..1b261e084c 100644 --- a/frappe/public/js/frappe/form/sidebar/attachments.js +++ b/frappe/public/js/frappe/form/sidebar/attachments.js @@ -162,7 +162,7 @@ frappe.ui.form.Attachments = class Attachments { } const icon = ` - ${frappe.utils.icon(attachment.is_private ? "lock" : "unlock", "sm ml-0")} + ${frappe.utils.icon(attachment.is_private ? "es-line-lock" : "es-line-unlock", "sm ml-0")} `; $(`
  • `) diff --git a/frappe/public/js/frappe/form/templates/timeline_message_box.html b/frappe/public/js/frappe/form/templates/timeline_message_box.html index ea30059be9..5e0afdc9a2 100644 --- a/frappe/public/js/frappe/form/templates/timeline_message_box.html +++ b/frappe/public/js/frappe/form/templates/timeline_message_box.html @@ -67,7 +67,7 @@ {% } %}
    -