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

change update visiblity ux #25856

Closed
wants to merge 12 commits into from
Closed

Conversation

mohammad258852
Copy link

@mohammad258852 mohammad258852 commented Jul 12, 2023

Fixes: #25085
Fixes: #23826

before
before
after
after
after

change UX for update visibility. when the Repository is visible, in the basic settings section, the user can just see the visibility status. For changing visibility, he/she should go to the danger zone section. if the Repository is not visible, use can use basic settings section.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 12, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 12, 2023
@lafriks
Copy link
Member

lafriks commented Jul 13, 2023

Can you add also screenshot how it looks to make it public

@mohammad258852
Copy link
Author

make repository private modal
private modal

@mohammad258852
Copy link
Author

when the repository is already private you can make it public like before. without any warning

make public

there is no section in danger zone
danger zone

@silverwind
Copy link
Member

silverwind commented Jul 13, 2023

Imho, we should completely move it to danger zone under label "Change repository visibility" there, e.g. remove the old checkbox and this tooltip that sounds like broken english and make change in both directions only via danger zone.

@mohammad258852
Copy link
Author

at first, I want to do so. but is it really dangerous to make a repository public?? I mean warnings are just reasonable when you want to make it private.
On the other hand, you should be able to see the visibility status. so you can't remove this part completely

@lunny lunny added the topic/ui-interaction Change the process how users use Gitea instead of the visual appearance label Jul 22, 2023
@lunny lunny added this to the 1.21.0 milestone Jul 22, 2023
@techknowlogick
Copy link
Member

It is potentially dangerous to make a repo public, as if you have private code (or perhaps infrastructure as code templates) that contain sensitive information then you wouldn't want that out in the world.

@wxiaoguang
Copy link
Contributor

There could be an easier approach:

When toggling the "checkbox", show a modal dialog "Do you want to make the repo public/priate? It will cause (1) (2) (3) ... [Cancel] [Confirm]", if "cancel", then do not toggle the "checked" state.

Then:

  1. Unified UI experience
  2. No need to add more backend code

@lunny
Copy link
Member

lunny commented Jul 24, 2023

I would like this PR to split the private/public switch operations with other settings changes. The private/public switching operations should be a heavy operation which need to change many databases records.

@silverwind
Copy link
Member

silverwind commented Jul 25, 2023

I still prefer to have it in the danger zone only because both direction can be considered dangerous under certain conditions and it's consistent with GitHub UI. Public -> Private may break dependents (for example golang), Private -> Public may expose unintended information to the public.

@wxiaoguang
Copy link
Contributor

totally move it to danger zone also looks good to me

templates/repo/settings/options.tmpl Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 3, 2023
@mohammad258852
Copy link
Author

based on feedback changing visibility moved to the danger zone
In basic settings you can just view visibility

image

when repo is public
image
image

when repo is private
image
image

# Conflicts:
#	templates/repo/settings/options.tmpl
@denyskon
Copy link
Member

@mohammad258852 Could you update your branch and resolve merge conflicts?

@denyskon
Copy link
Member

Also, since your PR, the layout changed a bit. You'd need to update your PR to the new layout.

@silverwind
Copy link
Member

silverwind commented Sep 13, 2023

image

Move red text to paragraph above and remove parens.

image

Uncolor text and add a "." at the end.

Imho, there is no reason to style this entry differently then the rest. Just make it consistent with existing entries. Danger zone implies danger.

@lunny lunny modified the milestones: 1.21.0, 1.22.0 Sep 21, 2023
@mohammad258852
Copy link
Author

branch is now up-to-date.
image
image
image
image

@alystair
Copy link

This resolves #23826. #25085 is basically a dupe ;)

@denyskon denyskon added the giteabot/update-branch Hint for the bot that it should update a PR with the latest state on main label Oct 18, 2023
@GiteaBot GiteaBot removed the giteabot/update-branch Hint for the bot that it should update a PR with the latest state on main label Oct 18, 2023
</div>
<div class="required field">
<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" required>
Copy link
Contributor

Choose a reason for hiding this comment

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

There are many id="repo_name" elements in this page. The "id" should be unique.

@@ -763,6 +756,44 @@
</div>
</div>
{{end}}

{{if not .Repository.IsFork}}
<div class="divider"></div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this divider (and below) is needed? IIRC the flex-item has proper border-top: 1px solid var(--color-secondary);.

}

visibilityChanged := repo.IsPrivate != private
if visibilityChanged && setting.Repository.ForcePrivate && !private && !ctx.Doer.IsAdmin {
Copy link
Contributor

Choose a reason for hiding this comment

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

A useful comment is lost

// when ForcePrivate enabled, you could change public repo to private, but only admin users can change private to public

Comment on lines +865 to +868
if !ctx.Repo.IsOwner() {
ctx.Error(http.StatusNotFound)
return
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The old code doesn't have such check.

IIRC the IsOwner should have been correctly checked by a middleware for this handler.

@lunny lunny modified the milestones: 1.22.0, 1.23.0 Mar 29, 2024
@lunny
Copy link
Member

lunny commented Aug 11, 2024

replaced by #31126

@lunny lunny closed this Aug 11, 2024
@lunny lunny removed this from the 1.23.0 milestone Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged modifies/translation size/L Denotes a PR that changes 100-499 lines, ignoring generated files. topic/ui-interaction Change the process how users use Gitea instead of the visual appearance
Projects
None yet
9 participants