From dad1c04aae2ded057ef649a845476a65fca22501 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 29 Jan 2019 14:59:39 +0530 Subject: [PATCH] feat: Deprecate In App Help (#6801) * [feat] Removed help from toolbar.js * [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 /search_docs from website * Removed help from migrate * Deprecated help from command utils * Removed help.py * Removed help setup from travis.yml * [fix] Fixed formatting issues * [fix] Deleted commented code from toolbar.js * [fix] Minor link fix * [Fix] Fixed a small typo * Removed docs_app dependency from pathces * [fix] Removed commented code * [fix] Typo in function name * fix: remove commented code * [fix] Changed 'Deprecated' message to 'Removed' Removed will be the correct term instead of deprecated --- .travis.yml | 2 - frappe/change_log/v8/v8_7_0.md | 2 +- frappe/commands/utils.py | 49 +-- frappe/migrate.py | 5 - frappe/patches.txt | 1 - .../v11_0/get_docs_apps_if_not_present.py | 7 - .../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 | 36 +- frappe/utils/help.py | 346 ------------------ frappe/www/search_docs.html | 7 - frappe/www/search_docs.py | 33 -- 13 files changed, 15 insertions(+), 546 deletions(-) delete mode 100644 frappe/patches/v11_0/get_docs_apps_if_not_present.py delete mode 100644 frappe/utils/help.py delete mode 100644 frappe/www/search_docs.html delete mode 100644 frappe/www/search_docs.py diff --git a/.travis.yml b/.travis.yml index 55481b7d4b..4039be4ec8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,8 +35,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 c920b9d6a6..917eb16be8 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -571,54 +571,27 @@ 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 + '''Removed: 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_app_help_deprecation() @click.command('get-docs-app') @click.argument('app') def get_docs_app(app): - '''Get the docs app for given app''' - from frappe.utils.help import setup_apps_for_docs - setup_apps_for_docs(app) + '''Removed: Get the docs app for given app''' + print_in_app_help_deprecation() @click.command('get-all-docs-apps') def get_all_docs_apps(): - '''Get docs apps for all apps''' - from frappe.utils.help import setup_apps_for_docs - for app in frappe.get_installed_apps(): - setup_apps_for_docs(app) + '''Removed: Get docs apps for all apps''' + print_in_app_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() + '''Removed: Setup help table in the current site (called after migrate)''' + print_in_app_help_deprecation() @click.command('rebuild-global-search') @pass_context @@ -681,6 +654,10 @@ def auto_deploy(context, app, migrate=False, restart=False, remote='upstream'): else: print('No Updates') +def print_in_app_help_deprecation(): + print("In app help has been removed.\nYou can access the documentation on erpnext.com/docs or frappe.io/docs") + return + commands = [ build, clear_cache, @@ -709,8 +686,6 @@ commands = [ watch, _bulk_rename, add_to_email_queue, - setup_global_help, - setup_help, rebuild_global_search, auto_deploy ] diff --git a/frappe/migrate.py b/frappe/migrate.py index d0fc2bf93c..956b4a3c93 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: @@ -60,10 +59,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/patches.txt b/frappe/patches.txt index ae0d85851b..cc2dc8827b 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -222,7 +222,6 @@ frappe.patches.v11_0.rename_workflow_action_to_workflow_action_master #13-06-201 frappe.patches.v11_0.rename_email_alert_to_notification #13-06-2018 frappe.patches.v11_0.delete_duplicate_user_permissions frappe.patches.v11_0.set_dropbox_file_backup -frappe.patches.v11_0.get_docs_apps_if_not_present frappe.patches.v10_0.set_default_locking_time frappe.patches.v11_0.rename_google_maps_doctype frappe.patches.v10_0.modify_smallest_currency_fraction diff --git a/frappe/patches/v11_0/get_docs_apps_if_not_present.py b/frappe/patches/v11_0/get_docs_apps_if_not_present.py deleted file mode 100644 index e534ebd0b3..0000000000 --- a/frappe/patches/v11_0/get_docs_apps_if_not_present.py +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import unicode_literals -import frappe -from frappe.utils.help import setup_apps_for_docs - -def execute(): - for app in frappe.get_installed_apps(): - setup_apps_for_docs(app) diff --git a/frappe/public/js/frappe/ui/toolbar/navbar.html b/frappe/public/js/frappe/ui/toolbar/navbar.html index dc13b357cc..12e4c5beaa 100644 --- a/frappe/public/js/frappe/ui/toolbar/navbar.html +++ b/frappe/public/js/frappe/ui/toolbar/navbar.html @@ -47,16 +47,8 @@ style="padding: 50% 7px; font-size: 17px; background-color: #fafbfc; font-weight: 100;">?