Commit graph

38095 commits

Author SHA1 Message Date
Ankush Menat
b7a032e7e8 refactor: generate naming series preview without DB calls 2022-05-31 12:59:49 +05:30
Ankush Menat
5590cb0be8 feat: NamingSeries class
Single class to group together everything required related to naming
series
2022-05-31 11:53:58 +05:30
Ankush Menat
6930822a20 refactor: simplify _get_prefixes 2022-05-31 11:53:58 +05:30
Ankush Menat
ae678cca78 refactor: simplify duplicate naming series check 2022-05-31 11:53:58 +05:30
Ankush Menat
5c35aae876 fix: accurate prefix parsing
Previous version of prefix parsing relied on partial reimplemntation of
naming series logic which was outdated and often incorrect.
2022-05-31 11:53:58 +05:30
Ankush Menat
952a59a048 fix: freeze dom while updating series 2022-05-31 11:53:58 +05:30
Ankush Menat
efd0832235 refactor: property setters for setting naming series 2022-05-31 11:53:58 +05:30
Ankush Menat
ebcb568e9d test: making naming tests re-runnable
These were modifying TODO schema ._. WAD
2022-05-31 11:53:58 +05:30
Ankush Menat
15dbcacd56 refactor: split transaction and prefix functions
refactor: fetching transaction list

refactor: get default naming series

refactor: simplify naming series option scrubbing

fix: remove dead code related to insert series

This code is dead in many ways
- Creates map but it's never evaluated, so it doesn't actually run :D
- Just randomly splits naming series parts to create prefix... makes no
  sense.

fix: deduplicate prefix list
2022-05-31 11:53:40 +05:30
Ankush Menat
0fca966a8f refactor: rename preview field
`preview` is very common and might conflict with other settings in
future
2022-05-31 11:53:34 +05:30
Ankush Menat
28721be875 fix(UX): auto complete for selecting transaction
Giant select fields are bad for UX, many users dont know they can type
prefix to select value which leads to slow "visual search"
2022-05-31 11:52:55 +05:30
Ankush Menat
c75cfcc659 fix(UX): tab layout + misc
- Use tab layout
- Use second column for instructions / help
- Avoid huge content slides while selecting transactions
2022-05-31 11:52:23 +05:30
Ankush Menat
b0a7c47de7 fix(UX): dont query options for doctype that dont exist 2022-05-30 21:01:51 +05:30
Ankush Menat
22f2c78400 refactor: use sane-r fieldnames 2022-05-30 21:01:51 +05:30
Ankush Menat
4c691d5da3 chore: Naming Series -> Document Naming Settings
Migrate old code and format JS code
2022-05-30 21:01:51 +05:30
Ankush Menat
75b7a823a9
Merge pull request #17009 from ankush/delete_doctype_changes
fix!: dont delete customizations when doctypes are deleted
2022-05-30 21:00:50 +05:30
gavin
6031339f89
Merge pull request #17006 from gavindsouza/splash-image-website-settings
feat(website-settings): Configurable Splash Image
2022-05-30 20:30:23 +05:30
Gavin D'souza
9bc85402f6 fix: Add splash_image to context if exists 2022-05-30 18:56:17 +05:30
Ankush Menat
6d2be5e2c3
Merge pull request #17023 from ankush/pypika_bump
chore: bump pypika
2022-05-30 17:57:48 +05:30
Ankush Menat
dcff9a5d75 chore: bump pypika
functions.Replace is used but it's only available in latest version
2022-05-30 17:20:53 +05:30
Suraj Shetty
ed72fc5a0e
Merge pull request #17003 from netchampfaris/db-query-child-table-syntax-sugar 2022-05-30 12:21:35 +05:30
gavin
86f4746399
Merge pull request #17016 from ankush/nargs
fix: identify varkw in get_newargs
2022-05-30 12:19:03 +05:30
Faris Ansari
87ec6d4fb9 fix: initialize link_tables in constructor 2022-05-30 10:50:16 +05:30
Ankush Menat
4085646495 fix: identify varkw in get_newargs 2022-05-29 17:11:58 +05:30
Ankush Menat
c3918e8e34 test: test get_newargs 2022-05-29 16:26:02 +05:30
Ankush Menat
82cc98366d fix: dont attempt to init singles that dont exist
This is done during app install stage and causes unnecessary failures
where stale doctypes are left in db.
2022-05-29 13:46:48 +05:30
Ankush Menat
1e64abe9a5 fix!: meaningful error messages over KeyError 2022-05-29 13:46:48 +05:30
Ankush Menat
076eb593e3 refactor: delete_from_table
Whole lot of unnecessary complexity, closure, multiple function calls,
comprehensions all that can be replaced with single `get_all`
2022-05-29 13:46:48 +05:30
Ankush Menat
a0ecb912db fix!: dont delete customizations when doctypes are deleted
If someone deletes doctype and restores it back all customization are
lost, there's no "real" reason to delete all these customization. They
are only ever active if the doctype is being used.

Explanations:

- Custom field: is used by meta when doctype meta is requested, if meta
  isn't requested then custom field is effectively inactive.
- Client script: loaded by meta when doctype is requested by desk. So
  inactive in deleted state.
- Property setter: loaded by meta, so inactive when doctype isn't
  present.
- Report: will break doctype isn't present, but user should delete them
  manually to avoid loss of "scripts" or anything special they might
  have done. Also report's doctype don't 100% indicate that it's based
  solely on that doctype.
2022-05-29 13:46:44 +05:30
Faris Ansari
507a45d8f2 fix: dot syntax support for link fields
 test
2022-05-28 13:57:44 +05:30
gavin
d193ea22d1
Merge pull request #17007 from gavindsouza/frappe-qb-subquery
refactor(qb): Term subqry renamed to SubQuery
2022-05-27 23:48:07 +05:30
Shariq Ansari
8f245be460
fix: Strip all spacing characters from Message-ID & In-Reply-To (#16999) 2022-05-27 21:06:07 +05:30
gavin
e92ead1257 refactor: Re-write queries using SubQuery 2022-05-27 17:32:37 +05:30
gavin
6db1038501 refactor(qb): Rename term subqry to SubQuery
"SubQuery" conforms with terms naming in PyPika. Kept subqry that points
to same def for maintaining APIs.
2022-05-27 16:55:54 +05:30
gavin
f416e2a1d2 feat(website-settings): Configurable Splash Image
Configurable Splash Image option which will override app's splash_image
hook set.
2022-05-27 16:36:37 +05:30
Faris Ansari
96b30e714c feat: table_field.fieldname field syntax for db_query 2022-05-27 16:04:22 +05:30
Ankush Menat
9348ba5537
Merge pull request #16950 from ankush/auth_speedup
perf: faster auth ~50% avg speed up on each request
2022-05-26 19:36:12 +05:30
Ankush Menat
5c9421b750 perf: use redis cache for user_info 2022-05-26 18:22:31 +05:30
Ankush Menat
8557cff2bb perf: faster auth ~ validate_ip_address from redis 2022-05-26 18:22:31 +05:30
Ankush Menat
f7610ba423
test: flaky test due to stale translation cache (#16985) 2022-05-25 15:22:30 +05:30
Raffael Meyer
c38219627c
feat: Display button "Create User Email" only if current user can create an Email Account (#16979) 2022-05-25 15:20:28 +05:30
Ritwik Puri
e42fa8de05
test: fix newsletter tests setup due to duplicate entry of email group member for postgres (#16989) 2022-05-25 15:18:08 +05:30
Byju Abraham
9ffb0db80c
Fix: Change currency fraction for Singapore from Sen to Cent (#16987) 2022-05-25 15:14:31 +05:30
Rushabh Mehta
a2baaa8b01
Merge pull request #16988 from rmehta/minor-heading-style-fixes
fix(minor): remove top margins for headings on standard templates
2022-05-25 12:39:13 +05:30
Rushabh Mehta
1c864159f2 fix(minor): remove top margins for headings on standard templates 2022-05-25 12:38:29 +05:30
HENRY Florian
3a05c0f093
fix: update franch translation (#16974)
remove plurals (as other translation)
2022-05-25 10:36:19 +05:30
Ankush Menat
a6014bcabe
Merge pull request #16973 from ankush/old_email_queue_cleanup
fix: email queue cleanup in pure SQL
2022-05-25 09:43:16 +05:30
Ankush Menat
29710621d8 fix: commit after each log cleanup
This preserves "progress" and releases locks held on log tables
2022-05-25 09:42:15 +05:30
Ankush Menat
00f665c634 fix: email queue cleanup in pure SQL
Currently this background job constantly fails because of the way query
is written:

1. It tries to find all docs to delete using select query
2. Deletes them by using `in query` with a HUGE amount of docs
3. Deletes child table with parent, again using `IN` query with huge
   amount of docs.

This times out and never finishes on old sites.

Solution:

1. Modified deletion to straightaway delete all main table rows that are
   older
2. Apply same deletion logic to child table rows.

PS: This has potential to leave some orphan child table rows behind for few more days iff modified time was later than parent doc (this is quite rare). But it's safe since child table doesn't contain "links" anyway.
2022-05-25 09:42:12 +05:30
Ankush Menat
b1a0dfecb3
Merge pull request #16947 from ankush/contrast
fix(a11y): increase contrast in various places
2022-05-25 09:38:51 +05:30