Commit graph

42389 commits

Author SHA1 Message Date
Shariq Ansari
c3afd003d4 fix: check if field has standard field not if field is custom 2022-11-17 11:54:17 +05:30
Ankush Menat
c658d8cb1b
fix: ignore unpicklable hooks (#18902)
If any custom app use import statement in hooks.py everything breaks.
Hooks.py while being python file is still only supposed to be used for
configuring.

This PR ignores unpicklable members of hooks.py
2022-11-17 11:50:18 +05:30
Shariq Ansari
95c55fa00d fix: tab containing standard fields was draggable in customize form 2022-11-17 11:48:22 +05:30
Jannat Patel
6428930857
fix: security issue in discussions component (#18903)
[skip ci]
2022-11-17 11:39:43 +05:30
Ankush Menat
1f6f31fc97 refactor: int > cint 2022-11-17 11:35:24 +05:30
Athul Cyriac Ajay
190e01a5f3 fix: Force integer type in request.max_content_length 2022-11-17 11:35:24 +05:30
Shariq Ansari
15fa4bb160 feat: preview mode 2022-11-17 00:04:22 +05:30
gavin
e32f0cd0f8
Merge branch 'develop' into socket_io-refactor 2022-11-16 23:08:23 +05:30
Gavin D'souza
c3c1848b2a fix: Restrict socket data to respective users after commit
Fix conditions to bother only those who asked for the data:
- Clear permissions cache only for updated users' data
- Defer appropriate events until commit to avoid ghost events
- Remove event unused by desk (and other apps)
2022-11-16 23:07:07 +05:30
Gavin D'souza
16bd7a2d0b fix(socketio): Scoping & hoisting bugs
Due to the previous logic, cookie data seemed inconsistent causing ghost
sessions.
2022-11-16 23:02:23 +05:30
Gavin D'souza
96fee8c293 feat: {site}:website room open to all users
- Subscribe to room and pass messages without auth
- Pass `room='website'` to publish_realtime to use
- Pass discussions' comms through particular site's website room
2022-11-16 21:53:49 +05:30
Shariq Ansari
a9ff1269db fix: drag animation & cannot drag alert on dragging standard fields 2022-11-16 21:32:44 +05:30
Ankush Menat
70633573c2
fix: dont convert row format if not required (#18900) 2022-11-16 20:48:50 +05:30
marination
299831d209 fix: server method to return evaluated dict of perms for a document 2022-11-16 19:24:12 +05:30
Shariq Ansari
28ec144675 fix: remove label focus outline while editing
also added tooltip to know double click to edit label
2022-11-16 19:23:31 +05:30
Shariq Ansari
70d3640e0f
Merge branch 'develop' into form-builder-vue3 2022-11-16 18:00:29 +05:30
Shariq Ansari
4f13ad24b1
Merge branch 'develop' into form-builder-vue3 2022-11-16 18:00:19 +05:30
Shariq Ansari
2faa8ef292
Merge pull request #18894 from shariquerik/web-form-read-only 2022-11-16 17:56:55 +05:30
Shariq Ansari
0831babf5a fix: render rest of the fieldtypes in properties section & main form 2022-11-16 17:22:33 +05:30
Shariq Ansari
990dcc7538
Merge branch 'develop' into web-form-read-only 2022-11-16 17:07:58 +05:30
Ankush Menat
0d5d2cf95c
ci: fix flake8 URL (#18895) 2022-11-16 16:15:31 +05:30
Shariq Ansari
424a7d39bc fix: webform read only field not working 2022-11-16 16:00:24 +05:30
Gavin D'souza
2b7e4554c4 fix(desk): maintain realtime & cached data consistency
- Clear docinfo_update callbacks before setting one; ensure only
  one active callback at any given point.
- Remove document from local cache if list_update sent if not edited
2022-11-16 15:19:03 +05:30
Ankush Menat
45b0c3e28d chore: remove dead code 2022-11-16 14:05:53 +05:30
Maharshi Patel
88e331e236 fix: z-index for barcode and awesomeplete 2022-11-16 12:55:25 +05:30
Abdo Hamoud
e5ad087521
Update File Types Preview
- Update preview types [PDF], [MP4], [Mp3]
2022-11-15 16:59:08 +02:00
Faris Ansari
13c8da8ee1
Merge branch 'develop' into app-include-site-config 2022-11-15 19:55:22 +05:30
gavin
24f4b85031
Merge branch 'develop' into socket_io-refactor 2022-11-15 19:19:29 +05:30
Ankush Menat
9fc330ea6c
Revert "fix: remove middleware to clear frappe.local (#18874)" (#18886)
This reverts commit 2971abe517.
2022-11-15 18:45:51 +05:30
marination
92d9e7d611 fix: Don't assign document level perms to doctype level permission store
- If `doc` is passed to `has_perm`, checking for pre-stored doctype level perms is wrong
- It gives back stale values that don't consider document level permissions and only change on reload (window property)
- Get freshly evaluate perms at the doc level
- If no `doc` is involved, doctype level custom window property can be used
2022-11-15 17:57:49 +05:30
Gavin D'souza
3a8fa6cbd5 refactor(socketio): Use same room for doc & info events
other changes
- Name list room as doctype room for more generic use
- avoid re-setting up listeners for generic events
- discard docinfo_subscribe event
2022-11-15 17:55:53 +05:30
Faris Ansari
e10d19a317
Merge branch 'develop' into app-include-site-config 2022-11-15 17:19:59 +05:30
Ankush Menat
9b90e620bc chore: disable flaky test
This is
- flaky
- difficult to find source of flake because of crazy tests
- adds little value tbh

[skip ci]
2022-11-15 17:17:10 +05:30
Sagar Vora
425e4bf1b3
fix(File): validate attached_to_* when saving (#18880) 2022-11-15 16:19:02 +05:30
Faris Ansari
cfc2dd4437 test: patch get_hooks to bypass cache 2022-11-15 14:50:38 +05:30
marination
7f94e158ac fix: Consistency in get_role_permissions return value
- Return value contains `if_owner` propert in object same as py
- Elaborate code documentation
2022-11-15 14:38:56 +05:30
Gavin D'souza
97d2eab3e2 refactor(socketio): docinfo_update
- Rename event from `update_docinfo_for_{}_{}` to docinfo_update
- Separate rooms for separate documents generated on requirement
- Check if user has access to doc before sharing docinfo
2022-11-15 13:15:34 +05:30
Gavin D'souza
9931c3af04 refactor(socketio)!: list_update
- Subscribe to list_update only for the list/report views that are
  opened
- Check if user has read permission for doctype to subscribe to list
  updates
2022-11-15 13:15:34 +05:30
Gavin D'souza
e97994f211 chore: Drop duplicate event method
This particular definition was chosen since there was no corresponding
subscribe method with the same key generation logic
2022-11-15 13:15:34 +05:30
Gavin D'souza
54bf617d09 perf(socketio): get_site_name
The usages and number of conditions evaluated in the function called for
some sort of a cache. If the site name is evaluated once, store it in
the socket object!
2022-11-15 13:15:34 +05:30
Gavin D'souza
4de9c39bb8 refactor: SocketIO
- Check request data in middleware
- Authenticate each connection before allowing room access
- Allow site room access only to System Users, restrict Website User &
  Guests to their respective user rooms

Note: This doesn't check for roles / permissions
2022-11-15 13:15:30 +05:30
Gavin D'souza
5210ea593f fix(socketio): Re-try thrice before trying to reconnect
Set reconnectionAttempts to 3. If the server doesn't want to connect
with the respective client (invalid origin, no cookie or sid transmitted)
or is gone down, socketio client would retry connections indefinitely.
This change limits retrying connection to just thrice every second.
2022-11-15 13:12:51 +05:30
Gavin D'souza
c86e1de38a fix(recorder): Publish update only to Administrator 2022-11-15 13:12:51 +05:30
Gavin D'souza
01fdb6a241 chore: Remove unused realtime updates
These events were added for supporting listeners in desk. The listeners
have thus been removed and these are now unnecessary messages published
to anyone landing on Frappe pages or on Desk.
2022-11-15 13:12:51 +05:30
Sagar Vora
2971abe517
fix: remove middleware to clear frappe.local (#18874) 2022-11-15 11:07:18 +05:30
barredterra
cb434d728b feat: preview real data 2022-11-15 00:48:44 +01:00
barredterra
29465c1e3a feat: add csv preview 2022-11-15 00:07:19 +01:00
barredterra
d955a29ce8 feat: add translation context 2022-11-15 00:06:08 +01:00
gavin
440825a372
refactor: which > find_executable (#18872)
Use shutil from the standard library instead of distutils to find
executables in PATH
2022-11-14 18:15:38 +05:30
Faris Ansari
5695346668
fix: allow mark tag in texteditor (#18871) 2022-11-14 17:33:28 +05:30