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

Admin: Fix the usage of userType #1445

Closed
palisadoes opened this issue Jan 17, 2024 · 59 comments
Closed

Admin: Fix the usage of userType #1445

palisadoes opened this issue Jan 17, 2024 · 59 comments
Assignees
Labels
bug Something isn't working feature request ui/ux issue related and being worked with the figma file of the Admin UI

Comments

@palisadoes
Copy link
Contributor

palisadoes commented Jan 17, 2024

NOTE

  1. This issue will require close coordination with persons assigned issues in the reference section.
  2. You may find it easier to split responsibilities in a different way than proposed here to be more efficient is creating the goal

Describe the bug

  1. The schema doesn't apply a person's userType by organization.
  2. The userType is currently a part of the User definition not part of a userOrganization definition or something similar.
    1. This means that an Admin is an Admin for all organizations which grants the same rights as a SuperAdmin. This is not the intention.
    2. This has created historical confusion in the Admin and SuperAdmin roles.

This needs to be resolved as it is a showstopper bug.

Expected behavior

These conditions must apply:

  1. The userType must be applied per person per organization.
  2. Each SuperAdmin must be a SuperAdmin for all organizations
  3. All other userTypes would be on a per organization basis

This means that all code logic referencing the userType will need to be updated accordingly.

TALAWA API

Additional considerations include:

  1. New user registrations will need to default to the userType USER if not done so already
  2. The Schema will need to be updated to reflect this requirement
  3. Mutations and queries will need to be updated and in some cases new ones added.

TALAWA ADMIN

Additional considerations include:

  1. The current screen that edits a person's userType will need to be updated. A design is being created for this and will be reflected in the Figma file on our Design Guide page:
    1. https://docs.talawa.io/docs/design/ux/ux-design-system

TALAWA MOBILE

No expected changes as userType isn't referenced in the code base

Actual behavior

  • The schema doesn't apply a person's userType by organization.

Screenshots

The current schema:

image

Additional details

Related issues:

  1. API: Fix the usage of userType talawa-api#1711
  2. Mobile: Fix the usage of userType talawa#2373
  3. Admin: Fix the usage of userType #1445
  4. Update the Organization People Screen Design and Functionality #1451
  5. Update the Community Users Screen Design and Functionality #1452
  6. Update adminApproved to expected functionality in the develop-userTypeFix branch talawa-api#1862
  7. Update thedevelop-userTypeFix branch with the latest features from develop - Fundraising / Recurring Events talawa-api#1904

Potential internship candidates

Please read this if you are planning to apply for a Palisadoes Foundation internship

@palisadoes palisadoes added the bug Something isn't working label Jan 17, 2024
@github-actions github-actions bot added feature request ui/ux issue related and being worked with the figma file of the Admin UI unapproved labels Jan 17, 2024
@Saturn225
Copy link

Would like to work on this issue.

@Sejal1411
Copy link

would like to work on this issue! Pls assign

@manishjha-04
Copy link

would like to work in this issue!

@NayOoLwin5
Copy link
Contributor

NayOoLwin5 commented Jan 17, 2024

I would like to work on this issue.

@Pranavx1
Copy link
Contributor

Can i work on this?

@palisadoes
Copy link
Contributor Author

@KoraboinaSankeerth

  1. We have created profile design issues that will impact your work. We expect a delay in the API work while we finalize the methodology. This will mean the design issues should be either completed or near completion by the time you are ready.
  2. The issues are referenced in the first comment

@palisadoes
Copy link
Contributor Author

Unassigning due to no PR activity or assignee comments in the past 10 days

@NayOoLwin5
Copy link
Contributor

I would like to work on this issue

@Cioppolo14
Copy link
Contributor

@NayOoLwin5 You currently have 2 issues. Our policy is to assign no more than two issues to each contributor across all repositories. This way everyone gets a chance to participate in the projects. We sometimes give exceptions for more urgent cases and sometimes we lose track, but the policy stands. You have reached your limit, please wait until your existing issues are closed before requesting more issues. You could unassign yourself from one of the other issues too.

@Saturn225
Copy link

Saturn225 commented Jan 28, 2024 via email

@git-init-priyanshu
Copy link
Member

I would like to work on this issue. Thanks.

@Cioppolo14
Copy link
Contributor

@KoraboinaSankeerth I'm going to give someone else a chance with this issue. When your exams are done, please check back for open issues, we would love to collaborate with you.

@git-init-priyanshu
Copy link
Member

I need to check the userType of the User which could be either of these USER, NON_USER, ADMIN, SUPER_ADMIN and I need to change the code accordingly. Am I right?

@palisadoes
Copy link
Contributor Author

The issue description covers what you need to do. Read it carefully

@git-init-priyanshu
Copy link
Member

Unassigning myself.
As much as I love to work on this issue, I'm currently unable to allocate time for it. I would like to work on this in the future when I have a bit more availability. Meanwhile, I encourage someone else can try to fix this issue. Thanks.

@adi790uu
Copy link
Contributor

adi790uu commented Feb 3, 2024

Would like to solve this @Cioppolo14

@adi790uu
Copy link
Contributor

@adi790uu @AVtheking @Dante291
Are we ready to start merging develop-userTypeFix into develop now?

No sir rn only auth is changed,many queries and mutation are left

@AVtheking in mobile only queries and mutations need to be updated now if I am not wrong...

I didnt get your point.

@Dante291
Copy link

Dante291 commented Feb 29, 2024

@adi790uu @AVtheking @Dante291
Are we ready to start merging develop-userTypeFix into develop now?

No sir rn only auth is changed,many queries and mutation are left

@AVtheking in mobile only queries and mutations need to be updated now if I am not wrong...

I didnt get your point.

In Talawa mobile App I have made logical changes according to how we are saving User details in the app now just some queries need to updated and then we will be good merge it with develop mobile branch

@adi790uu
Copy link
Contributor

okay but work is still left in this repo.

@adi790uu
Copy link
Contributor

@palisadoes we need to reopen this.

@palisadoes palisadoes reopened this Feb 29, 2024
@palisadoes
Copy link
Contributor Author

@adi790uu @AVtheking @Dante291
Are we ready to start merging develop-userTypeFix into develop now?

No sir rn only auth is changed,many queries and mutation are left

@AVtheking in mobile only queries and mutations need to be updated now if I am not wrong...

I didnt get your point.

In Talawa mobile App I have made logical changes according to how we are saving User details in the app now just some queries need to updated and then we will be good merge it with develop mobile branch

Your most recent PR was merged. Please open the next one in the set

@palisadoes
Copy link
Contributor Author

palisadoes commented Mar 1, 2024

Adding @AdityaRaimec22 to this thread for context. Follow up API work that needs to be done

@adi790uu
Copy link
Contributor

adi790uu commented Mar 1, 2024

@palisadoes Yeah I have changed the logic in orgList screen but some tests are failing I have to fix those and then I will create a PR for that.

@palisadoes
Copy link
Contributor Author

@palisadoes Yeah I have changed the logic in orgList screen but some tests are failing I have to fix those and then I will create a PR for that.

Is there a lot of work outstanding to begin the merge back into develop?

@adi790uu
Copy link
Contributor

adi790uu commented Mar 1, 2024

@palisadoes yes for each screen I have to fix the tests as well as some logical changes are made in the codebase, so it will take some time.

@AVtheking
Copy link
Contributor

@palisadoes admin repo extensively used user type field and other which are moved to appUserProfile ,it will require lot of changes

@AVtheking
Copy link
Contributor

AVtheking commented Mar 2, 2024

@Dante291 after changing existing queries and mutation you have to lookout for the new merges in the mobile repo which woul require change accordingly until we merge it in develop

@AVtheking
Copy link
Contributor

@adi790uu I would suggest you list down the screens which are decoupled from one another so that we can open issues and multiple people can work parallely on this

@palisadoes
Copy link
Contributor Author

That would be the best approach.

@adi790uu Please create a list for this and post it here. We can use it too create a more efficient approach

@adi790uu
Copy link
Contributor

adi790uu commented Mar 2, 2024

@palisadoes @AVtheking Okay I will create a list of changes required and post it here today.

@palisadoes
Copy link
Contributor Author

@palisadoes @AVtheking Okay I will create a list of changes required and post it here today.

Please remember this so we can share the load

@adi790uu
Copy link
Contributor

adi790uu commented Mar 3, 2024

The changes will be done in mutations, queries, mocks, tests and components used in these screens mainly.

list of screens which require changes :

1.MemberDetail
2.OrganizationPeople
3.OrgList
4.UserPortal/Home.tsx
5.UserPortal/Organizations
6.UserPortal/Users

there might be some screens where changes might not be required as some queries and mutations are being reused. @palisadoes

@adi790uu
Copy link
Contributor

adi790uu commented Mar 3, 2024

@palisadoes I have been working on OrgList the tests for this screen are taking time to be resolved but as soon as it is done will create a PR for it.

@adi790uu
Copy link
Contributor

adi790uu commented Mar 3, 2024

@palisadoes I have tried fixing the tests for Org List and it just doesn't work, will it be fine if I leave the tests and create a PR and move on to other components and at last comeback to the tests which are consuming a lot of time fixing?

@palisadoes
Copy link
Contributor Author

  1. Create a separate issue for it and ask one of the others to work on its tests.
  2. We need the tests for all the screens to be done.
  3. Create issues for some of the other screens so others can assist as suggested before. They can work on the tests for those screens independently

Historically the code gets bad very quickly when we ignore testing. This is an are in which we cannot compromise

@palisadoes
Copy link
Contributor Author

  1. Closing. We are going to split this up into smaller issues to keep on track with our timeline
  2. The first PR was completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature request ui/ux issue related and being worked with the figma file of the Admin UI
Projects
None yet
Development

No branches or pull requests