Commit graph

44910 commits

Author SHA1 Message Date
barredterra
b23b0633e5 fix: create new pot file instead of adding to existing one 2024-01-12 01:55:14 +01:00
barredterra
547a6107ce fix: improve translatable string description 2024-01-11 19:32:40 +01:00
Ankush Menat
4dc9cd39ae chore: rename permission debugger to inspector 2024-01-11 22:01:38 +05:30
mergify[bot]
8c4776092b
Merge pull request #24278 from RitvikSardana/develop-ritvik-select-field-no-debounce
fix: select field should not have debounce
2024-01-11 16:25:02 +00:00
mergify[bot]
df8d00c9e5
Merge pull request #24109 from blaggacao/feat/link-preview-in-tree-view
feat: add link preview capability to tree view
2024-01-11 14:44:39 +00:00
RitvikSardana
8dd216fd09 fix: select field should not have debounce 2024-01-11 20:00:39 +05:30
Ankush Menat
50b59d293f chore: regen PO files 2024-01-11 18:51:53 +05:30
Ankush Menat
64c7906b92 fix: regen single po file using --locale 2024-01-11 18:51:53 +05:30
Ankush Menat
1e83b2e848 fix: disable line wrapping for PO files
This is a relic from old days where text had to be formatted <80 chars so
terminals can read them. We have massive screens now.
2024-01-11 18:51:53 +05:30
Raffael Meyer
851a3bcf59
Merge pull request #24257 from maharshivpatel/fix-notification-mark-read 2024-01-11 14:20:34 +01:00
barredterra
d3f16b7ccb Merge remote-tracking branch 'upstream/develop' into feat/link-preview-in-tree-view 2024-01-11 14:13:13 +01:00
Safwan Samsudeen
0824b8e3ed
fix: remove_custom_button bug (#24199)
* fix: remove_custom_button removes menu item

* fix: correct indentation

* correct formatting

* fix: formatting, add yarn to gitignore
2024-01-11 17:42:50 +05:30
Ankush Menat
af5cc4fbe4 Update Crowdin configuration file 2024-01-11 16:24:36 +05:30
Akhil Narang
5c90e151ab
Merge pull request #24246 from akhilnarang/fix-file-download
fix(response): fixup non-ASCII character filenames
2024-01-11 16:15:23 +05:30
Akhil Narang
beac0122b6
Merge pull request #24235 from akhilnarang/notification-receiver-language
fix: use receiver's language for some notifications
2024-01-11 16:03:23 +05:30
Ankush Menat
ca6bbde5c8
chore:! remove outdated language packs (#24261) 2024-01-11 14:38:51 +05:30
Ankush Menat
447f02e8d3
fix!: Remove misleading "raise_exception" (#24266)
frappe.permission.has_permission won't accept raise_exception anymore,
it was extremely misleading argument and actual purpose of the argument
was to print perm check logs.
2024-01-11 08:24:18 +00:00
Ankush Menat
3e2e10780b
Merge pull request #24263 from ankush/fix_perm_message
fix: print perm check logs from DB query
2024-01-11 13:31:29 +05:30
Ankush Menat
0a38fb0813 fix: skip exc without exc id 2024-01-11 13:09:43 +05:30
Ankush Menat
b38199a3b3 fix: pass user to has_perm check 2024-01-11 12:34:15 +05:30
Ankush Menat
9f135e8c1d fix: print perm check logs from DB query
Doing has_permission and then manually raising exception erases the perm check messages.

This causes insane amounts of confusion when perm error says X not
permitted while user is trying to check Y.
2024-01-11 12:27:39 +05:30
Maharshi Patel
141abf9faf
fix: set correct recipient when reply to own email (#24256)
* fix: set correct recipient when reply to own email

When Sender clicks on reply to own email, the recipient is set to the Sender's email address instead of the original ( last_email ) recipient.
Added a check if sender is composing a reply to own email and set the recipient to the original ( last_email ) recipient.

* Update communication.js

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2024-01-11 09:57:10 +05:30
Maharshi Patel
0a7cdc74d3 fix: add empty space for notification mark read
mark-as-read added 8px width which caused layout shift
so i added empty space to compensate for it
2024-01-11 06:54:23 +05:30
Ankush Menat
5ef8577cff
fix!: Stricter requirement for permission hooks (#24253)
BREAKING CHANGE:

before: `has_permission` hooks need to explicitly return "False" to block a user.

after: `has_permission` hook need to explicitly return "True" (or truthy) value to allow user. They will be blocked otherwise.

Why? Everything related to permission should be block by default and allow if some checks pass.
2024-01-11 01:35:08 +05:30
Ankush Menat
5566d20705
Merge pull request #24251 from ankush/translation_fixes
fix: misc translation fixes
2024-01-10 22:05:09 +05:30
Ankush Menat
98b62e8220 fix: add _lt to extractors 2024-01-10 21:47:55 +05:30
Ankush Menat
1f6201b4af feat: lazy global translated strings 2024-01-10 21:28:01 +05:30
Ankush Menat
1f83fd8847 fix: skip if file is not found 2024-01-10 20:47:58 +05:30
Ankush Menat
a77093d6f6
Merge pull request #22732 from barredterra/po-translation
feat: translations via gettext
2024-01-10 19:10:13 +05:30
Ankush Menat
79b0ec76ae test: increase delay after focus
Cypress can't automatically wait for correct time here, it ends up
focusing at wrong field.
2024-01-10 18:59:42 +05:30
Raffael Meyer
81d6bea82c
Merge pull request #24245 from barredterra/ws-domain-restriction 2024-01-10 14:20:32 +01:00
Akhil Narang
e622198bab
fix(response): fixup non-ASCII character filenames
This was previously only handled for binary files

Werkzeug crashes otherwise:

17:54:40 web.1         | Traceback (most recent call last):
17:54:40 web.1         |   File "/home/akhil/frappe/frappe-bench/env/lib/python3.11/site-packages/werkzeug/serving.py", line 362, in run_wsgi
17:54:40 web.1         |     execute(self.server.app)
17:54:40 web.1         |   File "/home/akhil/frappe/frappe-bench/env/lib/python3.11/site-packages/werkzeug/serving.py", line 326, in execute
17:54:40 web.1         |     write(data)
17:54:40 web.1         |   File "/home/akhil/frappe/frappe-bench/env/lib/python3.11/site-packages/werkzeug/serving.py", line 266, in write
17:54:40 web.1         |     self.send_header(key, value)
17:54:40 web.1         |   File "/usr/lib/python3.11/http/server.py", line 526, in send_header
17:54:40 web.1         |     ("%s: %s\r\n" % (keyword, value)).encode('latin-1', 'strict'))
17:54:40 web.1         | UnicodeEncodeError: 'latin-1' codec can't encode characters in position 43-52: ordinal not in range(256)

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-10 18:44:51 +05:30
Ankush Menat
f246f37762 fix: language variants support 2024-01-10 18:27:57 +05:30
barredterra
89582dc73d fix: include workspaces without domain restriction 2024-01-10 13:13:19 +01:00
Ankush Menat
4c0a2060dd chore: migrate translations to PO files 2024-01-10 17:30:45 +05:30
Ankush Menat
e893312f37 perf: parallelize MO compilation
This operation is CPU heavy and has little to no Frappe code
involvement. So we can use a processpool of 4 to reduce time taken for
compilation by 4x.
2024-01-10 17:21:19 +05:30
Ankush Menat
9482126b93 perf: Skip rebuilding MO files where PO file is not updated 2024-01-10 17:04:34 +05:30
Ankush Menat
f7413d74fb
Merge pull request #24243 from ankush/annotate_meta
fix(DX): Type annotations for Meta
2024-01-10 16:45:07 +05:30
Ankush Menat
5d8208ccf4 feat: Build MO files with bench build
Translation assets are also... assets, so grouping them with `bench build`.

We can do some special function but that will likely require updating
bench for everyone. Not so ideal.

Also renamed `compile` function as it is a builtin in python.
2024-01-10 16:41:04 +05:30
Akhil Narang
1147c8bbed
refactor: read email body with policy=SMTP
`policy=SMTPUTF8` seems to break without specifying SMTPUTF8 in mail_options when actually sending the mail
(can't validate this because no server I tried seems to support that)

The `default` or `SMTP` policy work fine. Stuck to `SMTP` for CRLF line endings - default only does LF

Can get away with just changing this for SendMailContext().get_message_object(), but seemed better to standardize it

Non ASCII characters in the subject break completely, for example hindi characters get replaced by `?`

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-10 16:21:36 +05:30
Akhil Narang
55088ce7bd
chore: translate subject as well
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-10 16:21:36 +05:30
Akhil Narang
e29b39f7df
refactor: use receiver's language for some notifications
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-10 16:21:36 +05:30
Ankush Menat
9620a3c596 Merge branch 'develop' into po-translation 2024-01-10 16:17:47 +05:30
Ankush Menat
09ff2a6fb3
Merge pull request #24240 from ankush/file_has_perm
feat: extend perm debugging to popular controllers
2024-01-10 16:09:48 +05:30
Ankush Menat
d09df92497 fix(DX): Type annotations for Meta
`frappe.get_meta` returns which is 90% `DocType` + 10% `Meta` specific
stuff, this hack just allows us to mix both for autocompletions.
2024-01-10 15:58:03 +05:30
Ankush Menat
b3532024b5 fix: Accept "Falsy" values from perm controllers 2024-01-10 15:43:06 +05:30
Ankush Menat
914406d31b feat: extend perm debugging to popular controllers
- [x] File
- [x] Communication
2024-01-10 15:16:52 +05:30
Ankush Menat
3a8fc90961
feat: permission debugger (#24239)
* feat: permission debugger

This PR adds a virtual doctype that can run has_permission for
doctype-docname-user-ptype combinations and spit out detailed log for
why/where some permissionw as denied or granted.

This isn't supposed to be programatic, it's just textual dump of what code is doing.

IMO a better debugger can be written but that will require extensive
rewrite of perm checks first. All debugging, error messages in current
systems are bolted on top with hacks to avoid messing with
implementation.

* fix: capture UP pass check

* fix: reset docname on changing doctype

* fix: docname is optional

* fix: debug doctype perms
2024-01-10 09:29:13 +00:00
Ankush Menat
238085d865
fix: pass parent doctype on dashboard chart (#24236) 2024-01-10 12:27:49 +05:30
Ankush Menat
3884fa3c63
fix: duplicate field in filters (#24189)
* fix: duplicate field in filters

* test: clear filters using new clear filter button
2024-01-09 16:08:27 +05:30