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

[FEATURE] Search for members on paginated member page #369

Closed
2 tasks done
aerugo opened this issue Nov 5, 2021 · 31 comments
Closed
2 tasks done

[FEATURE] Search for members on paginated member page #369

aerugo opened this issue Nov 5, 2021 · 31 comments
Assignees
Labels
needs testing To be tested before being considered done.

Comments

@aerugo
Copy link
Contributor

aerugo commented Nov 5, 2021

As an admin, I want to be able to search for a user by name on the member page of my group or round (for example to change the users' balance or to upgrade them to admin).

terminology: in the code, rounds are sometimes called collections or events. Groups are sometimes called organizations/orgs.

@aerugo
Copy link
Contributor Author

aerugo commented Nov 22, 2021

related #307 /j

@Powersource
Copy link
Member

fwiw there's some member searching added to the api in #525 that might be reusable/usable for inspiration

@aerugo
Copy link
Contributor Author

aerugo commented Feb 7, 2022

Ping @SeunghunSunmoonLee

@shsunmoonlee
Copy link
Contributor

shsunmoonlee commented Feb 9, 2022

Just followed README and I got an error. Help would be appreciated @aerugo
ReferenceError: Cannot access 'WEBPACK_DEFAULT_EXPORT' before initialization

➜  ui git:(main) ✗ yarn dev
yarn run v1.22.4
$ yarn run generate
$ yarn run generate:prisma
$ prisma generate
Environment variables loaded from .env
Prisma schema loaded from server/prisma/schema.prisma

✔ Generated Prisma Client (3.4.1) to ./node_modules/@prisma/client in 344ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /Users/seunghunlee/Software/cobudget/ui/.env.local
info  - Loaded env from /Users/seunghunlee/Software/cobudget/ui/.env.development
info  - Loaded env from /Users/seunghunlee/Software/cobudget/ui/.env
info  - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled
event - compiled client and server successfully in 2.9s (2113 modules)
wait  - compiling / (client and server)...
info  - Using external babel configuration from /Users/seunghunlee/Software/cobudget/ui/.babelrc
event - compiled client and server successfully in 1483 ms (2116 modules)
wait  - compiling /api...
event - compiled client and server successfully in 431 ms (2160 modules)
wait  - compiling /_error (client and server)...
error - ReferenceError: Cannot access '__WEBPACK_DEFAULT_EXPORT__' before initialization
event - compiled client and server successfully in 292 ms (2161 modules)

@Powersource
Copy link
Member

@SeunghunSunmoonLee it's a strange bug since neither Gustav nor I are getting it, but both you and also another person I've heard get it. But it seems to be fixed by vercel/next.js#33831 , however that pr doesn't seem to have ended up in a normal release yet so you might have to update to a canary version of next, e.g. 12.0.11-canary.9

@shsunmoonlee
Copy link
Contributor

shsunmoonlee commented Feb 9, 2022

Thank you @Powersource ! Now I can run it after setting env variable after getting another error.

Error: Add MAGIC_LINK_SECRET environment variable

Is there a better solution to access members page without having to change the code to determine authenticated or not?

@aerugo
Copy link
Contributor Author

aerugo commented Feb 9, 2022 via email

@Powersource
Copy link
Member

Is there a better solution to access members page without having to change the code to determine authenticated or not?

How do you mean? It should be enough to be logged in as a member of the collection.

@aerugo
Copy link
Contributor Author

aerugo commented Feb 9, 2022

@SeunghunSunmoonLee - to log in with a magic link, you use the link that is printed to terminal when you try to log in with any email.

@aerugo
Copy link
Contributor Author

aerugo commented Feb 10, 2022

Did you get it to work @SeunghunSunmoonLee?

@shsunmoonlee
Copy link
Contributor

Yeah. I have WIP solution. Can you let me push?

➜  cobudget git:(369-search-for-members) git push --set-upstream origin 369-search-for-members
remote: Permission to cobudget/cobudget.git denied to SeunghunSunmoonLee.
fatal: unable to access 'https://github.com/cobudget/cobudget.git/': The requested URL returned error: 403

@shsunmoonlee
Copy link
Contributor

@Powersource I've used your implementation. I got error with usernameStartsWith.

CombinedError {name: 'CombinedError', message: '[GraphQL] Unknown argument "usernameStartsWith" on field "MembersPage.members".', graphQLErrors: Array(1), networkError: undefined, response: Response}

Do you have any clue on this?

Not sure why MembersPage resolver is reading members from db while members do the same?

@Powersource
Copy link
Member

@SeunghunSunmoonLee MembersPage is(/was? I think we might have switched to another one in some/all places) our solution for pagination.

For that error, when adding an argument to a graphql resolver you need to add it in a few different places, including in the graphql schema.

@aerugo
Copy link
Contributor Author

aerugo commented Feb 10, 2022

@SeunghunSunmoonLee open a pull request and @gustavlrsn or @Powersource will review. :)
Our main branch deploys directly to production.

@Powersource
Copy link
Member

i think he's trying to push to a new branch in our repo. that would be fine but he'd need more permissions.

@SeunghunSunmoonLee i think it's simplest if you create a fork on github and push to that one instead

shsunmoonlee added a commit to shsunmoonlee/cobudget that referenced this issue Feb 10, 2022
@shsunmoonlee
Copy link
Contributor

Here it is :) #545

@francesca-sp
Copy link
Collaborator

francesca-sp commented Feb 14, 2022

Following a discussion in today's meeting, I've added this new issue to improve the search options for the round members: #555 ping @SeunghunSunmoonLee

@Powersource
Copy link
Member

there's also a bug that you have to currently search case-sensitively for names but i think that has the same cause as #554 which i'll fix today (i think i might refactor the two resolvers into one)

@Powersource
Copy link
Member

@SeunghunSunmoonLee assigned this to you since iirc you were still gonna work on cobudget, just not very much per month?

@aerugo aerugo changed the title Search for members on paginated member page [FEATURE] Search for members on paginated member page Mar 13, 2022
@shsunmoonlee
Copy link
Contributor

shsunmoonlee commented Mar 14, 2022

Hey! Which ticket? #554 or #555?
ah this ticket is open again. I see. So requirement is improve the search options I guess?
@Powersource

@Powersource
Copy link
Member

@SeunghunSunmoonLee yep this issue, i've updated the description a tad to clarify. specifically we want

Search on Group (aka org) member list page

We currently only have it on the Round (aka collection) page

@gustavlrsn gustavlrsn assigned gustavlrsn and unassigned shsunmoonlee Jun 2, 2022
@gustavlrsn gustavlrsn mentioned this issue Jun 2, 2022
3 tasks
@Powersource Powersource added the needs testing To be tested before being considered done. label Jun 6, 2022
@Powersource
Copy link
Member

This issue should be closable now. As mentioned in the PR, new features to test:

  • pagination on round members page
  • search on group members page
  • ability to search on email on the round members list (for admins only)

@francesca-sp
Copy link
Collaborator

The last 2 bullet points are working, and for pagination, I'm trying to test it - but it's not even kicking in with a list of 27 members. As of how many members is pagination supposed to start? @Powersource

@francesca-sp
Copy link
Collaborator

@Powersource did you see the above question of mine? So that we can close this....

@gustavlrsn
Copy link
Member

@francesca-sp the pagination limit is 30

@francesca-sp
Copy link
Collaborator

francesca-sp commented Jun 28, 2022

thanks @gustavlrsn . Just tested this with a round, and for me pagination does not seem to be working. When I go above 30, then simply the "load more" button shows up, and I need to unfold the list to load the remaining emails. Is that what is supposed to happen? @Powersource

This is the one: https://staging.cobudget.com/staging-group/my-staging-round/participants

@gustavlrsn
Copy link
Member

Hm, I only see 3 participants in that list. But unsure what you mean with the load more behavior. Clicking the button should add up to 30 more records in the same list. We're adding automatic "infinite scrolling" in another issue, so that you don't need to press the button manually.

@francesca-sp
Copy link
Collaborator

that's very odd, there are 31 people in that list.
image

My understanding was that this issue is about "pagination", which I understand as pages showing up that you switch between, once you reach above 30. Is that incorrect?

@gustavlrsn
Copy link
Member

Right, as a non-admin I can only see people that have accepted the invitation.

Ah, yes, confusing term, it is pagination more in the technical sense of dividing up the result in "pages", to avoid loading everything at once

@francesca-sp
Copy link
Collaborator

ok, I understand now. So in that case, this seems to be working and can be closed.

@gustavlrsn
Copy link
Member

Great, closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs testing To be tested before being considered done.
Projects
None yet
Development

No branches or pull requests

5 participants