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

dont allow user to override admin sharing settings when its disabled #34764

Merged
merged 1 commit into from
Mar 20, 2019

Conversation

karakayasemi
Copy link
Contributor

@karakayasemi karakayasemi commented Mar 14, 2019

Description

Implementation of https://github.com/owncloud/enterprise/issues/3128#issuecomment-471185144

If all the options are disabled by admin, instead of showing empty page, I added Nothing to configure sentence for each section.

To-do:

  • Fix acceptance tests

Related Issue

Fixes https://github.com/owncloud/enterprise/issues/3128
Closes #34763
Closes #34708

Motivation and Context

How Has This Been Tested?

  • Disable auto_accept options from admin panel
  • User should see Nothing to configure text in sharing personal panel
  • Enable auto_accept options from admin panel
  • User should allowed to make their own choice

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@@ -57,7 +57,7 @@ public function getPanel() {
$tmpl->assign('incomingServer2serverShareEnabled', $this->shareProvider->isIncomingServer2serverShareEnabled());
$tmpl->assign(
'autoAcceptTrusted',
$this->config->getAppValue('federatedfilesharing', 'auto_accept_trusted', 'no')
$this->config->getAppValue('federatedfilesharing', 'auto_accept_trusted', 'no') === 'yes'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix for #34763

@jvillafanez
Copy link
Member

for the template, how about having 2 different templates, one for the "nothing to configure" and another one for the normal content? I'm not sure it this approach can help with the unittests and simplify the code.

In addition, you're following the same approach for the federated sharing and "normal" sharing, is this what we want? (just checking)

@karakayasemi
Copy link
Contributor Author

karakayasemi commented Mar 15, 2019

for the template, how about having 2 different templates, one for the "nothing to configure" and another one for the normal content? I'm not sure it this approach can help with the unittests and simplify the code.

I think it makes sense. Using two different template can reduce template and panel complexity.

In addition, you're following the same approach for the federated sharing and "normal" sharing, is this what we want? (just checking)

According to the agreement on this comment https://github.com/owncloud/enterprise/issues/3128#issuecomment-471185144, it is desired same functionality for both federated and local sharing.

@codecov
Copy link

codecov bot commented Mar 15, 2019

Codecov Report

Merging #34764 into master will increase coverage by <.01%.
The diff coverage is 94.59%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #34764      +/-   ##
============================================
+ Coverage      65.3%   65.31%   +<.01%     
- Complexity    18479    18483       +4     
============================================
  Files          1209     1209              
  Lines         69971    69996      +25     
  Branches       1280     1280              
============================================
+ Hits          45695    45715      +20     
- Misses        23904    23909       +5     
  Partials        372      372
Flag Coverage Δ Complexity Δ
#javascript 53.04% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.71% <94.59%> (ø) 18483 <0> (+4) ⬆️
Impacted Files Coverage Δ Complexity Δ
apps/files_sharing/templates/settings-personal.php 25% <0%> (-41.67%) 0 <0> (ø)
...ilesharing/templates/settings-personal-sharing.php 25% <0%> (-41.67%) 0 <0> (ø)
...es_sharing/lib/Controller/Share20OcsController.php 85.39% <100%> (+0.05%) 194 <0> (+1) ⬆️
...tedfilesharing/lib/Panels/SharingPersonalPanel.php 100% <100%> (ø) 5 <0> (+1) ⬆️
...ederatedfilesharing/lib/FederatedShareProvider.php 61.13% <100%> (+0.17%) 85 <0> (+1) ⬆️
...pps/federatedfilesharing/lib/Panels/AdminPanel.php 100% <100%> (ø) 4 <0> (ø) ⬇️
...iles_sharing/lib/Panels/Personal/PersonalPanel.php 100% <100%> (ø) 5 <0> (+1) ⬆️
...eratedfilesharing/lib/Controller/OcmController.php 66.06% <0%> (-0.21%) 30% <0%> (ø)
lib/private/Server.php 86.56% <0%> (-0.12%) 253% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ac13e2...8db3515. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 15, 2019

Codecov Report

Merging #34764 into master will increase coverage by <.01%.
The diff coverage is 81.39%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #34764      +/-   ##
============================================
+ Coverage     65.31%   65.31%   +<.01%     
- Complexity    18481    18487       +6     
============================================
  Files          1209     1209              
  Lines         69983    70009      +26     
  Branches       1280     1280              
============================================
+ Hits          45706    45726      +20     
- Misses        23905    23911       +6     
  Partials        372      372
Flag Coverage Δ Complexity Δ
#javascript 53.04% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.72% <81.39%> (ø) 18487 <0> (+6) ⬆️
Impacted Files Coverage Δ Complexity Δ
apps/files_sharing/templates/settings-personal.php 20% <0%> (-46.67%) 0 <0> (ø)
...ilesharing/templates/settings-personal-sharing.php 20% <0%> (-46.67%) 0 <0> (ø)
...es_sharing/lib/Controller/Share20OcsController.php 85.39% <100%> (+0.05%) 194 <0> (+1) ⬆️
...iles_sharing/lib/Panels/Personal/PersonalPanel.php 100% <100%> (ø) 6 <0> (+2) ⬆️
...pps/federatedfilesharing/lib/Panels/AdminPanel.php 100% <100%> (ø) 4 <0> (ø) ⬇️
...ederatedfilesharing/lib/FederatedShareProvider.php 61.13% <100%> (+0.17%) 85 <0> (+1) ⬆️
...tedfilesharing/lib/Panels/SharingPersonalPanel.php 100% <100%> (ø) 6 <0> (+2) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 898c68f...ce02210. Read the comment docs.

@karakayasemi karakayasemi force-pushed the fix-3128 branch 3 times, most recently from 879ff74 to 322ca36 Compare March 15, 2019 15:40
@PVince81
Copy link
Contributor

some sharing tests failed, @karakayasemi please have a look.

if you need assistance with adjusting or extending UI tests, feel free to ask @individual-it or @phil-davis

@karakayasemi
Copy link
Contributor Author

karakayasemi commented Mar 16, 2019

@individual-it I tried to adapt acceptance tests to the new behavior, removed some of the issue tags.
I read the documentation about acceptance testing, it is pretty explanatory by the way. But, I have no prior experience in it. Please review, acceptance tests part. Thanks.

@individual-it
Copy link
Member

the tests look very good to me, just don't like the long lines

very good, achievement unlocked 🎉

@individual-it
Copy link
Member

👍 for the acceptance tests part

@karakayasemi
Copy link
Contributor Author

@jvillafanez I adjusted the code to your last review. Templates and panel simplified with creating two templates. Please review, one more time. Thanks.

@karakayasemi
Copy link
Contributor Author

@jvillafanez the code adjusted to your last suggestions, please review one more time. Thanks.

@karakayasemi karakayasemi merged commit 86b49ab into master Mar 20, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-3128 branch March 20, 2019 08:45
@lock lock bot locked as resolved and limited conversation to collaborators Mar 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants