Commit graph

1808 commits

Author SHA1 Message Date
Ankush Menat
cfd3fb9341 refactor: PUT == PATCH
Correct conventions for partial updates
2023-10-16 18:13:50 +05:30
Ankush Menat
c8cd658d26 fix: add login and logout methods 2023-10-16 18:13:50 +05:30
Ankush Menat
232f080044 feat: run_doc_method v2 2023-10-16 18:13:50 +05:30
Ankush Menat
e63f0c895d refactor: resource => document
This lets us create three types of APIs:

- Document APIs that operate on documents
- DocType APIs that operate on collections - list, count, search
- Method APIs that are RPC calls
2023-10-16 18:12:53 +05:30
Ankush Menat
0a244b10fc test: basic tests v2 API 2023-10-16 18:12:53 +05:30
Ankush Menat
947e7f6864 test: refactor API test cases for paramterization 2023-10-16 18:12:53 +05:30
Ankush Menat
627b777a9c refactor!: manual creation of response
This contains minor breaking change where `delete` API call now returns `OK` in `data` key instead of `message`.
2023-10-16 18:12:53 +05:30
Ankush Menat
0b0b7f7f60 test: check that document actually got deleted 2023-10-16 18:12:53 +05:30
Ankush Menat
3effd9e101 test: fix test failure from parallel merge 2023-10-16 16:42:46 +05:30
Ankush Menat
c476c5e6d7
refactor!: Link field search (#22745)
* refactor!: Drop handling for SQL queries

This hasn't been supported in really long time, no need to check that
use cases.

It will still fail but with no special error message.

* fix: Catch all import related errors

* fix!: Use last query from hooks

* refactor!: Return search results like any other function

Search results are returned in `results` key which is incosistent from
most other functions

* refactor: simplify search_link
2023-10-16 15:41:02 +05:30
Corentin Flr
89aab5d748
fix(query_doctypes): Allow search in translated name (#22590)
* fix(query_doctypes): Allow search in translated name

* test: Add test for DocType search in foreign language
2023-10-16 15:13:57 +05:30
Ankush Menat
55a444959e fix: Make search_link query postgres compatible 2023-10-16 11:51:51 +05:30
Ankush Menat
fec7759d00 fix: Give idx higher preference than meta order
Meta order in most cases is default "modified" which doesn't quite help.

idx is # of times a document is referred to somewhere else, which is
more likely to be relevant.
2023-10-16 10:50:57 +05:30
Ankush Menat
31444228c3 fix: Improve search relevance for search_link
When `locate` returns 0 it's shown on top instead it should be shown
last or not shown at all.

This is math hack to avoid using any complex SQL functionality which
isn't allowed in DB query.
2023-10-16 10:46:47 +05:30
Ankush Menat
e1f2f4bb54 fix: Let social login key control signups
There are cases where certain social login keys

- Should not allow signups at all and only allow logins. E.g. social media login keys.
- Should allow signups even if global sign ups are disabled. e.g. internal SSO like setups.
2023-10-14 12:43:48 +05:30
Ankush Menat
404f3fbeec test: add better test for backup restoration
Before restore:
- Wipe DB, files.

After restore:
- Actually check if things got restored.
2023-10-11 18:39:12 +05:30
Sambasiva Suda
7165f94148
fix: validate_email_addr should return email id as it is if it is valid (#22613) 2023-10-11 12:37:48 +05:30
Akhil Narang
b601131d8f
fix: don't allow setting an invalid rating (#22633)
* feat: don't allow setting an invalid rating

Convert anything <0 to 0, and anything >1 to 1

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* chore: add in tests for rating

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-10 15:38:58 +05:30
Shariq Ansari
9bafe1f558
Merge pull request #22408 from RitvikSardana/develop-ritvik-add-column-fix 2023-09-26 12:30:10 +05:30
RitvikSardana
9368f0aee4 fix: enable server script while testing 2023-09-26 12:02:25 +05:30
RitvikSardana
9ae56289df test: code cleanup 2023-09-25 12:31:18 +05:30
RitvikSardana
32e3198c83 test: code cleanup 2023-09-24 11:34:06 +05:30
Ankush Menat
a81fb2a11a
Merge pull request #22509 from netchampfaris/file-backup-path
fix: use relative path in file backup
2023-09-24 10:06:47 +05:30
RitvikSardana
0c2c6f2aec chore: code cleanup 2023-09-24 02:36:04 +05:30
RitvikSardana
34cd943556 test: added test for conflicting column names 2023-09-24 01:31:41 +05:30
Faris Ansari
d53a8832c8 chore: run restore test only on mariadb 2023-09-24 01:17:26 +05:30
Ankush Menat
d7a9d0111c
perf: lazy load SVG icons (#22517)
| Metric                             | Before | After | Change    |
| ---                                | ---    | ---   | ---       |
| app.html first response size       | 421kb  | 106kb | -75% (!)  |
| First response duration            | 60ms   | 40ms  | -33%      |

huge thanks to @cogk for doing most of the work for this PR on this issue: https://github.com/frappe/frappe/issues/17449#issuecomment-1728328726

Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
2023-09-23 15:13:43 +05:30
Faris Ansari
18c4f653f4 chore: unskip restore test 2023-09-23 13:01:40 +05:30
Corentin Flr
41d30e7213
feat: Add custom icons with the app_include_icons hook (#22254)
* feat: Add custom icons with the `app_include_icons` hook

These custom icons are available on the desk only. They can be picked in the `ControlIcon` picker.

Co-authored-by: Abraham Kalungi <85731451+kalungia@users.noreply.github.com>

* fix: skip conf for including icons

* test: Fix test_include_icons

---------

Co-authored-by: Abraham Kalungi <85731451+kalungia@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-09-20 20:23:17 +05:30
Ankush Menat
acd1b9d64e
fix: Don't run query if dn is None (#22475) 2023-09-19 15:11:15 +00:00
Ankush Menat
0381f836d6 fix: update correct role permission rule
Right now if you have if-owner rule on doctype then whatever you change
will only apply to last inserted rule because we don't check if-owner
value

Long term better fix: Identify with perm rule name instead of arbitrary
"primary keys" defined in code.
2023-09-18 13:45:20 +05:30
Ankush Menat
662b07170c test: orpahned doctype check after patch test 2023-09-15 16:18:25 +05:30
Ankush Menat
909457de3d
fix: PDF and raw response (#22402) 2023-09-13 16:42:49 +00:00
0xsaif
aa7ee1c6b9
refactor: force ipv4 localhost (#22394)
* reafctor: force ipv4 localhost

Replacing "localhost" with "127.0.0.1" in the codebase; sometimes the name localhost force-resolves to ipv6

* revert: leave localhost usage in oauth tests

Change not required.

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-13 16:23:23 +05:30
Ankush Menat
970a740164
revert: #22308 (#22389)
* Revert "chore: move function to correct file"

This reverts commit ebfdfa283b.

* Revert "refactor!: merge get_site_url into get_url (#22308)"

This reverts commit 2001bc278f.
2023-09-13 14:34:52 +05:30
Ankush Menat
b445c20e22
test: ignore whitespace changes while comparing HTML (#22386) 2023-09-13 08:18:56 +00:00
Suraj Shetty
35000c2e4f
fix: + btn not appearing for connections with both internal and external links (#22320) 2023-09-11 15:51:28 +05:30
David Arnold
2001bc278f
refactor!: merge get_site_url into get_url (#22308)
* chore: merge get_site_url into get_url

* fix: keep alias with deprecation notice
2023-09-11 15:09:05 +05:30
anandbaburajan
1dc7a3705b fix: separate internal_and_external_links from internal_links 2023-09-05 21:41:43 +05:30
niraj gautam
fbbdef1e9c
feat: Dynamically generate license text (#22299)
* feat: Add dynamic license dtext

* feat: Validate license name

* fix(DX): Pass options as click.Choice

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-05 05:45:27 +00:00
David Arnold
011e44656b
fix(test): ensure tests construe the site url from its constructor (#21870) 2023-09-02 15:36:24 +05:30
Ankush Menat
1ad5c0ea86 refactor: Avoid regex for email validation
[skip ci]
2023-09-02 11:38:56 +05:30
Raffael Meyer
1dcf1d1f4b
Merge pull request #21874 from blaggacao/fix-website-asset-discovery 2023-08-29 19:23:55 +02:00
Ankush Menat
e88cdb6e70
Merge pull request #22224 from ankush/desk_user
feat: `Desk User` role
2023-08-29 20:27:21 +05:30
Ankush Menat
8176b86b25 fix: notification_settings has_permission hooks 2023-08-29 13:26:48 +05:30
Ankush Menat
85956ed0c1 test: switch user before modifying other user 2023-08-29 12:07:58 +05:30
Ankush Menat
1b406edd54 feat: Desk User role 2023-08-28 22:31:23 +05:30
Ankush Menat
961585f1d9
fix: misc dx improvemnts (#22188)
* fix(dx): simplify adding callbacks

frappe.db.after_commit(func) == frappe.db.after_commit.add(func)

* fix: trace id missing

DB gets initted before request
2023-08-28 07:01:25 +00:00
mergify[bot]
fdcfb82f47
Merge pull request #22114 from gavindsouza/doc-bulk_insert-include_child
fix: Handle child record insertions via bulk_insert
2023-08-25 13:57:38 +00:00
Gavin D'souza
c89130caf0
test: Add checks for child records bulk inserts
doc bulk_insert for "Role Profile" tables
2023-08-25 11:56:52 +05:30