Commit graph

102 commits

Author SHA1 Message Date
Ankush Menat
8a1889301a chore!: remove dead hooks app_icon & app_color 2022-05-10 14:41:01 +05:30
Ankush Menat
42942f36a6 feat: provide github workflow for unittest in new app 2022-05-10 14:41:01 +05:30
Ankush Menat
3fd4759dd4 fix: gitignore node_modules in new frappe apps 2022-05-10 14:41:01 +05:30
Ankush Menat
53f54c3761 refactor: use click for new-app prompts 2022-05-10 14:41:01 +05:30
Ankush Menat
74d7753a5a refactor: split make_boilerplate function 2022-05-10 14:41:01 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Raffael Meyer
f80a16ed14
feat: add translated search doctypes to hooks (#16197)
In `search.py` it was hardcoded that **DocType** and **Role** get translated before matching against the search text. This way, a user can type in his local language and still see correct results.

This feature is useful for other DocTypes as well. The criterion would be: there is a small, fairly static number of records, so that the performance impact of translating all names first is not too bad.

This PR adds a hook `translated_search_doctypes` that determines which DocType names get translated before search.

I also added **Country** to `translated_search_doctypes` for frappe. The link to **Country** is frequently used in **Address**, but until now there was no way to use it in the local language. There are ~70% less Countries than DocTypes (including ERPNext), so the performance should be fine.

ERPNext could, for example, add the **Gender** DocType to this hook. As there are very few genders, translating them is fast and improves the UX.

Docs: https://frappeframework.com/docs/v13/user/en/python-api/hooks/edit?wiki_page_patch=b4d7c8d6fc
2022-03-23 10:43:04 +00:00
Faris Ansari
bf19ebdeb6
fix(boilerplate): add .gitkeep in public folder (#15765)
add .gitkeep file so that public folder is committed to git this is
needed because if public doesn't exist, bench build doesn't
symlink the public folder to sites/assets
2022-01-27 19:17:41 +05:30
Ankush Menat
fd227d38f4
feat: post model-sync patches (#15351)
Ability to run a few patches after the doctype model schema is synced.

Read module-level docstring of patch_handler.py for more info.
2022-01-26 11:21:30 +05:30
phot0n
1d879f741b feat: before_uninstall and after_uninstall hooks 2021-12-20 14:05:10 +05:30
ritwik
5cfe3ad946
feat: add no-git option in make-app command and boilerplate generation (#15028) 2021-11-23 04:11:06 +00:00
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Sagar Vora
b23dd71116 fix: escape quotes before declaring variables when making a new app 2021-07-13 17:56:47 +05:30
Suraj Shetty
3cbc7dfb92 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-06-14 12:24:50 +05:30
Gavin D'souza
8e8490976c fix: Remove frappe from boilerplate requirements.txt
Remove frappe from new app boilerplates to avoid possible supply chain attacks. Don't make pip fetch frappe from PyPI
2021-06-07 14:10:49 +05:30
Suraj Shetty
2d8c6c1710 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-06-03 11:43:28 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Suraj Shetty
9a3d280484 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-05-13 14:23:20 +05:30
Gavin D'souza
e7d089d1cb Merge branch 'develop' of github.com:frappe/frappe into misc-fixes-py3-1 2021-05-11 13:03:56 +05:30
Suraj Shetty
b39b5effbf Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-05-11 10:38:04 +05:30
Gavin D'souza
b3af9f0c72 fix: Use raw strings for strings with \
Avoid DeprecationWarning which will turn into SyntaxError in later
Python versions
2021-05-07 17:59:20 +05:30
Leela vadlamudi
9d3b993b71
Merge pull request #13144 from ankush/test_create_app
test: add unittest for creating new app using boilerplate
2021-05-07 13:39:24 +05:30
Ankush Menat
c48a8e933f
fix: remove six.moves.input and use builtin.input
reason: py2 support no longer required and six makes mocking/testing
complicated.
2021-05-06 19:26:06 +05:30
Ankush Menat
2548bca187
fix: hook format for user_data_fields 2021-05-06 16:48:59 +05:30
mergify[bot]
585b123bd7
Merge pull request #13134 from ankush/hooks_template_fixes
fix: missing comma and uncommented code in hooks.py template
2021-05-06 09:32:55 +00:00
Ankush Menat
9e39249059
fix: comment user_data_fields and fix structure 2021-05-06 14:01:56 +05:30
Ankush Menat
aba315daf8
fix: missing comma in hooks template 2021-05-06 14:01:39 +05:30
Ankush Menat
a617348a79
chore: remove py2 specific code from boilerplate 2021-05-03 20:11:00 +05:30
Suraj Shetty
f50cb61888 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-04-26 12:52:23 +05:30
mergify[bot]
85cbdf7683
Merge pull request #12895 from revant/feat-auth-hooks
feat(hooks): auth hooks
2021-04-23 06:33:27 +00:00
Suraj Shetty
3209cd5c09
Merge branch 'develop' into refactor-website 2021-04-19 10:35:11 +05:30
Revant Nandgaonkar
d309343c6f feat(hooks): auth hooks
hook for request authentication
2021-04-19 06:31:28 +05:30
Faris Ansari
a62ef80cdd fix: Add jinja hook boilerplate 2021-04-17 16:11:28 +05:30
Gavin D'souza
cd94227aa5 refactor(hooks): Personal Data Deletion Request
Changes:
* Renamed hook from `user_privacy_documents` to `user_data_fields`
* Renamed ref field from `match_field` to `filter_by`
* Renamed ref field from `personal_fields` to `redact_fields`
* Removed ref field `applies_to_website_user` from hook options -- let's
treat all requests equally and redact data from all privacy docs
* Added boilerplate hook for new apps
2021-02-26 20:31:02 +05:30
Rushabh Mehta
435bbe2665 wip: refactor website routing and rendering 2021-02-15 09:54:13 +05:30
Faris Ansari
0db383499e
Merge pull request #11555 from netchampfaris/website_theme_hook 2020-09-24 14:13:16 +05:30
Faris Ansari
f2a6f3dd21 fix: Add example in boilerplate 2020-09-18 17:12:26 +05:30
barredterra
e7d21a813c feat: hook for website_theme_scss 2020-08-27 18:05:45 +02:00
Rushabh Mehta
137df8290b fix(sider): fix sider issues 2020-08-17 09:41:54 +05:30
Rushabh Mehta
77018fc9d6 fix(cleanup): cleanup layout of doctype, user, role, add home_page to Portal Settings, Role 2020-08-17 09:41:54 +05:30
Faris Ansari
3051ac5e57 fix: Use gitpython module instead of subprocess 2020-07-12 11:04:10 +05:30
Faris Ansari
0474044ec2 fix: Initialize git repository after creating app 2020-07-10 19:33:50 +05:30
Felipe Orellana
4479405872
fix: hooks.py boilerplate escape chars
Creating new app currently breaks due to comments in hooks.py do not properly escape sample configuration on webform hooks.
2020-04-05 21:27:32 -04:00
Rohan Bansal
91f023edbe feat: include custom JS and CSS files in web form 2020-03-02 16:28:47 +05:30
vishal
b2a44e922e fix: added auto_cancel_exempted_doctypes in boilerplate 2020-01-13 13:31:00 +05:30
vishal
f741d46fdb feat: cancel multiple documents in a single transaction
- show all linked doc in a dialog box on cancel event
- following changes only fetch cancelable docs
- recursively build a list of linked submitted docs
- cancel all linked documents before cancelling current document
- add progress bar and group documents by doctype
- added exempted doctype list in hooks
2020-01-13 13:31:00 +05:30
Rohan
355fc4b49e feat: allow extending doctype dashboards via hooks (develop) (#8336)
* feat: allow overriding dasboards via hooks

* fix: allow extending dashboard data in hooks

* fix: move logic to generic function

* format: added description to hook
2019-09-08 02:29:43 +05:30
Gavin D'souza
44cab5d326 refactor: updated boilerplate
moved from regex + ast eval to just using import
2019-07-29 16:24:24 +05:30
Aditya Hase
6b72faf44f style: Linting fixes (#6809)
* style: Remove unused imports

* style: Remove unused local variables
2019-01-23 16:39:55 +05:30
Saurabh
c899c94c96 escape new line char while creating boilerplate for app 2018-05-07 12:50:19 +05:30