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

Hide "Protected" privacy level from users #5833

Merged
merged 6 commits into from
Jul 3, 2019

Conversation

humitos
Copy link
Member

@humitos humitos commented Jun 20, 2019

Protected privacy level causes a lot of confusions to users. I'm hiding it for now as a temporarily solution while we implement more Version states and this behavior can be easily managed. See #5321

All the logic around Protect versions keeps working as is. Although, Projects and Versions are not being able to be added as Protected once this PR gets merged.

This is just a proposal to ease the problem, but it's not a solution.

@humitos humitos requested a review from a team June 20, 2019 13:03
# Remove Protected for now since it cause confusions to users.
# There is a better way to manage this by using Version states
# See: https://github.com/rtfd/readthedocs.org/issues/5321
# (PROTECTED, _('Protected')),
Copy link
Member

Choose a reason for hiding this comment

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

What do people with Protected in the DB currently see for this listing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Weird stuffs :)

Some places it will say protected (version listing) and some other Public (version details).

It may be better to remove it from the Form itself by overriding the field instead of from this global constant.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, i'd have the same reservations around just removing it from the database full stop. I think we might need to be more gentle here, or perhaps even use a feature flag to grandfather projects into protected.

We also discussed maybe researching how projects are using the feature now, and probably messaging the users before making a hard change like this one.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not too worry about asking users how they use protected because it's definitely a weird concept and it's currently broken.

I don't want to remove it from the DB either, I just want to hide it from the users so they can not use Protected anymore in new projects/versions and get confused with it. The old ones should remain as they are: "in a Protected privacy level, but broken"

@humitos humitos added the PR: work in progress Pull request is not ready for full review label Jun 25, 2019
Protected causes a lot of confusions to users. I'm hiding it from the
Form for now as a temporarily solution while we implement more Version
states and this behavior can be easily managed.

See #5321

Project/Version that are Protected will remain in the same state and
everything should keep working. Although, new Project/Version are not
allowed to set as Protected.
@humitos humitos force-pushed the humitos/hide-protected-privacy-level branch from 3d9992c to 1a13261 Compare June 27, 2019 10:24
@humitos
Copy link
Member Author

humitos commented Jun 27, 2019

I update the PR. This is better than what we have. Version/Project listing will say Protected if they have that level in DB. Although, if you go into "Edit" one of this object you will see Public (because Protected is not allowed in the form). It kind of makes sense if we want people moving out from this privacy level.

@humitos humitos requested a review from ericholscher June 27, 2019 10:30
@humitos humitos removed the PR: work in progress Pull request is not ready for full review label Jun 27, 2019
@humitos humitos requested a review from agjohnson June 27, 2019 10:30
@humitos
Copy link
Member Author

humitos commented Jun 27, 2019

If this "partial solution" does not fulfill what we want, we should just close the PR and spend time on the real solution.

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

This is a better approach. I think this could use a test, but I'm +1 on doing it.

if any([
not self.instance,
self.instance and self.instance.privacy_level != PROTECTED,
]):
Copy link
Member

Choose a reason for hiding this comment

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

This logic feels quite complex. Can we not just do something like:

if self.instance is None or self.instance.privacy_level != PROTECTED

@humitos
Copy link
Member Author

humitos commented Jul 2, 2019

I added a test case for this and simplify the if logic as you mentioned. We can merge after the tests pass.

Only the help_text field changed (removed the protected sentence).
@humitos humitos merged commit 87bb73c into master Jul 3, 2019
@delete-merged-branch delete-merged-branch bot deleted the humitos/hide-protected-privacy-level branch July 3, 2019 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants