diff --git a/.github/helper/install.sh b/.github/helper/install.sh index 6c81d6298a..454cc89694 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -50,6 +50,7 @@ if [ "$TYPE" == "server" ]; then sed -i 's/^socketio:/# socketio:/g' Procfile; f if [ "$TYPE" == "server" ]; then sed -i 's/^redis_socketio:/# redis_socketio:/g' Procfile; fi if [ "$TYPE" == "ui" ]; then bench setup requirements --node; fi +if [ "$TYPE" == "server" ]; then bench setup requirements --dev; fi # install node-sass which is required for website theme test cd ./apps/frappe || exit diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000000..df3ae9484a --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,3 @@ +Faker~=8.1.0 +pyngrok~=5.0.5 +unittest-xml-reporting~=3.0.4 diff --git a/frappe/__init__.py b/frappe/__init__.py index 1b4429d55b..c8245b0bf0 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -30,9 +30,6 @@ from .utils.lazy_loader import lazy_import from frappe.query_builder import get_query_builder, patch_query_execute -# Lazy imports -faker = lazy_import('faker') - __version__ = '14.0.0-dev' __title__ = "Frappe Framework" @@ -1838,6 +1835,7 @@ def parse_json(val): return parse_json(val) def mock(type, size=1, locale='en'): + import faker results = [] fake = faker.Faker(locale) if type not in dir(fake): diff --git a/frappe/build.py b/frappe/build.py index 8b32b03d60..6b93b8b93a 100644 --- a/frappe/build.py +++ b/frappe/build.py @@ -16,7 +16,6 @@ from frappe.utils.minify import JavascriptMinify import click import psutil from urllib.parse import urlparse -from simple_chalk import green from semantic_version import Version from requests import head from requests.exceptions import HTTPError @@ -108,7 +107,7 @@ def fetch_assets(url, frappe_head): if not assets_archive: raise AssetsNotDownloadedError(f"Assets could not be retrived from {url}") - print(f"\n{green('✔')} Downloaded Frappe assets from {url}") + click.echo(click.style("✔", fg="green") + f" Downloaded Frappe assets from {url}") return assets_archive @@ -131,7 +130,7 @@ def setup_assets(assets_archive): directories_created.add(asset_directory) tar.makefile(file, dest) - print("{0} Restored {1}".format(green('✔'), show)) + click.echo(click.style("✔", fg="green") + f" Restored {show}") return directories_created @@ -379,7 +378,7 @@ def make_asset_dirs(hard_link=False): except Exception: print(fail_message, end="\r") - print(unstrip(f"{green('✔')} Application Assets Linked") + "\n") + click.echo(unstrip(click.style("✔", fg="green") + " Application Assets Linked") + "\n") def link_assets_dir(source, target, hard_link=False): diff --git a/frappe/exceptions.py b/frappe/exceptions.py index 31a94ac883..4b59f8f38f 100644 --- a/frappe/exceptions.py +++ b/frappe/exceptions.py @@ -99,8 +99,8 @@ class IncompatibleApp(ValidationError): pass class InvalidDates(ValidationError): pass class DataTooLongException(ValidationError): pass class FileAlreadyAttachedException(Exception): pass -class DocumentAlreadyRestored(Exception): pass -class AttachmentLimitReached(Exception): pass +class DocumentAlreadyRestored(ValidationError): pass +class AttachmentLimitReached(ValidationError): pass # OAuth exceptions class InvalidAuthorizationHeader(CSRFTokenError): pass class InvalidAuthorizationPrefix(CSRFTokenError): pass diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index 09072e106e..07c8acef27 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -302,9 +302,20 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { refresh(refresh_header=false) { super.refresh().then(() => { this.render_header(refresh_header); + this.update_checkbox(); }); } + update_checkbox(target) { + let $check_all_checkbox = this.$checkbox_actions.find(".list-check-all"); + + if ($check_all_checkbox.prop("checked") && target && !target.prop("checked")) { + $check_all_checkbox.prop("checked", false); + } + + $check_all_checkbox.prop("checked", this.$checks.length === this.data.length); + } + setup_freeze_area() { this.$freeze = $( `
${__( @@ -1253,6 +1264,8 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { } this.$checkbox_cursor = $target; + + this.update_checkbox($target); }); } @@ -1398,6 +1411,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { this.$checkbox_actions.show(); this.$list_head_subject.hide(); } + this.update_checkbox(); this.toggle_actions_menu_button(this.$checks.length > 0); } diff --git a/requirements.txt b/requirements.txt index 7a17d3794d..17f77efa5d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,6 @@ croniter~=1.0.11 cryptography~=3.4.7 dropbox~=11.7.0 email-reply-parser~=0.5.12 -Faker~=8.1.0 git-url-parse~=1.2.2 gitdb~=4.0.7 GitPython~=3.1.14 @@ -44,7 +43,6 @@ pyasn1~=0.4.8 pycryptodome~=3.10.1 PyJWT~=2.0.1 PyMySQL~=1.0.2 -pyngrok~=5.0.5 pyOpenSSL~=20.0.1 pyotp~=2.6.0 PyPDF2~=1.26.0 @@ -64,12 +62,10 @@ rq~=1.8.0 rsa>=4.1 # not directly required, pinned by Snyk to avoid a vulnerability schedule~=1.1.0 semantic-version~=2.8.5 -simple-chalk~=0.1.0 six~=1.15.0 sqlparse~=0.4.1 stripe~=2.56.0 terminaltables~=3.1.0 -unittest-xml-reporting~=3.0.4 urllib3~=1.26.4 Werkzeug~=0.16.1 Whoosh~=2.7.4