diff --git a/frappe/boot.py b/frappe/boot.py index 8cf75e02bb..0dfcb8d1b4 100644 --- a/frappe/boot.py +++ b/frappe/boot.py @@ -21,7 +21,7 @@ from frappe.website.doctype.web_page_view.web_page_view import is_tracking_enabl from frappe.social.doctype.energy_point_log.energy_point_log import get_energy_points from frappe.model.base_document import get_controller from frappe.social.doctype.post.post import frequently_visited_links -from frappe.core.doctype.navbar_settings.navbar_settings import get_navbar_settings +from frappe.core.doctype.navbar_settings.navbar_settings import get_navbar_settings, get_app_logo def get_bootinfo(): """build and return boot info""" @@ -62,6 +62,7 @@ def get_bootinfo(): doclist.extend(get_meta_bundle("Page")) bootinfo.home_folder = frappe.db.get_value("File", {"is_home_folder": 1}) bootinfo.navbar_settings = get_navbar_settings() + bootinfo.notification_settings = get_notification_settings() # ipinfo if frappe.session.data.get('ipinfo'): @@ -90,6 +91,7 @@ def get_bootinfo(): bootinfo.link_preview_doctypes = get_link_preview_doctypes() bootinfo.additional_filters_config = get_additional_filters_from_hooks() bootinfo.desk_settings = get_desk_settings() + bootinfo.app_logo_url = get_app_logo() return bootinfo @@ -323,4 +325,7 @@ def get_desk_settings(): for key in desk_properties: desk_settings[key] = desk_settings.get(key) or role.get(key) - return desk_settings \ No newline at end of file + return desk_settings + +def get_notification_settings(): + return frappe.get_cached_doc('Notification Settings', frappe.session.user) diff --git a/frappe/core/doctype/navbar_settings/navbar_settings.py b/frappe/core/doctype/navbar_settings/navbar_settings.py index db510981a4..2244bc9e4e 100644 --- a/frappe/core/doctype/navbar_settings/navbar_settings.py +++ b/frappe/core/doctype/navbar_settings/navbar_settings.py @@ -25,7 +25,7 @@ class NavbarSettings(Document): @frappe.whitelist(allow_guest=True) def get_app_logo(): - app_logo = frappe.db.get_single_value('Navbar Settings', 'app_logo') + app_logo = frappe.db.get_single_value('Navbar Settings', 'app_logo', cache=True) if not app_logo: app_logo = frappe.get_hooks('app_logo_url')[-1] diff --git a/frappe/email/test_email_body.py b/frappe/email/test_email_body.py index 9b0b5e41d7..3fcabb9495 100644 --- a/frappe/email/test_email_body.py +++ b/frappe/email/test_email_body.py @@ -17,7 +17,7 @@ class TestEmailBody(unittest.TestCase):

Hey John Doe!

This is embedded image you asked for

- +
''' email_text = ''' @@ -25,7 +25,7 @@ Hey John Doe! This is the text version of this email ''' - img_path = os.path.abspath('assets/frappe/images/favicon.png') + img_path = os.path.abspath('assets/frappe/images/frappe-favicon.svg') with open(img_path, 'rb') as f: img_content = f.read() img_base64 = base64.b64encode(img_content).decode() @@ -77,12 +77,11 @@ This is the text version of this email def test_image(self): img_signature = ''' -Content-Type: image/png +Content-Type: image/svg+xml MIME-Version: 1.0 Content-Transfer-Encoding: base64 -Content-Disposition: inline; filename="favicon.png" +Content-Disposition: inline; filename="frappe-favicon.svg" ''' - self.assertTrue(img_signature in self.email_string) self.assertTrue(self.img_base64 in self.email_string) @@ -117,7 +116,7 @@ w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> def test_replace_filename_with_cid(self): original_message = '''
- test + test
''' diff --git a/frappe/integrations/doctype/social_login_key/social_login_key.py b/frappe/integrations/doctype/social_login_key/social_login_key.py index 1092c3240e..d84e6ef11d 100644 --- a/frappe/integrations/doctype/social_login_key/social_login_key.py +++ b/frappe/integrations/doctype/social_login_key/social_login_key.py @@ -124,7 +124,7 @@ class SocialLoginKey(Document): "provider_name": "Frappe", "enable_social_login": 1, "custom_base_url": 1, - "icon":"/assets/frappe/images/favicon.png", + "icon":"/assets/frappe/images/frappe-favicon.svg", "redirect_url": "/api/method/frappe.www.login.login_via_frappe", "api_endpoint": "/api/method/frappe.integrations.oauth2.openid_profile", "api_endpoint_args":None, diff --git a/frappe/public/build.json b/frappe/public/build.json index 6d7ccaa3da..5f63a32dd2 100755 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -27,8 +27,6 @@ "public/js/frappe/microtemplate.js", "public/js/frappe/query_string.js", - "public/js/frappe/ui/dropzone.js", - "public/js/frappe/ui/upload.html", "public/js/frappe/upload.js", "public/js/frappe/model/meta.js", @@ -150,7 +148,6 @@ "public/js/frappe/ui/dialog.js", "public/js/frappe/ui/capture.js", "public/js/frappe/ui/app_icon.js", - "public/js/frappe/ui/dropzone.js", "public/js/frappe/ui/theme_switcher.js", "public/js/frappe/model/model.js", @@ -177,7 +174,6 @@ "public/js/frappe/utils/preview_email.js", "public/js/frappe/utils/file_manager.js", - "public/js/frappe/ui/upload.html", "public/js/frappe/upload.js", "public/js/frappe/ui/tree.js", @@ -207,6 +203,7 @@ "public/js/frappe/ui/sort_selector.js", "public/js/frappe/change_log.html", + "public/js/frappe/ui/workspace_loading_skeleton.html", "public/js/frappe/desk.js", "public/js/frappe/query_string.js", diff --git a/frappe/public/css/fonts/inter/inter.css b/frappe/public/css/fonts/inter/inter.css index 8fba7cf2cf..e7c92eed4e 100644 --- a/frappe/public/css/fonts/inter/inter.css +++ b/frappe/public/css/fonts/inter/inter.css @@ -1,5 +1,6 @@ @font-face { font-family: 'Inter'; + font-display: swap; font-style: normal; font-weight: 100; src: url("/assets/frappe/css/fonts/inter/inter_thin.woff2") format("woff2"), @@ -7,6 +8,7 @@ } @font-face { font-family: 'Inter'; + font-display: swap; font-style: italic; font-weight: 100; src: url("/assets/frappe/css/fonts/inter/inter_thinitalic.woff2") format("woff2"), @@ -15,6 +17,7 @@ @font-face { font-family: 'Inter'; + font-display: swap; font-style: normal; font-weight: 200; src: url("/assets/frappe/css/fonts/inter/inter_extralight.woff2") format("woff2"), @@ -22,6 +25,7 @@ } @font-face { font-family: 'Inter'; + font-display: swap; font-style: italic; font-weight: 200; src: url("/assets/frappe/css/fonts/inter/inter_extralightitalic.woff2") format("woff2"), @@ -30,6 +34,7 @@ @font-face { font-family: 'Inter'; + font-display: swap; font-style: normal; font-weight: 300; src: url("/assets/frappe/css/fonts/inter/inter_light.woff2") format("woff2"), @@ -37,6 +42,7 @@ } @font-face { font-family: 'Inter'; + font-display: swap; font-style: italic; font-weight: 300; src: url("/assets/frappe/css/fonts/inter/inter_lightitalic.woff2") format("woff2"), @@ -45,6 +51,7 @@ @font-face { font-family: 'Inter'; + font-display: swap; font-style: normal; font-weight: 400; src: url("/assets/frappe/css/fonts/inter/inter_regular.woff2") format("woff2"), @@ -52,6 +59,7 @@ } @font-face { font-family: 'Inter'; + font-display: swap; font-style: italic; font-weight: 400; src: url("/assets/frappe/css/fonts/inter/inter_italic.woff2") format("woff2"), @@ -60,6 +68,7 @@ @font-face { font-family: 'Inter'; + font-display: swap; font-style: normal; font-weight: 500; src: url("/assets/frappe/css/fonts/inter/inter_medium.woff2") format("woff2"), @@ -67,6 +76,7 @@ } @font-face { font-family: 'Inter'; + font-display: swap; font-style: italic; font-weight: 500; src: url("/assets/frappe/css/fonts/inter/inter_mediumitalic.woff2") format("woff2"), @@ -75,6 +85,7 @@ @font-face { font-family: 'Inter'; + font-display: swap; font-style: normal; font-weight: 600; src: url("/assets/frappe/css/fonts/inter/inter_semibold.woff2") format("woff2"), @@ -82,6 +93,7 @@ } @font-face { font-family: 'Inter'; + font-display: swap; font-style: italic; font-weight: 600; src: url("/assets/frappe/css/fonts/inter/inter_semibolditalic.woff2") format("woff2"), @@ -90,6 +102,7 @@ @font-face { font-family: 'Inter'; + font-display: swap; font-style: normal; font-weight: 700; src: url("/assets/frappe/css/fonts/inter/inter_bold.woff2") format("woff2"), @@ -97,6 +110,7 @@ } @font-face { font-family: 'Inter'; + font-display: swap; font-style: italic; font-weight: 700; src: url("/assets/frappe/css/fonts/inter/inter_bolditalic.woff2") format("woff2"), @@ -105,6 +119,7 @@ @font-face { font-family: 'Inter'; + font-display: swap; font-style: normal; font-weight: 800; src: url("/assets/frappe/css/fonts/inter/inter_extrabold.woff2") format("woff2"), @@ -112,6 +127,7 @@ } @font-face { font-family: 'Inter'; + font-display: swap; font-style: italic; font-weight: 800; src: url("/assets/frappe/css/fonts/inter/inter_extrabolditalic.woff2") format("woff2"), @@ -120,6 +136,7 @@ @font-face { font-family: 'Inter'; + font-display: swap; font-style: normal; font-weight: 900; src: url("/assets/frappe/css/fonts/inter/inter_black.woff2") format("woff2"), @@ -127,8 +144,9 @@ } @font-face { font-family: 'Inter'; + font-display: swap; font-style: italic; font-weight: 900; src: url("/assets/frappe/css/fonts/inter/inter_blackitalic.woff2") format("woff2"), url("/assets/frappe/css/fonts/inter/inter_blackitalic.woff") format("woff"); -} \ No newline at end of file +} diff --git a/frappe/public/images/favicon.png b/frappe/public/images/favicon.png deleted file mode 100644 index d66d3920f8..0000000000 Binary files a/frappe/public/images/favicon.png and /dev/null differ diff --git a/frappe/public/js/frappe/chat.js b/frappe/public/js/frappe/chat.js index 813205ecd0..fd440dcbbc 100644 --- a/frappe/public/js/frappe/chat.js +++ b/frappe/public/js/frappe/chat.js @@ -2781,7 +2781,8 @@ frappe.chat.setup = () => { } } -$(document).on('ready toolbar_setup', () => -{ - frappe.chat.setup() -}) +// TODO: Re-enable after re-designing chat +// $(document).on('ready toolbar_setup', () => +// { +// frappe.chat.setup() +// }) diff --git a/frappe/public/js/frappe/desk.js b/frappe/public/js/frappe/desk.js index cac2e65885..4141f37c98 100644 --- a/frappe/public/js/frappe/desk.js +++ b/frappe/public/js/frappe/desk.js @@ -45,10 +45,7 @@ frappe.Application = Class.extend({ this.setup_frappe_vue(); this.load_bootinfo(); this.load_user_permissions(); - this.set_app_logo_url() - .then(() => { - this.make_nav_bar(); - }); + this.make_nav_bar(); this.set_favicon(); this.setup_analytics(); this.set_fullwidth_if_enabled(); @@ -82,8 +79,11 @@ frappe.Application = Class.extend({ } if (frappe.user_roles.includes('System Manager')) { - this.show_change_log(); - this.show_update_available(); + // delayed following requests to make boot faster + setTimeout(() => { + this.show_change_log(); + this.show_update_available(); + }, 1000); } if (!frappe.boot.developer_mode) { @@ -470,19 +470,6 @@ frappe.Application = Class.extend({ $('').appendTo("head"); $('').appendTo("head"); }, - - set_app_logo_url: function() { - return frappe.call('frappe.core.doctype.navbar_settings.navbar_settings.get_app_logo') - .then(r => { - frappe.app.logo_url = r.message; - if (window.cordova) { - let host = frappe.request.url; - host = host.slice(0, host.length - 1); - frappe.app.logo_url = host + frappe.app.logo_url; - } - }); - }, - trigger_primary_action: function() { if(window.cur_dialog && cur_dialog.display) { // trigger primary diff --git a/frappe/public/js/frappe/ui/dropzone.js b/frappe/public/js/frappe/ui/dropzone.js deleted file mode 100644 index c2bb92293d..0000000000 --- a/frappe/public/js/frappe/ui/dropzone.js +++ /dev/null @@ -1,57 +0,0 @@ -// DropZone -frappe.ui.DropZone = class -{ - constructor (selector, options) { - this.options = Object.assign({ }, frappe.ui.DropZone.OPTIONS, options); - this.$container = $(selector); - this.$wrapper = $(frappe.ui.DropZone.TEMPLATE); - - this.make(); - } - - make ( ) { - const me = this; - const $dropzone = this.$wrapper.find('.panel-body'); - const $title = $dropzone.find('.dropzone-title'); - $title.html(this.options.title); - - $dropzone.on('dragover', function (e) { - e.preventDefault(); - - $title.html(__('Drop')); - }); - $dropzone.on('dragleave', function (e) { - e.preventDefault(); - - $title.html(me.options.title); - }); - $dropzone.on('drop', function (e) { - e.preventDefault(); - - const files = e.originalEvent.dataTransfer.files; - me.options.drop(files); - - $title.html(me.options.title); - }); - - this.$container.html(this.$wrapper); - } -}; -frappe.ui.DropZone.TEMPLATE = -` -
-
-
-
-
-
-`; -frappe.ui.DropZone.OPTIONS = -{ - title: __('Drop Here') -}; diff --git a/frappe/public/js/frappe/ui/notifications/notifications.js b/frappe/public/js/frappe/ui/notifications/notifications.js index 7d7f66e848..719531c524 100644 --- a/frappe/public/js/frappe/ui/notifications/notifications.js +++ b/frappe/public/js/frappe/ui/notifications/notifications.js @@ -3,12 +3,8 @@ frappe.provide('frappe.search'); frappe.ui.Notifications = class Notifications { constructor() { this.tabs = {}; - frappe.model - .with_doc('Notification Settings', frappe.session.user) - .then(doc => { - this.notifications_settings = doc; - this.make(); - }); + this.notification_settings = frappe.boot.notification_settings; + this.make(); } make() { @@ -23,7 +19,6 @@ frappe.ui.Notifications = class Notifications { this.user = frappe.session.user; this.setup_headers(); - let me = this; this.setup_dropdown_events(); } @@ -109,7 +104,7 @@ frappe.ui.Notifications = class Notifications { let tabView = new item.view( item.el, this.dropdown, - this.notifications_settings + this.notification_settings ); this.tabs[item.id] = tabView; } @@ -444,4 +439,4 @@ class EventsView extends BaseNotificationsView { this.container.html(html); } -} \ No newline at end of file +} diff --git a/frappe/public/js/frappe/ui/toolbar/navbar.html b/frappe/public/js/frappe/ui/toolbar/navbar.html index 2349b2205e..2f22bf5909 100644 --- a/frappe/public/js/frappe/ui/toolbar/navbar.html +++ b/frappe/public/js/frappe/ui/toolbar/navbar.html @@ -1,7 +1,7 @@