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 = $( `