Commit graph

38064 commits

Author SHA1 Message Date
gavin
f355034e7c refactor: get_group_by_count
Refactored raw query and partial get_all building with db.query + qb
notation equivalent. Added type hints & f-strings.

Intent: This particular API (for field "assigned_to") was taking
a while to run so decided to refactor this in hopes of perf improvemnts.

Result: 50% reduction in response times :D
2022-05-27 17:31:31 +05:30
gavin
e50dfbc859 refactor(minor): Consistent usage & styling 2022-05-27 15:05:36 +05:30
gavin
54ea02b573 fix: Maintain filters from additional_filters_config on refresh
Custom / Dynamic filters like "Fiscal Year" type would be in broken
state upon Page refresh. This was because get_selected_value didn't
handle that.

Perf change: Don't call util to recompute value each time when value
exists in current context. The UI feels a lot less clunkier after this
change - reduced repeated seemingly unnecessary computations.
2022-05-27 15:05:36 +05:30
gavin
c9504f3bfc perf: Make request for filters_config once
Prior to this, a request was made on every filter change for a
filters_config entry. The options would not change based on the List /
filters context since no such data is shared with the API. Hence, it
can be stored upon first request for re-use.

Eg: Current usage in ERPNext - fiscal year operator's options don't change
frequently.
2022-05-27 15:05:36 +05:30
gavin
e6460b2930 fix: Safe get_filter_value str replacing
This would cause Custom Operator to stay in a broken state. Eg:
ERPNext's Item list with while selecting filters as <"Created On",
"Fiscal Year"> would not set correct option type or fetch options.
Console would show the following error message:

base_list.js:431 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')
    at ListView.get_filter_value (base_list.js:431:22)
    at frappe.ui.Filter.set_field (filter.js:249:43)
    at HTMLSelectElement.<anonymous> (filter.js:122:9)
    at HTMLSelectElement.dispatch (jquery.js:5430:27)
    at HTMLSelectElement.elemData.handle (jquery.js:5234:28)
2022-05-27 15:05:36 +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
Raffael Meyer
576af52ec6
fix: mention only users that can be read (#16978)
Full Name and Email ID of a **User** are sensitive data.

With **Role and User Permissions** we can restrict which other users a user can see, thus maintaining data protection. This could be circumvented by using the `@mention` functionality in comments. It allows us to see all users and their names, regardless of our permissions.

This PR aims to fix this issue by using `get_list` instead of `get_all` while retrieving options for `@mention`.
2022-05-24 16:26:34 +00:00
Shariq Ansari
b44235587f
test: fixed failing UI test (#16958) 2022-05-24 13:17:21 +05:30
Ankush Menat
bfda3869a6
fix: delete email queue first (#16968)
email queue takes a long time and during that previously deleted tables
remain locked. Activity/Error logs are relatively faster to delete so
should moved last
2022-05-24 12:50:37 +05:30
Ankush Menat
b61e1d8e55 fix: same stroke color as text on list filters 2022-05-24 12:19:36 +05:30
Ankush Menat
e5d96cac91
Merge branch 'develop' into contrast 2022-05-24 11:50:57 +05:30
Ankush Menat
57b2f755e5
fix: use darker shade for text on dark blue
Co-authored-by: Shariq Ansari <30859809+shariquerik@users.noreply.github.com>
2022-05-24 11:50:51 +05:30
gavin
9bd79e80a6
Merge pull request #16902 from phot0n/ci-no-run
ci: `Skip CI` label for not running build processes
2022-05-24 11:25:15 +05:30
gavin
026258360d
Merge pull request #16962 from alyf-de/german-translations-2022-05-23
feat: Add german translations
2022-05-24 11:24:57 +05:30
Suraj Shetty
16bf9c0dfb
Merge pull request #16964 from FHenry/dev_feat_defaut_mail_selected 2022-05-24 08:14:44 +05:30
Florian HENRY
e41bad6066 feat: if only on email per user the preselect it in email form 2022-05-23 17:20:25 +02:00
barredterra
d83251ad47 feat: Add german translations 2022-05-23 16:51:12 +02:00
barredterra
88f65cdefb feat: Add german translations 2022-05-23 16:01:42 +02:00
gavin
15af545acf chore: Update typing + noqa - flake8 failures 2022-05-23 18:55:55 +05:30
Ankush Menat
c09d61f15f
fix: return found items from duplicate btn check (#16959)
Co-Authored-By: Suraj Shetty <surajshetty3416@gmail.com>

Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
2022-05-23 18:25:23 +05:30
gavin
6dedf899ff
Merge pull request #16899 from ChillarAnand/imports
refactor: Removed unused imports & added flake8 check in CI
2022-05-23 15:53:18 +05:30
Ankush Menat
2800923d1b fix: darken blue 600
Co-Authored-By: Shariq Ansari <sharique.rik@gmail.com>
2022-05-23 14:32:42 +05:30
Vladislav
65d96963ba
chore: update ru translate (#16948) 2022-05-23 13:18:40 +05:30
phot0n
909ce30f0a ci: Skip CI label for stopping build process 2022-05-23 13:01:31 +05:30
Sagar Vora
97df77f954
perf(translation): improve if condition to return all values except None (#16953) 2022-05-23 12:58:42 +05:30
Ankush Menat
fe8520a2bd
fix: duplicate buttons on desk (#16941) 2022-05-23 12:39:01 +05:30
gavin
a6ca565f24
Merge pull request #16949 from ankush/perf/translation_merging
perf: ~3x faster server side `_(translate)` calls
2022-05-23 10:19:13 +05:30
Ankush Menat
d90d6536ef perf: dont rebuild same translation dict 2022-05-22 22:54:23 +05:30
Ankush Menat
ae6657c66b fix: darken text color on light blue buttons 2022-05-21 17:57:06 +05:30
Ankush Menat
552ea50a73 fix: bump shade of muted text to gray-700 2022-05-21 17:51:23 +05:30
Ankush Menat
ec798598ef fix: pagination button contrast 2022-05-21 17:34:59 +05:30
Ankush Menat
154f7abea1 fix: always show consistent style for comment count
Muted text on pure white background is difficult to read
2022-05-21 17:24:22 +05:30
Ankush Menat
b86669ef61 fix(a11y): increase contrast levels
All these were failing WCAG recommended contrast levels.
2022-05-21 17:14:40 +05:30
Shariq Ansari
d26b78dad6
fix: UI fixes (#16946) 2022-05-21 15:10:50 +05:30
chillaranand
6afe4809f2 refactor: Clean up setup file 2022-05-21 08:27:04 +05:30
Ankush Menat
6e53c3d339
fix: use reference to form instead of global var (#16942) 2022-05-20 15:11:01 +05:30
Suraj Shetty
9975391210
Merge pull request #16939 from surajshetty3416/fix-link-popover 2022-05-20 12:01:45 +05:30