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

feat: Allow Org admins to Remove Users from their Organization #8705

Merged
merged 10 commits into from
Jul 31, 2023

Conversation

MonalikaPatnaik
Copy link
Collaborator

@MonalikaPatnaik MonalikaPatnaik commented Jul 19, 2023

What

Building upon #8511 PR, added a separate column for deleting User and made a button alongside every user row which are associated to the organization.

Screenshot

image

Related issue(s) and discussion

@github-actions github-actions bot added 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. labels Jul 19, 2023
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Code is good (:clap:), but I still got two functional problems:

  1. the user is removed from the org members list but his "org" field still have the organization inside. He can still access the org

image

--> you have to remove user from members and admins list, but also reset their "org" field.

  1. after hitting remove, organization edit the page is not displayed correctly

@stephanegigandet
Copy link
Contributor

So after hitting remove, we get:

image

That's because when the type is "user_delete", we don't set the template parameters for the org name and link:

		$template_data_ref->{profile_url} = canonicalize_tag_link("editors", "org-" . $orgid);
		$template_data_ref->{profile_name} = sprintf(lang('user_s_page'), $org_ref->{name});

They should be moved above the if condition for the type, so that they apply to both edit org and user delete.

@github-actions github-actions bot added the Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org label Jul 25, 2023
@MonalikaPatnaik MonalikaPatnaik changed the title feat: Allow Org admins to add/remove/invite User to their Organization feat: Allow Org admins to Remove Users from their Organization Jul 25, 2023
@MonalikaPatnaik MonalikaPatnaik marked this pull request as ready for review July 25, 2023 04:14
@MonalikaPatnaik MonalikaPatnaik requested a review from a team as a code owner July 25, 2023 04:14
cgi/org.pl Outdated Show resolved Hide resolved
cgi/org.pl Show resolved Hide resolved
cgi/org.pl Outdated Show resolved Hide resolved
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Two more small changes and there we are @MonalikaPatnaik

Thanks !

@sonarcloud
Copy link

sonarcloud bot commented Jul 30, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug B 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

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

Looks good, thank you @MonalikaPatnaik !

@stephanegigandet stephanegigandet dismissed alexgarel’s stale review July 31, 2023 09:55

I think Alex changes have been addressed.

@stephanegigandet stephanegigandet merged commit 0f18a64 into openfoodfacts:main Jul 31, 2023
13 of 14 checks passed
@MonalikaPatnaik MonalikaPatnaik deleted the org-profile branch January 4, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Display 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org 👥 Users
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Should producers be able to self-delete accounts from the Pro Platform ?
3 participants