PalisadoesFoundation / talawa-admin

Admin portal for the Talawa Mobile App. Click on the link below to see our documentation
https://docs.talawa.io/
GNU General Public License v3.0
147 stars 603 forks source link

[userTypeFix] Admin: Remove legacy references to `userType` #1827

Closed palisadoes closed 7 months ago

palisadoes commented 7 months ago

Is your feature request related to a problem? Please describe.

We recently updated the code base to replace the authorization mechanism for users from being a userType field in the database’s User collection to an appUserProfile field.

Describe the solution you'd like

  1. Though the updated code works, there are still many unused references to userType in the code base.
  2. Some of these references may still be accessible under certain circumstances creating malfunctioning code. These sections will need to be refactored.

The aim is for the userType to be removed, while maintaining the expected functionality of the app

Describe alternatives you've considered

Approach to be followed (optional)

Additional context

  1. This is the project tracking the userType adjustment
    1. https://github.com/orgs/PalisadoesFoundation/projects/24/views/1
  2. All tests must be valid and pass. There must be no reduction in test code coverage
  3. All functionality must be maintained
  4. These are the files that need to be updated in this repo
public/locales/en.json
public/locales/fr.json
public/locales/hi.json
public/locales/sp.json
public/locales/zh.json
schema.graphql
src/App.test.tsx
src/components/DeleteOrg/DeleteOrg.test.tsx
src/components/DeleteOrg/DeleteOrg.tsx
src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx
src/components/LeftDrawerEvent/LeftDrawerEvent.tsx
src/components/LeftDrawer/LeftDrawer.test.tsx
src/components/LeftDrawer/LeftDrawer.tsx
src/components/LeftDrawerOrg/LeftDrawerOrg.test.tsx
src/components/OrgAdminListCard/OrgAdminListCard.tsx
src/components/OrganizationScreen/OrganizationScreen.test.tsx
src/components/ProfileDropdown/profileDropdown.tsx
src/components/RequestsTableItem/RequestsTableItem.test.tsx
src/components/SuperAdminScreen/SuperAdminScreen.test.tsx
src/components/UserPortal/Login/Login.test.tsx
src/components/UserPortal/OrganizationSidebar/OrganizationSidebar.test.tsx
src/components/UserPortal/StartPostModal/StartPostModal.test.tsx
src/GraphQl/Mutations/mutations.ts
src/GraphQl/Queries/Queries.ts
src/screens/MemberDetail/MemberDetail.test.tsx
src/screens/OrganizationDashboard/OrganizationDashboard.test.tsx
src/screens/OrganizationEvents/OrganizationEvents.tsx
src/screens/OrganizationPeople/OrganizationPeople.test.tsx
src/screens/OrgList/OrganizationModal.tsx
src/screens/OrgList/OrgListMocks.ts
src/screens/OrgList/OrgList.tsx
src/screens/OrgSettings/OrgSettings.test.tsx
src/screens/Requests/Requests.test.tsx
src/screens/Requests/Requests.tsx
src/screens/UserPortal/Chat/Chat.test.tsx
src/screens/UserPortal/Events/Events.tsx
src/screens/UserPortal/People/People.test.tsx
src/screens/UserPortal/People/People.tsx
src/screens/UserPortal/Settings/Settings.test.tsx
src/screens/Users/Users.tsx
src/utils/interfaces.ts
src/utils/memberFields.ts

Potential internship candidates

pranshugupta54 commented 7 months ago

@palisadoes, how are we planning to work on this? 1) Spreadsheet like before and a common PR 2) Everyone gets assigned to this issue and works (Every user can make a separate issue themselves, link it to this parent issue and start working on it)

palisadoes commented 7 months ago

It was recommended in the slack discussion that this could all be handled by a single person because it was mostly removing unused code.

pranshugupta54 commented 7 months ago
pranshugupta54 commented 7 months ago

@palisadoes, after checking more files - I found that some of them are actually bugs. Not all of the code is un-used. Some of the code is making changes in features like Delete org and etc doesn't work.

I'll make separate PRs for each of these fixes so that it's easy to review and merge.

pranshugupta54 commented 7 months ago

@Cioppolo14 / @palisadoes, please assign

pranshugupta54 commented 7 months ago
palisadoes commented 7 months ago
  1. The Part 1 PR is complete.
  2. Are these remaining files on your roadmap?
src/components/LeftDrawerEvent/LeftDrawerEvent.tsx
src/components/OrgAdminListCard/OrgAdminListCard.tsx
src/components/UserPortal/OrganizationSidebar/OrganizationSidebar.test.tsx
src/components/UserPortal/SecuredRouteForUser/SecuredRouteForUser.test.tsx
src/GraphQl/Mutations/mutations.ts
src/screens/OrganizationPeople/MockDataTypes.ts
src/screens/OrganizationPeople/OrganizationPeople.test.tsx
src/screens/Requests/Requests.tsx
src/screens/UserPortal/Chat/Chat.test.tsx
src/screens/UserPortal/People/People.test.tsx
src/screens/UserPortal/People/People.tsx
src/screens/Users/Users.tsx
pranshugupta54 commented 7 months ago

@palisadoes, Will be fixed in their respective PRs:

-- Have an issue with Orgmember connection API, https://github.com/PalisadoesFoundation/talawa-api/issues/2157:

-- Need to first fix eslint issue in functions:

-- To check:

pranshugupta54 commented 7 months ago
image

To fix:

To be fixed in admin/1852:

Still API issue: