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

CLDR-14788 Hide TC and manager level menu items from vetters #3871

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

btangmu
Copy link
Member

@btangmu btangmu commented Jul 16, 2024

-Front end: hide buttons for Show all users, unless new function canListMultipleUsers returns true, that is, userIsManager

-Front end: in main menu hide My Organization section header if the section would be empty

-Front end: canListUsers and canMonitorVetting only if userIsManager

-Front end: canSeeUnofficialEmail only if isUnofficial and userIsManager

-Back end: canDoList only if isManagerOrStronger

-Back end: SurveyVettingParticipation only if isManagerOrStronger

-Back end: fix TestUserLevel.csv, userCanDoList false for vetter

CLDR-14788

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

-Front end: hide buttons for Show all users, unless new function canListMultipleUsers returns true, that is, userIsManager

-Front end: in main menu hide My Organization section header if the section would be empty

-Front end: canListUsers and canMonitorVetting only if userIsManager

-Front end: canSeeUnofficialEmail only if isUnofficial and userIsManager

-Back end: canDoList only if isManagerOrStronger

-Back end: SurveyVettingParticipation only if isManagerOrStronger
srl295
srl295 previously approved these changes Jul 23, 2024
Copy link
Member

@srl295 srl295 left a comment

Choose a reason for hiding this comment

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

needs test fix but it's basically ok.

The "My Account" panel under https://cldr-smoke.unicode.org/cldr-apps/v#account/// may be hidden as a result of this. (try it when logged in on smoketest)

A good followon might be to have a simple popover when you mouse over the user's name in the header that shows the user's name, organization, status, email address etc. Currently the user's name has a tooltip showing their email address.

@@ -354,6 +356,10 @@ function getTableEnd(json) {
return html;
}

function canListMultipleUsers() {
return !!cldrStatus.getPermissions()?.userIsManager;
Copy link
Member

Choose a reason for hiding this comment

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

another way would be to expand the cldrStatus.getPermissions() struct ( a string -> boolean map i think) to include a new item from the server side.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea. I'll follow up with a PR to get canDoList from the back end...

@@ -381,7 +381,7 @@ public boolean canImportOldVotes(CheckCLDR.Phase inPhase) {
}

public boolean canDoList() {
return isVetter();
return isManagerOrStronger();
Copy link
Member

Choose a reason for hiding this comment

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

unit tests are failing here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Fixed by the 2nd commit

-Make userCanDoList false for vetter
Copy link
Member

@srl295 srl295 left a comment

Choose a reason for hiding this comment

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

good that we have a test

@btangmu
Copy link
Member Author

btangmu commented Jul 24, 2024

may be hidden as a result

Testing locally, "My Account" is still visible for a vetter, it just lacks the "Show all users" button. I'll double check on smoketest

@btangmu btangmu merged commit 061c679 into unicode-org:main Jul 24, 2024
13 checks passed
@btangmu btangmu deleted the t14788_a branch July 24, 2024 15:07
@btangmu
Copy link
Member Author

btangmu commented Jul 24, 2024

I'll double check on smoketest

I did, and it's OK: "My Account" is still visible for a vetter

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.

2 participants