Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Basic Case Management/Dynamic Data Attachments #3057

Merged
merged 400 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
400 commits
Select commit Hold shift + click to select a range
db263ab
Merge branch '2487-form-media' into 2767-basic-case-management
noliveleger Mar 16, 2021
4466fb5
Merge branch '2487-form-media' into 2767-basic-case-management
noliveleger Mar 19, 2021
9522347
Merge remote-tracking branch 'origin/2487-form-media' into 2767-basic…
duvld Mar 29, 2021
70e9d54
PR Changes: moved dda actions to seprate file
duvld Mar 29, 2021
031c653
PR Changes: simplified action responses
duvld Mar 29, 2021
68e75b4
PR Changes: simplified parent array response
duvld Mar 29, 2021
52c6dfa
PR Changes: use new trucnate util functions remove old comments
duvld Mar 29, 2021
937b688
PR Changes: made util function for getting uid from url
duvld Mar 29, 2021
c705eb4
PR Changes: replace hard coded routes with constants
duvld Mar 29, 2021
f9b40c0
PR Changes: remove unused class
duvld Mar 29, 2021
5c9fd61
PR Changes: replace hard coded routes with constans
duvld Mar 29, 2021
7da3dfe
remove unused route
duvld Mar 29, 2021
b427945
PR Changes: better class name for sidebar label
duvld Mar 29, 2021
9c40b2e
PR Changes: use abs import route
duvld Mar 29, 2021
5b57f37
PR Changes: remove non-neutral boolean names
duvld Mar 29, 2021
358f989
PR Changes: call actions after listener is hooked
duvld Mar 29, 2021
feb85b6
PR Changes: update isSharing with response instead of internally
duvld Mar 29, 2021
e53c6cf
PR Changes: mark error responses for translation
duvld Mar 29, 2021
d6e706c
PR Changes: add comment to ambiguous function
duvld Mar 29, 2021
3688ad4
PR Changes: use modal helpers renderLoading
duvld Mar 29, 2021
9fe3c20
PR Changes: simplify switch logic
duvld Mar 29, 2021
973d2e5
PR Changes: refactor rendering import select
duvld Mar 29, 2021
436bcd3
PR Changes: remove useless guard
duvld Mar 29, 2021
217dc11
PR Changes: remove unused css class
duvld Mar 29, 2021
f7aa3c0
PR Changes: use non breaking space in jsx
duvld Mar 29, 2021
de59b0b
PR Changes: use consitent booleans
duvld Mar 29, 2021
60efe29
PR Changes: improve CSS
duvld Mar 30, 2021
a41a66c
Merge branch '2767-basic-case-management' into 2767-column-filtering
duvld Mar 30, 2021
42264c5
missed action response simplification
duvld Mar 30, 2021
42e3808
remove duplicate `multiCheckbox`
duvld Mar 30, 2021
a2672a8
remove non-neutral booleans
duvld Mar 30, 2021
82a8b26
WIP - Validate whether user is allow to perform write actions with pa…
noliveleger Mar 31, 2021
d716cbf
Add abstract methods to BaseDeploymentBack class
noliveleger Apr 1, 2021
c60e31b
Remove useless "method" paramater in "DeploymentBackend.set_validatio…
noliveleger Apr 1, 2021
81dfa59
WIP - consistency for user vs requesting_user vs requesting_user_id
noliveleger Apr 1, 2021
bbc4d65
WIP - Validate whether user is allow to perform write actions with pa…
noliveleger Mar 31, 2021
ff4dc0e
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Apr 6, 2021
cf5a1ab
Move validation of write access to backend base class, update some do…
noliveleger Apr 7, 2021
b1043e6
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Apr 7, 2021
ca0ed46
PR changes
duvld Apr 7, 2021
2a8f080
PR Changes
duvld Apr 12, 2021
7dd0f69
PR Changes: export generateAutoname for utils
duvld Apr 12, 2021
4cea022
Merge branch '2487-form-media-alphabetized-methods' into 2767-basic-c…
noliveleger Apr 13, 2021
9f2a7ad
Remove args/returns keywords from new docstrings
noliveleger Apr 13, 2021
c5ee67a
Reorder classes alphabetically in permissions.py
noliveleger Apr 13, 2021
2e2baf9
Merge branch '2487-form-media-alphabetized-methods' into 2767-basic-c…
noliveleger Apr 13, 2021
aa86dfd
Use new exceptions: AbstractMethodError, AbstractPropertyError
noliveleger Apr 13, 2021
b6d1fa4
Merge branch '2487-form-media-alphabetized-methods' into 2767-basic-c…
noliveleger Apr 13, 2021
021b676
Code clean-up and reformat
noliveleger Apr 13, 2021
2f2387b
Merge branch '2767-basic-case-management' into 2767-column-filtering
noliveleger Apr 13, 2021
045b975
Merge branch '2767-basic-case-management' into 3115-allowed-write-act…
noliveleger Apr 13, 2021
219e243
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Apr 13, 2021
a0c3ffe
Fixed bad merge
noliveleger Apr 14, 2021
e927b80
WIP tiny fix
noliveleger Apr 14, 2021
15c5d10
WIP - validation write access with partial perms
noliveleger Apr 14, 2021
435788e
WIP - add validation check for partial permissions
noliveleger Apr 14, 2021
db55f67
refactoring: centralize bulk action validation for submission_ids
noliveleger Apr 14, 2021
de6f676
Merge branch '2487-form-media-alphabetized-methods' into 2767-basic-c…
noliveleger Apr 20, 2021
8ab18b8
Merge branch '2767-basic-case-management' into 2767-column-filtering
noliveleger Apr 20, 2021
f4bec05
Merge branch '2767-basic-case-management' into 3115-allowed-write-act…
noliveleger Apr 20, 2021
7c628f8
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Apr 20, 2021
b4e6b80
Add tests for row level write permissions, refactor mock backend to s…
noliveleger Apr 22, 2021
79e6e0c
Fixed: users with any partial permissions is granted access to all su…
noliveleger Apr 22, 2021
82c94c7
Add `validation_status.uid` and `confirm` to DataBulkActionsValidator
noliveleger Apr 22, 2021
9522bd7
Coerce instance ids to int when validating them on row level write ac…
noliveleger Apr 22, 2021
b52a8da
Add tests for bulk validate statuses with partial permissions
noliveleger Apr 22, 2021
cb63114
Allow DELETE/PATCH actions on all submissions at once or with a query
noliveleger Apr 27, 2021
56cdd8c
Fixed tests for v1
noliveleger Apr 27, 2021
8b22517
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Apr 27, 2021
52d7ac3
Add test ts for bulk delete submissions
noliveleger Apr 27, 2021
168eaa5
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Apr 28, 2021
5a19abf
Standarize variable names for submission ID and user, make
noliveleger Apr 28, 2021
29d9e5f
Clean up unused imports
noliveleger Apr 28, 2021
d078239
Rename Hook.instance_id to Hook.submission_id
noliveleger Apr 28, 2021
6bce326
Use MockMongo to use mock submissions in unit tests
noliveleger Apr 29, 2021
2af3488
Make the tests pass with MockMongo and dynamic subset of submissioms
noliveleger Apr 30, 2021
7c6fcd2
Forgotten `submission_pk` and remove wrong `FIXME`s
noliveleger Apr 30, 2021
58930a1
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger Apr 30, 2021
e225c6c
Fixed: Hook app unit tests fail with XML submissions
noliveleger Apr 30, 2021
b2ec450
Fixed: api v1 submissions unit tests fail: Wrong variable call
noliveleger Apr 30, 2021
b205e00
Fixed: Some tests are failing because "_id" is auto assigned
noliveleger Apr 30, 2021
a3464cd
Remove FIXME comment because of kpi#3148
noliveleger Apr 30, 2021
a39a96b
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Apr 30, 2021
c321ea9
Fixed typo
noliveleger Apr 30, 2021
b1a6087
Merge branch '2487-form-media-alphabetized-methods' into 2767-basic-c…
noliveleger Apr 30, 2021
4ec222b
Merge branch '2767-basic-case-management' into 2767-column-filtering
noliveleger Apr 30, 2021
2d5622b
Merge branch '2767-column-filtering' into 3115-allowed-write-actions-…
noliveleger Apr 30, 2021
7e71c4b
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Apr 30, 2021
5e5e8bb
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger Apr 30, 2021
c9eed76
Move deepmerge pip dependency to production
noliveleger May 3, 2021
9404a26
Merge branch '2487-form-media-alphabetized-methods' into 2767-basic-c…
noliveleger May 4, 2021
ae9d02d
Merge branch '2767-basic-case-management' into 2767-column-filtering
noliveleger May 4, 2021
ea27de1
Merge branch '2767-column-filtering' into 3115-allowed-write-actions-…
noliveleger May 4, 2021
aab2688
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger May 4, 2021
89f6900
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger May 4, 2021
c84d0f5
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger May 4, 2021
06172dc
Replace deprecated "renderLoading" function with LoadingSpinner compo…
noliveleger May 4, 2021
c744e32
Replace deprecated "renderLoading" function with LoadingSpinner compo…
noliveleger May 4, 2021
44ef72c
Merge branch '2767-column-filtering' into 3115-allowed-write-actions-…
noliveleger May 4, 2021
f9a58d6
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger May 4, 2021
4b03813
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger May 4, 2021
3bda82d
don't use string label in QUESTION_TYPES constants
duvld May 4, 2021
6b4b848
Merge branch '2487-form-media' into 2767-basic-case-management
duvld May 4, 2021
64d7814
Merge branch '2767-basic-case-management' into 2767-column-filtering
duvld May 4, 2021
adf48ca
Merge branch '2767-basic-case-management' of github.com:kobotoolbox/k…
noliveleger May 7, 2021
3592a56
Allow users with `change_form` permissions to (un)link parent projects
noliveleger May 7, 2021
fde1395
Change test to allow editors to (un)link projects
noliveleger May 10, 2021
df22d63
Merge branch '2767-basic-case-management' into 2767-column-filtering
noliveleger May 10, 2021
fc7b222
Merge branch '2767-column-filtering' into 3115-allowed-write-actions-…
noliveleger May 10, 2021
aac03a9
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger May 10, 2021
c4ca74c
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger May 10, 2021
6563d8d
Other replacements for 'submission_pk' and 'pk'
noliveleger May 12, 2021
3518d3b
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger May 12, 2021
e3e5ca4
Fixed: Wrong submission detail url in mockbackend
noliveleger May 13, 2021
e1bc004
Merge branch '2487-form-media-alphabetized-methods' into 2767-basic-c…
noliveleger May 14, 2021
0dbf4e6
Merge branch '2767-basic-case-management' into 2767-column-filtering
noliveleger May 14, 2021
cec384e
Merge branch '2767-column-filtering' into 3115-allowed-write-actions-…
noliveleger May 14, 2021
73188df
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger May 14, 2021
acf17c7
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger May 14, 2021
3327aa6
Missing import
noliveleger May 14, 2021
65d4ca3
Merge branch '2487-form-media-alphabetized-methods' into 2767-basic-c…
noliveleger May 14, 2021
9d1be9d
Merge branch '2767-basic-case-management' into 2767-column-filtering
noliveleger May 14, 2021
f7ae1f4
Merge branch '2767-column-filtering' into 3115-allowed-write-actions-…
noliveleger May 14, 2021
106a536
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger May 14, 2021
ee68584
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger May 14, 2021
d79f2ea
Fixed bad previous merge
noliveleger May 14, 2021
f6c9638
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger May 14, 2021
44d4588
Fixed bad merge
noliveleger May 14, 2021
8901d19
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger May 14, 2021
e1f1d57
Restore variable name
noliveleger May 14, 2021
29085a0
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger May 14, 2021
38991b6
Merge branch '2487-form-media-alphabetized-methods' into 2767-basic-c…
noliveleger May 17, 2021
7a2a3fb
Merge branch '2767-basic-case-management' into 2767-column-filtering
noliveleger May 17, 2021
0f123d1
Merge branch '2767-column-filtering' into 3115-allowed-write-actions-…
noliveleger May 17, 2021
84c0061
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger May 17, 2021
e10a2e9
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger May 17, 2021
19bcb8b
Merge branch '2487-form-media-alphabetized-methods' into 2767-basic-c…
noliveleger May 25, 2021
f4f7690
Merge branch '2767-basic-case-management' into 2767-column-filtering
noliveleger May 25, 2021
796b88e
Merge branch '2767-column-filtering' into 3115-allowed-write-actions-…
noliveleger May 27, 2021
e15f7da
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger May 27, 2021
b5889ce
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger May 27, 2021
1f66c3b
PR changes: use boolean instead of truthy value
duvld May 27, 2021
151d857
PR changes: use button instead of `a` or `i`
duvld May 27, 2021
fe3ce99
PR changes: new gray scheme
duvld May 27, 2021
bffe294
PR changes: link to backend generating autoname
duvld May 28, 2021
59e8489
Merge pull request #3117 from kobotoolbox/2767-column-filtering
magicznyleszek May 31, 2021
d14a672
Merge branch 'beta' into 2767-basic-case-management
noliveleger Jun 4, 2021
ec05469
Merge branch 'beta' into 2767-basic-case-management
noliveleger Jun 8, 2021
5b8e1f6
Stop shadowing "hash" python built-in function with object properties
noliveleger Jun 8, 2021
f7f5a28
Use new KC metadata file type "paired_data" instead of a regex to det…
noliveleger Jun 8, 2021
d182e42
Use abc.ABC metaclass instead of pseudo implementation of abstraction…
noliveleger Jun 9, 2021
3facf0a
Fixed: Cannot run manage.py migrate because of meta classes conflicts
noliveleger Jun 9, 2021
aede0b2
Move `AssetSnapshot` class away from `kpi/models/asset.py` to its own…
noliveleger Jun 10, 2021
8d65260
Merge branch 'beta' into 2767-basic-case-management
noliveleger Jun 10, 2021
454bf8a
Merge branch '2767-basic-case-management' into 3134-use-abc-with-djan…
noliveleger Jun 10, 2021
2f46291
Merge branch '3134-use-abc-with-django-models' into refactor-model-utils
noliveleger Jun 10, 2021
9a08a22
Merge branch 'refactor-model-utils' into 3115-allowed-write-actions-w…
noliveleger Jun 10, 2021
5a6ecdc
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Jun 10, 2021
6c11945
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger Jun 10, 2021
78e0e05
Add "Mixin" suffix to Asset mixins
noliveleger Jun 10, 2021
7b1561a
Split apart file `kpi/models/object_permission.py` between model, mix…
noliveleger Jun 10, 2021
c432312
Get rid of "ObjectPermissionHelper" class, moved static methods to ut…
noliveleger Jun 10, 2021
c4ecec1
Merge branch 'beta' into 2767-basic-case-management
magicznyleszek Jun 17, 2021
bdc2673
Merge branch '2767-basic-case-management' into 3134-use-abc-with-djan…
noliveleger Jun 17, 2021
0091d8e
Merge branch '3134-use-abc-with-django-models' into refactor-model-utils
noliveleger Jun 17, 2021
0337eb3
Merge branch 'beta' into 2767-basic-case-management
noliveleger Jun 21, 2021
67bda2a
Merge branch '2767-basic-case-management' into 3134-use-abc-with-djan…
noliveleger Jun 21, 2021
8128358
Merge branch '3134-use-abc-with-django-models' into refactor-model-utils
noliveleger Jun 21, 2021
2d9c6c1
Merge branch 'refactor-model-utils' into 3115-allowed-write-actions-w…
noliveleger Jun 21, 2021
1bcd83a
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Jun 21, 2021
dbb7b47
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger Jun 21, 2021
422311b
Add missing formpack import
noliveleger Jun 21, 2021
e3425ed
Merge branch 'refactor-model-utils' into 3115-allowed-write-actions-w…
noliveleger Jun 21, 2021
6d372ce
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Jun 21, 2021
82b85e1
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger Jun 21, 2021
fc4cc91
Merge branch 'beta' into 2767-basic-case-management
duvld Jun 28, 2021
c3bcf98
Merge branch 'beta' into 2767-basic-case-management
noliveleger Jul 5, 2021
991757a
Merge branch '2767-basic-case-management' into 3134-use-abc-with-djan…
noliveleger Jul 5, 2021
7806c16
Merge branch '3134-use-abc-with-django-models' into refactor-model-utils
noliveleger Jul 5, 2021
5bf1055
Fixed: migrations conflicts
noliveleger Jul 5, 2021
7e7123d
Merge branch '2767-basic-case-management' into 3134-use-abc-with-djan…
noliveleger Jul 6, 2021
5fc9edb
Merge branch '3134-use-abc-with-django-models' into refactor-model-utils
noliveleger Jul 6, 2021
c165675
Merge branch 'refactor-model-utils' into 3115-allowed-write-actions-w…
noliveleger Jul 6, 2021
ef6edf5
Fix wrong import path
noliveleger Jul 6, 2021
d14a586
Merge branch 'refactor-model-utils' into 3115-allowed-write-actions-w…
noliveleger Jul 6, 2021
a2fd02c
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Jul 6, 2021
2341b73
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger Jul 6, 2021
fa4a014
Fixed bad previous merge
noliveleger Jul 6, 2021
7bcc3e8
Fixed unit failing tests after merge
noliveleger Jul 6, 2021
6f4dfc1
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Jul 6, 2021
4116d5f
Fixed failing unit tests: Wrong detail submission endpoint url
noliveleger Jul 6, 2021
3aeb2b2
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger Jul 6, 2021
b652dc3
Rename parent to source in dynamic data linking
jnm Jul 7, 2021
3dac21c
Fix mistake in prior renaming
jnm Jul 7, 2021
879f03e
Remove swap file. Oops.
jnm Jul 7, 2021
fb49886
Apply changes from first day of reviewing #3057
jnm Jul 8, 2021
33c8f0d
Refactored assertions
noliveleger Jul 8, 2021
fa5a4c3
Fixed: hashing remote content crashes when remote server does not ret…
noliveleger Jul 8, 2021
1107ae6
Removed #noqa for PEP-8 E501 (line too long) when line is smaller tha…
noliveleger Jul 12, 2021
a66c43f
Applied requested changes in PR#3057
noliveleger Jul 12, 2021
4046d2f
Get rid of PairedData object hash calculation. Use related AssetFile …
noliveleger Jul 13, 2021
7fb92fe
Simplify hashing utility algorithm: Get rid of `fast` option. Use
noliveleger Jul 13, 2021
903c1f9
Clarify asset file / paired data code
jnm Jul 13, 2021
4c681b5
Fix missing `file_type` on `PairedData`
jnm Jul 8, 2021
e41a8db
Standardize translation of AnonymousUser to User
jnm Jul 8, 2021
7a3976b
Standardize formpack access
jnm Jul 14, 2021
36ef28e
Add new is_user_anonymous() utility function and…
jnm Jul 14, 2021
f260c20
Consistently use "writable" spelling
jnm Jul 14, 2021
b3b0f19
Improve WritableJSONField validation error
jnm Jul 14, 2021
ef47ee6
Add minor improvements from review of #3057
jnm Jul 14, 2021
70f8030
Fixed: xml-external endpoint does not respect source fields list
noliveleger Jul 14, 2021
e87159d
Change tests to match new WritableJSONField error
jnm Jul 14, 2021
8fb73e4
Merge branch '2767-basic-case-management' into 2767-simplier-hash-tmp
noliveleger Jul 15, 2021
0c66fc9
Void cache on preview, do not cache xml-external XML when source has …
noliveleger Jul 15, 2021
5f336e8
Restore setters for filename, mimetype in AssetFile class
noliveleger Jul 15, 2021
2a93d13
Rename root node using XML tree
jnm Jul 15, 2021
e2006fc
Improve API terminology
jnm Jul 15, 2021
bf5a831
Remove `deployment__status` since `AssetFile`s…
jnm Jul 15, 2021
086e07d
Add support for all hashing mechanisms of hashlib library
noliveleger Jul 15, 2021
d9be384
Use abc.ABC metaclass instead of pseudo implementation of abstraction…
noliveleger Jun 9, 2021
efe2c3c
Fixed: Cannot run manage.py migrate because of meta classes conflicts
noliveleger Jun 9, 2021
93919e7
Make XML declaration detection more universal
jnm Jul 15, 2021
8c0adb4
ES6 related PR changes
duvld Jul 15, 2021
6a2f238
Merge branch '2767-basic-case-management' of https://github.com/kobot…
duvld Jul 15, 2021
622363a
Merge pull request #3268 from kobotoolbox/3134-use-abc-with-django-mo…
jnm Jul 15, 2021
29c8c26
Merge branch '2767-basic-case-management' of https://github.com/kobot…
duvld Jul 15, 2021
711ef46
fix empty alertify message for filename errors
duvld Jul 15, 2021
57086c8
Revert locale
jnm Jul 15, 2021
1b25938
Add aspirational comment
jnm Jul 15, 2021
55f8a84
Merge branch '2767-basic-case-management' into 2767-simpler-hashing
noliveleger Jul 15, 2021
6cef1e1
Merge branch '2767-simpler-hashing' of github.com:kobotoolbox/kpi int…
noliveleger Jul 15, 2021
f02f20f
Merge pull request #3345 from kobotoolbox/2767-simpler-hashing
noliveleger Jul 15, 2021
19791f4
Merge branch '2767-basic-case-management' into 2767-void-cache-on-pre…
noliveleger Jul 15, 2021
47ae961
some CSS PR changes
duvld Jul 15, 2021
de9ae8b
Merge branch '2767-basic-case-management' of https://github.com/kobot…
duvld Jul 15, 2021
fab8906
Merge branch '2767-void-cache-on-preview' into refactor-model-utils
noliveleger Jul 15, 2021
5ea066d
Merge branch '2767-basic-case-management' into refactor-model-utils
noliveleger Jul 15, 2021
ee4fa73
Merge pull request #3346 from kobotoolbox/2767-void-cache-on-preview
jnm Jul 15, 2021
435aa2f
Merge pull request #3271 from kobotoolbox/refactor-model-utils
jnm Jul 15, 2021
4c8f23a
Merge branch 'beta' into 2767-basic-case-management
duvld Jul 19, 2021
7622e09
add (not yet published) support url
duvld Jul 19, 2021
86beb8d
Merge branch '2767-basic-case-management' into 3115-allowed-write-act…
noliveleger Jul 20, 2021
fc51432
Revise comment
jnm Jul 20, 2021
af0968e
Add docstring
jnm Jul 20, 2021
06ef9b7
Merge branch '3115-allowed-write-actions-with-partial-perm' of github…
noliveleger Jul 21, 2021
fc4e460
Merge branch '3115-allowed-write-actions-with-partial-perm' into 3115…
noliveleger Jul 21, 2021
b09eaff
Merge branch '3115-refactoring' into 3115-mockbackend-with-mongo-support
noliveleger Jul 21, 2021
d9727c3
Merge pull request #3123 from kobotoolbox/3115-allowed-write-actions-…
jnm Jul 26, 2021
b853fff
Merge pull request #3124 from kobotoolbox/3115-refactoring
jnm Jul 26, 2021
bf20376
Merge pull request #3173 from kobotoolbox/3115-mockbackend-with-mongo…
jnm Jul 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions hub/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from django.shortcuts import get_object_or_404
from markitup.fields import MarkupField

from kpi.models.object_permission import get_anonymous_user
from kpi.utils.object_permission import get_database_user


class SitewideMessage(models.Model):
Expand Down Expand Up @@ -76,8 +76,7 @@ class PerUserSetting(models.Model):
value_when_not_matched = models.CharField(max_length=2048, blank=True)

def user_matches(self, user, ignore_invalid_queries=True):
if user.is_anonymous:
user = get_anonymous_user()
user = get_database_user(user)
manager = user._meta.model.objects
queryset = manager.none()
for user_query in self.user_queries:
Expand Down
2 changes: 2 additions & 0 deletions jsapp/js/actions.es6
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import libraryActions from './actions/library';
import submissionsActions from './actions/submissions';
import formMediaActions from './actions/mediaActions';
import exportsActions from './actions/exportsActions';
import dataShareActions from './actions/dataShareActions';
import {
notify,
replaceSupportEmail,
Expand All @@ -34,6 +35,7 @@ export const actions = {
submissions: submissionsActions,
media: formMediaActions,
exports: exportsActions,
dataShare: dataShareActions,
};

actions.navigation = Reflux.createActions([
Expand Down
126 changes: 126 additions & 0 deletions jsapp/js/actions/dataShareActions.es6
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/**
* Dynamic data attachment related actions
*/

import Reflux from 'reflux';
import alertify from 'alertifyjs';
import {dataInterface} from 'js/dataInterface';
import {MAX_DISPLAYED_STRING_LENGTH} from 'js/constants';
import {
getAssetUIDFromUrl,
truncateFile,
truncateString,
} from 'js/utils';

const dataShareActions = Reflux.createActions({
attachToSource: {children: ['started', 'completed', 'failed']},
detachSource: {children: ['completed', 'failed']},
patchSource: {children: ['started', 'completed', 'failed']},
getAttachedSources: {children: ['completed', 'failed']},
getSharingEnabledAssets: {children: ['completed', 'failed']},
toggleDataSharing: {children: ['completed', 'failed']},
updateColumnFilters: {children: ['completed', 'failed']},
});

dataShareActions.attachToSource.listen((assetUid, data) => {
dataInterface.attachToSource(assetUid, data)
.done(dataShareActions.attachToSource.completed)
.fail(dataShareActions.attachToSource.failed);
dataShareActions.attachToSource.started();
});
dataShareActions.attachToSource.failed.listen((response) => {
alertify.error(
response?.responseJSON?.filename[0] ||
response?.responseJSON ||
t('Failed to attach to source')
);
});

dataShareActions.detachSource.listen((attachmentUrl) => {
dataInterface.detachSource(attachmentUrl)
.done(dataShareActions.detachSource.completed)
.fail(dataShareActions.detachSource.failed);
});
dataShareActions.detachSource.failed.listen((response) => {
alertify.error(response?.responseJSON || t('Failed to detach from source'));
});

dataShareActions.patchSource.listen((attachmentUrl, data) => {
dataInterface.patchSource(attachmentUrl, data)
.done(dataShareActions.patchSource.completed)
.fail(dataShareActions.patchSource.failed);
dataShareActions.patchSource.started();
});
dataShareActions.patchSource.failed.listen((response) => {
alertify(response?.responseJSON || t('Failed to patch source'));
});

dataShareActions.getAttachedSources.listen((assetUid) => {
dataInterface.getAttachedSources(assetUid)
.done((response) => {
// We create our own object from backend response because:
// 1. We need to truncate the filename and display this instead
// 2. We need both the current asset URL as well as it's source data URL
let allSources = [];

// TODO: Check is pagination is an issue, if so we should try to use the
// backend response directly
response.results.forEach((source) => {
let sourceUid = getAssetUIDFromUrl(source.source);
allSources.push({
sourceName: truncateString(
source.source__name,
MAX_DISPLAYED_STRING_LENGTH.connect_projects,
),
// Source's asset url
sourceUrl: source.source,
sourceUid: sourceUid,
// Fields that the connecting project has selected to import
linkedFields: source.fields,
filename: truncateFile(
source.filename,
MAX_DISPLAYED_STRING_LENGTH.connect_projects,
),
// Source project attachment endpoint
attachmentUrl: source.url,
});
});

dataShareActions.getAttachedSources.completed(allSources);
})
.fail(dataShareActions.getAttachedSources.failed);
});

dataShareActions.getSharingEnabledAssets.listen(() => {
dataInterface.getSharingEnabledAssets()
.done(dataShareActions.getSharingEnabledAssets.completed)
.fail(dataShareActions.getSharingEnabledAssets.failed);
});
dataShareActions.getSharingEnabledAssets.failed.listen(() => {
alertify.error(t('Failed to retrieve sharing enabled assets'));
});

// The next two actions have the same endpoint but must be handled very
// differently so we leave them as seperate actions

// TODO: Improve the parameters so these functions are clearly different from
// each other
dataShareActions.toggleDataSharing.listen((uid, data) => {
dataInterface.patchDataSharing(uid, data)
.done(dataShareActions.toggleDataSharing.completed)
.fail(dataShareActions.toggleDataSharing.failed);
});
dataShareActions.toggleDataSharing.failed.listen((response) => {
alertify.error(response?.responseJSON?.detail || t('Failed to toggle sharing'))
});

dataShareActions.updateColumnFilters.listen((uid, data) => {
dataInterface.patchDataSharing(uid, data)
.done(dataShareActions.updateColumnFilters.completed)
.fail(dataShareActions.updateColumnFilters.failed);
});
dataShareActions.updateColumnFilters.failed.listen((response) => {
alertify.error(response?.responseJSON || t('Failed to update column filters'));
});

export default dataShareActions;
1 change: 1 addition & 0 deletions jsapp/js/app.es6
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export var routes = (
<IndexRoute component={FormSubScreens} />
<Route path={ROUTES.FORM_MEDIA} component={FormSubScreens} />
<Route path={ROUTES.FORM_SHARING} component={FormSubScreens} />
<Route path={ROUTES.FORM_RECORDS} component={FormSubScreens} />
<Route path={ROUTES.FORM_REST} component={FormSubScreens} />
<Route path={ROUTES.FORM_REST_HOOK} component={FormSubScreens} />
<Route path={ROUTES.FORM_KOBOCAT} component={FormSubScreens} />
Expand Down
1 change: 0 additions & 1 deletion jsapp/js/bem.es6
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ bem.FormView__subs = bem.FormView.__('subs');
// end used in header.es6
bem.FormView__toptabs = bem.FormView.__('toptabs');
bem.FormView__sidetabs = bem.FormView.__('sidetabs');
bem.FormView__tab = bem.FormView.__('tab', '<a>');

bem.FormView__label = bem.FormView.__('label');
bem.FormView__group = bem.FormView.__('group');
Expand Down
Loading