-
Notifications
You must be signed in to change notification settings - Fork 0
Retrieve all users #75
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
Open
Arshadul-Monir
wants to merge
2
commits into
main
Choose a base branch
from
retrieve-all-users
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,167 @@ | ||
| INSERT INTO members ( | ||
| id, | ||
| first_name, | ||
| last_name, | ||
| email, | ||
| linked_in_url, | ||
| introduction, | ||
| referral_source, | ||
| active, | ||
| match_pref, | ||
| industry_pref, | ||
| role_pref, | ||
| topics, | ||
| extra_notes | ||
| ) | ||
| VALUES | ||
| ( | ||
| '10000000-0000-4000-8000-000000000001', | ||
| 'Avery', | ||
| 'Chen', | ||
| 'avery.chen@example.com', | ||
| 'https://www.linkedin.com/in/avery-chen-example', | ||
| 'Product designer interested in making financial tools easier to use.', | ||
| 'Patina Network newsletter', | ||
| TRUE, | ||
| 'Peer - I want to meet someone with similar experience', | ||
| 'Financial Technology', | ||
| 'Product Designer', | ||
| 'Design systems, Financial literacy, Career growth', | ||
| 'Available for coffee in Manhattan or a virtual chat.' | ||
| ), | ||
| ( | ||
| '10000000-0000-4000-8000-000000000002', | ||
| 'Jordan', | ||
| 'Williams', | ||
| 'jordan.williams@example.com', | ||
| 'https://www.linkedin.com/in/jordan-williams-example', | ||
| 'Backend engineer building reliable systems for healthcare teams.', | ||
| 'Friend', | ||
| TRUE, | ||
| 'Mentor - I am looking for guidance from someone with more experience', | ||
| 'Healthcare Technology', | ||
| 'Software Engineer', | ||
| 'Distributed systems, Leadership, Open source', | ||
| 'Usually available after work on Tuesdays and Thursdays.' | ||
| ), | ||
| ( | ||
| '10000000-0000-4000-8000-000000000003', | ||
| 'Priya', | ||
| 'Patel', | ||
| 'priya.patel@example.com', | ||
| 'https://www.linkedin.com/in/priya-patel-example', | ||
| 'Founder working on software that helps small businesses measure emissions.', | ||
| 'Patina Network event', | ||
| TRUE, | ||
| 'Peer - I want to exchange ideas with another builder', | ||
| 'Climate Technology', | ||
| 'Founder', | ||
| 'Fundraising, Sustainability, Product strategy', | ||
| 'Happy to meet virtually or in Brooklyn.' | ||
| ), | ||
| ( | ||
| '10000000-0000-4000-8000-000000000004', | ||
| 'Marcus', | ||
| 'Johnson', | ||
| 'marcus.johnson@example.com', | ||
| NULL, | ||
| 'Data analyst focused on improving outcomes for public school students.', | ||
| 'Colleague', | ||
| FALSE, | ||
| 'Mentor - I can offer guidance to someone earlier in their career', | ||
| 'Education', | ||
| 'Data Analyst', | ||
| 'Analytics, Public policy, Mentorship', | ||
| 'Taking a break from matching this month.' | ||
| ), | ||
| ( | ||
| '10000000-0000-4000-8000-000000000005', | ||
| 'Sofia', | ||
| 'Rodriguez', | ||
| 'sofia.rodriguez@example.com', | ||
| 'https://www.linkedin.com/in/sofia-rodriguez-example', | ||
| 'Community program director connecting volunteers with neighborhood nonprofits.', | ||
| 'Community partner', | ||
| TRUE, | ||
| 'Open - I am happy to meet a peer, mentor, or mentee', | ||
| 'Nonprofit', | ||
| 'Program Director', | ||
| 'Community building, Social impact, Volunteer engagement', | ||
| 'Prefers an in-person conversation when possible.' | ||
| ), | ||
| ( | ||
| '10000000-0000-4000-8000-000000000006', | ||
| 'Ethan', | ||
| 'Kim', | ||
| 'ethan.kim@example.com', | ||
| 'https://www.linkedin.com/in/ethan-kim-example', | ||
| 'Graduate student researching responsible machine learning applications.', | ||
| 'University alumni group', | ||
| TRUE, | ||
| 'Mentor - I am looking for guidance from someone with more experience', | ||
| 'Artificial Intelligence', | ||
| 'Graduate Researcher', | ||
| 'Responsible AI, Research careers, Entrepreneurship', | ||
| NULL | ||
| ), | ||
| ( | ||
| '10000000-0000-4000-8000-000000000007', | ||
| 'Nia', | ||
| 'Thompson', | ||
| 'nia.thompson@example.com', | ||
| NULL, | ||
| 'Marketing strategist helping independent creators grow sustainable audiences.', | ||
| 'LinkedIn', | ||
| TRUE, | ||
| 'Peer - I want to meet someone with similar experience', | ||
| 'Media', | ||
| 'Marketing Strategist', | ||
| 'Brand strategy, Creator economy, Storytelling', | ||
| 'Virtual chats work best during weekday mornings.' | ||
| ), | ||
| ( | ||
| '10000000-0000-4000-8000-000000000008', | ||
| 'Leo', | ||
| 'Martinez', | ||
| 'leo.martinez@example.com', | ||
| 'https://www.linkedin.com/in/leo-martinez-example', | ||
| 'Operations manager interested in technology-enabled hospitality experiences.', | ||
| 'Friend', | ||
| TRUE, | ||
| 'Open - I am happy to meet a peer, mentor, or mentee', | ||
| 'Hospitality', | ||
| 'Operations Manager', | ||
| 'Operations, Customer experience, Small business', | ||
| 'Available in Queens or by video call.' | ||
| ), | ||
| ( | ||
| '10000000-0000-4000-8000-000000000009', | ||
| 'Maya', | ||
| 'Brooks', | ||
| 'maya.brooks@example.com', | ||
| 'https://www.linkedin.com/in/maya-brooks-example', | ||
| 'People operations leader building inclusive teams at growing companies.', | ||
| 'Patina Network event', | ||
| TRUE, | ||
| 'Mentor - I can offer guidance to someone earlier in their career', | ||
| 'Professional Services', | ||
| 'People Operations Director', | ||
| 'Inclusive hiring, Management, Organizational design', | ||
| 'Open to meeting anywhere near a major subway line.' | ||
| ), | ||
| ( | ||
| '10000000-0000-4000-8000-000000000010', | ||
| 'Noah', | ||
| 'Okafor', | ||
| 'noah.okafor@example.com', | ||
| NULL, | ||
| 'Independent consultant helping local retailers modernize their operations.', | ||
| 'Community partner', | ||
| FALSE, | ||
| 'Peer - I want to exchange ideas with another builder', | ||
| 'Retail', | ||
| 'Business Consultant', | ||
| 'Digital transformation, Consulting, Local business', | ||
| 'Inactive seed record for testing member status filters.' | ||
| ) | ||
| ON CONFLICT (email) DO NOTHING; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import MembersPage from "@/features/members/Members.page"; | ||
| import { renderWithProviders, screen } from "@/lib/test/render"; | ||
| import { server } from "@/lib/test/server"; | ||
| import { http, HttpResponse } from "msw"; | ||
| import { expect, test } from "vitest"; | ||
|
|
||
| test("renders every member returned by the API", async () => { | ||
| renderWithProviders(<MembersPage />); | ||
|
|
||
| expect(await screen.findByText("Alex Morgan")).toBeInTheDocument(); | ||
| expect(screen.getByText("Jordan Lee")).toBeInTheDocument(); | ||
| expect(screen.getByText("2 members")).toBeInTheDocument(); | ||
| expect(screen.getByText("Active")).toBeInTheDocument(); | ||
| expect(screen.getByText("Inactive")).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| test("renders an empty state when there are no members", async () => { | ||
| server.use( | ||
| http.get("/api/members", () => | ||
| HttpResponse.json({ | ||
| message: "Members retrieved successfully", | ||
| payload: [], | ||
| success: true, | ||
| }), | ||
| ), | ||
| ); | ||
|
|
||
| renderWithProviders(<MembersPage />); | ||
|
|
||
| expect(await screen.findByText("No members found.")).toBeInTheDocument(); | ||
| expect(screen.getByText("0 members")).toBeInTheDocument(); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| import { useMembers } from "@/features/members/api/useMembers"; | ||
| import { | ||
| Alert, | ||
| Anchor, | ||
| Badge, | ||
| Center, | ||
| Group, | ||
| Loader, | ||
| Paper, | ||
| Stack, | ||
| Table, | ||
| Text, | ||
| Title, | ||
| } from "@mantine/core"; | ||
|
|
||
| const dateFormatter = new Intl.DateTimeFormat(undefined, { | ||
| dateStyle: "medium", | ||
| }); | ||
|
|
||
| export default function MembersPage() { | ||
| const { data: members, isError, isPending } = useMembers(); | ||
|
|
||
| if (isPending) { | ||
| return ( | ||
| <Center py="xl"> | ||
| <Loader aria-label="Loading members" /> | ||
| </Center> | ||
| ); | ||
| } | ||
|
|
||
| if (isError) { | ||
| return ( | ||
| <Alert color="red" title="Members could not be loaded"> | ||
| Try refreshing the page. If the problem continues, check that the | ||
| backend is running. | ||
| </Alert> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <Stack> | ||
| <Group justify="space-between"> | ||
| <div> | ||
| <Title order={2}>Members</Title> | ||
| <Text c="dimmed">Everyone registered for PatChats.</Text> | ||
| </div> | ||
| <Badge size="lg" variant="light"> | ||
| {members.length} {members.length === 1 ? "member" : "members"} | ||
| </Badge> | ||
| </Group> | ||
| {members.length === 0 ? | ||
| <Paper p="xl" withBorder> | ||
| <Text c="dimmed" ta="center"> | ||
| No members found. | ||
| </Text> | ||
| </Paper> | ||
| : <Table.ScrollContainer minWidth={1100}> | ||
| <Table highlightOnHover striped withTableBorder> | ||
| <Table.Thead> | ||
| <Table.Tr> | ||
| <Table.Th>Name</Table.Th> | ||
| <Table.Th>Email</Table.Th> | ||
| <Table.Th>LinkedIn</Table.Th> | ||
| <Table.Th>Status</Table.Th> | ||
| <Table.Th>Match preference</Table.Th> | ||
| <Table.Th>Industry</Table.Th> | ||
| <Table.Th>Role</Table.Th> | ||
| <Table.Th>Topics</Table.Th> | ||
| <Table.Th>Joined</Table.Th> | ||
| </Table.Tr> | ||
| </Table.Thead> | ||
| <Table.Tbody> | ||
| {members.map((member) => ( | ||
| <Table.Tr key={member.id}> | ||
| <Table.Td fw={600}> | ||
| {member.firstName} {member.lastName} | ||
| </Table.Td> | ||
| <Table.Td> | ||
| <Anchor href={`mailto:${member.email}`}> | ||
| {member.email} | ||
| </Anchor> | ||
| </Table.Td> | ||
| <Table.Td> | ||
| {member.linkedInUrl ? | ||
| <Anchor | ||
| href={member.linkedInUrl} | ||
| rel="noreferrer" | ||
| target="_blank" | ||
| > | ||
| Profile | ||
| </Anchor> | ||
| : "—"} | ||
| </Table.Td> | ||
| <Table.Td> | ||
| <Badge color={member.active ? "green" : "gray"}> | ||
| {member.active ? "Active" : "Inactive"} | ||
| </Badge> | ||
| </Table.Td> | ||
| <Table.Td>{member.matchPref ?? "—"}</Table.Td> | ||
| <Table.Td>{member.industryPref ?? "—"}</Table.Td> | ||
| <Table.Td>{member.rolePref ?? "—"}</Table.Td> | ||
| <Table.Td>{member.topics ?? "—"}</Table.Td> | ||
| <Table.Td> | ||
| {dateFormatter.format(new Date(member.createdAt))} | ||
| </Table.Td> | ||
| </Table.Tr> | ||
| ))} | ||
| </Table.Tbody> | ||
| </Table> | ||
| </Table.ScrollContainer> | ||
| } | ||
| </Stack> | ||
| ); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No default exports pls