From d3b4a165f2d49d82bc64df42e047d7526a4b99c0 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 28 Jan 2019 12:20:24 +0530 Subject: [PATCH] feat: [v10] Deprecate In App Help (#6834) * [feat] Removed help from global search * [feat] redirected search in help to docs website [] Url needs to be configurable from hooks * [Feat] Removed search functions for help * [fix] Help links not redirecting * [feat] Modified "Help" menu on desk toolbar * [feat] Removed docs search from desk toolbar * Removed Search from toolbar.js * Removed help from migrate * Deprecated help from command utils * Removed help setup from travis.yml * [fix] Fixed formatting issues * [fix] Deleted commented code from toolbar.js * [fix] Minor link fix * [fix] Removed accidentally added autodeploy --- .travis.yml | 2 - frappe/change_log/v8/v8_7_0.md | 2 +- frappe/commands/utils.py | 38 ++++-------------- frappe/migrate.py | 5 --- .../public/js/frappe/ui/toolbar/navbar.html | 8 +--- frappe/public/js/frappe/ui/toolbar/search.js | 25 +----------- .../js/frappe/ui/toolbar/search_utils.js | 40 ------------------- frappe/public/js/frappe/ui/toolbar/toolbar.js | 37 +---------------- 8 files changed, 14 insertions(+), 143 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c16472271..803d414cd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,6 @@ before_script: - cd ~/frappe-bench - bench use test_site - bench reinstall --yes - - bench setup-help - - bench setup-global-help --mariadb_root_password travis - bench scheduler disable - sed -i 's/9000/9001/g' sites/common_site_config.json - bench start & diff --git a/frappe/change_log/v8/v8_7_0.md b/frappe/change_log/v8/v8_7_0.md index c7b0b4d577..8c982dcbcc 100644 --- a/frappe/change_log/v8/v8_7_0.md +++ b/frappe/change_log/v8/v8_7_0.md @@ -1,2 +1,2 @@ ### User Permissions -- User Permission is now a DocType, a new UX for the existing Role and User Permission managers to make it easy to enter permissions. For more details please check User Permissions \ No newline at end of file +- User Permission is now a DocType, a new UX for the existing Role and User Permission managers to make it easy to enter permissions. For more details please check User Permissions \ No newline at end of file diff --git a/frappe/commands/utils.py b/frappe/commands/utils.py index ff606d940d..774728ca6a 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -455,40 +455,16 @@ def get_version(): @click.command('setup-global-help') @click.option('--mariadb_root_password') def setup_global_help(mariadb_root_password=None): - '''setup help table in a separate database that will be + '''Deprecated: setup help table in a separate database that will be shared by the whole bench and set `global_help_setup` as 1 in common_site_config.json''' - - from frappe.installer import update_site_config - - frappe.local.flags = frappe._dict() - frappe.local.flags.in_setup_help = True - frappe.local.flags.in_install = True - frappe.local.lang = 'en' - frappe.local.conf = frappe.get_site_config(sites_path='.') - - update_site_config('global_help_setup', 1, - site_config_path=os.path.join('.', 'common_site_config.json')) - - if mariadb_root_password: - frappe.local.conf.root_password = mariadb_root_password - - from frappe.utils.help import sync - sync() + print_in_an_help_deprecation() @click.command('setup-help') @pass_context def setup_help(context): - '''Setup help table in the current site (called after migrate)''' - from frappe.utils.help import sync - - for site in context.sites: - try: - frappe.init(site) - frappe.connect() - sync() - finally: - frappe.destroy() + '''Deprecated: Setup help table in the current site (called after migrate)''' + print_in_an_help_deprecation() @click.command('rebuild-global-search') @pass_context @@ -509,6 +485,10 @@ def rebuild_global_search(context): frappe.destroy() +def print_in_an_help_deprecation(): + print("In app help has been deprectated.\nYou can access the documentation on erpnext.com/docs or frappe.io/docs") + return + commands = [ build, clear_cache, @@ -535,7 +515,5 @@ commands = [ watch, _bulk_rename, add_to_email_queue, - setup_global_help, - setup_help, rebuild_global_search ] diff --git a/frappe/migrate.py b/frappe/migrate.py index 8d9ed33b31..6726207add 100644 --- a/frappe/migrate.py +++ b/frappe/migrate.py @@ -14,7 +14,6 @@ from frappe.website import render, router from frappe.desk.doctype.desktop_icon.desktop_icon import sync_desktop_icons from frappe.core.doctype.language.language import sync_languages from frappe.modules.utils import sync_customizations -import frappe.utils.help def migrate(verbose=True, rebuild_website=False): '''Migrate all apps to the latest version, will: @@ -47,10 +46,6 @@ def migrate(verbose=True, rebuild_website=False): frappe.db.commit() - if not frappe.conf.get('global_help_setup'): - # sync help if not set as global - frappe.utils.help.sync() - clear_notifications() frappe.publish_realtime("version-update") diff --git a/frappe/public/js/frappe/ui/toolbar/navbar.html b/frappe/public/js/frappe/ui/toolbar/navbar.html index f702994dcb..cb38a95ea0 100644 --- a/frappe/public/js/frappe/ui/toolbar/navbar.html +++ b/frappe/public/js/frappe/ui/toolbar/navbar.html @@ -53,16 +53,12 @@ style="padding: 50% 7px; font-size: 17px; background-color: #fafbfc; font-weight: 100;">?