Share item model attributes javascript api v2#35836
Conversation
Codecov Report
@@ Coverage Diff @@
## master #35836 +/- ##
==========================================
+ Coverage 53.85% 54% +0.14%
==========================================
Files 63 63
Lines 7377 7403 +26
Branches 1301 1307 +6
==========================================
+ Hits 3973 3998 +25
Misses 3019 3019
- Partials 385 386 +1
Continue to review full report at Codecov.
|
af3065a to
b0b7b87
Compare
|
We are blocked, needs review from @PVince81 |
b0b7b87 to
5d0ec3b
Compare
6f1223f to
bad8336
Compare
|
@pmaier1 @PVince81 @DeepDiver1975 updated top post with tested matrix of v1/v2. |
bad8336 to
3f7e5cc
Compare
|
@DeepDiver1975 @pmaier1 @micbar all tests green |
PVince81
left a comment
There was a problem hiding this comment.
Looks fine overall.
One thing I'm not very clear about is that some comment says that the API v2 requires overriding the ShareItemModel.addShare/updateShare, but I don't see any overriding done in the unit tests. What I see however, is that the model has an "attributes" JS property that can be set.
I guess the overriding by apps is only needed in case special handling is needed ? Can you clarify ?
| }); | ||
|
|
||
| it('uses/hides attributes with permission filters of registered attributes', function() { | ||
| it('updates attribute with new enabled value correctly when boyh shareAttributesApi v1 and v2 are used', function() { |
|
@PVince81 yes, this is used when some special handling is needed:
If this is possible, I can try to write a test that wrapps the updateShare call. Should I? |
the test might not be that useful as the code path has no effect on the rest of the logic, considering that the overriding is mostly there for rendering purposes ? if you think there's more to it, please go ahead and add tests. (and fix the typo) then we're good to go :-) |
3f7e5cc to
e99e2f2
Compare
|
@PVince81 added tests for wrapping - check for |
|
@mrow4a |
|
@LinneyS please for now use share_item_model_attr_api_v2 (https://github.com/owncloud/core/tree/share_item_model_attr_api_v2) , in the future owncloud master (which is current target for next oc10 release), but this fix is required there #36086 . |
|
@LinneyS I would recommend also not to rush with implementing new logic in your app, we are still searching for best recommended "styling". I would be happy also to submit some PR to your working branch for share attributes, or in talk.owncloud.com we could have a chat and make sure we are all aligned. |
This PR:
ShareItemModel.registerShareAttributeShareItemModel.updateShareandShareItemModel.addSharefunction to pass the custom 'attributes'. This allows for much more customizations to checkbozes instead of relying on core api.Tested matrix of v1/v2 with: