From 92b1e59b8661085f2523208a0307e210863efc5c Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Mon, 11 Nov 2024 18:12:24 -0300 Subject: [PATCH 01/13] BA-1777-fe-multiple-profiles-member-list --- .../UserMembersListFragment.graphql.ts | 325 +++++ .../UserMembersListPaginationQuery.graphql.ts | 347 ++++++ ...embersListPaginationRefetchable.graphql.ts | 367 ++++++ .../profiles/Members/MemberItem/index.tsx | 50 + .../profiles/Members/MemberItem/styled.tsx | 21 + .../profiles/Members/MemberItem/types.ts | 20 + .../profiles/Members/MembersList/index.tsx | 107 ++ .../modules/profiles/Members/constants.ts | 7 + .../modules/profiles/Members/index.tsx | 77 ++ .../modules/profiles/Members/styled.tsx | 7 + .../modules/profiles/Members/types.ts | 26 + .../graphql/queries/UserMembersList.ts | 44 + packages/components/modules/profiles/index.ts | 1 + packages/components/schema.graphql | 1042 +++++++++++++---- .../components/inputs/TextField/index.tsx | 4 +- 15 files changed, 2227 insertions(+), 218 deletions(-) create mode 100644 packages/components/__generated__/UserMembersListFragment.graphql.ts create mode 100644 packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts create mode 100644 packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts create mode 100644 packages/components/modules/profiles/Members/MemberItem/index.tsx create mode 100644 packages/components/modules/profiles/Members/MemberItem/styled.tsx create mode 100644 packages/components/modules/profiles/Members/MemberItem/types.ts create mode 100644 packages/components/modules/profiles/Members/MembersList/index.tsx create mode 100644 packages/components/modules/profiles/Members/constants.ts create mode 100644 packages/components/modules/profiles/Members/index.tsx create mode 100644 packages/components/modules/profiles/Members/styled.tsx create mode 100644 packages/components/modules/profiles/Members/types.ts create mode 100644 packages/components/modules/profiles/graphql/queries/UserMembersList.ts diff --git a/packages/components/__generated__/UserMembersListFragment.graphql.ts b/packages/components/__generated__/UserMembersListFragment.graphql.ts new file mode 100644 index 00000000..6ba87d89 --- /dev/null +++ b/packages/components/__generated__/UserMembersListFragment.graphql.ts @@ -0,0 +1,325 @@ +/** + * @generated SignedSource<<6487acdc5c21d43116573cae55a8dfc0>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ + +/* eslint-disable */ +// @ts-nocheck +import { ReaderFragment, RefetchableFragment } from 'relay-runtime' +import { FragmentRefs } from 'relay-runtime' + +export type ProfileRoleStatus = 'ACTIVE' | 'INACTIVE' | 'PENDING' | '%future added value' +export type ProfileRoles = 'ADMIN' | 'MANAGER' | '%future added value' + +export type UserMembersListFragment$data = { + readonly id: string + readonly profile: + | { + readonly members: + | { + readonly edges: ReadonlyArray< + | { + readonly node: + | { + readonly id: string + readonly role: ProfileRoles | null | undefined + readonly status: ProfileRoleStatus | null | undefined + readonly user: { + readonly profile: + | { + readonly ' $fragmentSpreads': FragmentRefs<'ProfileItemFragment'> + } + | null + | undefined + } + } + | null + | undefined + } + | null + | undefined + > + readonly pageInfo: { + readonly endCursor: string | null | undefined + readonly hasNextPage: boolean + } + readonly totalCount: number | null | undefined + } + | null + | undefined + readonly ' $fragmentSpreads': FragmentRefs<'ProfileItemFragment'> + } + | null + | undefined + readonly ' $fragmentType': 'UserMembersListFragment' +} +export type UserMembersListFragment$key = { + readonly ' $data'?: UserMembersListFragment$data + readonly ' $fragmentSpreads': FragmentRefs<'UserMembersListFragment'> +} + +const node: ReaderFragment = (function () { + var v0 = ['profile', 'members'], + v1 = { + alias: null, + args: null, + kind: 'ScalarField', + name: 'id', + storageKey: null, + }, + v2 = { + kind: 'InlineDataFragmentSpread', + name: 'ProfileItemFragment', + selections: [ + v1 /*: any*/, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'name', + storageKey: null, + }, + { + alias: null, + args: [ + { + kind: 'Literal', + name: 'height', + value: 100, + }, + { + kind: 'Literal', + name: 'width', + value: 100, + }, + ], + concreteType: 'File', + kind: 'LinkedField', + name: 'image', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'url', + storageKey: null, + }, + ], + storageKey: 'image(height:100,width:100)', + }, + { + alias: null, + args: null, + concreteType: 'URLPath', + kind: 'LinkedField', + name: 'urlPath', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'path', + storageKey: null, + }, + ], + storageKey: null, + }, + ], + args: null, + argumentDefinitions: [] /*: any*/, + } + return { + argumentDefinitions: [ + { + defaultValue: 10, + kind: 'LocalArgument', + name: 'count', + }, + { + defaultValue: null, + kind: 'LocalArgument', + name: 'cursor', + }, + { + defaultValue: 'custom', + kind: 'LocalArgument', + name: 'orderByStatus', + }, + ], + kind: 'Fragment', + metadata: { + connection: [ + { + count: 'count', + cursor: 'cursor', + direction: 'forward', + path: v0 /*: any*/, + }, + ], + refetch: { + connection: { + forward: { + count: 'count', + cursor: 'cursor', + }, + backward: null, + path: v0 /*: any*/, + }, + fragmentPathInResult: ['node'], + operation: require('./userMembersListPaginationRefetchable.graphql'), + identifierInfo: { + identifierField: 'id', + identifierQueryVariableName: 'id', + }, + }, + }, + name: 'UserMembersListFragment', + selections: [ + { + alias: null, + args: null, + concreteType: 'Profile', + kind: 'LinkedField', + name: 'profile', + plural: false, + selections: [ + v2 /*: any*/, + { + alias: 'members', + args: [ + { + kind: 'Variable', + name: 'orderByStatus', + variableName: 'orderByStatus', + }, + ], + concreteType: 'ProfileUserRoleConnection', + kind: 'LinkedField', + name: '__UserMembersFragment_members_connection', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'totalCount', + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'ProfileUserRoleEdge', + kind: 'LinkedField', + name: 'edges', + plural: true, + selections: [ + { + alias: null, + args: null, + concreteType: 'ProfileUserRole', + kind: 'LinkedField', + name: 'node', + plural: false, + selections: [ + v1 /*: any*/, + { + alias: null, + args: null, + concreteType: 'User', + kind: 'LinkedField', + name: 'user', + plural: false, + selections: [ + { + alias: null, + args: null, + concreteType: 'Profile', + kind: 'LinkedField', + name: 'profile', + plural: false, + selections: [v2 /*: any*/], + storageKey: null, + }, + ], + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'role', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'status', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: '__typename', + storageKey: null, + }, + ], + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'cursor', + storageKey: null, + }, + ], + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'PageInfo', + kind: 'LinkedField', + name: 'pageInfo', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'endCursor', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'hasNextPage', + storageKey: null, + }, + ], + storageKey: null, + }, + ], + storageKey: null, + }, + ], + storageKey: null, + }, + v1 /*: any*/, + ], + type: 'User', + abstractKey: null, + } +})() + +;(node as any).hash = '5114446aef93bf0eb196a55ba3f9a429' + +export default node diff --git a/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts b/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts new file mode 100644 index 00000000..f0691ec8 --- /dev/null +++ b/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts @@ -0,0 +1,347 @@ +/** + * @generated SignedSource<<5590b423755faa5cae40c081ea26fb23>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ + +/* eslint-disable */ +// @ts-nocheck +import { ConcreteRequest, Query } from 'relay-runtime' +import { FragmentRefs } from 'relay-runtime' + +export type UserMembersListPaginationQuery$variables = { + count?: number | null | undefined + cursor?: string | null | undefined + orderByStatus?: string | null | undefined +} +export type UserMembersListPaginationQuery$data = { + readonly me: + | { + readonly ' $fragmentSpreads': FragmentRefs<'UserMembersListFragment'> + } + | null + | undefined +} +export type UserMembersListPaginationQuery = { + response: UserMembersListPaginationQuery$data + variables: UserMembersListPaginationQuery$variables +} + +const node: ConcreteRequest = (function () { + var v0 = [ + { + defaultValue: 10, + kind: 'LocalArgument', + name: 'count', + }, + { + defaultValue: null, + kind: 'LocalArgument', + name: 'cursor', + }, + { + defaultValue: null, + kind: 'LocalArgument', + name: 'orderByStatus', + }, + ], + v1 = { + kind: 'Variable', + name: 'orderByStatus', + variableName: 'orderByStatus', + }, + v2 = { + alias: null, + args: null, + kind: 'ScalarField', + name: 'id', + storageKey: null, + }, + v3 = { + alias: null, + args: null, + kind: 'ScalarField', + name: 'name', + storageKey: null, + }, + v4 = { + alias: null, + args: [ + { + kind: 'Literal', + name: 'height', + value: 100, + }, + { + kind: 'Literal', + name: 'width', + value: 100, + }, + ], + concreteType: 'File', + kind: 'LinkedField', + name: 'image', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'url', + storageKey: null, + }, + ], + storageKey: 'image(height:100,width:100)', + }, + v5 = { + alias: null, + args: null, + concreteType: 'URLPath', + kind: 'LinkedField', + name: 'urlPath', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'path', + storageKey: null, + }, + v2 /*: any*/, + ], + storageKey: null, + }, + v6 = [ + { + kind: 'Variable', + name: 'after', + variableName: 'cursor', + }, + { + kind: 'Variable', + name: 'first', + variableName: 'count', + }, + v1 /*: any*/, + ] + return { + fragment: { + argumentDefinitions: v0 /*: any*/, + kind: 'Fragment', + metadata: null, + name: 'UserMembersListPaginationQuery', + selections: [ + { + alias: null, + args: null, + concreteType: 'User', + kind: 'LinkedField', + name: 'me', + plural: false, + selections: [ + { + args: [ + { + kind: 'Variable', + name: 'count', + variableName: 'count', + }, + { + kind: 'Variable', + name: 'cursor', + variableName: 'cursor', + }, + v1 /*: any*/, + ], + kind: 'FragmentSpread', + name: 'UserMembersListFragment', + }, + ], + storageKey: null, + }, + ], + type: 'Query', + abstractKey: null, + }, + kind: 'Request', + operation: { + argumentDefinitions: v0 /*: any*/, + kind: 'Operation', + name: 'UserMembersListPaginationQuery', + selections: [ + { + alias: null, + args: null, + concreteType: 'User', + kind: 'LinkedField', + name: 'me', + plural: false, + selections: [ + { + alias: null, + args: null, + concreteType: 'Profile', + kind: 'LinkedField', + name: 'profile', + plural: false, + selections: [ + v2 /*: any*/, + v3 /*: any*/, + v4 /*: any*/, + v5 /*: any*/, + { + alias: null, + args: v6 /*: any*/, + concreteType: 'ProfileUserRoleConnection', + kind: 'LinkedField', + name: 'members', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'totalCount', + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'ProfileUserRoleEdge', + kind: 'LinkedField', + name: 'edges', + plural: true, + selections: [ + { + alias: null, + args: null, + concreteType: 'ProfileUserRole', + kind: 'LinkedField', + name: 'node', + plural: false, + selections: [ + v2 /*: any*/, + { + alias: null, + args: null, + concreteType: 'User', + kind: 'LinkedField', + name: 'user', + plural: false, + selections: [ + { + alias: null, + args: null, + concreteType: 'Profile', + kind: 'LinkedField', + name: 'profile', + plural: false, + selections: [ + v2 /*: any*/, + v3 /*: any*/, + v4 /*: any*/, + v5 /*: any*/, + ], + storageKey: null, + }, + v2 /*: any*/, + ], + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'role', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'status', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: '__typename', + storageKey: null, + }, + ], + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'cursor', + storageKey: null, + }, + ], + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'PageInfo', + kind: 'LinkedField', + name: 'pageInfo', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'endCursor', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'hasNextPage', + storageKey: null, + }, + ], + storageKey: null, + }, + ], + storageKey: null, + }, + { + alias: null, + args: v6 /*: any*/, + filters: ['orderByStatus'], + handle: 'connection', + key: 'UserMembersFragment_members', + kind: 'LinkedHandle', + name: 'members', + }, + ], + storageKey: null, + }, + v2 /*: any*/, + ], + storageKey: null, + }, + ], + }, + params: { + cacheID: '01fb387e0c0ef07a4b949c31accf3a0c', + id: null, + metadata: {}, + name: 'UserMembersListPaginationQuery', + operationKind: 'query', + text: 'query UserMembersListPaginationQuery(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String\n) {\n me {\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on User {\n profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n }\n id\n}\n', + }, + } +})() + +;(node as any).hash = '5925af2542eb06c4457a1e16c1591fd9' + +export default node diff --git a/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts b/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts new file mode 100644 index 00000000..a676f99f --- /dev/null +++ b/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts @@ -0,0 +1,367 @@ +/** + * @generated SignedSource<<92f589914a9995a763cf552ec687d3c7>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ + +/* eslint-disable */ +// @ts-nocheck +import { ConcreteRequest, Query } from 'relay-runtime' +import { FragmentRefs } from 'relay-runtime' + +export type userMembersListPaginationRefetchable$variables = { + count?: number | null | undefined + cursor?: string | null | undefined + id: string + orderByStatus?: string | null | undefined +} +export type userMembersListPaginationRefetchable$data = { + readonly node: + | { + readonly ' $fragmentSpreads': FragmentRefs<'UserMembersListFragment'> + } + | null + | undefined +} +export type userMembersListPaginationRefetchable = { + response: userMembersListPaginationRefetchable$data + variables: userMembersListPaginationRefetchable$variables +} + +const node: ConcreteRequest = (function () { + var v0 = { + defaultValue: 10, + kind: 'LocalArgument', + name: 'count', + }, + v1 = { + defaultValue: null, + kind: 'LocalArgument', + name: 'cursor', + }, + v2 = { + defaultValue: null, + kind: 'LocalArgument', + name: 'id', + }, + v3 = { + defaultValue: 'custom', + kind: 'LocalArgument', + name: 'orderByStatus', + }, + v4 = [ + { + kind: 'Variable', + name: 'id', + variableName: 'id', + }, + ], + v5 = { + kind: 'Variable', + name: 'orderByStatus', + variableName: 'orderByStatus', + }, + v6 = { + alias: null, + args: null, + kind: 'ScalarField', + name: '__typename', + storageKey: null, + }, + v7 = { + alias: null, + args: null, + kind: 'ScalarField', + name: 'id', + storageKey: null, + }, + v8 = { + alias: null, + args: null, + kind: 'ScalarField', + name: 'name', + storageKey: null, + }, + v9 = { + alias: null, + args: [ + { + kind: 'Literal', + name: 'height', + value: 100, + }, + { + kind: 'Literal', + name: 'width', + value: 100, + }, + ], + concreteType: 'File', + kind: 'LinkedField', + name: 'image', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'url', + storageKey: null, + }, + ], + storageKey: 'image(height:100,width:100)', + }, + v10 = { + alias: null, + args: null, + concreteType: 'URLPath', + kind: 'LinkedField', + name: 'urlPath', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'path', + storageKey: null, + }, + v7 /*: any*/, + ], + storageKey: null, + }, + v11 = [ + { + kind: 'Variable', + name: 'after', + variableName: 'cursor', + }, + { + kind: 'Variable', + name: 'first', + variableName: 'count', + }, + v5 /*: any*/, + ] + return { + fragment: { + argumentDefinitions: [v0 /*: any*/, v1 /*: any*/, v2 /*: any*/, v3 /*: any*/], + kind: 'Fragment', + metadata: null, + name: 'userMembersListPaginationRefetchable', + selections: [ + { + alias: null, + args: v4 /*: any*/, + concreteType: null, + kind: 'LinkedField', + name: 'node', + plural: false, + selections: [ + { + args: [ + { + kind: 'Variable', + name: 'count', + variableName: 'count', + }, + { + kind: 'Variable', + name: 'cursor', + variableName: 'cursor', + }, + v5 /*: any*/, + ], + kind: 'FragmentSpread', + name: 'UserMembersListFragment', + }, + ], + storageKey: null, + }, + ], + type: 'Query', + abstractKey: null, + }, + kind: 'Request', + operation: { + argumentDefinitions: [v0 /*: any*/, v1 /*: any*/, v3 /*: any*/, v2 /*: any*/], + kind: 'Operation', + name: 'userMembersListPaginationRefetchable', + selections: [ + { + alias: null, + args: v4 /*: any*/, + concreteType: null, + kind: 'LinkedField', + name: 'node', + plural: false, + selections: [ + v6 /*: any*/, + v7 /*: any*/, + { + kind: 'InlineFragment', + selections: [ + { + alias: null, + args: null, + concreteType: 'Profile', + kind: 'LinkedField', + name: 'profile', + plural: false, + selections: [ + v7 /*: any*/, + v8 /*: any*/, + v9 /*: any*/, + v10 /*: any*/, + { + alias: null, + args: v11 /*: any*/, + concreteType: 'ProfileUserRoleConnection', + kind: 'LinkedField', + name: 'members', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'totalCount', + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'ProfileUserRoleEdge', + kind: 'LinkedField', + name: 'edges', + plural: true, + selections: [ + { + alias: null, + args: null, + concreteType: 'ProfileUserRole', + kind: 'LinkedField', + name: 'node', + plural: false, + selections: [ + v7 /*: any*/, + { + alias: null, + args: null, + concreteType: 'User', + kind: 'LinkedField', + name: 'user', + plural: false, + selections: [ + { + alias: null, + args: null, + concreteType: 'Profile', + kind: 'LinkedField', + name: 'profile', + plural: false, + selections: [ + v7 /*: any*/, + v8 /*: any*/, + v9 /*: any*/, + v10 /*: any*/, + ], + storageKey: null, + }, + v7 /*: any*/, + ], + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'role', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'status', + storageKey: null, + }, + v6 /*: any*/, + ], + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'cursor', + storageKey: null, + }, + ], + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'PageInfo', + kind: 'LinkedField', + name: 'pageInfo', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'endCursor', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'hasNextPage', + storageKey: null, + }, + ], + storageKey: null, + }, + ], + storageKey: null, + }, + { + alias: null, + args: v11 /*: any*/, + filters: ['orderByStatus'], + handle: 'connection', + key: 'UserMembersFragment_members', + kind: 'LinkedHandle', + name: 'members', + }, + ], + storageKey: null, + }, + ], + type: 'User', + abstractKey: null, + }, + ], + storageKey: null, + }, + ], + }, + params: { + cacheID: 'f5fc645f9fb9dcbb19f717aaeb5d405f', + id: null, + metadata: {}, + name: 'userMembersListPaginationRefetchable', + operationKind: 'query', + text: 'query userMembersListPaginationRefetchable(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String = "custom"\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on User {\n profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n }\n id\n}\n', + }, + } +})() + +;(node as any).hash = '5114446aef93bf0eb196a55ba3f9a429' + +export default node diff --git a/packages/components/modules/profiles/Members/MemberItem/index.tsx b/packages/components/modules/profiles/Members/MemberItem/index.tsx new file mode 100644 index 00000000..ed30786f --- /dev/null +++ b/packages/components/modules/profiles/Members/MemberItem/index.tsx @@ -0,0 +1,50 @@ +import { FC } from 'react' + +import { AvatarWithPlaceholder } from '@baseapp-frontend/design-system' + +import { Box, Button, Typography } from '@mui/material' +import { readInlineData } from 'react-relay' + +import { ProfileItemFragment$key } from '../../../../__generated__/ProfileItemFragment.graphql' +import { ProfileItemFragment } from '../../graphql/queries/ProfileItem' +import { MemberStatuses } from '../constants' +import { MemberItemContainer, MemberPersonalInformation } from './styled' +import { MemberItemProps } from './types' + +const MemberItem: FC = ({ + member, + memberRole, + status, + avatarProps = {}, + avatarWidth = 40, + avatarHeight = 40, +}) => { + if (!member) return null + const memberProfile = readInlineData(ProfileItemFragment, member) + return ( + + + + + {memberProfile.name} + {memberProfile?.urlPath?.path} + + + + + + + + ) +} + +export default MemberItem diff --git a/packages/components/modules/profiles/Members/MemberItem/styled.tsx b/packages/components/modules/profiles/Members/MemberItem/styled.tsx new file mode 100644 index 00000000..0eb56ddb --- /dev/null +++ b/packages/components/modules/profiles/Members/MemberItem/styled.tsx @@ -0,0 +1,21 @@ +import { Box, styled } from '@mui/material' + +import { IMemberPersonalInformation } from './types' + +export const MemberItemContainer = styled(Box)(({ theme }) => ({ + display: 'flex', + gap: theme.spacing(1.5), + alignItems: 'center', + justifyContent: 'space-between', + padding: theme.spacing(1.5, 0), +})) + +export const MemberPersonalInformation = styled(Box, { + shouldForwardProp: (prop) => prop !== 'isActive', +})(({ isActive, theme }) => ({ + opacity: isActive ? 1 : 0.6, + display: 'flex', + gap: theme.spacing(1.5), + alignItems: 'center', + justifyContent: 'space-between', +})) diff --git a/packages/components/modules/profiles/Members/MemberItem/types.ts b/packages/components/modules/profiles/Members/MemberItem/types.ts new file mode 100644 index 00000000..e41b13dc --- /dev/null +++ b/packages/components/modules/profiles/Members/MemberItem/types.ts @@ -0,0 +1,20 @@ +import type { AvatarProps, BoxProps } from '@mui/material' + +import type { ProfileItemFragment$key } from '../../../../__generated__/ProfileItemFragment.graphql' +import type { + ProfileRoleStatus, + ProfileRoles, +} from '../../../../__generated__/UserMembersListFragment.graphql' + +export interface IMemberPersonalInformation extends BoxProps { + isActive: boolean +} + +export interface MemberItemProps { + member: ProfileItemFragment$key | null | undefined + memberRole: ProfileRoles | null | undefined | 'owner' + status: ProfileRoleStatus | null | undefined + avatarProps?: AvatarProps + avatarWidth?: number + avatarHeight?: number +} diff --git a/packages/components/modules/profiles/Members/MembersList/index.tsx b/packages/components/modules/profiles/Members/MembersList/index.tsx new file mode 100644 index 00000000..52ffd61b --- /dev/null +++ b/packages/components/modules/profiles/Members/MembersList/index.tsx @@ -0,0 +1,107 @@ +import { FC, useMemo } from 'react' + +import { LoadingState as DefaultLoadingState } from '@baseapp-frontend/design-system' + +import { Box, Divider, Typography } from '@mui/material' +import { usePaginationFragment } from 'react-relay' +import { Virtuoso } from 'react-virtuoso' + +import { UserMembersListFragment } from '../../graphql/queries/UserMembersList' +import DefaultMemberItem from '../MemberItem' +import { MemberStatuses, NUMBER_OF_MEMBERS_TO_LOAD_NEXT } from '../constants' +import { MemberListProps } from '../types' + +const MembersList: FC = ({ + meRef, + MemberItem = DefaultMemberItem, + LoadingState = DefaultLoadingState, + LoadingStateProps = {}, + membersContainerHeight = 400, +}) => { + const { data, loadNext, hasNext, isLoadingNext } = usePaginationFragment( + UserMembersListFragment, + meRef, + ) + + const members = useMemo( + () => + data?.profile?.members?.edges.filter((edge) => edge?.node).map((edge) => edge?.node) || [], + [data?.profile?.members?.edges], + ) + + const renderLoadingState = () => { + if (!isLoadingNext) return + + return ( + + ) + } + + const renderMemberItem = (member: any, index: number) => { + if (!member) return null + if ( + member.status === MemberStatuses.active && + members[index - 1]?.status !== MemberStatuses.active + ) { + return ( + <> + + + + + ) + } + return ( + + ) + } + + if (members.length === 0) { + return ( + <> + + 1 member + + + + ) + } + + return ( + <> + {data.profile?.members?.totalCount && ( + + {(data.profile?.members?.totalCount ?? 0) + 1} members + + )} + renderMemberItem(member, _index)} + components={{ + Footer: renderLoadingState, + }} + endReached={() => { + if (hasNext) { + loadNext(NUMBER_OF_MEMBERS_TO_LOAD_NEXT) + } + }} + /> + + ) +} + +export default MembersList diff --git a/packages/components/modules/profiles/Members/constants.ts b/packages/components/modules/profiles/Members/constants.ts new file mode 100644 index 00000000..20dc5b35 --- /dev/null +++ b/packages/components/modules/profiles/Members/constants.ts @@ -0,0 +1,7 @@ +export const NUMBER_OF_MEMBERS_TO_LOAD_NEXT = 5 +export const NUMBER_OF_MEMBERS_ON_FIRST_LOAD = 10 +export enum MemberStatuses { + active = 'ACTIVE', + pending = 'PENDING', + inactive = 'INACTIVE', +} diff --git a/packages/components/modules/profiles/Members/index.tsx b/packages/components/modules/profiles/Members/index.tsx new file mode 100644 index 00000000..7ea418a6 --- /dev/null +++ b/packages/components/modules/profiles/Members/index.tsx @@ -0,0 +1,77 @@ +import { FC, Suspense } from 'react' + +import { LoadingState as DefaultLoadingState } from '@baseapp-frontend/design-system' + +import { Typography } from '@mui/material' +import { useLazyLoadQuery } from 'react-relay' + +import { UserMembersListPaginationQuery as IUserMembersListPaginationQuery } from '../../../__generated__/UserMembersListPaginationQuery.graphql' +import { UserMembersListPaginationQuery } from '../graphql/queries/UserMembersList' +import DefaultMemberItem from './MemberItem' +import MembersList from './MembersList' +import { NUMBER_OF_MEMBERS_ON_FIRST_LOAD } from './constants' +import { MemberItemSkeleton } from './styled' +import { UserMembersProps, UserMembersSuspendedProps } from './types' + +const DefaultInitialLoadingState: FC = () => ( + <> + {Array.from({ length: NUMBER_OF_MEMBERS_ON_FIRST_LOAD }).map((_, index) => ( + + ))} + +) + +const Members: FC = ({ + MemberItem, + LoadingState, + LoadingStateProps, + membersContainerHeight, +}) => { + const data = useLazyLoadQuery(UserMembersListPaginationQuery, { + count: NUMBER_OF_MEMBERS_ON_FIRST_LOAD, + orderByStatus: 'custom', + }) + if (!data.me) return null + return ( + + ) +} + +const MembersSuspended: FC = ({ + title = 'Members', + subtitle, + MemberItem = DefaultMemberItem, + LoadingState = DefaultLoadingState, + LoadingStateProps = {}, + InitialLoadingState = DefaultInitialLoadingState, + membersContainerHeight = 400, +}) => ( + <> + + {title} + + + {subtitle} + + }> + + + +) + +export default MembersSuspended diff --git a/packages/components/modules/profiles/Members/styled.tsx b/packages/components/modules/profiles/Members/styled.tsx new file mode 100644 index 00000000..eddb6b63 --- /dev/null +++ b/packages/components/modules/profiles/Members/styled.tsx @@ -0,0 +1,7 @@ +import { Skeleton, styled } from '@mui/material' + +export const MemberItemSkeleton = styled(Skeleton)(({ theme }) => ({ + width: '100%', + height: 52, + borderRadius: theme.spacing(0.75), +})) diff --git a/packages/components/modules/profiles/Members/types.ts b/packages/components/modules/profiles/Members/types.ts new file mode 100644 index 00000000..bb45f95e --- /dev/null +++ b/packages/components/modules/profiles/Members/types.ts @@ -0,0 +1,26 @@ +import type { FC } from 'react' + +import type { LoadingStateProps } from '@baseapp-frontend/design-system' + +import type { UserMembersListFragment$key } from '../../../__generated__/UserMembersListFragment.graphql' +import type { MemberItemProps } from './MemberItem/types' + +export interface MemberListProps { + MemberItem: FC + meRef: UserMembersListFragment$key + LoadingState: FC + LoadingStateProps: LoadingStateProps + membersContainerHeight?: number +} + +export interface UserMembersSuspendedProps { + MemberItem?: FC + LoadingState?: FC + LoadingStateProps?: LoadingStateProps + title?: string + subtitle?: string + InitialLoadingState?: FC + membersContainerHeight?: number +} + +export interface UserMembersProps extends Omit {} diff --git a/packages/components/modules/profiles/graphql/queries/UserMembersList.ts b/packages/components/modules/profiles/graphql/queries/UserMembersList.ts new file mode 100644 index 00000000..b246e5ec --- /dev/null +++ b/packages/components/modules/profiles/graphql/queries/UserMembersList.ts @@ -0,0 +1,44 @@ +import { graphql } from 'react-relay' + +export const UserMembersListPaginationQuery = graphql` + query UserMembersListPaginationQuery($count: Int = 10, $cursor: String, $orderByStatus: String) { + me { + ...UserMembersListFragment + @arguments(count: $count, cursor: $cursor, orderByStatus: $orderByStatus) + } + } +` + +export const UserMembersListFragment = graphql` + fragment UserMembersListFragment on User + @refetchable(queryName: "userMembersListPaginationRefetchable") + @argumentDefinitions( + count: { type: "Int", defaultValue: 10 } + cursor: { type: "String" } + orderByStatus: { type: "String", defaultValue: "custom" } + ) { + profile { + ...ProfileItemFragment + members(first: $count, after: $cursor, orderByStatus: $orderByStatus) + @connection(key: "UserMembersFragment_members", filters: ["orderByStatus"]) { + totalCount + edges { + node { + id + user { + profile { + ...ProfileItemFragment + } + } + role + status + } + } + pageInfo { + endCursor + hasNextPage + } + } + } + } +` diff --git a/packages/components/modules/profiles/index.ts b/packages/components/modules/profiles/index.ts index 697b3eef..36048f2b 100644 --- a/packages/components/modules/profiles/index.ts +++ b/packages/components/modules/profiles/index.ts @@ -3,3 +3,4 @@ export { default as useCurrentProfile } from './context/useCurrentProfile' // Components export * from './ProfilePopover' +export { default as Members } from './Members' diff --git a/packages/components/schema.graphql b/packages/components/schema.graphql index ca2b3d1f..10fbeebe 100644 --- a/packages/components/schema.graphql +++ b/packages/components/schema.graphql @@ -1,26 +1,42 @@ -"""Exposes a URL that specifies the behaviour of this scalar.""" +""" +Exposes a URL that specifies the behaviour of this scalar. +""" directive @specifiedBy( - """The URL that specifies the behaviour of this scalar.""" + """ + The URL that specifies the behaviour of this scalar. + """ url: String! ) on SCALAR -"""An enumeration.""" +""" +An enumeration. +""" enum BaseappNotificationsNotificationLevelChoices { - """success""" + """ + success + """ SUCCESS - """info""" + """ + info + """ INFO - """warning""" + """ + warning + """ WARNING - """error""" + """ + error + """ ERROR } type Block implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! created: DateTime! modified: DateTime! @@ -31,26 +47,38 @@ type Block implements Node { } type BlockConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [BlockEdge]! totalCount: Int edgeCount: Int } -"""A Relay edge containing a `Block` and its cursor.""" +""" +A Relay edge containing a `Block` and its cursor. +""" type BlockEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: Block - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } interface BlocksInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! blockers(offset: Int, before: String, after: String, first: Int, last: Int): BlockConnection blocking(offset: Int, before: String, after: String, first: Int, last: Int): BlockConnection @@ -66,7 +94,9 @@ input BlockToggleInput { } type BlockTogglePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug block: BlockEdge @@ -77,22 +107,41 @@ type BlockTogglePayload { } type ChatRoom implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! image: String lastMessage: Message lastMessageTime: DateTime - participants(offset: Int, before: String, after: String, first: Int, last: Int): ChatRoomParticipantConnection + participants( + offset: Int + before: String + after: String + first: Int + last: Int + ): ChatRoomParticipantConnection pk: Int! - allMessages(offset: Int, before: String, after: String, first: Int, last: Int, verb: Verbs): MessageConnection + allMessages( + offset: Int + before: String + after: String + first: Int + last: Int + verb: Verbs + ): MessageConnection unreadMessagesCount(profileId: ID): Int } type ChatRoomConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [ChatRoomEdge]! totalCount: Int edgeCount: Int @@ -105,7 +154,9 @@ input ChatRoomCreateInput { } type ChatRoomCreatePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug room: ChatRoomEdge @@ -113,12 +164,18 @@ type ChatRoomCreatePayload { clientMutationId: String } -"""A Relay edge containing a `ChatRoom` and its cursor.""" +""" +A Relay edge containing a `ChatRoom` and its cursor. +""" type ChatRoomEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: ChatRoom - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } @@ -135,28 +192,40 @@ type ChatRoomOnRoomUpdate { } type ChatRoomParticipant implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! profile: Profile pk: Int! } type ChatRoomParticipantConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [ChatRoomParticipantEdge]! totalCount: Int edgeCount: Int } -"""A Relay edge containing a `ChatRoomParticipant` and its cursor.""" +""" +A Relay edge containing a `ChatRoomParticipant` and its cursor. +""" type ChatRoomParticipantEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: ChatRoomParticipant - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } @@ -168,7 +237,9 @@ input ChatRoomReadMessagesInput { } type ChatRoomReadMessagesPayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug room: ChatRoom @@ -186,7 +257,9 @@ input ChatRoomSendMessageInput { } type ChatRoomSendMessagePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug message: MessageEdge @@ -194,7 +267,9 @@ type ChatRoomSendMessagePayload { } interface ChatRoomsInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! chatRooms( offset: Int @@ -204,7 +279,9 @@ interface ChatRoomsInterface { last: Int q: String - """Ordering""" + """ + Ordering + """ orderBy: String profileId: String ): ChatRoomConnection @@ -218,14 +295,18 @@ type Comment implements Node & CommentsInterface & ReactionsInterface & Permissi profile: Profile body: String - """languaged used in the comment""" + """ + languaged used in the comment + """ language: String isEdited: Boolean! isPinned: Boolean! inReplyTo: Comment status: CommentStatus - """The ID of the object""" + """ + The ID of the object + """ id: ID! commentsCount: CommentsCount! comments( @@ -236,12 +317,21 @@ type Comment implements Node & CommentsInterface & ReactionsInterface & Permissi last: Int q: String - """Ordering""" + """ + Ordering + """ orderBy: String ): CommentConnection isCommentsEnabled: Boolean! reactionsCount: ReactionsCount - reactions(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReactionConnection + reactions( + offset: Int + before: String + after: String + first: Int + last: Int + id: ID + ): ReactionConnection isReactionsEnabled: Boolean! myReaction(profileId: ID): Reaction @@ -254,10 +344,14 @@ type Comment implements Node & CommentsInterface & ReactionsInterface & Permissi } type CommentConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [CommentEdge]! totalCount: Int edgeCount: Int @@ -272,7 +366,9 @@ input CommentCreateInput { } type CommentCreatePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug comment: CommentEdge @@ -285,7 +381,9 @@ input CommentDeleteInput { } type CommentDeletePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug deletedId: ID @@ -294,12 +392,18 @@ type CommentDeletePayload { clientMutationId: String } -"""A Relay edge containing a `Comment` and its cursor.""" +""" +A Relay edge containing a `Comment` and its cursor. +""" type CommentEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: Comment - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } @@ -309,7 +413,9 @@ input CommentPinInput { } type CommentPinPayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug comment: Comment @@ -325,7 +431,9 @@ type CommentsCount { } interface CommentsInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! commentsCount: CommentsCount! comments( @@ -336,13 +444,17 @@ interface CommentsInterface { last: Int q: String - """Ordering""" + """ + Ordering + """ orderBy: String ): CommentConnection isCommentsEnabled: Boolean! } -"""An enumeration.""" +""" +An enumeration. +""" enum CommentStatus { DELETED PUBLISHED @@ -355,7 +467,9 @@ input CommentUpdateInput { } type CommentUpdatePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug comment: Comment @@ -369,69 +483,113 @@ value as specified by """ scalar DateTime -"""Debugging information for the current query.""" +""" +Debugging information for the current query. +""" type DjangoDebug { - """Executed SQL queries for this API query.""" + """ + Executed SQL queries for this API query. + """ sql: [DjangoDebugSQL] - """Raise exceptions for this API query.""" + """ + Raise exceptions for this API query. + """ exceptions: [DjangoDebugException] } -"""Represents a single exception raised.""" +""" +Represents a single exception raised. +""" type DjangoDebugException { - """The class of the exception""" + """ + The class of the exception + """ excType: String! - """The message of the exception""" + """ + The message of the exception + """ message: String! - """The stack trace""" + """ + The stack trace + """ stack: String! } -"""Represents a single database query made to a Django managed DB.""" +""" +Represents a single database query made to a Django managed DB. +""" type DjangoDebugSQL { - """The type of database being used (e.g. postrgesql, mysql, sqlite).""" + """ + The type of database being used (e.g. postrgesql, mysql, sqlite). + """ vendor: String! - """The Django database alias (e.g. 'default').""" + """ + The Django database alias (e.g. 'default'). + """ alias: String! - """The actual SQL sent to this database.""" + """ + The actual SQL sent to this database. + """ sql: String - """Duration of this database query in seconds.""" + """ + Duration of this database query in seconds. + """ duration: Float! - """The raw SQL of this query, without params.""" + """ + The raw SQL of this query, without params. + """ rawSql: String! - """JSON encoded database query parameters.""" + """ + JSON encoded database query parameters. + """ params: String! - """Start time of this database query.""" + """ + Start time of this database query. + """ startTime: Float! - """Stop time of this database query.""" + """ + Stop time of this database query. + """ stopTime: Float! - """Whether this database query took more than 10 seconds.""" + """ + Whether this database query took more than 10 seconds. + """ isSlow: Boolean! - """Whether this database query was a SELECT.""" + """ + Whether this database query was a SELECT. + """ isSelect: Boolean! - """Postgres transaction ID if available.""" + """ + Postgres transaction ID if available. + """ transId: String - """Postgres transaction status if available.""" + """ + Postgres transaction status if available. + """ transStatus: String - """Postgres isolation level if available.""" + """ + Postgres isolation level if available. + """ isoLevel: String - """Postgres connection encoding if available.""" + """ + Postgres connection encoding if available. + """ encoding: String } @@ -445,7 +603,9 @@ type File { } type Follow implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! created: DateTime! modified: DateTime! @@ -457,29 +617,55 @@ type Follow implements Node { } type FollowConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [FollowEdge]! totalCount: Int edgeCount: Int } -"""A Relay edge containing a `Follow` and its cursor.""" +""" +A Relay edge containing a `Follow` and its cursor. +""" type FollowEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: Follow - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } interface FollowsInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! - followers(offset: Int, before: String, after: String, first: Int, last: Int, targetIsFollowingBack: Boolean): FollowConnection - following(offset: Int, before: String, after: String, first: Int, last: Int, targetIsFollowingBack: Boolean): FollowConnection + followers( + offset: Int + before: String + after: String + first: Int + last: Int + targetIsFollowingBack: Boolean + ): FollowConnection + following( + offset: Int + before: String + after: String + first: Int + last: Int + targetIsFollowingBack: Boolean + ): FollowConnection followersCount: Int followingCount: Int isFollowedByMe(profileId: ID): Boolean @@ -492,7 +678,9 @@ input FollowToggleInput { } type FollowTogglePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug follow: FollowEdge @@ -517,7 +705,9 @@ schema (one of the key benefits of GraphQL). """ scalar JSONString -"""Languages available""" +""" +Languages available +""" enum Languages { en es @@ -525,7 +715,9 @@ enum Languages { } type Message implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! created: DateTime! content: String @@ -540,21 +732,31 @@ type Message implements Node { } type MessageConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [MessageEdge]! totalCount: Int edgeCount: Int } -"""A Relay edge containing a `Message` and its cursor.""" +""" +A Relay edge containing a `Message` and its cursor. +""" type MessageEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: Message - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } @@ -580,8 +782,12 @@ type Mutation { blockToggle(input: BlockToggleInput!): BlockTogglePayload reactionToggle(input: ReactionToggleInput!): ReactionTogglePayload notificationsMarkAsRead(input: NotificationsMarkAsReadInput!): NotificationsMarkAsReadPayload - notificationsMarkAllAsRead(input: NotificationsMarkAllAsReadInput!): NotificationsMarkAllAsReadPayload - notificationSettingToggle(input: NotificationSettingToggleInput!): NotificationSettingTogglePayload + notificationsMarkAllAsRead( + input: NotificationsMarkAllAsReadInput! + ): NotificationsMarkAllAsReadPayload + notificationSettingToggle( + input: NotificationSettingToggleInput! + ): NotificationSettingTogglePayload commentCreate(input: CommentCreateInput!): CommentCreatePayload commentUpdate(input: CommentUpdateInput!): CommentUpdatePayload commentPin(input: CommentPinInput!): CommentPinPayload @@ -592,14 +798,20 @@ type Mutation { profileDelete(input: ProfileDeleteInput!): ProfileDeletePayload } -"""An object with an ID""" +""" +An object with an ID +""" interface Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! } type Notification implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! level: BaseappNotificationsNotificationLevelChoices! recipient: User! @@ -620,42 +832,64 @@ type Notification implements Node { actionObject: Node } -"""An enumeration.""" +""" +An enumeration. +""" enum NotificationChannelTypes { - """All""" + """ + All + """ ALL - """Email""" + """ + Email + """ EMAIL - """Push""" + """ + Push + """ PUSH - """In-App""" + """ + In-App + """ IN_APP } type NotificationConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [NotificationEdge]! totalCount: Int edgeCount: Int } -"""A Relay edge containing a `Notification` and its cursor.""" +""" +A Relay edge containing a `Notification` and its cursor. +""" type NotificationEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: Notification - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } type NotificationSetting implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! created: DateTime! modified: DateTime! @@ -667,21 +901,31 @@ type NotificationSetting implements Node { } type NotificationSettingConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [NotificationSettingEdge]! totalCount: Int edgeCount: Int } -"""A Relay edge containing a `NotificationSetting` and its cursor.""" +""" +A Relay edge containing a `NotificationSetting` and its cursor. +""" type NotificationSettingEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: NotificationSetting - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } @@ -692,7 +936,9 @@ input NotificationSettingToggleInput { } type NotificationSettingTogglePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug notificationSetting: NotificationSetting @@ -700,22 +946,43 @@ type NotificationSettingTogglePayload { } interface NotificationsInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! notificationsUnreadCount: Int - notifications(offset: Int, before: String, after: String, first: Int, last: Int, level: BaseappNotificationsNotificationLevelChoices, unread: Boolean, verbs: String): NotificationConnection - notificationSettings(offset: Int, before: String, after: String, first: Int, last: Int): NotificationSettingConnection + notifications( + offset: Int + before: String + after: String + first: Int + last: Int + level: BaseappNotificationsNotificationLevelChoices + unread: Boolean + verbs: String + ): NotificationConnection + notificationSettings( + offset: Int + before: String + after: String + first: Int + last: Int + ): NotificationSettingConnection isNotificationSettingActive(verb: String!, channel: NotificationChannelTypes!): Boolean } input NotificationsMarkAllAsReadInput { - """Mark as read or unread""" + """ + Mark as read or unread + """ read: Boolean! clientMutationId: String } type NotificationsMarkAllAsReadPayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug recipient: NotificationsInterface @@ -723,14 +990,18 @@ type NotificationsMarkAllAsReadPayload { } input NotificationsMarkAsReadInput { - """Mark as read or unread""" + """ + Mark as read or unread + """ read: Boolean! notificationIds: [ID!] clientMutationId: String } type NotificationsMarkAsReadPayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug recipient: NotificationsInterface @@ -756,7 +1027,9 @@ type Page implements Node & PageInterface & PermissionsInterface & CommentsInter user: User status: PageStatus - """The ID of the object""" + """ + The ID of the object + """ id: ID! urlPath: URLPath urlPaths: [URLPath] @@ -775,7 +1048,9 @@ type Page implements Node & PageInterface & PermissionsInterface & CommentsInter last: Int q: String - """Ordering""" + """ + Ordering + """ orderBy: String ): CommentConnection isCommentsEnabled: Boolean! @@ -785,10 +1060,14 @@ type Page implements Node & PageInterface & PermissionsInterface & CommentsInter } type PageConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [PageEdge]! totalCount: Int edgeCount: Int @@ -803,19 +1082,27 @@ input PageCreateInput { } type PageCreatePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug page: PageEdge clientMutationId: String } -"""A Relay edge containing a `Page` and its cursor.""" +""" +A Relay edge containing a `Page` and its cursor. +""" type PageEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: Page - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } @@ -829,7 +1116,9 @@ input PageEditInput { } type PageEditPayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug page: Page @@ -840,38 +1129,56 @@ type PageEditPayload { The Relay compliant `PageInfo` type, containing data necessary to paginate this connection. """ type PageInfo { - """When paginating forwards, are there more items?""" + """ + When paginating forwards, are there more items? + """ hasNextPage: Boolean! - """When paginating backwards, are there more items?""" + """ + When paginating backwards, are there more items? + """ hasPreviousPage: Boolean! - """When paginating backwards, the cursor to continue.""" + """ + When paginating backwards, the cursor to continue. + """ startCursor: String - """When paginating forwards, the cursor to continue.""" + """ + When paginating forwards, the cursor to continue. + """ endCursor: String } interface PageInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! urlPath: URLPath urlPaths: [URLPath] metadata: Metadata } -"""An enumeration.""" +""" +An enumeration. +""" enum PageStatus { - """Draft""" + """ + Draft + """ DRAFT - """Published""" + """ + Published + """ PUBLISHED } interface PermissionsInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! """ @@ -881,7 +1188,9 @@ interface PermissionsInterface { } type Profile implements Node & PermissionsInterface & PageInterface & FollowsInterface & BlocksInterface & ChatRoomsInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! created: DateTime! modified: DateTime! @@ -907,18 +1216,64 @@ type Profile implements Node & PermissionsInterface & PageInterface & FollowsInt last: Int q: String - """Ordering""" + """ + Ordering + """ orderBy: String ): CommentConnection! blocking(offset: Int, before: String, after: String, first: Int, last: Int): BlockConnection blockers(offset: Int, before: String, after: String, first: Int, last: Int): BlockConnection - following(offset: Int, before: String, after: String, first: Int, last: Int, targetIsFollowingBack: Boolean): FollowConnection - followers(offset: Int, before: String, after: String, first: Int, last: Int, targetIsFollowingBack: Boolean): FollowConnection - reactions(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReactionConnection! + following( + offset: Int + before: String + after: String + first: Int + last: Int + targetIsFollowingBack: Boolean + ): FollowConnection + followers( + offset: Int + before: String + after: String + first: Int + last: Int + targetIsFollowingBack: Boolean + ): FollowConnection + reactions( + offset: Int + before: String + after: String + first: Int + last: Int + id: ID + ): ReactionConnection! ratings(offset: Int, before: String, after: String, first: Int, last: Int): RateConnection! user: User - chatroomparticipantSet(offset: Int, before: String, after: String, first: Int, last: Int, profile_TargetContentType: ID): ChatRoomParticipantConnection! - messageSet(offset: Int, before: String, after: String, first: Int, last: Int, verb: Verbs): MessageConnection! + members( + orderByStatus: String + offset: Int + before: String + after: String + first: Int + last: Int + role: ProfileRoles + ): ProfileUserRoleConnection + chatroomparticipantSet( + offset: Int + before: String + after: String + first: Int + last: Int + profile_TargetContentType: ID + ): ChatRoomParticipantConnection! + messageSet( + offset: Int + before: String + after: String + first: Int + last: Int + verb: Verbs + ): MessageConnection! """ Determine if the logged in user has a specific permission for this object. @@ -937,7 +1292,9 @@ type Profile implements Node & PermissionsInterface & PageInterface & FollowsInt last: Int q: String - """Ordering""" + """ + Ordering + """ orderBy: String profileId: String ): ChatRoomConnection @@ -947,10 +1304,14 @@ type Profile implements Node & PermissionsInterface & PageInterface & FollowsInt } type ProfileConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [ProfileEdge]! totalCount: Int edgeCount: Int @@ -962,34 +1323,85 @@ input ProfileDeleteInput { } type ProfileDeletePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug deletedId: ID clientMutationId: String } -"""A Relay edge containing a `Profile` and its cursor.""" +""" +A Relay edge containing a `Profile` and its cursor. +""" type ProfileEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: Profile - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } interface ProfileInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! profile: Profile } -"""An enumeration.""" +""" +An enumeration. +""" +enum ProfileRoles { + """ + admin + """ + ADMIN + + """ + manager + """ + MANAGER +} + +""" +An enumeration. +""" +enum ProfileRoleStatus { + """ + active + """ + ACTIVE + + """ + pending + """ + PENDING + + """ + inactive + """ + INACTIVE +} + +""" +An enumeration. +""" enum ProfilesProfileStatusChoices { - """public""" + """ + public + """ A_1 - """private""" + """ + private + """ A_2 } @@ -1006,28 +1418,78 @@ input ProfileUpdateInput { } type ProfileUpdatePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug profile: Profile clientMutationId: String } +type ProfileUserRole implements Node { + """ + The ID of the object + """ + id: ID! + user: User! + role: ProfileRoles + status: ProfileRoleStatus + pk: Int! +} + +type ProfileUserRoleConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + + """ + Contains the nodes in this connection. + """ + edges: [ProfileUserRoleEdge]! + totalCount: Int + edgeCount: Int +} + +""" +A Relay edge containing a `ProfileUserRole` and its cursor. +""" +type ProfileUserRoleEdge { + """ + The item at the end of the edge + """ + node: ProfileUserRole + + """ + A cursor for use in pagination + """ + cursor: String! +} + type Query { chatRoom( - """The ID of the object""" + """ + The ID of the object + """ id: ID! ): ChatRoom rate( - """The ID of the object""" + """ + The ID of the object + """ id: ID! ): Rate report( - """The ID of the object""" + """ + The ID of the object + """ id: ID! ): Report comment( - """The ID of the object""" + """ + The ID of the object + """ id: ID! ): Comment allComments( @@ -1038,18 +1500,38 @@ type Query { last: Int q: String - """Ordering""" + """ + Ordering + """ orderBy: String ): CommentConnection urlPath(path: String!): URLPath - allPages(offset: Int, before: String, after: String, first: Int, last: Int, status: PageStatus): PageConnection + allPages( + offset: Int + before: String + after: String + first: Int + last: Int + status: PageStatus + ): PageConnection page( - """The ID of the object""" + """ + The ID of the object + """ id: ID! ): Page - allProfiles(offset: Int, before: String, after: String, first: Int, last: Int, name: String): ProfileConnection + allProfiles( + offset: Int + before: String + after: String + first: Int + last: Int + name: String + ): ProfileConnection profile( - """The ID of the object""" + """ + The ID of the object + """ id: ID! ): Profile users( @@ -1060,23 +1542,31 @@ type Query { last: Int q: String - """Ordering""" + """ + Ordering + """ orderBy: String ): UserConnection user( - """The ID of the object""" + """ + The ID of the object + """ id: ID! ): User me: User node( - """The ID of the object""" + """ + The ID of the object + """ id: ID! ): Node _debug: DjangoDebug } type Rate implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! created: DateTime! modified: DateTime! @@ -1088,26 +1578,38 @@ type Rate implements Node { } type RateConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [RateEdge]! totalCount: Int edgeCount: Int } -"""A Relay edge containing a `Rate` and its cursor.""" +""" +A Relay edge containing a `Rate` and its cursor. +""" type RateEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: Rate - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } interface RatingsInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! ratingsCount: Int ratingsSum: Int @@ -1118,7 +1620,9 @@ interface RatingsInterface { } type Reaction implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! created: DateTime! modified: DateTime! @@ -1129,21 +1633,31 @@ type Reaction implements Node { } type ReactionConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [ReactionEdge]! totalCount: Int edgeCount: Int } -"""A Relay edge containing a `Reaction` and its cursor.""" +""" +A Relay edge containing a `Reaction` and its cursor. +""" type ReactionEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: Reaction - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } @@ -1154,10 +1668,19 @@ type ReactionsCount { } interface ReactionsInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! reactionsCount: ReactionsCount - reactions(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReactionConnection + reactions( + offset: Int + before: String + after: String + first: Int + last: Int + id: ID + ): ReactionConnection isReactionsEnabled: Boolean! myReaction(profileId: ID): Reaction } @@ -1170,7 +1693,9 @@ input ReactionToggleInput { } type ReactionTogglePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug reaction: ReactionEdge @@ -1179,17 +1704,25 @@ type ReactionTogglePayload { clientMutationId: String } -"""An enumeration.""" +""" +An enumeration. +""" enum ReactionTypes { - """like""" + """ + like + """ LIKE - """dislike""" + """ + dislike + """ DISLIKE } type Report implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! created: DateTime! modified: DateTime! @@ -1201,10 +1734,14 @@ type Report implements Node { } type ReportConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [ReportEdge]! totalCount: Int edgeCount: Int @@ -1218,7 +1755,9 @@ input ReportCreateInput { } type ReportCreatePayload { - """May contain more than one error for same field.""" + """ + May contain more than one error for same field. + """ errors: [ErrorType] _debug: DjangoDebug report: ReportEdge @@ -1226,12 +1765,18 @@ type ReportCreatePayload { clientMutationId: String } -"""A Relay edge containing a `Report` and its cursor.""" +""" +A Relay edge containing a `Report` and its cursor. +""" type ReportEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: Report - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } @@ -1244,25 +1789,44 @@ type ReportsCount { } interface ReportsInterface { - """The ID of the object""" + """ + The ID of the object + """ id: ID! reportsCount: ReportsCount - reports(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReportConnection + reports( + offset: Int + before: String + after: String + first: Int + last: Int + id: ID + ): ReportConnection myReports: Report } -"""An enumeration.""" +""" +An enumeration. +""" enum ReportTypes { - """Spam""" + """ + Spam + """ SPAM - """Inappropriate""" + """ + Inappropriate + """ INAPPROPRIATE - """Fake""" + """ + Fake + """ FAKE - """Other""" + """ + Other + """ OTHER } @@ -1275,7 +1839,9 @@ type Subscription { } type URLPath implements Node { - """The ID of the object""" + """ + The ID of the object + """ id: ID! created: DateTime! modified: DateTime! @@ -1302,7 +1868,14 @@ type User implements Node & PermissionsInterface & NotificationsInterface & Page """ isActive: Boolean! isStaff: Boolean - reactions(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReactionConnection! + reactions( + offset: Int + before: String + after: String + first: Int + last: Int + id: ID + ): ReactionConnection! comments( offset: Int before: String @@ -1311,12 +1884,23 @@ type User implements Node & PermissionsInterface & NotificationsInterface & Page last: Int q: String - """Ordering""" + """ + Ordering + """ orderBy: String ): CommentConnection! - pages(offset: Int, before: String, after: String, first: Int, last: Int, status: PageStatus): PageConnection! + pages( + offset: Int + before: String + after: String + first: Int + last: Int + status: PageStatus + ): PageConnection! - """The ID of the object""" + """ + The ID of the object + """ id: ID! """ @@ -1324,8 +1908,23 @@ type User implements Node & PermissionsInterface & NotificationsInterface & Page """ hasPerm(perm: String!): Boolean notificationsUnreadCount: Int - notifications(offset: Int, before: String, after: String, first: Int, last: Int, level: BaseappNotificationsNotificationLevelChoices, unread: Boolean, verbs: String): NotificationConnection - notificationSettings(offset: Int, before: String, after: String, first: Int, last: Int): NotificationSettingConnection + notifications( + offset: Int + before: String + after: String + first: Int + last: Int + level: BaseappNotificationsNotificationLevelChoices + unread: Boolean + verbs: String + ): NotificationConnection + notificationSettings( + offset: Int + before: String + after: String + first: Int + last: Int + ): NotificationSettingConnection isNotificationSettingActive(verb: String!, channel: NotificationChannelTypes!): Boolean urlPath: URLPath urlPaths: [URLPath] @@ -1346,32 +1945,45 @@ type User implements Node & PermissionsInterface & NotificationsInterface & Page } type UserConnection { - """Pagination data for this connection.""" + """ + Pagination data for this connection. + """ pageInfo: PageInfo! - """Contains the nodes in this connection.""" + """ + Contains the nodes in this connection. + """ edges: [UserEdge]! totalCount: Int edgeCount: Int } -"""A Relay edge containing a `User` and its cursor.""" +""" +A Relay edge containing a `User` and its cursor. +""" type UserEdge { - """The item at the end of the edge""" + """ + The item at the end of the edge + """ node: User - """A cursor for use in pagination""" + """ + A cursor for use in pagination + """ cursor: String! } interface UserProfiles { - """The ID of the object""" + """ + The ID of the object + """ id: ID! profiles: [Profile] } -"""An enumeration.""" +""" +An enumeration. +""" enum Verbs { SENT_MESSAGE } - diff --git a/packages/design-system/components/inputs/TextField/index.tsx b/packages/design-system/components/inputs/TextField/index.tsx index a8122b32..31dd1b8a 100644 --- a/packages/design-system/components/inputs/TextField/index.tsx +++ b/packages/design-system/components/inputs/TextField/index.tsx @@ -4,14 +4,12 @@ import { FC } from 'react' import { withController } from '@baseapp-frontend/utils' -import { useTheme } from '@emotion/react' import { TextField as MUITextField, Theme, useMediaQuery } from '@mui/material' import { TextFieldProps } from './types' const TextField: FC = ({ isResponsive = true, ...props }) => { - const theme = useTheme() as Theme - const isMobile = useMediaQuery(theme.breakpoints.down('sm')) + const isMobile = useMediaQuery((theme) => theme.breakpoints.down('sm')) return } From cfd9bf95f0f2c55b7a77097510e2b3246ed2cc01 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Mon, 11 Nov 2024 18:17:51 -0300 Subject: [PATCH 02/13] Temporarily remove catalogs to use GitHub version --- packages/components/package.json | 142 ++++++++++---------- pnpm-lock.yaml | 217 ++++++++++++------------------- 2 files changed, 154 insertions(+), 205 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 8cd6c31f..d8f9327d 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -21,92 +21,92 @@ "test:unit": "jest --config ./jest.config.ts" }, "dependencies": { - "@hookform/resolvers": "catalog:", - "@mui/lab": "catalog:material-ui", - "@mui/material": "catalog:material-ui", - "@mui/system": "catalog:material-ui", - "@storybook/react": "catalog:storybook", - "@tanstack/react-query": "catalog:", + "@hookform/resolvers": "^3.6.0", + "@mui/lab": "^5.0.0-alpha.170", + "@mui/material": "^5.15.19", + "@mui/system": "^5.15.19", + "@storybook/react": "^8.2.8", + "@tanstack/react-query": "^5.45.1", "framer-motion": "^11.5.4", - "graphql": "catalog:graphql", - "js-cookie": "catalog:", - "luxon": "catalog:", - "next": "catalog:", - "react-hook-form": "catalog:", - "react-relay": "catalog:graphql", - "react-virtuoso": "catalog:", + "graphql": "^16.8.1", + "js-cookie": "^3.0.5", + "luxon": "^3.4.4", + "next": "14.3.0-canary.24", + "react-hook-form": "^7.51.5", + "react-relay": "^16.2.0", + "react-virtuoso": "^4.7.11", "use-long-press": "^3.2.0", - "zod": "catalog:", - "zustand": "catalog:" + "zod": "^3.23.8", + "zustand": "^4.5.2" }, "peerDependencies": { "@baseapp-frontend/authentication": "workspace:*", "@baseapp-frontend/design-system": "workspace:*", "@baseapp-frontend/graphql": "workspace:*", "@baseapp-frontend/utils": "workspace:*", - "react": "catalog:react18", - "react-dom": "catalog:react18" + "react": "18.3.1", + "react-dom": "18.3.1" }, "devDependencies": { - "@babel/preset-env": "catalog:storybook", - "@babel/preset-react": "catalog:storybook", - "@babel/preset-typescript": "catalog:storybook", + "@babel/preset-env": "^7.24.7", + "@babel/preset-react": "^7.24.7", + "@babel/preset-typescript": "^7.24.7", "@baseapp-frontend/config": "workspace:*", "@baseapp-frontend/test": "workspace:*", "@baseapp-frontend/tsconfig": "workspace:*", - "@chromatic-com/storybook": "catalog:storybook", - "@cypress/webpack-dev-server": "catalog:test", - "@faker-js/faker": "catalog:test", - "@storybook/addon-essentials": "catalog:storybook", - "@storybook/addon-interactions": "catalog:storybook", - "@storybook/addon-links": "catalog:storybook", - "@storybook/addon-styling-webpack": "catalog:storybook", - "@storybook/addon-webpack5-compiler-babel": "catalog:storybook", - "@storybook/blocks": "catalog:storybook", - "@storybook/react-webpack5": "catalog:storybook", - "@storybook/test": "catalog:storybook", - "@tailwindcss/typography": "catalog:tailwind", - "@testing-library/cypress": "catalog:test", - "@testing-library/jest-dom": "catalog:test", - "@testing-library/react": "catalog:test", - "@testing-library/user-event": "catalog:test", - "@types/jest": "catalog:test", - "@types/js-cookie": "catalog:", - "@types/luxon": "catalog:", - "@types/react": "catalog:react18", - "@types/react-dom": "catalog:react18", - "@types/react-relay": "catalog:graphql", - "@types/relay-test-utils": "catalog:graphql", - "autoprefixer": "catalog:tailwind", - "babel-jest": "catalog:test", - "babel-loader": "catalog:storybook", - "babel-plugin-relay": "catalog:graphql", - "css-loader": "catalog:storybook", - "cypress": "catalog:test", - "cypress-plugin-steps": "catalog:test", - "cypress-wait-until": "catalog:test", + "@chromatic-com/storybook": "^1.5.0", + "@cypress/webpack-dev-server": "^3.10.1", + "@faker-js/faker": "^9.0.3", + "@storybook/addon-essentials": "^8.2.8", + "@storybook/addon-interactions": "^8.2.8", + "@storybook/addon-links": "^8.2.8", + "@storybook/addon-styling-webpack": "^1.0.0", + "@storybook/addon-webpack5-compiler-babel": "^3.0.3", + "@storybook/blocks": "^8.2.8", + "@storybook/react-webpack5": "^8.2.8", + "@storybook/test": "^8.2.8", + "@tailwindcss/typography": "^0.5.13", + "@testing-library/cypress": "^10.0.2", + "@testing-library/jest-dom": "^6.4.6", + "@testing-library/react": "^16.0.0", + "@testing-library/user-event": "^14.5.2", + "@types/jest": "^29.5.12", + "@types/js-cookie": "^3.0.6", + "@types/luxon": "^3.4.2", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "@types/react-relay": "^16.0.6", + "@types/relay-test-utils": "^14.1.4", + "autoprefixer": "^10.4.19", + "babel-jest": "^29.7.0", + "babel-loader": "^9.1.3", + "babel-plugin-relay": "^17.0.0", + "css-loader": "^7.1.2", + "cypress": "^13.13.3", + "cypress-plugin-steps": "^1.1.1", + "cypress-wait-until": "^3.0.2", "dotenv": "^16.4.5", "dotenv-cli": "^7.4.2", - "eslint-plugin-storybook": "catalog:lint", - "get-graphql-schema": "catalog:graphql", - "html-webpack-plugin": "catalog:storybook", - "jest": "catalog:test", - "jest-environment-jsdom": "catalog:test", - "msw": "catalog:storybook", - "msw-storybook-addon": "catalog:storybook", - "postcss": "catalog:tailwind", - "postcss-loader": "catalog:storybook", - "relay-compiler": "catalog:graphql", - "relay-test-utils": "catalog:graphql", - "storybook": "catalog:storybook", - "style-loader": "catalog:storybook", - "tailwindcss": "catalog:tailwind", - "ts-jest": "catalog:test", - "ts-node": "catalog:test", - "typescript": "catalog:", - "webpack": "catalog:storybook", - "webpack-cli": "catalog:storybook", - "webpack-dev-server": "catalog:storybook" + "eslint-plugin-storybook": "^0.8.0", + "get-graphql-schema": "^2.1.2", + "html-webpack-plugin": "^5.6.0", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "msw": "^2.3.1", + "msw-storybook-addon": "^2.0.2", + "postcss": "^8.4.41", + "postcss-loader": "^8.1.1", + "relay-compiler": "^16.2.0", + "relay-test-utils": "^17.0.0", + "storybook": "^8.2.8", + "style-loader": "^4.0.0", + "tailwindcss": "^3.4.4", + "ts-jest": "^29.1.4", + "ts-node": "^10.9.2", + "typescript": "^5.4.5", + "webpack": "^5.93.0", + "webpack-cli": "^5.1.4", + "webpack-dev-server": "^5.0.4" }, "license": "MIT", "repository": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b86d9b45..141b5845 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,9 +48,6 @@ catalogs: react-hook-form: specifier: ^7.51.5 version: 7.53.1 - react-virtuoso: - specifier: ^4.7.11 - version: 4.12.0 typescript: specifier: ^5.4.5 version: 5.6.3 @@ -70,12 +67,6 @@ catalogs: '@types/relay-test-utils': specifier: ^14.1.4 version: 14.1.4 - babel-plugin-relay: - specifier: ^17.0.0 - version: 17.0.0 - get-graphql-schema: - specifier: ^2.1.2 - version: 2.1.2 graphql: specifier: ^16.8.1 version: 16.9.0 @@ -242,21 +233,9 @@ catalogs: '@storybook/test': specifier: ^8.2.8 version: 8.3.6 - babel-loader: - specifier: ^9.1.3 - version: 9.2.1 css-loader: specifier: ^7.1.2 version: 7.1.2 - html-webpack-plugin: - specifier: ^5.6.0 - version: 5.6.2 - msw: - specifier: ^2.3.1 - version: 2.4.11 - msw-storybook-addon: - specifier: ^2.0.2 - version: 2.0.3 postcss-loader: specifier: ^8.1.1 version: 8.1.1 @@ -266,15 +245,6 @@ catalogs: style-loader: specifier: ^4.0.0 version: 4.0.0 - webpack: - specifier: ^5.93.0 - version: 5.95.0 - webpack-cli: - specifier: ^5.1.4 - version: 5.1.4 - webpack-dev-server: - specifier: ^5.0.4 - version: 5.1.0 tailwind: '@tailwindcss/typography': specifier: ^0.5.13 @@ -289,15 +259,6 @@ catalogs: specifier: ^3.4.4 version: 3.4.14 test: - '@cypress/webpack-dev-server': - specifier: ^3.10.1 - version: 3.11.0 - '@faker-js/faker': - specifier: ^9.0.3 - version: 9.0.3 - '@testing-library/cypress': - specifier: ^10.0.2 - version: 10.0.2 '@testing-library/jest-dom': specifier: ^6.4.6 version: 6.6.2 @@ -313,15 +274,6 @@ catalogs: babel-jest: specifier: ^29.7.0 version: 29.7.0 - cypress: - specifier: ^13.13.3 - version: 13.15.0 - cypress-plugin-steps: - specifier: ^1.1.1 - version: 1.1.1 - cypress-wait-until: - specifier: ^3.0.2 - version: 3.0.2 jest: specifier: ^29.7.0 version: 29.7.0 @@ -467,71 +419,71 @@ importers: specifier: workspace:* version: link:../utils '@hookform/resolvers': - specifier: 'catalog:' + specifier: ^3.6.0 version: 3.9.0(react-hook-form@7.53.1(react@18.3.1)) '@mui/lab': - specifier: catalog:material-ui + specifier: ^5.0.0-alpha.170 version: 5.0.0-alpha.173(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': - specifier: catalog:material-ui + specifier: ^5.15.19 version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/system': - specifier: catalog:material-ui + specifier: ^5.15.19 version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1) '@storybook/react': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.3.6(@storybook/test@8.3.6(storybook@8.3.6))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.3.6)(typescript@5.6.3) '@tanstack/react-query': - specifier: 'catalog:' + specifier: ^5.45.1 version: 5.59.15(react@18.3.1) framer-motion: specifier: ^11.5.4 version: 11.11.9(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) graphql: - specifier: catalog:graphql + specifier: ^16.8.1 version: 16.9.0 js-cookie: - specifier: 'catalog:' + specifier: ^3.0.5 version: 3.0.5 luxon: - specifier: 'catalog:' + specifier: ^3.4.4 version: 3.5.0 next: - specifier: 'catalog:' + specifier: 14.3.0-canary.24 version: 14.3.0-canary.24(@babel/core@7.25.8)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: - specifier: catalog:react18 + specifier: 18.3.1 version: 18.3.1 react-dom: - specifier: catalog:react18 + specifier: 18.3.1 version: 18.3.1(react@18.3.1) react-hook-form: - specifier: 'catalog:' + specifier: ^7.51.5 version: 7.53.1(react@18.3.1) react-relay: - specifier: catalog:graphql + specifier: ^16.2.0 version: 16.2.0(react@18.3.1) react-virtuoso: - specifier: 'catalog:' + specifier: ^4.7.11 version: 4.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) use-long-press: specifier: ^3.2.0 version: 3.2.0(react@18.3.1) zod: - specifier: 'catalog:' + specifier: ^3.23.8 version: 3.23.8 zustand: - specifier: 'catalog:' + specifier: ^4.5.2 version: 4.5.5(@types/react@18.3.11)(react@18.3.1) devDependencies: '@babel/preset-env': - specifier: catalog:storybook + specifier: ^7.24.7 version: 7.25.8(@babel/core@7.25.8) '@babel/preset-react': - specifier: catalog:storybook + specifier: ^7.24.7 version: 7.25.7(@babel/core@7.25.8) '@babel/preset-typescript': - specifier: catalog:storybook + specifier: ^7.24.7 version: 7.25.7(@babel/core@7.25.8) '@baseapp-frontend/config': specifier: workspace:* @@ -543,97 +495,97 @@ importers: specifier: workspace:* version: link:../tsconfig '@chromatic-com/storybook': - specifier: catalog:storybook + specifier: ^1.5.0 version: 1.9.0(react@18.3.1) '@cypress/webpack-dev-server': - specifier: catalog:test + specifier: ^3.10.1 version: 3.11.0(webpack-cli@5.1.4)(webpack@5.95.0) '@faker-js/faker': - specifier: catalog:test + specifier: ^9.0.3 version: 9.0.3 '@storybook/addon-essentials': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.3.6(storybook@8.3.6)(webpack-sources@3.2.3) '@storybook/addon-interactions': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.3.6(storybook@8.3.6) '@storybook/addon-links': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.3.6(react@18.3.1)(storybook@8.3.6) '@storybook/addon-styling-webpack': - specifier: catalog:storybook + specifier: ^1.0.0 version: 1.0.0(storybook@8.3.6)(webpack@5.95.0) '@storybook/addon-webpack5-compiler-babel': - specifier: catalog:storybook + specifier: ^3.0.3 version: 3.0.3(webpack@5.95.0) '@storybook/blocks': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.3.6) '@storybook/react-webpack5': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.3.6(@storybook/test@8.3.6(storybook@8.3.6))(@swc/core@1.7.36(@swc/helpers@0.5.13))(esbuild@0.23.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.3.6)(typescript@5.6.3)(webpack-cli@5.1.4) '@storybook/test': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.3.6(storybook@8.3.6) '@tailwindcss/typography': - specifier: catalog:tailwind + specifier: ^0.5.13 version: 0.5.15(tailwindcss@3.4.14(ts-node@10.9.2(@swc/core@1.7.36(@swc/helpers@0.5.13))(@types/node@22.7.7)(typescript@5.6.3))) '@testing-library/cypress': - specifier: catalog:test + specifier: ^10.0.2 version: 10.0.2(cypress@13.15.0) '@testing-library/jest-dom': - specifier: catalog:test + specifier: ^6.4.6 version: 6.6.2 '@testing-library/react': - specifier: catalog:test + specifier: ^16.0.0 version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.1)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@testing-library/user-event': - specifier: catalog:test + specifier: ^14.5.2 version: 14.5.2(@testing-library/dom@10.4.0) '@types/jest': - specifier: catalog:test + specifier: ^29.5.12 version: 29.5.13 '@types/js-cookie': - specifier: 'catalog:' + specifier: ^3.0.6 version: 3.0.6 '@types/luxon': - specifier: 'catalog:' + specifier: ^3.4.2 version: 3.4.2 '@types/react': - specifier: catalog:react18 + specifier: ^18.3.3 version: 18.3.11 '@types/react-dom': - specifier: catalog:react18 + specifier: ^18.3.0 version: 18.3.1 '@types/react-relay': - specifier: catalog:graphql + specifier: ^16.0.6 version: 16.0.6 '@types/relay-test-utils': - specifier: catalog:graphql + specifier: ^14.1.4 version: 14.1.4 autoprefixer: - specifier: catalog:tailwind + specifier: ^10.4.19 version: 10.4.20(postcss@8.4.47) babel-jest: - specifier: catalog:test + specifier: ^29.7.0 version: 29.7.0(@babel/core@7.25.8) babel-loader: - specifier: catalog:storybook + specifier: ^9.1.3 version: 9.2.1(@babel/core@7.25.8)(webpack@5.95.0) babel-plugin-relay: - specifier: catalog:graphql + specifier: ^17.0.0 version: 17.0.0 css-loader: - specifier: catalog:storybook + specifier: ^7.1.2 version: 7.1.2(webpack@5.95.0) cypress: - specifier: catalog:test + specifier: ^13.13.3 version: 13.15.0 cypress-plugin-steps: - specifier: catalog:test + specifier: ^1.1.1 version: 1.1.1(cypress@13.15.0) cypress-wait-until: - specifier: catalog:test + specifier: ^3.0.2 version: 3.0.2 dotenv: specifier: ^16.4.5 @@ -642,64 +594,64 @@ importers: specifier: ^7.4.2 version: 7.4.2 eslint-plugin-storybook: - specifier: catalog:lint + specifier: ^0.8.0 version: 0.8.0(eslint@8.57.1)(typescript@5.6.3) get-graphql-schema: - specifier: catalog:graphql + specifier: ^2.1.2 version: 2.1.2 html-webpack-plugin: - specifier: catalog:storybook + specifier: ^5.6.0 version: 5.6.2(webpack@5.95.0) jest: - specifier: catalog:test + specifier: ^29.7.0 version: 29.7.0(@types/node@22.7.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.7.36(@swc/helpers@0.5.13))(@types/node@22.7.7)(typescript@5.6.3)) jest-environment-jsdom: - specifier: catalog:test + specifier: ^29.7.0 version: 29.7.0 msw: - specifier: catalog:storybook + specifier: ^2.3.1 version: 2.4.11(typescript@5.6.3) msw-storybook-addon: - specifier: catalog:storybook + specifier: ^2.0.2 version: 2.0.3(msw@2.4.11(typescript@5.6.3)) postcss: - specifier: catalog:tailwind + specifier: ^8.4.41 version: 8.4.47 postcss-loader: - specifier: catalog:storybook + specifier: ^8.1.1 version: 8.1.1(postcss@8.4.47)(typescript@5.6.3)(webpack@5.95.0) relay-compiler: - specifier: catalog:graphql + specifier: ^16.2.0 version: 16.2.0 relay-test-utils: - specifier: catalog:graphql + specifier: ^17.0.0 version: 17.0.0 storybook: - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.3.6 style-loader: - specifier: catalog:storybook + specifier: ^4.0.0 version: 4.0.0(webpack@5.95.0) tailwindcss: - specifier: catalog:tailwind + specifier: ^3.4.4 version: 3.4.14(ts-node@10.9.2(@swc/core@1.7.36(@swc/helpers@0.5.13))(@types/node@22.7.7)(typescript@5.6.3)) ts-jest: - specifier: catalog:test + specifier: ^29.1.4 version: 29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(esbuild@0.23.1)(jest@29.7.0(@types/node@22.7.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.7.36(@swc/helpers@0.5.13))(@types/node@22.7.7)(typescript@5.6.3)))(typescript@5.6.3) ts-node: - specifier: catalog:test + specifier: ^10.9.2 version: 10.9.2(@swc/core@1.7.36(@swc/helpers@0.5.13))(@types/node@22.7.7)(typescript@5.6.3) typescript: - specifier: 'catalog:' + specifier: ^5.4.5 version: 5.6.3 webpack: - specifier: catalog:storybook + specifier: ^5.93.0 version: 5.95.0(@swc/core@1.7.36(@swc/helpers@0.5.13))(esbuild@0.23.1)(webpack-cli@5.1.4) webpack-cli: - specifier: catalog:storybook + specifier: ^5.1.4 version: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.95.0) webpack-dev-server: - specifier: catalog:storybook + specifier: ^5.0.4 version: 5.1.0(webpack-cli@5.1.4)(webpack@5.95.0) packages/config: @@ -12333,8 +12285,6 @@ snapshots: '@parcel/logger': 2.12.0 '@parcel/utils': 2.12.0 lmdb: 2.8.5 - transitivePeerDependencies: - - '@swc/helpers' '@parcel/codeframe@2.12.0': dependencies: @@ -12438,7 +12388,7 @@ snapshots: '@parcel/source-map': 2.1.1 '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/utils': 2.12.0 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) abortcontroller-polyfill: 1.7.5 base-x: 3.0.10 browserslist: 4.24.0 @@ -12466,7 +12416,7 @@ snapshots: '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/utils': 2.12.0 '@parcel/watcher': 2.4.1 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) transitivePeerDependencies: - '@swc/helpers' @@ -12566,7 +12516,7 @@ snapshots: '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/rust': 2.12.0 '@parcel/utils': 2.12.0 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) transitivePeerDependencies: - '@swc/helpers' @@ -12599,9 +12549,9 @@ snapshots: '@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/logger': 2.12.0 '@parcel/node-resolver-core': 3.3.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) - '@parcel/types': 2.12.0(@parcel/core@2.12.0) + '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/utils': 2.12.0 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@swc/core': 1.7.36(@swc/helpers@0.5.13) semver: 7.6.3 transitivePeerDependencies: @@ -12681,7 +12631,6 @@ snapshots: '@parcel/plugin': 2.12.0(@parcel/core@2.12.0) transitivePeerDependencies: - '@parcel/core' - - '@swc/helpers' '@parcel/packager-wasm@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13)': dependencies: @@ -12702,7 +12651,6 @@ snapshots: '@parcel/types': 2.12.0(@parcel/core@2.12.0) transitivePeerDependencies: - '@parcel/core' - - '@swc/helpers' '@parcel/profiler@2.12.0': dependencies: @@ -12837,7 +12785,7 @@ snapshots: '@parcel/core': 2.12.0(@swc/helpers@0.5.13) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/utils': 2.12.0 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) nullthrows: 1.1.1 transitivePeerDependencies: - '@swc/helpers' @@ -12850,7 +12798,7 @@ snapshots: '@parcel/rust': 2.12.0 '@parcel/source-map': 2.1.1 '@parcel/utils': 2.12.0 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@swc/helpers': 0.5.13 browserslist: 4.24.0 nullthrows: 1.1.1 @@ -12933,7 +12881,6 @@ snapshots: typescript: 5.6.3 transitivePeerDependencies: - '@parcel/core' - - '@swc/helpers' '@parcel/ts-utils@2.12.0(typescript@5.6.3)': dependencies: @@ -12947,7 +12894,7 @@ snapshots: '@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/source-map': 2.1.1 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) utility-types: 3.11.0 transitivePeerDependencies: - '@parcel/core' @@ -13033,15 +12980,17 @@ snapshots: '@parcel/watcher-win32-ia32': 2.4.1 '@parcel/watcher-win32-x64': 2.4.1 - '@parcel/workers@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))': + '@parcel/workers@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13)': dependencies: '@parcel/core': 2.12.0(@swc/helpers@0.5.13) '@parcel/diagnostic': 2.12.0 '@parcel/logger': 2.12.0 '@parcel/profiler': 2.12.0 - '@parcel/types': 2.12.0(@parcel/core@2.12.0) + '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/utils': 2.12.0 nullthrows: 1.1.1 + transitivePeerDependencies: + - '@swc/helpers' '@parcel/workers@2.12.0(@parcel/core@2.12.0)': dependencies: From 970fff1ffe41cddfc81c1be787c937015e069260 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Tue, 12 Nov 2024 20:27:17 -0300 Subject: [PATCH 03/13] capitalize member status --- .../modules/profiles/Members/MemberItem/index.tsx | 7 +++++-- .../modules/profiles/Members/MemberItem/types.ts | 4 ++-- packages/components/modules/profiles/Members/utils.ts | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 packages/components/modules/profiles/Members/utils.ts diff --git a/packages/components/modules/profiles/Members/MemberItem/index.tsx b/packages/components/modules/profiles/Members/MemberItem/index.tsx index ed30786f..abe5efad 100644 --- a/packages/components/modules/profiles/Members/MemberItem/index.tsx +++ b/packages/components/modules/profiles/Members/MemberItem/index.tsx @@ -8,6 +8,7 @@ import { readInlineData } from 'react-relay' import { ProfileItemFragment$key } from '../../../../__generated__/ProfileItemFragment.graphql' import { ProfileItemFragment } from '../../graphql/queries/ProfileItem' import { MemberStatuses } from '../constants' +import { capitalizeFirstLetter } from '../utils' import { MemberItemContainer, MemberPersonalInformation } from './styled' import { MemberItemProps } from './types' @@ -38,9 +39,11 @@ const MemberItem: FC = ({ - + diff --git a/packages/components/modules/profiles/Members/MemberItem/types.ts b/packages/components/modules/profiles/Members/MemberItem/types.ts index e41b13dc..58fbf521 100644 --- a/packages/components/modules/profiles/Members/MemberItem/types.ts +++ b/packages/components/modules/profiles/Members/MemberItem/types.ts @@ -12,8 +12,8 @@ export interface IMemberPersonalInformation extends BoxProps { export interface MemberItemProps { member: ProfileItemFragment$key | null | undefined - memberRole: ProfileRoles | null | undefined | 'owner' - status: ProfileRoleStatus | null | undefined + memberRole: ProfileRoles | 'owner' + status: ProfileRoleStatus avatarProps?: AvatarProps avatarWidth?: number avatarHeight?: number diff --git a/packages/components/modules/profiles/Members/utils.ts b/packages/components/modules/profiles/Members/utils.ts new file mode 100644 index 00000000..fe8410c0 --- /dev/null +++ b/packages/components/modules/profiles/Members/utils.ts @@ -0,0 +1,2 @@ +export const capitalizeFirstLetter = (string: string) => + string.charAt(0).toUpperCase() + string.slice(1).toLowerCase() From 8d564dc79d61cbd3925ad350e1426e22a3144541 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Wed, 20 Nov 2024 00:15:52 -0300 Subject: [PATCH 04/13] change graphql query --- .../UserMembersListFragment.graphql.ts | 198 ++++++++-------- .../UserMembersListPaginationQuery.graphql.ts | 218 +++++++++--------- ...embersListPaginationRefetchable.graphql.ts | 162 ++++++------- .../profiles/Members/MembersList/index.tsx | 35 ++- .../modules/profiles/Members/index.tsx | 9 +- .../modules/profiles/Members/types.ts | 4 +- .../graphql/queries/UserMembersList.ts | 46 ++-- 7 files changed, 336 insertions(+), 336 deletions(-) diff --git a/packages/components/__generated__/UserMembersListFragment.graphql.ts b/packages/components/__generated__/UserMembersListFragment.graphql.ts index 6ba87d89..9d3fed13 100644 --- a/packages/components/__generated__/UserMembersListFragment.graphql.ts +++ b/packages/components/__generated__/UserMembersListFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<6487acdc5c21d43116573cae55a8dfc0>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -16,44 +16,39 @@ export type ProfileRoles = 'ADMIN' | 'MANAGER' | '%future added value' export type UserMembersListFragment$data = { readonly id: string - readonly profile: + readonly members: | { - readonly members: + readonly edges: ReadonlyArray< | { - readonly edges: ReadonlyArray< + readonly node: | { - readonly node: - | { - readonly id: string - readonly role: ProfileRoles | null | undefined - readonly status: ProfileRoleStatus | null | undefined - readonly user: { - readonly profile: - | { - readonly ' $fragmentSpreads': FragmentRefs<'ProfileItemFragment'> - } - | null - | undefined + readonly id: string + readonly role: ProfileRoles | null | undefined + readonly status: ProfileRoleStatus | null | undefined + readonly user: { + readonly profile: + | { + readonly ' $fragmentSpreads': FragmentRefs<'ProfileItemFragment'> } - } - | null - | undefined + | null + | undefined + } } | null | undefined - > - readonly pageInfo: { - readonly endCursor: string | null | undefined - readonly hasNextPage: boolean - } - readonly totalCount: number | null | undefined } | null | undefined - readonly ' $fragmentSpreads': FragmentRefs<'ProfileItemFragment'> + > + readonly pageInfo: { + readonly endCursor: string | null | undefined + readonly hasNextPage: boolean + } + readonly totalCount: number | null | undefined } | null | undefined + readonly ' $fragmentSpreads': FragmentRefs<'ProfileItemFragment'> readonly ' $fragmentType': 'UserMembersListFragment' } export type UserMembersListFragment$key = { @@ -62,7 +57,7 @@ export type UserMembersListFragment$key = { } const node: ReaderFragment = (function () { - var v0 = ['profile', 'members'], + var v0 = ['members'], v1 = { alias: null, args: null, @@ -180,93 +175,61 @@ const node: ReaderFragment = (function () { }, name: 'UserMembersListFragment', selections: [ + v2 /*: any*/, { - alias: null, - args: null, - concreteType: 'Profile', + alias: 'members', + args: [ + { + kind: 'Variable', + name: 'orderByStatus', + variableName: 'orderByStatus', + }, + ], + concreteType: 'ProfileUserRoleConnection', kind: 'LinkedField', - name: 'profile', + name: '__UserMembersFragment_members_connection', plural: false, selections: [ - v2 /*: any*/, { - alias: 'members', - args: [ - { - kind: 'Variable', - name: 'orderByStatus', - variableName: 'orderByStatus', - }, - ], - concreteType: 'ProfileUserRoleConnection', + alias: null, + args: null, + kind: 'ScalarField', + name: 'totalCount', + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'ProfileUserRoleEdge', kind: 'LinkedField', - name: '__UserMembersFragment_members_connection', - plural: false, + name: 'edges', + plural: true, selections: [ { alias: null, args: null, - kind: 'ScalarField', - name: 'totalCount', - storageKey: null, - }, - { - alias: null, - args: null, - concreteType: 'ProfileUserRoleEdge', + concreteType: 'ProfileUserRole', kind: 'LinkedField', - name: 'edges', - plural: true, + name: 'node', + plural: false, selections: [ + v1 /*: any*/, { alias: null, args: null, - concreteType: 'ProfileUserRole', + concreteType: 'User', kind: 'LinkedField', - name: 'node', + name: 'user', plural: false, selections: [ - v1 /*: any*/, { alias: null, args: null, - concreteType: 'User', + concreteType: 'Profile', kind: 'LinkedField', - name: 'user', + name: 'profile', plural: false, - selections: [ - { - alias: null, - args: null, - concreteType: 'Profile', - kind: 'LinkedField', - name: 'profile', - plural: false, - selections: [v2 /*: any*/], - storageKey: null, - }, - ], - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'role', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'status', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: '__typename', + selections: [v2 /*: any*/], storageKey: null, }, ], @@ -276,37 +239,58 @@ const node: ReaderFragment = (function () { alias: null, args: null, kind: 'ScalarField', - name: 'cursor', + name: 'role', storageKey: null, }, - ], - storageKey: null, - }, - { - alias: null, - args: null, - concreteType: 'PageInfo', - kind: 'LinkedField', - name: 'pageInfo', - plural: false, - selections: [ { alias: null, args: null, kind: 'ScalarField', - name: 'endCursor', + name: 'status', storageKey: null, }, { alias: null, args: null, kind: 'ScalarField', - name: 'hasNextPage', + name: '__typename', storageKey: null, }, ], storageKey: null, }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'cursor', + storageKey: null, + }, + ], + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'PageInfo', + kind: 'LinkedField', + name: 'pageInfo', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'endCursor', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'hasNextPage', + storageKey: null, + }, ], storageKey: null, }, @@ -315,11 +299,11 @@ const node: ReaderFragment = (function () { }, v1 /*: any*/, ], - type: 'User', + type: 'Profile', abstractKey: null, } })() -;(node as any).hash = '5114446aef93bf0eb196a55ba3f9a429' +;(node as any).hash = '038f3f85d02ec3d5e31279acd14c0269' export default node diff --git a/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts b/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts index f0691ec8..a4ace9bf 100644 --- a/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts +++ b/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<5590b423755faa5cae40c081ea26fb23>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -15,10 +15,12 @@ export type UserMembersListPaginationQuery$variables = { count?: number | null | undefined cursor?: string | null | undefined orderByStatus?: string | null | undefined + profileId: string } export type UserMembersListPaginationQuery$data = { - readonly me: + readonly profile: | { + readonly pk: number readonly ' $fragmentSpreads': FragmentRefs<'UserMembersListFragment'> } | null @@ -46,27 +48,46 @@ const node: ConcreteRequest = (function () { kind: 'LocalArgument', name: 'orderByStatus', }, + { + defaultValue: null, + kind: 'LocalArgument', + name: 'profileId', + }, + ], + v1 = [ + { + kind: 'Variable', + name: 'id', + variableName: 'profileId', + }, ], - v1 = { + v2 = { + alias: null, + args: null, + kind: 'ScalarField', + name: 'pk', + storageKey: null, + }, + v3 = { kind: 'Variable', name: 'orderByStatus', variableName: 'orderByStatus', }, - v2 = { + v4 = { alias: null, args: null, kind: 'ScalarField', name: 'id', storageKey: null, }, - v3 = { + v5 = { alias: null, args: null, kind: 'ScalarField', name: 'name', storageKey: null, }, - v4 = { + v6 = { alias: null, args: [ { @@ -95,7 +116,7 @@ const node: ConcreteRequest = (function () { ], storageKey: 'image(height:100,width:100)', }, - v5 = { + v7 = { alias: null, args: null, concreteType: 'URLPath', @@ -110,11 +131,11 @@ const node: ConcreteRequest = (function () { name: 'path', storageKey: null, }, - v2 /*: any*/, + v4 /*: any*/, ], storageKey: null, }, - v6 = [ + v8 = [ { kind: 'Variable', name: 'after', @@ -125,7 +146,7 @@ const node: ConcreteRequest = (function () { name: 'first', variableName: 'count', }, - v1 /*: any*/, + v3 /*: any*/, ] return { fragment: { @@ -136,12 +157,13 @@ const node: ConcreteRequest = (function () { selections: [ { alias: null, - args: null, - concreteType: 'User', + args: v1 /*: any*/, + concreteType: 'Profile', kind: 'LinkedField', - name: 'me', + name: 'profile', plural: false, selections: [ + v2 /*: any*/, { args: [ { @@ -154,7 +176,7 @@ const node: ConcreteRequest = (function () { name: 'cursor', variableName: 'cursor', }, - v1 /*: any*/, + v3 /*: any*/, ], kind: 'FragmentSpread', name: 'UserMembersListFragment', @@ -174,104 +196,68 @@ const node: ConcreteRequest = (function () { selections: [ { alias: null, - args: null, - concreteType: 'User', + args: v1 /*: any*/, + concreteType: 'Profile', kind: 'LinkedField', - name: 'me', + name: 'profile', plural: false, selections: [ + v2 /*: any*/, + v4 /*: any*/, + v5 /*: any*/, + v6 /*: any*/, + v7 /*: any*/, { alias: null, - args: null, - concreteType: 'Profile', + args: v8 /*: any*/, + concreteType: 'ProfileUserRoleConnection', kind: 'LinkedField', - name: 'profile', + name: 'members', plural: false, selections: [ - v2 /*: any*/, - v3 /*: any*/, - v4 /*: any*/, - v5 /*: any*/, { alias: null, - args: v6 /*: any*/, - concreteType: 'ProfileUserRoleConnection', + args: null, + kind: 'ScalarField', + name: 'totalCount', + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'ProfileUserRoleEdge', kind: 'LinkedField', - name: 'members', - plural: false, + name: 'edges', + plural: true, selections: [ { alias: null, args: null, - kind: 'ScalarField', - name: 'totalCount', - storageKey: null, - }, - { - alias: null, - args: null, - concreteType: 'ProfileUserRoleEdge', + concreteType: 'ProfileUserRole', kind: 'LinkedField', - name: 'edges', - plural: true, + name: 'node', + plural: false, selections: [ + v4 /*: any*/, { alias: null, args: null, - concreteType: 'ProfileUserRole', + concreteType: 'User', kind: 'LinkedField', - name: 'node', + name: 'user', plural: false, selections: [ - v2 /*: any*/, { alias: null, args: null, - concreteType: 'User', + concreteType: 'Profile', kind: 'LinkedField', - name: 'user', + name: 'profile', plural: false, - selections: [ - { - alias: null, - args: null, - concreteType: 'Profile', - kind: 'LinkedField', - name: 'profile', - plural: false, - selections: [ - v2 /*: any*/, - v3 /*: any*/, - v4 /*: any*/, - v5 /*: any*/, - ], - storageKey: null, - }, - v2 /*: any*/, - ], - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'role', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'status', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: '__typename', + selections: [v4 /*: any*/, v5 /*: any*/, v6 /*: any*/, v7 /*: any*/], storageKey: null, }, + v4 /*: any*/, ], storageKey: null, }, @@ -279,69 +265,89 @@ const node: ConcreteRequest = (function () { alias: null, args: null, kind: 'ScalarField', - name: 'cursor', + name: 'role', storageKey: null, }, - ], - storageKey: null, - }, - { - alias: null, - args: null, - concreteType: 'PageInfo', - kind: 'LinkedField', - name: 'pageInfo', - plural: false, - selections: [ { alias: null, args: null, kind: 'ScalarField', - name: 'endCursor', + name: 'status', storageKey: null, }, { alias: null, args: null, kind: 'ScalarField', - name: 'hasNextPage', + name: '__typename', storageKey: null, }, ], storageKey: null, }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'cursor', + storageKey: null, + }, ], storageKey: null, }, { alias: null, - args: v6 /*: any*/, - filters: ['orderByStatus'], - handle: 'connection', - key: 'UserMembersFragment_members', - kind: 'LinkedHandle', - name: 'members', + args: null, + concreteType: 'PageInfo', + kind: 'LinkedField', + name: 'pageInfo', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'endCursor', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'hasNextPage', + storageKey: null, + }, + ], + storageKey: null, }, ], storageKey: null, }, - v2 /*: any*/, + { + alias: null, + args: v8 /*: any*/, + filters: ['orderByStatus'], + handle: 'connection', + key: 'UserMembersFragment_members', + kind: 'LinkedHandle', + name: 'members', + }, ], storageKey: null, }, ], }, params: { - cacheID: '01fb387e0c0ef07a4b949c31accf3a0c', + cacheID: '9b67c794489795c15c6ba25fca17e848', id: null, metadata: {}, name: 'UserMembersListPaginationQuery', operationKind: 'query', - text: 'query UserMembersListPaginationQuery(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String\n) {\n me {\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on User {\n profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n }\n id\n}\n', + text: 'query UserMembersListPaginationQuery(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String\n $profileId: ID!\n) {\n profile(id: $profileId) {\n pk\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on Profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n}\n', }, } })() -;(node as any).hash = '5925af2542eb06c4457a1e16c1591fd9' +;(node as any).hash = '6816a1706adef7eb99737264e9ab6582' export default node diff --git a/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts b/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts index a676f99f..74bdd7b1 100644 --- a/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts +++ b/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<92f589914a9995a763cf552ec687d3c7>> + * @generated SignedSource<<68687e846777bc425817ef6bdefdb60c>> * @lightSyntaxTransform * @nogrep */ @@ -203,92 +203,65 @@ const node: ConcreteRequest = (function () { { kind: 'InlineFragment', selections: [ + v8 /*: any*/, + v9 /*: any*/, + v10 /*: any*/, { alias: null, - args: null, - concreteType: 'Profile', + args: v11 /*: any*/, + concreteType: 'ProfileUserRoleConnection', kind: 'LinkedField', - name: 'profile', + name: 'members', plural: false, selections: [ - v7 /*: any*/, - v8 /*: any*/, - v9 /*: any*/, - v10 /*: any*/, { alias: null, - args: v11 /*: any*/, - concreteType: 'ProfileUserRoleConnection', + args: null, + kind: 'ScalarField', + name: 'totalCount', + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'ProfileUserRoleEdge', kind: 'LinkedField', - name: 'members', - plural: false, + name: 'edges', + plural: true, selections: [ { alias: null, args: null, - kind: 'ScalarField', - name: 'totalCount', - storageKey: null, - }, - { - alias: null, - args: null, - concreteType: 'ProfileUserRoleEdge', + concreteType: 'ProfileUserRole', kind: 'LinkedField', - name: 'edges', - plural: true, + name: 'node', + plural: false, selections: [ + v7 /*: any*/, { alias: null, args: null, - concreteType: 'ProfileUserRole', + concreteType: 'User', kind: 'LinkedField', - name: 'node', + name: 'user', plural: false, selections: [ - v7 /*: any*/, { alias: null, args: null, - concreteType: 'User', + concreteType: 'Profile', kind: 'LinkedField', - name: 'user', + name: 'profile', plural: false, selections: [ - { - alias: null, - args: null, - concreteType: 'Profile', - kind: 'LinkedField', - name: 'profile', - plural: false, - selections: [ - v7 /*: any*/, - v8 /*: any*/, - v9 /*: any*/, - v10 /*: any*/, - ], - storageKey: null, - }, v7 /*: any*/, + v8 /*: any*/, + v9 /*: any*/, + v10 /*: any*/, ], storageKey: null, }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'role', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'status', - storageKey: null, - }, - v6 /*: any*/, + v7 /*: any*/, ], storageKey: null, }, @@ -296,54 +269,69 @@ const node: ConcreteRequest = (function () { alias: null, args: null, kind: 'ScalarField', - name: 'cursor', + name: 'role', storageKey: null, }, - ], - storageKey: null, - }, - { - alias: null, - args: null, - concreteType: 'PageInfo', - kind: 'LinkedField', - name: 'pageInfo', - plural: false, - selections: [ { alias: null, args: null, kind: 'ScalarField', - name: 'endCursor', - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'hasNextPage', + name: 'status', storageKey: null, }, + v6 /*: any*/, ], storageKey: null, }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'cursor', + storageKey: null, + }, ], storageKey: null, }, { alias: null, - args: v11 /*: any*/, - filters: ['orderByStatus'], - handle: 'connection', - key: 'UserMembersFragment_members', - kind: 'LinkedHandle', - name: 'members', + args: null, + concreteType: 'PageInfo', + kind: 'LinkedField', + name: 'pageInfo', + plural: false, + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'endCursor', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'hasNextPage', + storageKey: null, + }, + ], + storageKey: null, }, ], storageKey: null, }, + { + alias: null, + args: v11 /*: any*/, + filters: ['orderByStatus'], + handle: 'connection', + key: 'UserMembersFragment_members', + kind: 'LinkedHandle', + name: 'members', + }, ], - type: 'User', + type: 'Profile', abstractKey: null, }, ], @@ -352,16 +340,16 @@ const node: ConcreteRequest = (function () { ], }, params: { - cacheID: 'f5fc645f9fb9dcbb19f717aaeb5d405f', + cacheID: '4b1dca117f539126bf6f6bde7a7171d3', id: null, metadata: {}, name: 'userMembersListPaginationRefetchable', operationKind: 'query', - text: 'query userMembersListPaginationRefetchable(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String = "custom"\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on User {\n profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n }\n id\n}\n', + text: 'query userMembersListPaginationRefetchable(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String = "custom"\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on Profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n}\n', }, } })() -;(node as any).hash = '5114446aef93bf0eb196a55ba3f9a429' +;(node as any).hash = '038f3f85d02ec3d5e31279acd14c0269' export default node diff --git a/packages/components/modules/profiles/Members/MembersList/index.tsx b/packages/components/modules/profiles/Members/MembersList/index.tsx index 52ffd61b..9628bd56 100644 --- a/packages/components/modules/profiles/Members/MembersList/index.tsx +++ b/packages/components/modules/profiles/Members/MembersList/index.tsx @@ -12,7 +12,7 @@ import { MemberStatuses, NUMBER_OF_MEMBERS_TO_LOAD_NEXT } from '../constants' import { MemberListProps } from '../types' const MembersList: FC = ({ - meRef, + userRef, MemberItem = DefaultMemberItem, LoadingState = DefaultLoadingState, LoadingStateProps = {}, @@ -20,13 +20,12 @@ const MembersList: FC = ({ }) => { const { data, loadNext, hasNext, isLoadingNext } = usePaginationFragment( UserMembersListFragment, - meRef, + userRef, ) const members = useMemo( - () => - data?.profile?.members?.edges.filter((edge) => edge?.node).map((edge) => edge?.node) || [], - [data?.profile?.members?.edges], + () => data?.members?.edges.filter((edge) => edge?.node).map((edge) => edge?.node) || [], + [data?.members?.edges], ) const renderLoadingState = () => { @@ -44,13 +43,14 @@ const MembersList: FC = ({ const renderMemberItem = (member: any, index: number) => { if (!member) return null if ( - member.status === MemberStatuses.active && - members[index - 1]?.status !== MemberStatuses.active + (member.status === MemberStatuses.active && + members[index - 1]?.status !== MemberStatuses.active) || + (member.status === MemberStatuses.active && !members[index - 1]?.status) ) { return ( <> - + = ({ ) } + if (member.status !== MemberStatuses.active && !members[index + 1]?.status) { + return ( + <> + + + + + ) + } return ( = ({ 1 member - + ) } return ( <> - {data.profile?.members?.totalCount && ( + {data.members?.totalCount && ( - {(data.profile?.members?.totalCount ?? 0) + 1} members + {(data.members?.totalCount ?? 0) + 1} members )} = ({ LoadingStateProps, membersContainerHeight, }) => { + const { profile: currentProfile } = useCurrentProfile() + const data = useLazyLoadQuery(UserMembersListPaginationQuery, { + profileId: currentProfile?.id || '', count: NUMBER_OF_MEMBERS_ON_FIRST_LOAD, orderByStatus: 'custom', }) - if (!data.me) return null + + if (!data.profile) return null return ( - meRef: UserMembersListFragment$key + userRef: UserMembersListFragment$key LoadingState: FC LoadingStateProps: LoadingStateProps membersContainerHeight?: number @@ -23,4 +23,4 @@ export interface UserMembersSuspendedProps { membersContainerHeight?: number } -export interface UserMembersProps extends Omit {} +export interface UserMembersProps extends Omit {} diff --git a/packages/components/modules/profiles/graphql/queries/UserMembersList.ts b/packages/components/modules/profiles/graphql/queries/UserMembersList.ts index b246e5ec..0b9f7290 100644 --- a/packages/components/modules/profiles/graphql/queries/UserMembersList.ts +++ b/packages/components/modules/profiles/graphql/queries/UserMembersList.ts @@ -1,8 +1,14 @@ import { graphql } from 'react-relay' export const UserMembersListPaginationQuery = graphql` - query UserMembersListPaginationQuery($count: Int = 10, $cursor: String, $orderByStatus: String) { - me { + query UserMembersListPaginationQuery( + $count: Int = 10 + $cursor: String + $orderByStatus: String + $profileId: ID! + ) { + profile(id: $profileId) { + pk ...UserMembersListFragment @arguments(count: $count, cursor: $cursor, orderByStatus: $orderByStatus) } @@ -10,34 +16,32 @@ export const UserMembersListPaginationQuery = graphql` ` export const UserMembersListFragment = graphql` - fragment UserMembersListFragment on User + fragment UserMembersListFragment on Profile @refetchable(queryName: "userMembersListPaginationRefetchable") @argumentDefinitions( count: { type: "Int", defaultValue: 10 } cursor: { type: "String" } orderByStatus: { type: "String", defaultValue: "custom" } ) { - profile { - ...ProfileItemFragment - members(first: $count, after: $cursor, orderByStatus: $orderByStatus) - @connection(key: "UserMembersFragment_members", filters: ["orderByStatus"]) { - totalCount - edges { - node { - id - user { - profile { - ...ProfileItemFragment - } + ...ProfileItemFragment + members(first: $count, after: $cursor, orderByStatus: $orderByStatus) + @connection(key: "UserMembersFragment_members", filters: ["orderByStatus"]) { + totalCount + edges { + node { + id + user { + profile { + ...ProfileItemFragment } - role - status } + role + status } - pageInfo { - endCursor - hasNextPage - } + } + pageInfo { + endCursor + hasNextPage } } } From 65c2ba7f1303a9c2db5bebe1e58484e0a0348b57 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Thu, 28 Nov 2024 13:57:45 -0300 Subject: [PATCH 05/13] Revert "Temporarily remove catalogs to use GitHub version" This reverts commit cfd9bf95f0f2c55b7a77097510e2b3246ed2cc01. --- packages/components/package.json | 142 ++++++++++---------- pnpm-lock.yaml | 217 +++++++++++++++++++------------ 2 files changed, 205 insertions(+), 154 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index d8f9327d..8cd6c31f 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -21,92 +21,92 @@ "test:unit": "jest --config ./jest.config.ts" }, "dependencies": { - "@hookform/resolvers": "^3.6.0", - "@mui/lab": "^5.0.0-alpha.170", - "@mui/material": "^5.15.19", - "@mui/system": "^5.15.19", - "@storybook/react": "^8.2.8", - "@tanstack/react-query": "^5.45.1", + "@hookform/resolvers": "catalog:", + "@mui/lab": "catalog:material-ui", + "@mui/material": "catalog:material-ui", + "@mui/system": "catalog:material-ui", + "@storybook/react": "catalog:storybook", + "@tanstack/react-query": "catalog:", "framer-motion": "^11.5.4", - "graphql": "^16.8.1", - "js-cookie": "^3.0.5", - "luxon": "^3.4.4", - "next": "14.3.0-canary.24", - "react-hook-form": "^7.51.5", - "react-relay": "^16.2.0", - "react-virtuoso": "^4.7.11", + "graphql": "catalog:graphql", + "js-cookie": "catalog:", + "luxon": "catalog:", + "next": "catalog:", + "react-hook-form": "catalog:", + "react-relay": "catalog:graphql", + "react-virtuoso": "catalog:", "use-long-press": "^3.2.0", - "zod": "^3.23.8", - "zustand": "^4.5.2" + "zod": "catalog:", + "zustand": "catalog:" }, "peerDependencies": { "@baseapp-frontend/authentication": "workspace:*", "@baseapp-frontend/design-system": "workspace:*", "@baseapp-frontend/graphql": "workspace:*", "@baseapp-frontend/utils": "workspace:*", - "react": "18.3.1", - "react-dom": "18.3.1" + "react": "catalog:react18", + "react-dom": "catalog:react18" }, "devDependencies": { - "@babel/preset-env": "^7.24.7", - "@babel/preset-react": "^7.24.7", - "@babel/preset-typescript": "^7.24.7", + "@babel/preset-env": "catalog:storybook", + "@babel/preset-react": "catalog:storybook", + "@babel/preset-typescript": "catalog:storybook", "@baseapp-frontend/config": "workspace:*", "@baseapp-frontend/test": "workspace:*", "@baseapp-frontend/tsconfig": "workspace:*", - "@chromatic-com/storybook": "^1.5.0", - "@cypress/webpack-dev-server": "^3.10.1", - "@faker-js/faker": "^9.0.3", - "@storybook/addon-essentials": "^8.2.8", - "@storybook/addon-interactions": "^8.2.8", - "@storybook/addon-links": "^8.2.8", - "@storybook/addon-styling-webpack": "^1.0.0", - "@storybook/addon-webpack5-compiler-babel": "^3.0.3", - "@storybook/blocks": "^8.2.8", - "@storybook/react-webpack5": "^8.2.8", - "@storybook/test": "^8.2.8", - "@tailwindcss/typography": "^0.5.13", - "@testing-library/cypress": "^10.0.2", - "@testing-library/jest-dom": "^6.4.6", - "@testing-library/react": "^16.0.0", - "@testing-library/user-event": "^14.5.2", - "@types/jest": "^29.5.12", - "@types/js-cookie": "^3.0.6", - "@types/luxon": "^3.4.2", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", - "@types/react-relay": "^16.0.6", - "@types/relay-test-utils": "^14.1.4", - "autoprefixer": "^10.4.19", - "babel-jest": "^29.7.0", - "babel-loader": "^9.1.3", - "babel-plugin-relay": "^17.0.0", - "css-loader": "^7.1.2", - "cypress": "^13.13.3", - "cypress-plugin-steps": "^1.1.1", - "cypress-wait-until": "^3.0.2", + "@chromatic-com/storybook": "catalog:storybook", + "@cypress/webpack-dev-server": "catalog:test", + "@faker-js/faker": "catalog:test", + "@storybook/addon-essentials": "catalog:storybook", + "@storybook/addon-interactions": "catalog:storybook", + "@storybook/addon-links": "catalog:storybook", + "@storybook/addon-styling-webpack": "catalog:storybook", + "@storybook/addon-webpack5-compiler-babel": "catalog:storybook", + "@storybook/blocks": "catalog:storybook", + "@storybook/react-webpack5": "catalog:storybook", + "@storybook/test": "catalog:storybook", + "@tailwindcss/typography": "catalog:tailwind", + "@testing-library/cypress": "catalog:test", + "@testing-library/jest-dom": "catalog:test", + "@testing-library/react": "catalog:test", + "@testing-library/user-event": "catalog:test", + "@types/jest": "catalog:test", + "@types/js-cookie": "catalog:", + "@types/luxon": "catalog:", + "@types/react": "catalog:react18", + "@types/react-dom": "catalog:react18", + "@types/react-relay": "catalog:graphql", + "@types/relay-test-utils": "catalog:graphql", + "autoprefixer": "catalog:tailwind", + "babel-jest": "catalog:test", + "babel-loader": "catalog:storybook", + "babel-plugin-relay": "catalog:graphql", + "css-loader": "catalog:storybook", + "cypress": "catalog:test", + "cypress-plugin-steps": "catalog:test", + "cypress-wait-until": "catalog:test", "dotenv": "^16.4.5", "dotenv-cli": "^7.4.2", - "eslint-plugin-storybook": "^0.8.0", - "get-graphql-schema": "^2.1.2", - "html-webpack-plugin": "^5.6.0", - "jest": "^29.7.0", - "jest-environment-jsdom": "^29.7.0", - "msw": "^2.3.1", - "msw-storybook-addon": "^2.0.2", - "postcss": "^8.4.41", - "postcss-loader": "^8.1.1", - "relay-compiler": "^16.2.0", - "relay-test-utils": "^17.0.0", - "storybook": "^8.2.8", - "style-loader": "^4.0.0", - "tailwindcss": "^3.4.4", - "ts-jest": "^29.1.4", - "ts-node": "^10.9.2", - "typescript": "^5.4.5", - "webpack": "^5.93.0", - "webpack-cli": "^5.1.4", - "webpack-dev-server": "^5.0.4" + "eslint-plugin-storybook": "catalog:lint", + "get-graphql-schema": "catalog:graphql", + "html-webpack-plugin": "catalog:storybook", + "jest": "catalog:test", + "jest-environment-jsdom": "catalog:test", + "msw": "catalog:storybook", + "msw-storybook-addon": "catalog:storybook", + "postcss": "catalog:tailwind", + "postcss-loader": "catalog:storybook", + "relay-compiler": "catalog:graphql", + "relay-test-utils": "catalog:graphql", + "storybook": "catalog:storybook", + "style-loader": "catalog:storybook", + "tailwindcss": "catalog:tailwind", + "ts-jest": "catalog:test", + "ts-node": "catalog:test", + "typescript": "catalog:", + "webpack": "catalog:storybook", + "webpack-cli": "catalog:storybook", + "webpack-dev-server": "catalog:storybook" }, "license": "MIT", "repository": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 141b5845..b86d9b45 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,6 +48,9 @@ catalogs: react-hook-form: specifier: ^7.51.5 version: 7.53.1 + react-virtuoso: + specifier: ^4.7.11 + version: 4.12.0 typescript: specifier: ^5.4.5 version: 5.6.3 @@ -67,6 +70,12 @@ catalogs: '@types/relay-test-utils': specifier: ^14.1.4 version: 14.1.4 + babel-plugin-relay: + specifier: ^17.0.0 + version: 17.0.0 + get-graphql-schema: + specifier: ^2.1.2 + version: 2.1.2 graphql: specifier: ^16.8.1 version: 16.9.0 @@ -233,9 +242,21 @@ catalogs: '@storybook/test': specifier: ^8.2.8 version: 8.3.6 + babel-loader: + specifier: ^9.1.3 + version: 9.2.1 css-loader: specifier: ^7.1.2 version: 7.1.2 + html-webpack-plugin: + specifier: ^5.6.0 + version: 5.6.2 + msw: + specifier: ^2.3.1 + version: 2.4.11 + msw-storybook-addon: + specifier: ^2.0.2 + version: 2.0.3 postcss-loader: specifier: ^8.1.1 version: 8.1.1 @@ -245,6 +266,15 @@ catalogs: style-loader: specifier: ^4.0.0 version: 4.0.0 + webpack: + specifier: ^5.93.0 + version: 5.95.0 + webpack-cli: + specifier: ^5.1.4 + version: 5.1.4 + webpack-dev-server: + specifier: ^5.0.4 + version: 5.1.0 tailwind: '@tailwindcss/typography': specifier: ^0.5.13 @@ -259,6 +289,15 @@ catalogs: specifier: ^3.4.4 version: 3.4.14 test: + '@cypress/webpack-dev-server': + specifier: ^3.10.1 + version: 3.11.0 + '@faker-js/faker': + specifier: ^9.0.3 + version: 9.0.3 + '@testing-library/cypress': + specifier: ^10.0.2 + version: 10.0.2 '@testing-library/jest-dom': specifier: ^6.4.6 version: 6.6.2 @@ -274,6 +313,15 @@ catalogs: babel-jest: specifier: ^29.7.0 version: 29.7.0 + cypress: + specifier: ^13.13.3 + version: 13.15.0 + cypress-plugin-steps: + specifier: ^1.1.1 + version: 1.1.1 + cypress-wait-until: + specifier: ^3.0.2 + version: 3.0.2 jest: specifier: ^29.7.0 version: 29.7.0 @@ -419,71 +467,71 @@ importers: specifier: workspace:* version: link:../utils '@hookform/resolvers': - specifier: ^3.6.0 + specifier: 'catalog:' version: 3.9.0(react-hook-form@7.53.1(react@18.3.1)) '@mui/lab': - specifier: ^5.0.0-alpha.170 + specifier: catalog:material-ui version: 5.0.0-alpha.173(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': - specifier: ^5.15.19 + specifier: catalog:material-ui version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/system': - specifier: ^5.15.19 + specifier: catalog:material-ui version: 5.16.7(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1) '@storybook/react': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.3.6(@storybook/test@8.3.6(storybook@8.3.6))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.3.6)(typescript@5.6.3) '@tanstack/react-query': - specifier: ^5.45.1 + specifier: 'catalog:' version: 5.59.15(react@18.3.1) framer-motion: specifier: ^11.5.4 version: 11.11.9(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) graphql: - specifier: ^16.8.1 + specifier: catalog:graphql version: 16.9.0 js-cookie: - specifier: ^3.0.5 + specifier: 'catalog:' version: 3.0.5 luxon: - specifier: ^3.4.4 + specifier: 'catalog:' version: 3.5.0 next: - specifier: 14.3.0-canary.24 + specifier: 'catalog:' version: 14.3.0-canary.24(@babel/core@7.25.8)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: - specifier: 18.3.1 + specifier: catalog:react18 version: 18.3.1 react-dom: - specifier: 18.3.1 + specifier: catalog:react18 version: 18.3.1(react@18.3.1) react-hook-form: - specifier: ^7.51.5 + specifier: 'catalog:' version: 7.53.1(react@18.3.1) react-relay: - specifier: ^16.2.0 + specifier: catalog:graphql version: 16.2.0(react@18.3.1) react-virtuoso: - specifier: ^4.7.11 + specifier: 'catalog:' version: 4.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) use-long-press: specifier: ^3.2.0 version: 3.2.0(react@18.3.1) zod: - specifier: ^3.23.8 + specifier: 'catalog:' version: 3.23.8 zustand: - specifier: ^4.5.2 + specifier: 'catalog:' version: 4.5.5(@types/react@18.3.11)(react@18.3.1) devDependencies: '@babel/preset-env': - specifier: ^7.24.7 + specifier: catalog:storybook version: 7.25.8(@babel/core@7.25.8) '@babel/preset-react': - specifier: ^7.24.7 + specifier: catalog:storybook version: 7.25.7(@babel/core@7.25.8) '@babel/preset-typescript': - specifier: ^7.24.7 + specifier: catalog:storybook version: 7.25.7(@babel/core@7.25.8) '@baseapp-frontend/config': specifier: workspace:* @@ -495,97 +543,97 @@ importers: specifier: workspace:* version: link:../tsconfig '@chromatic-com/storybook': - specifier: ^1.5.0 + specifier: catalog:storybook version: 1.9.0(react@18.3.1) '@cypress/webpack-dev-server': - specifier: ^3.10.1 + specifier: catalog:test version: 3.11.0(webpack-cli@5.1.4)(webpack@5.95.0) '@faker-js/faker': - specifier: ^9.0.3 + specifier: catalog:test version: 9.0.3 '@storybook/addon-essentials': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.3.6(storybook@8.3.6)(webpack-sources@3.2.3) '@storybook/addon-interactions': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.3.6(storybook@8.3.6) '@storybook/addon-links': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.3.6(react@18.3.1)(storybook@8.3.6) '@storybook/addon-styling-webpack': - specifier: ^1.0.0 + specifier: catalog:storybook version: 1.0.0(storybook@8.3.6)(webpack@5.95.0) '@storybook/addon-webpack5-compiler-babel': - specifier: ^3.0.3 + specifier: catalog:storybook version: 3.0.3(webpack@5.95.0) '@storybook/blocks': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.3.6) '@storybook/react-webpack5': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.3.6(@storybook/test@8.3.6(storybook@8.3.6))(@swc/core@1.7.36(@swc/helpers@0.5.13))(esbuild@0.23.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.3.6)(typescript@5.6.3)(webpack-cli@5.1.4) '@storybook/test': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.3.6(storybook@8.3.6) '@tailwindcss/typography': - specifier: ^0.5.13 + specifier: catalog:tailwind version: 0.5.15(tailwindcss@3.4.14(ts-node@10.9.2(@swc/core@1.7.36(@swc/helpers@0.5.13))(@types/node@22.7.7)(typescript@5.6.3))) '@testing-library/cypress': - specifier: ^10.0.2 + specifier: catalog:test version: 10.0.2(cypress@13.15.0) '@testing-library/jest-dom': - specifier: ^6.4.6 + specifier: catalog:test version: 6.6.2 '@testing-library/react': - specifier: ^16.0.0 + specifier: catalog:test version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.1)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@testing-library/user-event': - specifier: ^14.5.2 + specifier: catalog:test version: 14.5.2(@testing-library/dom@10.4.0) '@types/jest': - specifier: ^29.5.12 + specifier: catalog:test version: 29.5.13 '@types/js-cookie': - specifier: ^3.0.6 + specifier: 'catalog:' version: 3.0.6 '@types/luxon': - specifier: ^3.4.2 + specifier: 'catalog:' version: 3.4.2 '@types/react': - specifier: ^18.3.3 + specifier: catalog:react18 version: 18.3.11 '@types/react-dom': - specifier: ^18.3.0 + specifier: catalog:react18 version: 18.3.1 '@types/react-relay': - specifier: ^16.0.6 + specifier: catalog:graphql version: 16.0.6 '@types/relay-test-utils': - specifier: ^14.1.4 + specifier: catalog:graphql version: 14.1.4 autoprefixer: - specifier: ^10.4.19 + specifier: catalog:tailwind version: 10.4.20(postcss@8.4.47) babel-jest: - specifier: ^29.7.0 + specifier: catalog:test version: 29.7.0(@babel/core@7.25.8) babel-loader: - specifier: ^9.1.3 + specifier: catalog:storybook version: 9.2.1(@babel/core@7.25.8)(webpack@5.95.0) babel-plugin-relay: - specifier: ^17.0.0 + specifier: catalog:graphql version: 17.0.0 css-loader: - specifier: ^7.1.2 + specifier: catalog:storybook version: 7.1.2(webpack@5.95.0) cypress: - specifier: ^13.13.3 + specifier: catalog:test version: 13.15.0 cypress-plugin-steps: - specifier: ^1.1.1 + specifier: catalog:test version: 1.1.1(cypress@13.15.0) cypress-wait-until: - specifier: ^3.0.2 + specifier: catalog:test version: 3.0.2 dotenv: specifier: ^16.4.5 @@ -594,64 +642,64 @@ importers: specifier: ^7.4.2 version: 7.4.2 eslint-plugin-storybook: - specifier: ^0.8.0 + specifier: catalog:lint version: 0.8.0(eslint@8.57.1)(typescript@5.6.3) get-graphql-schema: - specifier: ^2.1.2 + specifier: catalog:graphql version: 2.1.2 html-webpack-plugin: - specifier: ^5.6.0 + specifier: catalog:storybook version: 5.6.2(webpack@5.95.0) jest: - specifier: ^29.7.0 + specifier: catalog:test version: 29.7.0(@types/node@22.7.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.7.36(@swc/helpers@0.5.13))(@types/node@22.7.7)(typescript@5.6.3)) jest-environment-jsdom: - specifier: ^29.7.0 + specifier: catalog:test version: 29.7.0 msw: - specifier: ^2.3.1 + specifier: catalog:storybook version: 2.4.11(typescript@5.6.3) msw-storybook-addon: - specifier: ^2.0.2 + specifier: catalog:storybook version: 2.0.3(msw@2.4.11(typescript@5.6.3)) postcss: - specifier: ^8.4.41 + specifier: catalog:tailwind version: 8.4.47 postcss-loader: - specifier: ^8.1.1 + specifier: catalog:storybook version: 8.1.1(postcss@8.4.47)(typescript@5.6.3)(webpack@5.95.0) relay-compiler: - specifier: ^16.2.0 + specifier: catalog:graphql version: 16.2.0 relay-test-utils: - specifier: ^17.0.0 + specifier: catalog:graphql version: 17.0.0 storybook: - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.3.6 style-loader: - specifier: ^4.0.0 + specifier: catalog:storybook version: 4.0.0(webpack@5.95.0) tailwindcss: - specifier: ^3.4.4 + specifier: catalog:tailwind version: 3.4.14(ts-node@10.9.2(@swc/core@1.7.36(@swc/helpers@0.5.13))(@types/node@22.7.7)(typescript@5.6.3)) ts-jest: - specifier: ^29.1.4 + specifier: catalog:test version: 29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(esbuild@0.23.1)(jest@29.7.0(@types/node@22.7.7)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.7.36(@swc/helpers@0.5.13))(@types/node@22.7.7)(typescript@5.6.3)))(typescript@5.6.3) ts-node: - specifier: ^10.9.2 + specifier: catalog:test version: 10.9.2(@swc/core@1.7.36(@swc/helpers@0.5.13))(@types/node@22.7.7)(typescript@5.6.3) typescript: - specifier: ^5.4.5 + specifier: 'catalog:' version: 5.6.3 webpack: - specifier: ^5.93.0 + specifier: catalog:storybook version: 5.95.0(@swc/core@1.7.36(@swc/helpers@0.5.13))(esbuild@0.23.1)(webpack-cli@5.1.4) webpack-cli: - specifier: ^5.1.4 + specifier: catalog:storybook version: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.95.0) webpack-dev-server: - specifier: ^5.0.4 + specifier: catalog:storybook version: 5.1.0(webpack-cli@5.1.4)(webpack@5.95.0) packages/config: @@ -12285,6 +12333,8 @@ snapshots: '@parcel/logger': 2.12.0 '@parcel/utils': 2.12.0 lmdb: 2.8.5 + transitivePeerDependencies: + - '@swc/helpers' '@parcel/codeframe@2.12.0': dependencies: @@ -12388,7 +12438,7 @@ snapshots: '@parcel/source-map': 2.1.1 '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/utils': 2.12.0 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) abortcontroller-polyfill: 1.7.5 base-x: 3.0.10 browserslist: 4.24.0 @@ -12416,7 +12466,7 @@ snapshots: '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/utils': 2.12.0 '@parcel/watcher': 2.4.1 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) transitivePeerDependencies: - '@swc/helpers' @@ -12516,7 +12566,7 @@ snapshots: '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/rust': 2.12.0 '@parcel/utils': 2.12.0 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) transitivePeerDependencies: - '@swc/helpers' @@ -12549,9 +12599,9 @@ snapshots: '@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/logger': 2.12.0 '@parcel/node-resolver-core': 3.3.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) - '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) + '@parcel/types': 2.12.0(@parcel/core@2.12.0) '@parcel/utils': 2.12.0 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) '@swc/core': 1.7.36(@swc/helpers@0.5.13) semver: 7.6.3 transitivePeerDependencies: @@ -12631,6 +12681,7 @@ snapshots: '@parcel/plugin': 2.12.0(@parcel/core@2.12.0) transitivePeerDependencies: - '@parcel/core' + - '@swc/helpers' '@parcel/packager-wasm@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13)': dependencies: @@ -12651,6 +12702,7 @@ snapshots: '@parcel/types': 2.12.0(@parcel/core@2.12.0) transitivePeerDependencies: - '@parcel/core' + - '@swc/helpers' '@parcel/profiler@2.12.0': dependencies: @@ -12785,7 +12837,7 @@ snapshots: '@parcel/core': 2.12.0(@swc/helpers@0.5.13) '@parcel/plugin': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/utils': 2.12.0 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) nullthrows: 1.1.1 transitivePeerDependencies: - '@swc/helpers' @@ -12798,7 +12850,7 @@ snapshots: '@parcel/rust': 2.12.0 '@parcel/source-map': 2.1.1 '@parcel/utils': 2.12.0 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) '@swc/helpers': 0.5.13 browserslist: 4.24.0 nullthrows: 1.1.1 @@ -12881,6 +12933,7 @@ snapshots: typescript: 5.6.3 transitivePeerDependencies: - '@parcel/core' + - '@swc/helpers' '@parcel/ts-utils@2.12.0(typescript@5.6.3)': dependencies: @@ -12894,7 +12947,7 @@ snapshots: '@parcel/fs': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/package-manager': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) '@parcel/source-map': 2.1.1 - '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) + '@parcel/workers': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13)) utility-types: 3.11.0 transitivePeerDependencies: - '@parcel/core' @@ -12980,17 +13033,15 @@ snapshots: '@parcel/watcher-win32-ia32': 2.4.1 '@parcel/watcher-win32-x64': 2.4.1 - '@parcel/workers@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13)': + '@parcel/workers@2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))': dependencies: '@parcel/core': 2.12.0(@swc/helpers@0.5.13) '@parcel/diagnostic': 2.12.0 '@parcel/logger': 2.12.0 '@parcel/profiler': 2.12.0 - '@parcel/types': 2.12.0(@parcel/core@2.12.0(@swc/helpers@0.5.13))(@swc/helpers@0.5.13) + '@parcel/types': 2.12.0(@parcel/core@2.12.0) '@parcel/utils': 2.12.0 nullthrows: 1.1.1 - transitivePeerDependencies: - - '@swc/helpers' '@parcel/workers@2.12.0(@parcel/core@2.12.0)': dependencies: From d18d6fe64ad31fac368737713812e786e47b5774 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Thu, 28 Nov 2024 14:01:56 -0300 Subject: [PATCH 06/13] Temporarily remove catalogs to use GitHub version --- packages/components/package.json | 148 ++++++++++++++--------------- pnpm-lock.yaml | 157 +++++++++++++++---------------- 2 files changed, 148 insertions(+), 157 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 2e8f17f3..7d5d04c6 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -21,95 +21,95 @@ "test:unit": "jest --config ./jest.config.ts" }, "dependencies": { - "@hookform/resolvers": "catalog:", - "@mui/lab": "catalog:material-ui", - "@mui/material": "catalog:material-ui", - "@mui/system": "catalog:material-ui", - "@storybook/react": "catalog:storybook", - "@tanstack/react-query": "catalog:", + "@hookform/resolvers": "^3.6.0", + "@mui/lab": "^5.0.0-alpha.170", + "@mui/material": "^5.15.19", + "@mui/system": "^5.15.19", + "@storybook/react": "^8.2.8", + "@tanstack/react-query": "^5.45.1", "framer-motion": "^11.5.4", - "graphql": "catalog:graphql", - "js-cookie": "catalog:", - "luxon": "catalog:", - "next": "catalog:", - "react-hook-form": "catalog:", - "react-relay": "catalog:graphql", - "react-virtuoso": "catalog:", - "relay-runtime": "catalog:graphql", + "graphql": "^16.8.1", + "js-cookie": "^3.0.5", + "luxon": "^3.4.4", + "next": "14.3.0-canary.24", + "react-hook-form": "^7.51.5", + "react-relay": "^16.2.0", + "react-virtuoso": "^4.7.11", + "relay-runtime": "^16.2.0", "use-long-press": "^3.2.0", - "zod": "catalog:", - "zustand": "catalog:" + "zod": "^3.23.8", + "zustand": "^4.5.2" }, "peerDependencies": { "@baseapp-frontend/authentication": "workspace:*", "@baseapp-frontend/design-system": "workspace:*", "@baseapp-frontend/graphql": "workspace:*", "@baseapp-frontend/utils": "workspace:*", - "react": "catalog:react18", - "react-dom": "catalog:react18" + "react": "18.3.1", + "react-dom": "18.3.1" }, "devDependencies": { - "@babel/preset-env": "catalog:storybook", - "@babel/preset-react": "catalog:storybook", - "@babel/preset-typescript": "catalog:storybook", + "@babel/preset-env": "^7.24.7", + "@babel/preset-react": "^7.24.7", + "@babel/preset-typescript": "^7.24.7", "@baseapp-frontend/config": "workspace:*", "@baseapp-frontend/test": "workspace:*", "@baseapp-frontend/tsconfig": "workspace:*", - "@chromatic-com/storybook": "catalog:storybook", - "@cypress/webpack-dev-server": "catalog:test", - "@faker-js/faker": "catalog:test", - "@storybook/addon-docs": "catalog:storybook", - "@storybook/addon-essentials": "catalog:storybook", - "@storybook/addon-interactions": "catalog:storybook", - "@storybook/addon-links": "catalog:storybook", - "@storybook/addon-styling-webpack": "catalog:storybook", - "@storybook/addon-webpack5-compiler-babel": "catalog:storybook", - "@storybook/blocks": "catalog:storybook", - "@storybook/react-webpack5": "catalog:storybook", - "@storybook/test": "catalog:storybook", - "@tailwindcss/typography": "catalog:tailwind", - "@testing-library/cypress": "catalog:test", - "@testing-library/jest-dom": "catalog:test", - "@testing-library/react": "catalog:test", - "@testing-library/user-event": "catalog:test", - "@types/jest": "catalog:test", - "@types/js-cookie": "catalog:", - "@types/luxon": "catalog:", - "@types/react": "catalog:react18", - "@types/react-dom": "catalog:react18", - "@types/react-relay": "catalog:graphql", - "@types/relay-runtime": "catalog:graphql", - "@types/relay-test-utils": "catalog:graphql", - "autoprefixer": "catalog:tailwind", - "babel-jest": "catalog:test", - "babel-loader": "catalog:storybook", - "babel-plugin-relay": "catalog:graphql", - "css-loader": "catalog:storybook", - "cypress": "catalog:test", - "cypress-plugin-steps": "catalog:test", - "cypress-wait-until": "catalog:test", + "@chromatic-com/storybook": "^1.5.0", + "@cypress/webpack-dev-server": "^3.10.1", + "@faker-js/faker": "^9.0.3", + "@storybook/addon-docs": "^8.2.8", + "@storybook/addon-essentials": "^8.2.8", + "@storybook/addon-interactions": "^8.2.8", + "@storybook/addon-links": "^8.2.8", + "@storybook/addon-styling-webpack": "^1.0.0", + "@storybook/addon-webpack5-compiler-babel": "^3.0.3", + "@storybook/blocks": "^8.2.8", + "@storybook/react-webpack5": "^8.2.8", + "@storybook/test": "^8.2.8", + "@tailwindcss/typography": "^0.5.13", + "@testing-library/cypress": "^10.0.2", + "@testing-library/jest-dom": "^6.4.6", + "@testing-library/react": "^16.0.0", + "@testing-library/user-event": "^14.5.2", + "@types/jest": "^29.5.12", + "@types/js-cookie": "^3.0.6", + "@types/luxon": "^3.4.2", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "@types/react-relay": "^16.0.6", + "@types/relay-runtime": "^17.0.3", + "@types/relay-test-utils": "^14.1.4", + "autoprefixer": "^10.4.19", + "babel-jest": "^29.7.0", + "babel-loader": "^9.1.3", + "babel-plugin-relay": "^17.0.0", + "css-loader": "^7.1.2", + "cypress": "^13.13.3", + "cypress-plugin-steps": "^1.1.1", + "cypress-wait-until": "^3.0.2", "dotenv": "^16.4.5", "dotenv-cli": "^7.4.2", - "eslint-plugin-storybook": "catalog:lint", - "get-graphql-schema": "catalog:graphql", - "html-webpack-plugin": "catalog:storybook", - "jest": "catalog:test", - "jest-environment-jsdom": "catalog:test", - "msw": "catalog:storybook", - "msw-storybook-addon": "catalog:storybook", - "postcss": "catalog:tailwind", - "postcss-loader": "catalog:storybook", - "relay-compiler": "catalog:graphql", - "relay-test-utils": "catalog:graphql", - "storybook": "catalog:storybook", - "style-loader": "catalog:storybook", - "tailwindcss": "catalog:tailwind", - "ts-jest": "catalog:test", - "ts-node": "catalog:test", - "typescript": "catalog:", - "webpack": "catalog:storybook", - "webpack-cli": "catalog:storybook", - "webpack-dev-server": "catalog:storybook" + "eslint-plugin-storybook": "^0.8.0", + "get-graphql-schema": "^2.1.2", + "html-webpack-plugin": "^5.6.0", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "msw": "^2.3.1", + "msw-storybook-addon": "^2.0.2", + "postcss": "^8.4.41", + "postcss-loader": "^8.1.1", + "relay-compiler": "^16.2.0", + "relay-test-utils": "^17.0.0", + "storybook": "^8.2.8", + "style-loader": "^4.0.0", + "tailwindcss": "^3.4.4", + "ts-jest": "^29.1.4", + "ts-node": "^10.9.2", + "typescript": "^5.4.5", + "webpack": "^5.93.0", + "webpack-cli": "^5.1.4", + "webpack-dev-server": "^5.0.4" }, "license": "MIT", "repository": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 33433bdb..359523ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,9 +48,6 @@ catalogs: react-hook-form: specifier: ^7.51.5 version: 7.53.2 - react-virtuoso: - specifier: ^4.7.11 - version: 4.12.2 typescript: specifier: ^5.4.5 version: 5.7.2 @@ -292,9 +289,6 @@ catalogs: '@cypress/webpack-dev-server': specifier: ^3.10.1 version: 3.11.0 - '@faker-js/faker': - specifier: ^9.0.3 - version: 9.2.0 '@testing-library/cypress': specifier: ^10.0.2 version: 10.0.2 @@ -319,9 +313,6 @@ catalogs: cypress-plugin-steps: specifier: ^1.1.1 version: 1.1.1 - cypress-wait-until: - specifier: ^3.0.2 - version: 3.0.2 jest: specifier: ^29.7.0 version: 29.7.0 @@ -467,74 +458,74 @@ importers: specifier: workspace:* version: link:../utils '@hookform/resolvers': - specifier: 'catalog:' + specifier: ^3.6.0 version: 3.9.1(react-hook-form@7.53.2(react@18.3.1)) '@mui/lab': - specifier: catalog:material-ui + specifier: ^5.0.0-alpha.170 version: 5.0.0-alpha.173(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@emotion/styled@11.13.5(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@emotion/styled@11.13.5(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': - specifier: catalog:material-ui + specifier: ^5.15.19 version: 5.16.7(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@emotion/styled@11.13.5(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/system': - specifier: catalog:material-ui + specifier: ^5.15.19 version: 5.16.7(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@emotion/styled@11.13.5(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1) '@storybook/react': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.4.5(@storybook/test@8.4.5(storybook@8.4.5(prettier@3.4.1)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.5(prettier@3.4.1))(typescript@5.7.2) '@tanstack/react-query': - specifier: 'catalog:' + specifier: ^5.45.1 version: 5.61.4(react@18.3.1) framer-motion: specifier: ^11.5.4 version: 11.11.17(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) graphql: - specifier: catalog:graphql + specifier: ^16.8.1 version: 16.9.0 js-cookie: - specifier: 'catalog:' + specifier: ^3.0.5 version: 3.0.5 luxon: - specifier: 'catalog:' + specifier: ^3.4.4 version: 3.5.0 next: - specifier: 'catalog:' + specifier: 14.3.0-canary.24 version: 14.3.0-canary.24(@babel/core@7.26.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: - specifier: catalog:react18 + specifier: 18.3.1 version: 18.3.1 react-dom: - specifier: catalog:react18 + specifier: 18.3.1 version: 18.3.1(react@18.3.1) react-hook-form: - specifier: 'catalog:' + specifier: ^7.51.5 version: 7.53.2(react@18.3.1) react-relay: - specifier: catalog:graphql + specifier: ^16.2.0 version: 16.2.0(react@18.3.1) react-virtuoso: - specifier: 'catalog:' + specifier: ^4.7.11 version: 4.12.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) relay-runtime: - specifier: catalog:graphql + specifier: ^16.2.0 version: 16.2.0 use-long-press: specifier: ^3.2.0 version: 3.2.0(react@18.3.1) zod: - specifier: 'catalog:' + specifier: ^3.23.8 version: 3.23.8 zustand: - specifier: 'catalog:' + specifier: ^4.5.2 version: 4.5.5(@types/react@18.3.12)(react@18.3.1) devDependencies: '@babel/preset-env': - specifier: catalog:storybook + specifier: ^7.24.7 version: 7.26.0(@babel/core@7.26.0) '@babel/preset-react': - specifier: catalog:storybook + specifier: ^7.24.7 version: 7.25.9(@babel/core@7.26.0) '@babel/preset-typescript': - specifier: catalog:storybook + specifier: ^7.24.7 version: 7.26.0(@babel/core@7.26.0) '@baseapp-frontend/config': specifier: workspace:* @@ -546,103 +537,103 @@ importers: specifier: workspace:* version: link:../tsconfig '@chromatic-com/storybook': - specifier: catalog:storybook + specifier: ^1.5.0 version: 1.9.0(react@18.3.1) '@cypress/webpack-dev-server': - specifier: catalog:test + specifier: ^3.10.1 version: 3.11.0(webpack-cli@5.1.4)(webpack@5.96.1) '@faker-js/faker': - specifier: catalog:test + specifier: ^9.0.3 version: 9.2.0 '@storybook/addon-docs': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.4.5(@types/react@18.3.12)(storybook@8.4.5(prettier@3.4.1)) '@storybook/addon-essentials': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.4.5(@types/react@18.3.12)(storybook@8.4.5(prettier@3.4.1)) '@storybook/addon-interactions': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.4.5(storybook@8.4.5(prettier@3.4.1)) '@storybook/addon-links': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.4.5(react@18.3.1)(storybook@8.4.5(prettier@3.4.1)) '@storybook/addon-styling-webpack': - specifier: catalog:storybook + specifier: ^1.0.0 version: 1.0.1(storybook@8.4.5(prettier@3.4.1))(webpack@5.96.1) '@storybook/addon-webpack5-compiler-babel': - specifier: catalog:storybook + specifier: ^3.0.3 version: 3.0.3(webpack@5.96.1) '@storybook/blocks': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.5(prettier@3.4.1)) '@storybook/react-webpack5': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.4.5(@storybook/test@8.4.5(storybook@8.4.5(prettier@3.4.1)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.5(prettier@3.4.1))(typescript@5.7.2)(webpack-cli@5.1.4) '@storybook/test': - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.4.5(storybook@8.4.5(prettier@3.4.1)) '@tailwindcss/typography': - specifier: catalog:tailwind + specifier: ^0.5.13 version: 0.5.15(tailwindcss@3.4.15(ts-node@10.9.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(@types/node@22.10.0)(typescript@5.7.2))) '@testing-library/cypress': - specifier: catalog:test + specifier: ^10.0.2 version: 10.0.2(cypress@13.16.0) '@testing-library/jest-dom': - specifier: catalog:test + specifier: ^6.4.6 version: 6.6.3 '@testing-library/react': - specifier: catalog:test + specifier: ^16.0.0 version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@testing-library/user-event': - specifier: catalog:test + specifier: ^14.5.2 version: 14.5.2(@testing-library/dom@10.4.0) '@types/jest': - specifier: catalog:test + specifier: ^29.5.12 version: 29.5.14 '@types/js-cookie': - specifier: 'catalog:' + specifier: ^3.0.6 version: 3.0.6 '@types/luxon': - specifier: 'catalog:' + specifier: ^3.4.2 version: 3.4.2 '@types/react': - specifier: catalog:react18 + specifier: ^18.3.3 version: 18.3.12 '@types/react-dom': - specifier: catalog:react18 + specifier: ^18.3.0 version: 18.3.1 '@types/react-relay': - specifier: catalog:graphql + specifier: ^16.0.6 version: 16.0.6 '@types/relay-runtime': - specifier: catalog:graphql + specifier: ^17.0.3 version: 17.0.4 '@types/relay-test-utils': - specifier: catalog:graphql + specifier: ^14.1.4 version: 14.1.4 autoprefixer: - specifier: catalog:tailwind + specifier: ^10.4.19 version: 10.4.20(postcss@8.4.49) babel-jest: - specifier: catalog:test + specifier: ^29.7.0 version: 29.7.0(@babel/core@7.26.0) babel-loader: - specifier: catalog:storybook + specifier: ^9.1.3 version: 9.2.1(@babel/core@7.26.0)(webpack@5.96.1) babel-plugin-relay: - specifier: catalog:graphql + specifier: ^17.0.0 version: 17.0.0 css-loader: - specifier: catalog:storybook + specifier: ^7.1.2 version: 7.1.2(webpack@5.96.1) cypress: - specifier: catalog:test + specifier: ^13.13.3 version: 13.16.0 cypress-plugin-steps: - specifier: catalog:test + specifier: ^1.1.1 version: 1.1.1(cypress@13.16.0) cypress-wait-until: - specifier: catalog:test + specifier: ^3.0.2 version: 3.0.2 dotenv: specifier: ^16.4.5 @@ -651,64 +642,64 @@ importers: specifier: ^7.4.2 version: 7.4.4 eslint-plugin-storybook: - specifier: catalog:lint + specifier: ^0.8.0 version: 0.8.0(eslint@8.57.1)(typescript@5.7.2) get-graphql-schema: - specifier: catalog:graphql + specifier: ^2.1.2 version: 2.1.2 html-webpack-plugin: - specifier: catalog:storybook + specifier: ^5.6.0 version: 5.6.3(webpack@5.96.1) jest: - specifier: catalog:test + specifier: ^29.7.0 version: 29.7.0(@types/node@22.10.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(@types/node@22.10.0)(typescript@5.7.2)) jest-environment-jsdom: - specifier: catalog:test + specifier: ^29.7.0 version: 29.7.0 msw: - specifier: catalog:storybook + specifier: ^2.3.1 version: 2.6.6(@types/node@22.10.0)(typescript@5.7.2) msw-storybook-addon: - specifier: catalog:storybook + specifier: ^2.0.2 version: 2.0.4(msw@2.6.6(@types/node@22.10.0)(typescript@5.7.2)) postcss: - specifier: catalog:tailwind + specifier: ^8.4.41 version: 8.4.49 postcss-loader: - specifier: catalog:storybook + specifier: ^8.1.1 version: 8.1.1(postcss@8.4.49)(typescript@5.7.2)(webpack@5.96.1) relay-compiler: - specifier: catalog:graphql + specifier: ^16.2.0 version: 16.2.0 relay-test-utils: - specifier: catalog:graphql + specifier: ^17.0.0 version: 17.0.0 storybook: - specifier: catalog:storybook + specifier: ^8.2.8 version: 8.4.5(prettier@3.4.1) style-loader: - specifier: catalog:storybook + specifier: ^4.0.0 version: 4.0.0(webpack@5.96.1) tailwindcss: - specifier: catalog:tailwind + specifier: ^3.4.4 version: 3.4.15(ts-node@10.9.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(@types/node@22.10.0)(typescript@5.7.2)) ts-jest: - specifier: catalog:test + specifier: ^29.1.4 version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.0)(jest@29.7.0(@types/node@22.10.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(@types/node@22.10.0)(typescript@5.7.2)))(typescript@5.7.2) ts-node: - specifier: catalog:test + specifier: ^10.9.2 version: 10.9.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(@types/node@22.10.0)(typescript@5.7.2) typescript: - specifier: 'catalog:' + specifier: ^5.4.5 version: 5.7.2 webpack: - specifier: catalog:storybook + specifier: ^5.93.0 version: 5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) webpack-cli: - specifier: catalog:storybook + specifier: ^5.1.4 version: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.96.1) webpack-dev-server: - specifier: catalog:storybook + specifier: ^5.0.4 version: 5.1.0(webpack-cli@5.1.4)(webpack@5.96.1) packages/config: From 2476ed24f8bd852bce44aacdf4c16254d1722e2a Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Thu, 28 Nov 2024 15:30:53 -0300 Subject: [PATCH 07/13] BA-1777-fe-multiple-profiles-member-list --- .../modules/profiles/Members/MemberItem/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/modules/profiles/Members/MemberItem/index.tsx b/packages/components/modules/profiles/Members/MemberItem/index.tsx index abe5efad..e343c79a 100644 --- a/packages/components/modules/profiles/Members/MemberItem/index.tsx +++ b/packages/components/modules/profiles/Members/MemberItem/index.tsx @@ -3,7 +3,7 @@ import { FC } from 'react' import { AvatarWithPlaceholder } from '@baseapp-frontend/design-system' import { Box, Button, Typography } from '@mui/material' -import { readInlineData } from 'react-relay' +import { useFragment } from 'react-relay' import { ProfileItemFragment$key } from '../../../../__generated__/ProfileItemFragment.graphql' import { ProfileItemFragment } from '../../graphql/queries/ProfileItem' @@ -20,8 +20,8 @@ const MemberItem: FC = ({ avatarWidth = 40, avatarHeight = 40, }) => { - if (!member) return null - const memberProfile = readInlineData(ProfileItemFragment, member) + const memberProfile = useFragment(ProfileItemFragment, member) + if (!memberProfile) return null return ( From 4852c835dfff41228cf377a2c686378e7f9a8319 Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Thu, 28 Nov 2024 17:46:04 -0300 Subject: [PATCH 08/13] update schema --- packages/components/schema.graphql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/schema.graphql b/packages/components/schema.graphql index 6a177de7..61c0cd02 100644 --- a/packages/components/schema.graphql +++ b/packages/components/schema.graphql @@ -1227,7 +1227,7 @@ type Profile implements Node & PermissionsInterface & PageInterface & FollowsInt reactions(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReactionConnection! ratings(offset: Int, before: String, after: String, first: Int, last: Int): RateConnection! user: User - members(offset: Int, before: String, after: String, first: Int, last: Int, role: ProfileRoles): ProfileUserRoleConnection + members(orderByStatus: String, offset: Int, before: String, after: String, first: Int, last: Int, role: ProfileRoles): ProfileUserRoleConnection chatroomparticipantSet(offset: Int, before: String, after: String, first: Int, last: Int, profile_TargetContentType: ID): ChatRoomParticipantConnection! messageSet(offset: Int, before: String, after: String, first: Int, last: Int, verb: Verbs): MessageConnection! following(offset: Int, before: String, after: String, first: Int, last: Int, targetIsFollowingBack: Boolean): FollowConnection From 68de6e098343e569208e648846150915a92f640c Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Mon, 2 Dec 2024 10:10:46 -0300 Subject: [PATCH 09/13] BA-1777-fe-multiple-profiles-member-list --- .../MemberItemFragment.graphql.ts | 97 ++ .../UserMembersListFragment.graphql.ts | 140 +-- .../UserMembersListPaginationQuery.graphql.ts | 6 +- ...embersListPaginationRefetchable.graphql.ts | 8 +- .../profiles/Members/MemberItem/index.tsx | 17 +- .../profiles/Members/MemberItem/styled.tsx | 4 +- .../profiles/Members/MemberItem/types.ts | 11 +- .../profiles/Members/MemberListItem/index.tsx | 77 ++ .../profiles/Members/MemberListItem/types.ts | 14 + .../profiles/Members/MembersList/index.tsx | 62 +- .../modules/profiles/Members/index.tsx | 15 +- .../modules/profiles/Members/styled.tsx | 7 - .../modules/profiles/Members/types.ts | 1 + .../profiles/graphql/queries/MemberItem.ts | 14 + .../graphql/queries/UserMembersList.ts | 9 +- packages/components/schema.graphql | 934 +++++------------- 16 files changed, 490 insertions(+), 926 deletions(-) create mode 100644 packages/components/__generated__/MemberItemFragment.graphql.ts create mode 100644 packages/components/modules/profiles/Members/MemberListItem/index.tsx create mode 100644 packages/components/modules/profiles/Members/MemberListItem/types.ts delete mode 100644 packages/components/modules/profiles/Members/styled.tsx create mode 100644 packages/components/modules/profiles/graphql/queries/MemberItem.ts diff --git a/packages/components/__generated__/MemberItemFragment.graphql.ts b/packages/components/__generated__/MemberItemFragment.graphql.ts new file mode 100644 index 00000000..e82bc5cc --- /dev/null +++ b/packages/components/__generated__/MemberItemFragment.graphql.ts @@ -0,0 +1,97 @@ +/** + * @generated SignedSource<<15dc9b53215c47ddbaac982d5c81d426>> + * @lightSyntaxTransform + * @nogrep + */ + +/* tslint:disable */ + +/* eslint-disable */ +// @ts-nocheck +import { Fragment, ReaderFragment } from 'relay-runtime' +import { FragmentRefs } from 'relay-runtime' + +export type ProfileRoleStatus = 'ACTIVE' | 'INACTIVE' | 'PENDING' | '%future added value' +export type ProfileRoles = 'ADMIN' | 'MANAGER' | '%future added value' + +export type MemberItemFragment$data = { + readonly id: string + readonly role: ProfileRoles | null | undefined + readonly status: ProfileRoleStatus | null | undefined + readonly user: { + readonly profile: + | { + readonly ' $fragmentSpreads': FragmentRefs<'ProfileItemFragment'> + } + | null + | undefined + } + readonly ' $fragmentType': 'MemberItemFragment' +} +export type MemberItemFragment$key = { + readonly ' $data'?: MemberItemFragment$data + readonly ' $fragmentSpreads': FragmentRefs<'MemberItemFragment'> +} + +const node: ReaderFragment = { + argumentDefinitions: [], + kind: 'Fragment', + metadata: null, + name: 'MemberItemFragment', + selections: [ + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'id', + storageKey: null, + }, + { + alias: null, + args: null, + concreteType: 'User', + kind: 'LinkedField', + name: 'user', + plural: false, + selections: [ + { + alias: null, + args: null, + concreteType: 'Profile', + kind: 'LinkedField', + name: 'profile', + plural: false, + selections: [ + { + args: null, + kind: 'FragmentSpread', + name: 'ProfileItemFragment', + }, + ], + storageKey: null, + }, + ], + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'role', + storageKey: null, + }, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'status', + storageKey: null, + }, + ], + type: 'ProfileUserRole', + abstractKey: null, +} + +;(node as any).hash = 'bd85958690e77e1ccd3a6cc89ce44335' + +export default node diff --git a/packages/components/__generated__/UserMembersListFragment.graphql.ts b/packages/components/__generated__/UserMembersListFragment.graphql.ts index 9d3fed13..9bdc68b7 100644 --- a/packages/components/__generated__/UserMembersListFragment.graphql.ts +++ b/packages/components/__generated__/UserMembersListFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<582eaebcebe39f8edc4ba01236f43897>> * @lightSyntaxTransform * @nogrep */ @@ -11,9 +11,6 @@ import { ReaderFragment, RefetchableFragment } from 'relay-runtime' import { FragmentRefs } from 'relay-runtime' -export type ProfileRoleStatus = 'ACTIVE' | 'INACTIVE' | 'PENDING' | '%future added value' -export type ProfileRoles = 'ADMIN' | 'MANAGER' | '%future added value' - export type UserMembersListFragment$data = { readonly id: string readonly members: @@ -22,17 +19,7 @@ export type UserMembersListFragment$data = { | { readonly node: | { - readonly id: string - readonly role: ProfileRoles | null | undefined - readonly status: ProfileRoleStatus | null | undefined - readonly user: { - readonly profile: - | { - readonly ' $fragmentSpreads': FragmentRefs<'ProfileItemFragment'> - } - | null - | undefined - } + readonly ' $fragmentSpreads': FragmentRefs<'MemberItemFragment'> } | null | undefined @@ -57,77 +44,7 @@ export type UserMembersListFragment$key = { } const node: ReaderFragment = (function () { - var v0 = ['members'], - v1 = { - alias: null, - args: null, - kind: 'ScalarField', - name: 'id', - storageKey: null, - }, - v2 = { - kind: 'InlineDataFragmentSpread', - name: 'ProfileItemFragment', - selections: [ - v1 /*: any*/, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'name', - storageKey: null, - }, - { - alias: null, - args: [ - { - kind: 'Literal', - name: 'height', - value: 100, - }, - { - kind: 'Literal', - name: 'width', - value: 100, - }, - ], - concreteType: 'File', - kind: 'LinkedField', - name: 'image', - plural: false, - selections: [ - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'url', - storageKey: null, - }, - ], - storageKey: 'image(height:100,width:100)', - }, - { - alias: null, - args: null, - concreteType: 'URLPath', - kind: 'LinkedField', - name: 'urlPath', - plural: false, - selections: [ - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'path', - storageKey: null, - }, - ], - storageKey: null, - }, - ], - args: null, - argumentDefinitions: [] /*: any*/, - } + var v0 = ['members'] return { argumentDefinitions: [ { @@ -175,7 +92,11 @@ const node: ReaderFragment = (function () { }, name: 'UserMembersListFragment', selections: [ - v2 /*: any*/, + { + args: null, + kind: 'FragmentSpread', + name: 'ProfileItemFragment', + }, { alias: 'members', args: [ @@ -213,41 +134,10 @@ const node: ReaderFragment = (function () { name: 'node', plural: false, selections: [ - v1 /*: any*/, - { - alias: null, - args: null, - concreteType: 'User', - kind: 'LinkedField', - name: 'user', - plural: false, - selections: [ - { - alias: null, - args: null, - concreteType: 'Profile', - kind: 'LinkedField', - name: 'profile', - plural: false, - selections: [v2 /*: any*/], - storageKey: null, - }, - ], - storageKey: null, - }, - { - alias: null, - args: null, - kind: 'ScalarField', - name: 'role', - storageKey: null, - }, { - alias: null, args: null, - kind: 'ScalarField', - name: 'status', - storageKey: null, + kind: 'FragmentSpread', + name: 'MemberItemFragment', }, { alias: null, @@ -297,13 +187,19 @@ const node: ReaderFragment = (function () { ], storageKey: null, }, - v1 /*: any*/, + { + alias: null, + args: null, + kind: 'ScalarField', + name: 'id', + storageKey: null, + }, ], type: 'Profile', abstractKey: null, } })() -;(node as any).hash = '038f3f85d02ec3d5e31279acd14c0269' +;(node as any).hash = '48972fa30cfc1866f92aae70b6fc83cb' export default node diff --git a/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts b/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts index a4ace9bf..d4e1a092 100644 --- a/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts +++ b/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -338,12 +338,12 @@ const node: ConcreteRequest = (function () { ], }, params: { - cacheID: '9b67c794489795c15c6ba25fca17e848', + cacheID: 'c2fccba42ccf5cc5af537fbaa16aec37', id: null, metadata: {}, name: 'UserMembersListPaginationQuery', operationKind: 'query', - text: 'query UserMembersListPaginationQuery(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String\n $profileId: ID!\n) {\n profile(id: $profileId) {\n pk\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on Profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n}\n', + text: 'query UserMembersListPaginationQuery(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String\n $profileId: ID!\n) {\n profile(id: $profileId) {\n pk\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment MemberItemFragment on ProfileUserRole {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on Profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n ...MemberItemFragment\n id\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n}\n', }, } })() diff --git a/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts b/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts index 74bdd7b1..f0b09c74 100644 --- a/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts +++ b/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<68687e846777bc425817ef6bdefdb60c>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -340,16 +340,16 @@ const node: ConcreteRequest = (function () { ], }, params: { - cacheID: '4b1dca117f539126bf6f6bde7a7171d3', + cacheID: '1cec1c6fc23db6005c95d0fc9d8a0cd5', id: null, metadata: {}, name: 'userMembersListPaginationRefetchable', operationKind: 'query', - text: 'query userMembersListPaginationRefetchable(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String = "custom"\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on Profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n}\n', + text: 'query userMembersListPaginationRefetchable(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String = "custom"\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment MemberItemFragment on ProfileUserRole {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on Profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n ...MemberItemFragment\n id\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n}\n', }, } })() -;(node as any).hash = '038f3f85d02ec3d5e31279acd14c0269' +;(node as any).hash = '48972fa30cfc1866f92aae70b6fc83cb' export default node diff --git a/packages/components/modules/profiles/Members/MemberItem/index.tsx b/packages/components/modules/profiles/Members/MemberItem/index.tsx index e343c79a..e3a07553 100644 --- a/packages/components/modules/profiles/Members/MemberItem/index.tsx +++ b/packages/components/modules/profiles/Members/MemberItem/index.tsx @@ -21,6 +21,7 @@ const MemberItem: FC = ({ avatarHeight = 40, }) => { const memberProfile = useFragment(ProfileItemFragment, member) + const hasStatusAndRole = status && memberRole if (!memberProfile) return null return ( @@ -39,13 +40,15 @@ const MemberItem: FC = ({ - - - + {hasStatusAndRole && ( + + + + )} ) } diff --git a/packages/components/modules/profiles/Members/MemberItem/styled.tsx b/packages/components/modules/profiles/Members/MemberItem/styled.tsx index 0eb56ddb..17f424c0 100644 --- a/packages/components/modules/profiles/Members/MemberItem/styled.tsx +++ b/packages/components/modules/profiles/Members/MemberItem/styled.tsx @@ -1,6 +1,6 @@ import { Box, styled } from '@mui/material' -import { IMemberPersonalInformation } from './types' +import { MemberPersonalInformationProps } from './types' export const MemberItemContainer = styled(Box)(({ theme }) => ({ display: 'flex', @@ -12,7 +12,7 @@ export const MemberItemContainer = styled(Box)(({ theme }) => ({ export const MemberPersonalInformation = styled(Box, { shouldForwardProp: (prop) => prop !== 'isActive', -})(({ isActive, theme }) => ({ +})(({ isActive, theme }) => ({ opacity: isActive ? 1 : 0.6, display: 'flex', gap: theme.spacing(1.5), diff --git a/packages/components/modules/profiles/Members/MemberItem/types.ts b/packages/components/modules/profiles/Members/MemberItem/types.ts index 58fbf521..072a903e 100644 --- a/packages/components/modules/profiles/Members/MemberItem/types.ts +++ b/packages/components/modules/profiles/Members/MemberItem/types.ts @@ -1,19 +1,16 @@ import type { AvatarProps, BoxProps } from '@mui/material' +import { MemberItemFragment$data } from '../../../../__generated__/MemberItemFragment.graphql' import type { ProfileItemFragment$key } from '../../../../__generated__/ProfileItemFragment.graphql' -import type { - ProfileRoleStatus, - ProfileRoles, -} from '../../../../__generated__/UserMembersListFragment.graphql' -export interface IMemberPersonalInformation extends BoxProps { +export interface MemberPersonalInformationProps extends BoxProps { isActive: boolean } export interface MemberItemProps { member: ProfileItemFragment$key | null | undefined - memberRole: ProfileRoles | 'owner' - status: ProfileRoleStatus + memberRole: MemberItemFragment$data['role'] | 'owner' + status: MemberItemFragment$data['status'] avatarProps?: AvatarProps avatarWidth?: number avatarHeight?: number diff --git a/packages/components/modules/profiles/Members/MemberListItem/index.tsx b/packages/components/modules/profiles/Members/MemberListItem/index.tsx new file mode 100644 index 00000000..aa9d1bf7 --- /dev/null +++ b/packages/components/modules/profiles/Members/MemberListItem/index.tsx @@ -0,0 +1,77 @@ +import { FC } from 'react' + +import { Divider } from '@mui/material' +import { useFragment } from 'react-relay' + +import { MemberItemFragment } from '../../graphql/queries/MemberItem' +import { MemberStatuses } from '../constants' +import { MemberListItemProps } from './types' + +const MemberListItem: FC = ({ + member, + data, + prevMember, + nextMember, + MemberItemComponent, + memberItemComponentProps, +}) => { + const memberFragment = useFragment(MemberItemFragment, member) + const nextMemberFragment = useFragment(MemberItemFragment, nextMember) + const prevMemberFragment = useFragment(MemberItemFragment, prevMember) + const isActiveMember = memberFragment.status === MemberStatuses.active + const isPreviousMemberInactive = prevMemberFragment?.status !== MemberStatuses.active + const isPreviousMemberUndefined = !prevMemberFragment?.status + const isNextMemberUndefined = !nextMemberFragment?.status + const isFirstActiveMember = + (isActiveMember && isPreviousMemberInactive) || (isActiveMember && isPreviousMemberUndefined) + const isLastMemberInactive = !isActiveMember && isNextMemberUndefined + if (!memberFragment) return null + if (isFirstActiveMember) { + return ( + <> + + + + + ) + } + if (isLastMemberInactive) { + return ( + <> + + + + + ) + } + return ( + + ) +} + +export default MemberListItem diff --git a/packages/components/modules/profiles/Members/MemberListItem/types.ts b/packages/components/modules/profiles/Members/MemberListItem/types.ts new file mode 100644 index 00000000..a86305b8 --- /dev/null +++ b/packages/components/modules/profiles/Members/MemberListItem/types.ts @@ -0,0 +1,14 @@ +import { FC } from 'react' + +import { MemberItemFragment$key } from '../../../../__generated__/MemberItemFragment.graphql' +import { UserMembersListFragment$data } from '../../../../__generated__/UserMembersListFragment.graphql' +import { MemberItemProps } from '../MemberItem/types' + +export interface MemberListItemProps { + member: MemberItemFragment$key + data: UserMembersListFragment$data + prevMember: MemberItemFragment$key | null | undefined + nextMember: MemberItemFragment$key | null | undefined + MemberItemComponent: FC + memberItemComponentProps?: Partial +} diff --git a/packages/components/modules/profiles/Members/MembersList/index.tsx b/packages/components/modules/profiles/Members/MembersList/index.tsx index 9628bd56..c4381a6e 100644 --- a/packages/components/modules/profiles/Members/MembersList/index.tsx +++ b/packages/components/modules/profiles/Members/MembersList/index.tsx @@ -2,18 +2,20 @@ import { FC, useMemo } from 'react' import { LoadingState as DefaultLoadingState } from '@baseapp-frontend/design-system' -import { Box, Divider, Typography } from '@mui/material' +import { Box, Typography } from '@mui/material' import { usePaginationFragment } from 'react-relay' import { Virtuoso } from 'react-virtuoso' import { UserMembersListFragment } from '../../graphql/queries/UserMembersList' import DefaultMemberItem from '../MemberItem' +import MemberListItem from '../MemberListItem' import { MemberStatuses, NUMBER_OF_MEMBERS_TO_LOAD_NEXT } from '../constants' import { MemberListProps } from '../types' const MembersList: FC = ({ userRef, MemberItem = DefaultMemberItem, + MemberItemProps = {}, LoadingState = DefaultLoadingState, LoadingStateProps = {}, membersContainerHeight = 400, @@ -40,46 +42,16 @@ const MembersList: FC = ({ ) } - const renderMemberItem = (member: any, index: number) => { - if (!member) return null - if ( - (member.status === MemberStatuses.active && - members[index - 1]?.status !== MemberStatuses.active) || - (member.status === MemberStatuses.active && !members[index - 1]?.status) - ) { - return ( - <> - - - - - ) - } - if (member.status !== MemberStatuses.active && !members[index + 1]?.status) { - return ( - <> - - - - - ) - } - return ( - - ) - } + const renderMemberItem = (member: any, index: number) => ( + + ) if (members.length === 0) { return ( @@ -94,11 +66,9 @@ const MembersList: FC = ({ return ( <> - {data.members?.totalCount && ( - - {(data.members?.totalCount ?? 0) + 1} members - - )} + + {(data.members?.totalCount ?? 0) + 1} members + ( - <> - {Array.from({ length: NUMBER_OF_MEMBERS_ON_FIRST_LOAD }).map((_, index) => ( - - ))} - -) - const Members: FC = ({ MemberItem, LoadingState, @@ -58,7 +45,7 @@ const MembersSuspended: FC = ({ MemberItem = DefaultMemberItem, LoadingState = DefaultLoadingState, LoadingStateProps = {}, - InitialLoadingState = DefaultInitialLoadingState, + InitialLoadingState = DefaultLoadingState, membersContainerHeight = 400, }) => ( <> diff --git a/packages/components/modules/profiles/Members/styled.tsx b/packages/components/modules/profiles/Members/styled.tsx deleted file mode 100644 index eddb6b63..00000000 --- a/packages/components/modules/profiles/Members/styled.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { Skeleton, styled } from '@mui/material' - -export const MemberItemSkeleton = styled(Skeleton)(({ theme }) => ({ - width: '100%', - height: 52, - borderRadius: theme.spacing(0.75), -})) diff --git a/packages/components/modules/profiles/Members/types.ts b/packages/components/modules/profiles/Members/types.ts index 96bcd391..b1c06a40 100644 --- a/packages/components/modules/profiles/Members/types.ts +++ b/packages/components/modules/profiles/Members/types.ts @@ -7,6 +7,7 @@ import type { MemberItemProps } from './MemberItem/types' export interface MemberListProps { MemberItem: FC + MemberItemProps?: Partial userRef: UserMembersListFragment$key LoadingState: FC LoadingStateProps: LoadingStateProps diff --git a/packages/components/modules/profiles/graphql/queries/MemberItem.ts b/packages/components/modules/profiles/graphql/queries/MemberItem.ts new file mode 100644 index 00000000..9851ef27 --- /dev/null +++ b/packages/components/modules/profiles/graphql/queries/MemberItem.ts @@ -0,0 +1,14 @@ +import { graphql } from 'react-relay' + +export const MemberItemFragment = graphql` + fragment MemberItemFragment on ProfileUserRole { + id + user { + profile { + ...ProfileItemFragment + } + } + role + status + } +` diff --git a/packages/components/modules/profiles/graphql/queries/UserMembersList.ts b/packages/components/modules/profiles/graphql/queries/UserMembersList.ts index 0b9f7290..2b39d06a 100644 --- a/packages/components/modules/profiles/graphql/queries/UserMembersList.ts +++ b/packages/components/modules/profiles/graphql/queries/UserMembersList.ts @@ -29,14 +29,7 @@ export const UserMembersListFragment = graphql` totalCount edges { node { - id - user { - profile { - ...ProfileItemFragment - } - } - role - status + ...MemberItemFragment } } pageInfo { diff --git a/packages/components/schema.graphql b/packages/components/schema.graphql index 61c0cd02..6e3423a2 100644 --- a/packages/components/schema.graphql +++ b/packages/components/schema.graphql @@ -1,42 +1,11 @@ -""" -Exposes a URL that specifies the behaviour of this scalar. -""" +"""Exposes a URL that specifies the behaviour of this scalar.""" directive @specifiedBy( - """ - The URL that specifies the behaviour of this scalar. - """ + """The URL that specifies the behaviour of this scalar.""" url: String! ) on SCALAR -""" -An enumeration. -""" -enum BaseappNotificationsNotificationLevelChoices { - """ - success - """ - SUCCESS - - """ - info - """ - INFO - - """ - warning - """ - WARNING - - """ - error - """ - ERROR -} - type Block implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! created: DateTime! modified: DateTime! @@ -47,38 +16,26 @@ type Block implements Node { } type BlockConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [BlockEdge]! totalCount: Int edgeCount: Int } -""" -A Relay edge containing a `Block` and its cursor. -""" +"""A Relay edge containing a `Block` and its cursor.""" type BlockEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: Block - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } interface BlocksInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! blockers(offset: Int, before: String, after: String, first: Int, last: Int): BlockConnection blocking(offset: Int, before: String, after: String, first: Int, last: Int): BlockConnection @@ -94,9 +51,7 @@ input BlockToggleInput { } type BlockTogglePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug block: BlockEdge @@ -107,42 +62,23 @@ type BlockTogglePayload { } type ChatRoom implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! title: String image(width: Int!, height: Int!): File lastMessage: Message lastMessageTime: DateTime - participants( - offset: Int - before: String - after: String - first: Int - last: Int - ): ChatRoomParticipantConnection + participants(offset: Int, before: String, after: String, first: Int, last: Int): ChatRoomParticipantConnection pk: Int! - allMessages( - offset: Int - before: String - after: String - first: Int - last: Int - verb: Verbs - ): MessageConnection + allMessages(offset: Int, before: String, after: String, first: Int, last: Int, verb: Verbs): MessageConnection unreadMessagesCount(profileId: ID): Int } type ChatRoomConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [ChatRoomEdge]! totalCount: Int edgeCount: Int @@ -155,9 +91,7 @@ input ChatRoomCreateInput { } type ChatRoomCreatePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug room: ChatRoomEdge @@ -165,18 +99,12 @@ type ChatRoomCreatePayload { clientMutationId: String } -""" -A Relay edge containing a `ChatRoom` and its cursor. -""" +"""A Relay edge containing a `ChatRoom` and its cursor.""" type ChatRoomEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: ChatRoom - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } @@ -193,40 +121,28 @@ type ChatRoomOnRoomUpdate { } type ChatRoomParticipant implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! profile: Profile pk: Int! } type ChatRoomParticipantConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [ChatRoomParticipantEdge]! totalCount: Int edgeCount: Int } -""" -A Relay edge containing a `ChatRoomParticipant` and its cursor. -""" +"""A Relay edge containing a `ChatRoomParticipant` and its cursor.""" type ChatRoomParticipantEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: ChatRoomParticipant - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } @@ -238,9 +154,7 @@ input ChatRoomReadMessagesInput { } type ChatRoomReadMessagesPayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug room: ChatRoom @@ -258,9 +172,7 @@ input ChatRoomSendMessageInput { } type ChatRoomSendMessagePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug message: MessageEdge @@ -268,9 +180,7 @@ type ChatRoomSendMessagePayload { } interface ChatRoomsInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! chatRooms( offset: Int @@ -280,9 +190,7 @@ interface ChatRoomsInterface { last: Int q: String - """ - Ordering - """ + """Ordering""" orderBy: String profileId: String unreadMessages: Boolean @@ -297,18 +205,14 @@ type Comment implements Node & CommentsInterface & ReactionsInterface & Permissi profile: Profile body: String - """ - languaged used in the comment - """ + """languaged used in the comment""" language: String isEdited: Boolean! isPinned: Boolean! inReplyTo: Comment status: CommentStatus - """ - The ID of the object - """ + """The ID of the object""" id: ID! commentsCount: CommentsCount! comments( @@ -319,21 +223,12 @@ type Comment implements Node & CommentsInterface & ReactionsInterface & Permissi last: Int q: String - """ - Ordering - """ + """Ordering""" orderBy: String ): CommentConnection isCommentsEnabled: Boolean! reactionsCount: ReactionsCount - reactions( - offset: Int - before: String - after: String - first: Int - last: Int - id: ID - ): ReactionConnection + reactions(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReactionConnection isReactionsEnabled: Boolean! myReaction(profileId: ID): Reaction @@ -346,14 +241,10 @@ type Comment implements Node & CommentsInterface & ReactionsInterface & Permissi } type CommentConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [CommentEdge]! totalCount: Int edgeCount: Int @@ -368,9 +259,7 @@ input CommentCreateInput { } type CommentCreatePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug comment: CommentEdge @@ -383,9 +272,7 @@ input CommentDeleteInput { } type CommentDeletePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug deletedId: ID @@ -394,18 +281,12 @@ type CommentDeletePayload { clientMutationId: String } -""" -A Relay edge containing a `Comment` and its cursor. -""" +"""A Relay edge containing a `Comment` and its cursor.""" type CommentEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: Comment - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } @@ -415,9 +296,7 @@ input CommentPinInput { } type CommentPinPayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug comment: Comment @@ -433,9 +312,7 @@ type CommentsCount { } interface CommentsInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! commentsCount: CommentsCount! comments( @@ -446,17 +323,13 @@ interface CommentsInterface { last: Int q: String - """ - Ordering - """ + """Ordering""" orderBy: String ): CommentConnection isCommentsEnabled: Boolean! } -""" -An enumeration. -""" +"""An enumeration.""" enum CommentStatus { DELETED PUBLISHED @@ -469,9 +342,7 @@ input CommentUpdateInput { } type CommentUpdatePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug comment: Comment @@ -485,113 +356,69 @@ value as specified by """ scalar DateTime -""" -Debugging information for the current query. -""" +"""Debugging information for the current query.""" type DjangoDebug { - """ - Executed SQL queries for this API query. - """ + """Executed SQL queries for this API query.""" sql: [DjangoDebugSQL] - """ - Raise exceptions for this API query. - """ + """Raise exceptions for this API query.""" exceptions: [DjangoDebugException] } -""" -Represents a single exception raised. -""" +"""Represents a single exception raised.""" type DjangoDebugException { - """ - The class of the exception - """ + """The class of the exception""" excType: String! - """ - The message of the exception - """ + """The message of the exception""" message: String! - """ - The stack trace - """ + """The stack trace""" stack: String! } -""" -Represents a single database query made to a Django managed DB. -""" +"""Represents a single database query made to a Django managed DB.""" type DjangoDebugSQL { - """ - The type of database being used (e.g. postrgesql, mysql, sqlite). - """ + """The type of database being used (e.g. postrgesql, mysql, sqlite).""" vendor: String! - """ - The Django database alias (e.g. 'default'). - """ + """The Django database alias (e.g. 'default').""" alias: String! - """ - The actual SQL sent to this database. - """ + """The actual SQL sent to this database.""" sql: String - """ - Duration of this database query in seconds. - """ + """Duration of this database query in seconds.""" duration: Float! - """ - The raw SQL of this query, without params. - """ + """The raw SQL of this query, without params.""" rawSql: String! - """ - JSON encoded database query parameters. - """ + """JSON encoded database query parameters.""" params: String! - """ - Start time of this database query. - """ + """Start time of this database query.""" startTime: Float! - """ - Stop time of this database query. - """ + """Stop time of this database query.""" stopTime: Float! - """ - Whether this database query took more than 10 seconds. - """ + """Whether this database query took more than 10 seconds.""" isSlow: Boolean! - """ - Whether this database query was a SELECT. - """ + """Whether this database query was a SELECT.""" isSelect: Boolean! - """ - Postgres transaction ID if available. - """ + """Postgres transaction ID if available.""" transId: String - """ - Postgres transaction status if available. - """ + """Postgres transaction status if available.""" transStatus: String - """ - Postgres isolation level if available. - """ + """Postgres isolation level if available.""" isoLevel: String - """ - Postgres connection encoding if available. - """ + """Postgres connection encoding if available.""" encoding: String } @@ -605,9 +432,7 @@ type File { } type Follow implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! created: DateTime! modified: DateTime! @@ -619,55 +444,29 @@ type Follow implements Node { } type FollowConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [FollowEdge]! totalCount: Int edgeCount: Int } -""" -A Relay edge containing a `Follow` and its cursor. -""" +"""A Relay edge containing a `Follow` and its cursor.""" type FollowEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: Follow - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } interface FollowsInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! - followers( - offset: Int - before: String - after: String - first: Int - last: Int - targetIsFollowingBack: Boolean - ): FollowConnection - following( - offset: Int - before: String - after: String - first: Int - last: Int - targetIsFollowingBack: Boolean - ): FollowConnection + followers(offset: Int, before: String, after: String, first: Int, last: Int, targetIsFollowingBack: Boolean): FollowConnection + following(offset: Int, before: String, after: String, first: Int, last: Int, targetIsFollowingBack: Boolean): FollowConnection followersCount: Int followingCount: Int isFollowedByMe(profileId: ID): Boolean @@ -680,9 +479,7 @@ input FollowToggleInput { } type FollowTogglePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug follow: FollowEdge @@ -707,19 +504,21 @@ schema (one of the key benefits of GraphQL). """ scalar JSONString -""" -Languages available -""" +"""Languages available""" enum Languages { en es pt } +interface MemberInterface { + """The ID of the object""" + id: ID! + member: ProfileUserRole +} + type Message implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! created: DateTime! content: String @@ -735,31 +534,21 @@ type Message implements Node { } type MessageConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [MessageEdge]! totalCount: Int edgeCount: Int } -""" -A Relay edge containing a `Message` and its cursor. -""" +"""A Relay edge containing a `Message` and its cursor.""" type MessageEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: Message - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } @@ -785,12 +574,8 @@ type Mutation { blockToggle(input: BlockToggleInput!): BlockTogglePayload reactionToggle(input: ReactionToggleInput!): ReactionTogglePayload notificationsMarkAsRead(input: NotificationsMarkAsReadInput!): NotificationsMarkAsReadPayload - notificationsMarkAllAsRead( - input: NotificationsMarkAllAsReadInput! - ): NotificationsMarkAllAsReadPayload - notificationSettingToggle( - input: NotificationSettingToggleInput! - ): NotificationSettingTogglePayload + notificationsMarkAllAsRead(input: NotificationsMarkAllAsReadInput!): NotificationsMarkAllAsReadPayload + notificationSettingToggle(input: NotificationSettingToggleInput!): NotificationSettingTogglePayload commentCreate(input: CommentCreateInput!): CommentCreatePayload commentUpdate(input: CommentUpdateInput!): CommentUpdatePayload commentPin(input: CommentPinInput!): CommentPinPayload @@ -801,22 +586,16 @@ type Mutation { profileDelete(input: ProfileDeleteInput!): ProfileDeletePayload } -""" -An object with an ID -""" +"""An object with an ID""" interface Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! } type Notification implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! - level: BaseappNotificationsNotificationLevelChoices! + level: NotificationsNotificationLevelChoices! recipient: User! unread: Boolean! actorObjectId: String! @@ -835,64 +614,42 @@ type Notification implements Node { actionObject: Node } -""" -An enumeration. -""" +"""An enumeration.""" enum NotificationChannelTypes { - """ - All - """ + """All""" ALL - """ - Email - """ + """Email""" EMAIL - """ - Push - """ + """Push""" PUSH - """ - In-App - """ + """In-App""" IN_APP } type NotificationConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [NotificationEdge]! totalCount: Int edgeCount: Int } -""" -A Relay edge containing a `Notification` and its cursor. -""" +"""A Relay edge containing a `Notification` and its cursor.""" type NotificationEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: Notification - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } type NotificationSetting implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! created: DateTime! modified: DateTime! @@ -904,31 +661,21 @@ type NotificationSetting implements Node { } type NotificationSettingConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [NotificationSettingEdge]! totalCount: Int edgeCount: Int } -""" -A Relay edge containing a `NotificationSetting` and its cursor. -""" +"""A Relay edge containing a `NotificationSetting` and its cursor.""" type NotificationSettingEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: NotificationSetting - - """ - A cursor for use in pagination - """ + + """A cursor for use in pagination""" cursor: String! } @@ -939,9 +686,7 @@ input NotificationSettingToggleInput { } type NotificationSettingTogglePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug notificationSetting: NotificationSetting @@ -949,43 +694,22 @@ type NotificationSettingTogglePayload { } interface NotificationsInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! notificationsUnreadCount: Int - notifications( - offset: Int - before: String - after: String - first: Int - last: Int - level: BaseappNotificationsNotificationLevelChoices - unread: Boolean - verbs: String - ): NotificationConnection - notificationSettings( - offset: Int - before: String - after: String - first: Int - last: Int - ): NotificationSettingConnection + notifications(offset: Int, before: String, after: String, first: Int, last: Int, level: NotificationsNotificationLevelChoices, unread: Boolean, verbs: String): NotificationConnection + notificationSettings(offset: Int, before: String, after: String, first: Int, last: Int): NotificationSettingConnection isNotificationSettingActive(verb: String!, channel: NotificationChannelTypes!): Boolean } input NotificationsMarkAllAsReadInput { - """ - Mark as read or unread - """ + """Mark as read or unread""" read: Boolean! clientMutationId: String } type NotificationsMarkAllAsReadPayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug recipient: NotificationsInterface @@ -993,18 +717,14 @@ type NotificationsMarkAllAsReadPayload { } input NotificationsMarkAsReadInput { - """ - Mark as read or unread - """ + """Mark as read or unread""" read: Boolean! notificationIds: [ID!] clientMutationId: String } type NotificationsMarkAsReadPayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug recipient: NotificationsInterface @@ -1012,6 +732,21 @@ type NotificationsMarkAsReadPayload { clientMutationId: String } +"""An enumeration.""" +enum NotificationsNotificationLevelChoices { + """success""" + SUCCESS + + """info""" + INFO + + """warning""" + WARNING + + """error""" + ERROR +} + type OnCommentChange { createdComment: CommentEdge updatedComment: Comment @@ -1030,9 +765,7 @@ type Page implements Node & PageInterface & PermissionsInterface & CommentsInter user: User status: PageStatus - """ - The ID of the object - """ + """The ID of the object""" id: ID! urlPath: URLPath urlPaths: [URLPath] @@ -1051,9 +784,7 @@ type Page implements Node & PageInterface & PermissionsInterface & CommentsInter last: Int q: String - """ - Ordering - """ + """Ordering""" orderBy: String ): CommentConnection isCommentsEnabled: Boolean! @@ -1063,14 +794,10 @@ type Page implements Node & PageInterface & PermissionsInterface & CommentsInter } type PageConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [PageEdge]! totalCount: Int edgeCount: Int @@ -1085,27 +812,19 @@ input PageCreateInput { } type PageCreatePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug page: PageEdge clientMutationId: String } -""" -A Relay edge containing a `Page` and its cursor. -""" +"""A Relay edge containing a `Page` and its cursor.""" type PageEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: Page - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } @@ -1119,9 +838,7 @@ input PageEditInput { } type PageEditPayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug page: Page @@ -1132,56 +849,38 @@ type PageEditPayload { The Relay compliant `PageInfo` type, containing data necessary to paginate this connection. """ type PageInfo { - """ - When paginating forwards, are there more items? - """ + """When paginating forwards, are there more items?""" hasNextPage: Boolean! - """ - When paginating backwards, are there more items? - """ + """When paginating backwards, are there more items?""" hasPreviousPage: Boolean! - """ - When paginating backwards, the cursor to continue. - """ + """When paginating backwards, the cursor to continue.""" startCursor: String - """ - When paginating forwards, the cursor to continue. - """ + """When paginating forwards, the cursor to continue.""" endCursor: String } interface PageInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! urlPath: URLPath urlPaths: [URLPath] metadata: Metadata } -""" -An enumeration. -""" +"""An enumeration.""" enum PageStatus { - """ - Draft - """ + """Draft""" DRAFT - """ - Published - """ + """Published""" PUBLISHED } interface PermissionsInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! """ @@ -1191,9 +890,7 @@ interface PermissionsInterface { } type Profile implements Node & PermissionsInterface & PageInterface & FollowsInterface & BlocksInterface & ChatRoomsInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! created: DateTime! modified: DateTime! @@ -1219,9 +916,7 @@ type Profile implements Node & PermissionsInterface & PageInterface & FollowsInt last: Int q: String - """ - Ordering - """ + """Ordering""" orderBy: String ): CommentConnection! reactions(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReactionConnection! @@ -1252,9 +947,7 @@ type Profile implements Node & PermissionsInterface & PageInterface & FollowsInt last: Int q: String - """ - Ordering - """ + """Ordering""" orderBy: String profileId: String unreadMessages: Boolean @@ -1265,14 +958,10 @@ type Profile implements Node & PermissionsInterface & PageInterface & FollowsInt } type ProfileConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [ProfileEdge]! totalCount: Int edgeCount: Int @@ -1284,34 +973,24 @@ input ProfileDeleteInput { } type ProfileDeletePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug deletedId: ID clientMutationId: String } -""" -A Relay edge containing a `Profile` and its cursor. -""" +"""A Relay edge containing a `Profile` and its cursor.""" type ProfileEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: Profile - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } interface ProfileInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! profile: Profile } @@ -1339,14 +1018,10 @@ enum ProfileRoleStatus { """An enumeration.""" enum ProfilesProfileStatusChoices { - """ - public - """ + """public""" A_1 - """ - private - """ + """private""" A_2 } @@ -1363,21 +1038,20 @@ input ProfileUpdateInput { } type ProfileUpdatePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug profile: Profile clientMutationId: String } -type ProfileUserRole implements Node { +type ProfileUserRole implements MemberInterface { """The ID of the object""" id: ID! user: User! role: ProfileRoles status: ProfileRoleStatus + member: ProfileUserRole pk: Int! } @@ -1402,27 +1076,19 @@ type ProfileUserRoleEdge { type Query { chatRoom( - """ - The ID of the object - """ + """The ID of the object""" id: ID! ): ChatRoom rate( - """ - The ID of the object - """ + """The ID of the object""" id: ID! ): Rate report( - """ - The ID of the object - """ + """The ID of the object""" id: ID! ): Report comment( - """ - The ID of the object - """ + """The ID of the object""" id: ID! ): Comment allComments( @@ -1433,24 +1099,13 @@ type Query { last: Int q: String - """ - Ordering - """ + """Ordering""" orderBy: String ): CommentConnection urlPath(path: String!): URLPath - allPages( - offset: Int - before: String - after: String - first: Int - last: Int - status: PageStatus - ): PageConnection + allPages(offset: Int, before: String, after: String, first: Int, last: Int, status: PageStatus): PageConnection page( - """ - The ID of the object - """ + """The ID of the object""" id: ID! ): Page allProfiles( @@ -1459,16 +1114,13 @@ type Query { after: String first: Int last: Int - name: String q: String """Ordering""" orderBy: String ): ProfileConnection profile( - """ - The ID of the object - """ + """The ID of the object""" id: ID! ): Profile users( @@ -1479,31 +1131,23 @@ type Query { last: Int q: String - """ - Ordering - """ + """Ordering""" orderBy: String ): UserConnection user( - """ - The ID of the object - """ + """The ID of the object""" id: ID! ): User me: User node( - """ - The ID of the object - """ + """The ID of the object""" id: ID! ): Node _debug: DjangoDebug } type Rate implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! created: DateTime! modified: DateTime! @@ -1515,38 +1159,26 @@ type Rate implements Node { } type RateConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [RateEdge]! totalCount: Int edgeCount: Int } -""" -A Relay edge containing a `Rate` and its cursor. -""" +"""A Relay edge containing a `Rate` and its cursor.""" type RateEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: Rate - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } interface RatingsInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! ratingsCount: Int ratingsSum: Int @@ -1557,9 +1189,7 @@ interface RatingsInterface { } type Reaction implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! created: DateTime! modified: DateTime! @@ -1570,31 +1200,21 @@ type Reaction implements Node { } type ReactionConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [ReactionEdge]! totalCount: Int edgeCount: Int } -""" -A Relay edge containing a `Reaction` and its cursor. -""" +"""A Relay edge containing a `Reaction` and its cursor.""" type ReactionEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: Reaction - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } @@ -1605,19 +1225,10 @@ type ReactionsCount { } interface ReactionsInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! reactionsCount: ReactionsCount - reactions( - offset: Int - before: String - after: String - first: Int - last: Int - id: ID - ): ReactionConnection + reactions(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReactionConnection isReactionsEnabled: Boolean! myReaction(profileId: ID): Reaction } @@ -1630,9 +1241,7 @@ input ReactionToggleInput { } type ReactionTogglePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug reaction: ReactionEdge @@ -1641,25 +1250,17 @@ type ReactionTogglePayload { clientMutationId: String } -""" -An enumeration. -""" +"""An enumeration.""" enum ReactionTypes { - """ - like - """ + """like""" LIKE - """ - dislike - """ + """dislike""" DISLIKE } type Report implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! created: DateTime! modified: DateTime! @@ -1671,14 +1272,10 @@ type Report implements Node { } type ReportConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [ReportEdge]! totalCount: Int edgeCount: Int @@ -1692,9 +1289,7 @@ input ReportCreateInput { } type ReportCreatePayload { - """ - May contain more than one error for same field. - """ + """May contain more than one error for same field.""" errors: [ErrorType] _debug: DjangoDebug report: ReportEdge @@ -1702,18 +1297,12 @@ type ReportCreatePayload { clientMutationId: String } -""" -A Relay edge containing a `Report` and its cursor. -""" +"""A Relay edge containing a `Report` and its cursor.""" type ReportEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: Report - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } @@ -1726,44 +1315,25 @@ type ReportsCount { } interface ReportsInterface { - """ - The ID of the object - """ + """The ID of the object""" id: ID! reportsCount: ReportsCount - reports( - offset: Int - before: String - after: String - first: Int - last: Int - id: ID - ): ReportConnection + reports(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReportConnection myReports: Report } -""" -An enumeration. -""" +"""An enumeration.""" enum ReportTypes { - """ - Spam - """ + """Spam""" SPAM - """ - Inappropriate - """ + """Inappropriate""" INAPPROPRIATE - """ - Fake - """ + """Fake""" FAKE - """ - Other - """ + """Other""" OTHER } @@ -1776,9 +1346,7 @@ type Subscription { } type URLPath implements Node { - """ - The ID of the object - """ + """The ID of the object""" id: ID! created: DateTime! modified: DateTime! @@ -1807,14 +1375,7 @@ type User implements Node & PermissionsInterface & NotificationsInterface & Page """ isActive: Boolean! isStaff: Boolean - reactions( - offset: Int - before: String - after: String - first: Int - last: Int - id: ID - ): ReactionConnection! + reactions(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReactionConnection! comments( offset: Int before: String @@ -1823,23 +1384,12 @@ type User implements Node & PermissionsInterface & NotificationsInterface & Page last: Int q: String - """ - Ordering - """ + """Ordering""" orderBy: String ): CommentConnection! - pages( - offset: Int - before: String - after: String - first: Int - last: Int - status: PageStatus - ): PageConnection! + pages(offset: Int, before: String, after: String, first: Int, last: Int, status: PageStatus): PageConnection! - """ - The ID of the object - """ + """The ID of the object""" id: ID! """ @@ -1847,23 +1397,8 @@ type User implements Node & PermissionsInterface & NotificationsInterface & Page """ hasPerm(perm: String!): Boolean notificationsUnreadCount: Int - notifications( - offset: Int - before: String - after: String - first: Int - last: Int - level: BaseappNotificationsNotificationLevelChoices - unread: Boolean - verbs: String - ): NotificationConnection - notificationSettings( - offset: Int - before: String - after: String - first: Int - last: Int - ): NotificationSettingConnection + notifications(offset: Int, before: String, after: String, first: Int, last: Int, level: NotificationsNotificationLevelChoices, unread: Boolean, verbs: String): NotificationConnection + notificationSettings(offset: Int, before: String, after: String, first: Int, last: Int): NotificationSettingConnection isNotificationSettingActive(verb: String!, channel: NotificationChannelTypes!): Boolean urlPath: URLPath urlPaths: [URLPath] @@ -1884,45 +1419,32 @@ type User implements Node & PermissionsInterface & NotificationsInterface & Page } type UserConnection { - """ - Pagination data for this connection. - """ + """Pagination data for this connection.""" pageInfo: PageInfo! - """ - Contains the nodes in this connection. - """ + """Contains the nodes in this connection.""" edges: [UserEdge]! totalCount: Int edgeCount: Int } -""" -A Relay edge containing a `User` and its cursor. -""" +"""A Relay edge containing a `User` and its cursor.""" type UserEdge { - """ - The item at the end of the edge - """ + """The item at the end of the edge""" node: User - """ - A cursor for use in pagination - """ + """A cursor for use in pagination""" cursor: String! } interface UserProfiles { - """ - The ID of the object - """ + """The ID of the object""" id: ID! profiles: [Profile] } -""" -An enumeration. -""" +"""An enumeration.""" enum Verbs { SENT_MESSAGE } + From a2779044ccdba1bf2f6a543f2fbcff95a094af7e Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Tue, 3 Dec 2024 17:51:48 -0300 Subject: [PATCH 10/13] change member query --- .../UserMembersListFragment.graphql.ts | 12 +++++------ .../UserMembersListPaginationQuery.graphql.ts | 18 ++++++++--------- ...embersListPaginationRefetchable.graphql.ts | 20 +++++++++---------- .../profiles/Members/MembersList/index.tsx | 6 +++--- .../modules/profiles/Members/index.tsx | 2 +- .../graphql/queries/UserMembersList.ts | 11 +++++----- packages/components/schema.graphql | 12 ++++++++++- 7 files changed, 45 insertions(+), 36 deletions(-) diff --git a/packages/components/__generated__/UserMembersListFragment.graphql.ts b/packages/components/__generated__/UserMembersListFragment.graphql.ts index 9bdc68b7..325d383b 100644 --- a/packages/components/__generated__/UserMembersListFragment.graphql.ts +++ b/packages/components/__generated__/UserMembersListFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<582eaebcebe39f8edc4ba01236f43897>> + * @generated SignedSource<<7b5d9ac9387460075ed09089a27cd807>> * @lightSyntaxTransform * @nogrep */ @@ -58,9 +58,9 @@ const node: ReaderFragment = (function () { name: 'cursor', }, { - defaultValue: 'custom', + defaultValue: null, kind: 'LocalArgument', - name: 'orderByStatus', + name: 'orderBy', }, ], kind: 'Fragment', @@ -102,8 +102,8 @@ const node: ReaderFragment = (function () { args: [ { kind: 'Variable', - name: 'orderByStatus', - variableName: 'orderByStatus', + name: 'orderBy', + variableName: 'orderBy', }, ], concreteType: 'ProfileUserRoleConnection', @@ -200,6 +200,6 @@ const node: ReaderFragment = (function () { } })() -;(node as any).hash = '48972fa30cfc1866f92aae70b6fc83cb' +;(node as any).hash = 'b14044279dce0f71bd144a09351f0df2' export default node diff --git a/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts b/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts index d4e1a092..1e98f54f 100644 --- a/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts +++ b/packages/components/__generated__/UserMembersListPaginationQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<5217aecc6cf81c52b03e9d986eff97c4>> * @lightSyntaxTransform * @nogrep */ @@ -14,7 +14,7 @@ import { FragmentRefs } from 'relay-runtime' export type UserMembersListPaginationQuery$variables = { count?: number | null | undefined cursor?: string | null | undefined - orderByStatus?: string | null | undefined + orderBy?: string | null | undefined profileId: string } export type UserMembersListPaginationQuery$data = { @@ -46,7 +46,7 @@ const node: ConcreteRequest = (function () { { defaultValue: null, kind: 'LocalArgument', - name: 'orderByStatus', + name: 'orderBy', }, { defaultValue: null, @@ -70,8 +70,8 @@ const node: ConcreteRequest = (function () { }, v3 = { kind: 'Variable', - name: 'orderByStatus', - variableName: 'orderByStatus', + name: 'orderBy', + variableName: 'orderBy', }, v4 = { alias: null, @@ -326,7 +326,7 @@ const node: ConcreteRequest = (function () { { alias: null, args: v8 /*: any*/, - filters: ['orderByStatus'], + filters: ['orderBy'], handle: 'connection', key: 'UserMembersFragment_members', kind: 'LinkedHandle', @@ -338,16 +338,16 @@ const node: ConcreteRequest = (function () { ], }, params: { - cacheID: 'c2fccba42ccf5cc5af537fbaa16aec37', + cacheID: 'e889baf91ade9a8612108dfa2583a2c8', id: null, metadata: {}, name: 'UserMembersListPaginationQuery', operationKind: 'query', - text: 'query UserMembersListPaginationQuery(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String\n $profileId: ID!\n) {\n profile(id: $profileId) {\n pk\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment MemberItemFragment on ProfileUserRole {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on Profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n ...MemberItemFragment\n id\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n}\n', + text: 'query UserMembersListPaginationQuery(\n $count: Int = 10\n $cursor: String\n $orderBy: String\n $profileId: ID!\n) {\n profile(id: $profileId) {\n pk\n ...UserMembersListFragment_32czeo\n id\n }\n}\n\nfragment MemberItemFragment on ProfileUserRole {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_32czeo on Profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderBy: $orderBy) {\n totalCount\n edges {\n node {\n ...MemberItemFragment\n id\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n}\n', }, } })() -;(node as any).hash = '6816a1706adef7eb99737264e9ab6582' +;(node as any).hash = 'bc02b9d42e6f3e087d064c23c98c1a16' export default node diff --git a/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts b/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts index f0b09c74..fc831d2f 100644 --- a/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts +++ b/packages/components/__generated__/userMembersListPaginationRefetchable.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<7fae0b75bc4bce4bae590e668afd8d37>> * @lightSyntaxTransform * @nogrep */ @@ -15,7 +15,7 @@ export type userMembersListPaginationRefetchable$variables = { count?: number | null | undefined cursor?: string | null | undefined id: string - orderByStatus?: string | null | undefined + orderBy?: string | null | undefined } export type userMembersListPaginationRefetchable$data = { readonly node: @@ -47,9 +47,9 @@ const node: ConcreteRequest = (function () { name: 'id', }, v3 = { - defaultValue: 'custom', + defaultValue: null, kind: 'LocalArgument', - name: 'orderByStatus', + name: 'orderBy', }, v4 = [ { @@ -60,8 +60,8 @@ const node: ConcreteRequest = (function () { ], v5 = { kind: 'Variable', - name: 'orderByStatus', - variableName: 'orderByStatus', + name: 'orderBy', + variableName: 'orderBy', }, v6 = { alias: null, @@ -324,7 +324,7 @@ const node: ConcreteRequest = (function () { { alias: null, args: v11 /*: any*/, - filters: ['orderByStatus'], + filters: ['orderBy'], handle: 'connection', key: 'UserMembersFragment_members', kind: 'LinkedHandle', @@ -340,16 +340,16 @@ const node: ConcreteRequest = (function () { ], }, params: { - cacheID: '1cec1c6fc23db6005c95d0fc9d8a0cd5', + cacheID: '3f7d21cee41fbf8a15113dc8de609c61', id: null, metadata: {}, name: 'userMembersListPaginationRefetchable', operationKind: 'query', - text: 'query userMembersListPaginationRefetchable(\n $count: Int = 10\n $cursor: String\n $orderByStatus: String = "custom"\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...UserMembersListFragment_Kswkm\n id\n }\n}\n\nfragment MemberItemFragment on ProfileUserRole {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_Kswkm on Profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderByStatus: $orderByStatus) {\n totalCount\n edges {\n node {\n ...MemberItemFragment\n id\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n}\n', + text: 'query userMembersListPaginationRefetchable(\n $count: Int = 10\n $cursor: String\n $orderBy: String\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...UserMembersListFragment_32czeo\n id\n }\n}\n\nfragment MemberItemFragment on ProfileUserRole {\n id\n user {\n profile {\n ...ProfileItemFragment\n id\n }\n id\n }\n role\n status\n}\n\nfragment ProfileItemFragment on Profile {\n id\n name\n image(width: 100, height: 100) {\n url\n }\n urlPath {\n path\n id\n }\n}\n\nfragment UserMembersListFragment_32czeo on Profile {\n ...ProfileItemFragment\n members(first: $count, after: $cursor, orderBy: $orderBy) {\n totalCount\n edges {\n node {\n ...MemberItemFragment\n id\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n id\n}\n', }, } })() -;(node as any).hash = '48972fa30cfc1866f92aae70b6fc83cb' +;(node as any).hash = 'b14044279dce0f71bd144a09351f0df2' export default node diff --git a/packages/components/modules/profiles/Members/MembersList/index.tsx b/packages/components/modules/profiles/Members/MembersList/index.tsx index c4381a6e..2c82d0ab 100644 --- a/packages/components/modules/profiles/Members/MembersList/index.tsx +++ b/packages/components/modules/profiles/Members/MembersList/index.tsx @@ -6,6 +6,7 @@ import { Box, Typography } from '@mui/material' import { usePaginationFragment } from 'react-relay' import { Virtuoso } from 'react-virtuoso' +import { MemberItemFragment$key } from '../../../../__generated__/MemberItemFragment.graphql' import { UserMembersListFragment } from '../../graphql/queries/UserMembersList' import DefaultMemberItem from '../MemberItem' import MemberListItem from '../MemberListItem' @@ -42,7 +43,7 @@ const MembersList: FC = ({ ) } - const renderMemberItem = (member: any, index: number) => ( + const renderMemberItem = (member: MemberItemFragment$key, index: number) => ( = ({ renderMemberItem(member, _index)} + itemContent={(_index, member) => member && renderMemberItem(member, _index)} components={{ Footer: renderLoadingState, }} diff --git a/packages/components/modules/profiles/Members/index.tsx b/packages/components/modules/profiles/Members/index.tsx index d922bad2..4f6b3070 100644 --- a/packages/components/modules/profiles/Members/index.tsx +++ b/packages/components/modules/profiles/Members/index.tsx @@ -24,7 +24,7 @@ const Members: FC = ({ const data = useLazyLoadQuery(UserMembersListPaginationQuery, { profileId: currentProfile?.id || '', count: NUMBER_OF_MEMBERS_ON_FIRST_LOAD, - orderByStatus: 'custom', + orderBy: 'status', }) if (!data.profile) return null diff --git a/packages/components/modules/profiles/graphql/queries/UserMembersList.ts b/packages/components/modules/profiles/graphql/queries/UserMembersList.ts index 2b39d06a..e50bbda4 100644 --- a/packages/components/modules/profiles/graphql/queries/UserMembersList.ts +++ b/packages/components/modules/profiles/graphql/queries/UserMembersList.ts @@ -4,13 +4,12 @@ export const UserMembersListPaginationQuery = graphql` query UserMembersListPaginationQuery( $count: Int = 10 $cursor: String - $orderByStatus: String + $orderBy: String $profileId: ID! ) { profile(id: $profileId) { pk - ...UserMembersListFragment - @arguments(count: $count, cursor: $cursor, orderByStatus: $orderByStatus) + ...UserMembersListFragment @arguments(count: $count, cursor: $cursor, orderBy: $orderBy) } } ` @@ -21,11 +20,11 @@ export const UserMembersListFragment = graphql` @argumentDefinitions( count: { type: "Int", defaultValue: 10 } cursor: { type: "String" } - orderByStatus: { type: "String", defaultValue: "custom" } + orderBy: { type: "String" } ) { ...ProfileItemFragment - members(first: $count, after: $cursor, orderByStatus: $orderByStatus) - @connection(key: "UserMembersFragment_members", filters: ["orderByStatus"]) { + members(first: $count, after: $cursor, orderBy: $orderBy) + @connection(key: "UserMembersFragment_members", filters: ["orderBy"]) { totalCount edges { node { diff --git a/packages/components/schema.graphql b/packages/components/schema.graphql index 6e3423a2..d734f314 100644 --- a/packages/components/schema.graphql +++ b/packages/components/schema.graphql @@ -922,7 +922,17 @@ type Profile implements Node & PermissionsInterface & PageInterface & FollowsInt reactions(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ReactionConnection! ratings(offset: Int, before: String, after: String, first: Int, last: Int): RateConnection! user: User - members(orderByStatus: String, offset: Int, before: String, after: String, first: Int, last: Int, role: ProfileRoles): ProfileUserRoleConnection + members( + offset: Int + before: String + after: String + first: Int + last: Int + role: ProfileRoles + + """Ordering""" + orderBy: String + ): ProfileUserRoleConnection chatroomparticipantSet(offset: Int, before: String, after: String, first: Int, last: Int, profile_TargetContentType: ID): ChatRoomParticipantConnection! messageSet(offset: Int, before: String, after: String, first: Int, last: Int, verb: Verbs): MessageConnection! following(offset: Int, before: String, after: String, first: Int, last: Int, targetIsFollowingBack: Boolean): FollowConnection From 792ab5109cdf4b50610777f21bd63b08ed75114e Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Tue, 3 Dec 2024 18:32:17 -0300 Subject: [PATCH 11/13] Revert "Temporarily remove catalogs to use GitHub version" This reverts commit d18d6fe64ad31fac368737713812e786e47b5774. --- packages/components/package.json | 148 ++++++++++++++--------------- pnpm-lock.yaml | 157 ++++++++++++++++--------------- 2 files changed, 157 insertions(+), 148 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 7d5d04c6..2e8f17f3 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -21,95 +21,95 @@ "test:unit": "jest --config ./jest.config.ts" }, "dependencies": { - "@hookform/resolvers": "^3.6.0", - "@mui/lab": "^5.0.0-alpha.170", - "@mui/material": "^5.15.19", - "@mui/system": "^5.15.19", - "@storybook/react": "^8.2.8", - "@tanstack/react-query": "^5.45.1", + "@hookform/resolvers": "catalog:", + "@mui/lab": "catalog:material-ui", + "@mui/material": "catalog:material-ui", + "@mui/system": "catalog:material-ui", + "@storybook/react": "catalog:storybook", + "@tanstack/react-query": "catalog:", "framer-motion": "^11.5.4", - "graphql": "^16.8.1", - "js-cookie": "^3.0.5", - "luxon": "^3.4.4", - "next": "14.3.0-canary.24", - "react-hook-form": "^7.51.5", - "react-relay": "^16.2.0", - "react-virtuoso": "^4.7.11", - "relay-runtime": "^16.2.0", + "graphql": "catalog:graphql", + "js-cookie": "catalog:", + "luxon": "catalog:", + "next": "catalog:", + "react-hook-form": "catalog:", + "react-relay": "catalog:graphql", + "react-virtuoso": "catalog:", + "relay-runtime": "catalog:graphql", "use-long-press": "^3.2.0", - "zod": "^3.23.8", - "zustand": "^4.5.2" + "zod": "catalog:", + "zustand": "catalog:" }, "peerDependencies": { "@baseapp-frontend/authentication": "workspace:*", "@baseapp-frontend/design-system": "workspace:*", "@baseapp-frontend/graphql": "workspace:*", "@baseapp-frontend/utils": "workspace:*", - "react": "18.3.1", - "react-dom": "18.3.1" + "react": "catalog:react18", + "react-dom": "catalog:react18" }, "devDependencies": { - "@babel/preset-env": "^7.24.7", - "@babel/preset-react": "^7.24.7", - "@babel/preset-typescript": "^7.24.7", + "@babel/preset-env": "catalog:storybook", + "@babel/preset-react": "catalog:storybook", + "@babel/preset-typescript": "catalog:storybook", "@baseapp-frontend/config": "workspace:*", "@baseapp-frontend/test": "workspace:*", "@baseapp-frontend/tsconfig": "workspace:*", - "@chromatic-com/storybook": "^1.5.0", - "@cypress/webpack-dev-server": "^3.10.1", - "@faker-js/faker": "^9.0.3", - "@storybook/addon-docs": "^8.2.8", - "@storybook/addon-essentials": "^8.2.8", - "@storybook/addon-interactions": "^8.2.8", - "@storybook/addon-links": "^8.2.8", - "@storybook/addon-styling-webpack": "^1.0.0", - "@storybook/addon-webpack5-compiler-babel": "^3.0.3", - "@storybook/blocks": "^8.2.8", - "@storybook/react-webpack5": "^8.2.8", - "@storybook/test": "^8.2.8", - "@tailwindcss/typography": "^0.5.13", - "@testing-library/cypress": "^10.0.2", - "@testing-library/jest-dom": "^6.4.6", - "@testing-library/react": "^16.0.0", - "@testing-library/user-event": "^14.5.2", - "@types/jest": "^29.5.12", - "@types/js-cookie": "^3.0.6", - "@types/luxon": "^3.4.2", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", - "@types/react-relay": "^16.0.6", - "@types/relay-runtime": "^17.0.3", - "@types/relay-test-utils": "^14.1.4", - "autoprefixer": "^10.4.19", - "babel-jest": "^29.7.0", - "babel-loader": "^9.1.3", - "babel-plugin-relay": "^17.0.0", - "css-loader": "^7.1.2", - "cypress": "^13.13.3", - "cypress-plugin-steps": "^1.1.1", - "cypress-wait-until": "^3.0.2", + "@chromatic-com/storybook": "catalog:storybook", + "@cypress/webpack-dev-server": "catalog:test", + "@faker-js/faker": "catalog:test", + "@storybook/addon-docs": "catalog:storybook", + "@storybook/addon-essentials": "catalog:storybook", + "@storybook/addon-interactions": "catalog:storybook", + "@storybook/addon-links": "catalog:storybook", + "@storybook/addon-styling-webpack": "catalog:storybook", + "@storybook/addon-webpack5-compiler-babel": "catalog:storybook", + "@storybook/blocks": "catalog:storybook", + "@storybook/react-webpack5": "catalog:storybook", + "@storybook/test": "catalog:storybook", + "@tailwindcss/typography": "catalog:tailwind", + "@testing-library/cypress": "catalog:test", + "@testing-library/jest-dom": "catalog:test", + "@testing-library/react": "catalog:test", + "@testing-library/user-event": "catalog:test", + "@types/jest": "catalog:test", + "@types/js-cookie": "catalog:", + "@types/luxon": "catalog:", + "@types/react": "catalog:react18", + "@types/react-dom": "catalog:react18", + "@types/react-relay": "catalog:graphql", + "@types/relay-runtime": "catalog:graphql", + "@types/relay-test-utils": "catalog:graphql", + "autoprefixer": "catalog:tailwind", + "babel-jest": "catalog:test", + "babel-loader": "catalog:storybook", + "babel-plugin-relay": "catalog:graphql", + "css-loader": "catalog:storybook", + "cypress": "catalog:test", + "cypress-plugin-steps": "catalog:test", + "cypress-wait-until": "catalog:test", "dotenv": "^16.4.5", "dotenv-cli": "^7.4.2", - "eslint-plugin-storybook": "^0.8.0", - "get-graphql-schema": "^2.1.2", - "html-webpack-plugin": "^5.6.0", - "jest": "^29.7.0", - "jest-environment-jsdom": "^29.7.0", - "msw": "^2.3.1", - "msw-storybook-addon": "^2.0.2", - "postcss": "^8.4.41", - "postcss-loader": "^8.1.1", - "relay-compiler": "^16.2.0", - "relay-test-utils": "^17.0.0", - "storybook": "^8.2.8", - "style-loader": "^4.0.0", - "tailwindcss": "^3.4.4", - "ts-jest": "^29.1.4", - "ts-node": "^10.9.2", - "typescript": "^5.4.5", - "webpack": "^5.93.0", - "webpack-cli": "^5.1.4", - "webpack-dev-server": "^5.0.4" + "eslint-plugin-storybook": "catalog:lint", + "get-graphql-schema": "catalog:graphql", + "html-webpack-plugin": "catalog:storybook", + "jest": "catalog:test", + "jest-environment-jsdom": "catalog:test", + "msw": "catalog:storybook", + "msw-storybook-addon": "catalog:storybook", + "postcss": "catalog:tailwind", + "postcss-loader": "catalog:storybook", + "relay-compiler": "catalog:graphql", + "relay-test-utils": "catalog:graphql", + "storybook": "catalog:storybook", + "style-loader": "catalog:storybook", + "tailwindcss": "catalog:tailwind", + "ts-jest": "catalog:test", + "ts-node": "catalog:test", + "typescript": "catalog:", + "webpack": "catalog:storybook", + "webpack-cli": "catalog:storybook", + "webpack-dev-server": "catalog:storybook" }, "license": "MIT", "repository": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 359523ce..33433bdb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,6 +48,9 @@ catalogs: react-hook-form: specifier: ^7.51.5 version: 7.53.2 + react-virtuoso: + specifier: ^4.7.11 + version: 4.12.2 typescript: specifier: ^5.4.5 version: 5.7.2 @@ -289,6 +292,9 @@ catalogs: '@cypress/webpack-dev-server': specifier: ^3.10.1 version: 3.11.0 + '@faker-js/faker': + specifier: ^9.0.3 + version: 9.2.0 '@testing-library/cypress': specifier: ^10.0.2 version: 10.0.2 @@ -313,6 +319,9 @@ catalogs: cypress-plugin-steps: specifier: ^1.1.1 version: 1.1.1 + cypress-wait-until: + specifier: ^3.0.2 + version: 3.0.2 jest: specifier: ^29.7.0 version: 29.7.0 @@ -458,74 +467,74 @@ importers: specifier: workspace:* version: link:../utils '@hookform/resolvers': - specifier: ^3.6.0 + specifier: 'catalog:' version: 3.9.1(react-hook-form@7.53.2(react@18.3.1)) '@mui/lab': - specifier: ^5.0.0-alpha.170 + specifier: catalog:material-ui version: 5.0.0-alpha.173(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@emotion/styled@11.13.5(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@emotion/styled@11.13.5(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/material': - specifier: ^5.15.19 + specifier: catalog:material-ui version: 5.16.7(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@emotion/styled@11.13.5(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/system': - specifier: ^5.15.19 + specifier: catalog:material-ui version: 5.16.7(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@emotion/styled@11.13.5(@emotion/react@11.13.5(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1))(@types/react@18.3.12)(react@18.3.1) '@storybook/react': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.4.5(@storybook/test@8.4.5(storybook@8.4.5(prettier@3.4.1)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.5(prettier@3.4.1))(typescript@5.7.2) '@tanstack/react-query': - specifier: ^5.45.1 + specifier: 'catalog:' version: 5.61.4(react@18.3.1) framer-motion: specifier: ^11.5.4 version: 11.11.17(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) graphql: - specifier: ^16.8.1 + specifier: catalog:graphql version: 16.9.0 js-cookie: - specifier: ^3.0.5 + specifier: 'catalog:' version: 3.0.5 luxon: - specifier: ^3.4.4 + specifier: 'catalog:' version: 3.5.0 next: - specifier: 14.3.0-canary.24 + specifier: 'catalog:' version: 14.3.0-canary.24(@babel/core@7.26.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: - specifier: 18.3.1 + specifier: catalog:react18 version: 18.3.1 react-dom: - specifier: 18.3.1 + specifier: catalog:react18 version: 18.3.1(react@18.3.1) react-hook-form: - specifier: ^7.51.5 + specifier: 'catalog:' version: 7.53.2(react@18.3.1) react-relay: - specifier: ^16.2.0 + specifier: catalog:graphql version: 16.2.0(react@18.3.1) react-virtuoso: - specifier: ^4.7.11 + specifier: 'catalog:' version: 4.12.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) relay-runtime: - specifier: ^16.2.0 + specifier: catalog:graphql version: 16.2.0 use-long-press: specifier: ^3.2.0 version: 3.2.0(react@18.3.1) zod: - specifier: ^3.23.8 + specifier: 'catalog:' version: 3.23.8 zustand: - specifier: ^4.5.2 + specifier: 'catalog:' version: 4.5.5(@types/react@18.3.12)(react@18.3.1) devDependencies: '@babel/preset-env': - specifier: ^7.24.7 + specifier: catalog:storybook version: 7.26.0(@babel/core@7.26.0) '@babel/preset-react': - specifier: ^7.24.7 + specifier: catalog:storybook version: 7.25.9(@babel/core@7.26.0) '@babel/preset-typescript': - specifier: ^7.24.7 + specifier: catalog:storybook version: 7.26.0(@babel/core@7.26.0) '@baseapp-frontend/config': specifier: workspace:* @@ -537,103 +546,103 @@ importers: specifier: workspace:* version: link:../tsconfig '@chromatic-com/storybook': - specifier: ^1.5.0 + specifier: catalog:storybook version: 1.9.0(react@18.3.1) '@cypress/webpack-dev-server': - specifier: ^3.10.1 + specifier: catalog:test version: 3.11.0(webpack-cli@5.1.4)(webpack@5.96.1) '@faker-js/faker': - specifier: ^9.0.3 + specifier: catalog:test version: 9.2.0 '@storybook/addon-docs': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.4.5(@types/react@18.3.12)(storybook@8.4.5(prettier@3.4.1)) '@storybook/addon-essentials': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.4.5(@types/react@18.3.12)(storybook@8.4.5(prettier@3.4.1)) '@storybook/addon-interactions': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.4.5(storybook@8.4.5(prettier@3.4.1)) '@storybook/addon-links': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.4.5(react@18.3.1)(storybook@8.4.5(prettier@3.4.1)) '@storybook/addon-styling-webpack': - specifier: ^1.0.0 + specifier: catalog:storybook version: 1.0.1(storybook@8.4.5(prettier@3.4.1))(webpack@5.96.1) '@storybook/addon-webpack5-compiler-babel': - specifier: ^3.0.3 + specifier: catalog:storybook version: 3.0.3(webpack@5.96.1) '@storybook/blocks': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.5(prettier@3.4.1)) '@storybook/react-webpack5': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.4.5(@storybook/test@8.4.5(storybook@8.4.5(prettier@3.4.1)))(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@8.4.5(prettier@3.4.1))(typescript@5.7.2)(webpack-cli@5.1.4) '@storybook/test': - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.4.5(storybook@8.4.5(prettier@3.4.1)) '@tailwindcss/typography': - specifier: ^0.5.13 + specifier: catalog:tailwind version: 0.5.15(tailwindcss@3.4.15(ts-node@10.9.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(@types/node@22.10.0)(typescript@5.7.2))) '@testing-library/cypress': - specifier: ^10.0.2 + specifier: catalog:test version: 10.0.2(cypress@13.16.0) '@testing-library/jest-dom': - specifier: ^6.4.6 + specifier: catalog:test version: 6.6.3 '@testing-library/react': - specifier: ^16.0.0 + specifier: catalog:test version: 16.0.1(@testing-library/dom@10.4.0)(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@testing-library/user-event': - specifier: ^14.5.2 + specifier: catalog:test version: 14.5.2(@testing-library/dom@10.4.0) '@types/jest': - specifier: ^29.5.12 + specifier: catalog:test version: 29.5.14 '@types/js-cookie': - specifier: ^3.0.6 + specifier: 'catalog:' version: 3.0.6 '@types/luxon': - specifier: ^3.4.2 + specifier: 'catalog:' version: 3.4.2 '@types/react': - specifier: ^18.3.3 + specifier: catalog:react18 version: 18.3.12 '@types/react-dom': - specifier: ^18.3.0 + specifier: catalog:react18 version: 18.3.1 '@types/react-relay': - specifier: ^16.0.6 + specifier: catalog:graphql version: 16.0.6 '@types/relay-runtime': - specifier: ^17.0.3 + specifier: catalog:graphql version: 17.0.4 '@types/relay-test-utils': - specifier: ^14.1.4 + specifier: catalog:graphql version: 14.1.4 autoprefixer: - specifier: ^10.4.19 + specifier: catalog:tailwind version: 10.4.20(postcss@8.4.49) babel-jest: - specifier: ^29.7.0 + specifier: catalog:test version: 29.7.0(@babel/core@7.26.0) babel-loader: - specifier: ^9.1.3 + specifier: catalog:storybook version: 9.2.1(@babel/core@7.26.0)(webpack@5.96.1) babel-plugin-relay: - specifier: ^17.0.0 + specifier: catalog:graphql version: 17.0.0 css-loader: - specifier: ^7.1.2 + specifier: catalog:storybook version: 7.1.2(webpack@5.96.1) cypress: - specifier: ^13.13.3 + specifier: catalog:test version: 13.16.0 cypress-plugin-steps: - specifier: ^1.1.1 + specifier: catalog:test version: 1.1.1(cypress@13.16.0) cypress-wait-until: - specifier: ^3.0.2 + specifier: catalog:test version: 3.0.2 dotenv: specifier: ^16.4.5 @@ -642,64 +651,64 @@ importers: specifier: ^7.4.2 version: 7.4.4 eslint-plugin-storybook: - specifier: ^0.8.0 + specifier: catalog:lint version: 0.8.0(eslint@8.57.1)(typescript@5.7.2) get-graphql-schema: - specifier: ^2.1.2 + specifier: catalog:graphql version: 2.1.2 html-webpack-plugin: - specifier: ^5.6.0 + specifier: catalog:storybook version: 5.6.3(webpack@5.96.1) jest: - specifier: ^29.7.0 + specifier: catalog:test version: 29.7.0(@types/node@22.10.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(@types/node@22.10.0)(typescript@5.7.2)) jest-environment-jsdom: - specifier: ^29.7.0 + specifier: catalog:test version: 29.7.0 msw: - specifier: ^2.3.1 + specifier: catalog:storybook version: 2.6.6(@types/node@22.10.0)(typescript@5.7.2) msw-storybook-addon: - specifier: ^2.0.2 + specifier: catalog:storybook version: 2.0.4(msw@2.6.6(@types/node@22.10.0)(typescript@5.7.2)) postcss: - specifier: ^8.4.41 + specifier: catalog:tailwind version: 8.4.49 postcss-loader: - specifier: ^8.1.1 + specifier: catalog:storybook version: 8.1.1(postcss@8.4.49)(typescript@5.7.2)(webpack@5.96.1) relay-compiler: - specifier: ^16.2.0 + specifier: catalog:graphql version: 16.2.0 relay-test-utils: - specifier: ^17.0.0 + specifier: catalog:graphql version: 17.0.0 storybook: - specifier: ^8.2.8 + specifier: catalog:storybook version: 8.4.5(prettier@3.4.1) style-loader: - specifier: ^4.0.0 + specifier: catalog:storybook version: 4.0.0(webpack@5.96.1) tailwindcss: - specifier: ^3.4.4 + specifier: catalog:tailwind version: 3.4.15(ts-node@10.9.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(@types/node@22.10.0)(typescript@5.7.2)) ts-jest: - specifier: ^29.1.4 + specifier: catalog:test version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.0)(jest@29.7.0(@types/node@22.10.0)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(@types/node@22.10.0)(typescript@5.7.2)))(typescript@5.7.2) ts-node: - specifier: ^10.9.2 + specifier: catalog:test version: 10.9.2(@swc/core@1.9.3(@swc/helpers@0.5.15))(@types/node@22.10.0)(typescript@5.7.2) typescript: - specifier: ^5.4.5 + specifier: 'catalog:' version: 5.7.2 webpack: - specifier: ^5.93.0 + specifier: catalog:storybook version: 5.96.1(@swc/core@1.9.3(@swc/helpers@0.5.15))(esbuild@0.24.0)(webpack-cli@5.1.4) webpack-cli: - specifier: ^5.1.4 + specifier: catalog:storybook version: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.96.1) webpack-dev-server: - specifier: ^5.0.4 + specifier: catalog:storybook version: 5.1.0(webpack-cli@5.1.4)(webpack@5.96.1) packages/config: From c44d2b06c32a208d6b4423f7dc4cd108b321b48d Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Tue, 3 Dec 2024 18:56:28 -0300 Subject: [PATCH 12/13] bump components package version --- packages/components/CHANGELOG.md | 6 ++++++ packages/components/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 021d747b..973b30df 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -1,5 +1,11 @@ # @baseapp-frontend/components +## 0.0.23 + +### Patch Changes + +- Create a component for listing the members of a profile + ## 0.0.22 ### Patch Changes diff --git a/packages/components/package.json b/packages/components/package.json index 11194558..1b8cf470 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,7 +1,7 @@ { "name": "@baseapp-frontend/components", "description": "BaseApp components modules such as comments, notifications, messages, and more.", - "version": "0.0.22", + "version": "0.0.23", "main": "./index.ts", "types": "dist/index.d.ts", "sideEffects": false, From 15a17cb271f48dd37985585b79030cb8428a1c1b Mon Sep 17 00:00:00 2001 From: Henrique Pozzolini Date: Wed, 4 Dec 2024 12:31:23 -0300 Subject: [PATCH 13/13] update graphql schema --- .../modules/profiles/Members/MemberListItem/index.tsx | 5 +++++ packages/components/schema.graphql | 9 +-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/components/modules/profiles/Members/MemberListItem/index.tsx b/packages/components/modules/profiles/Members/MemberListItem/index.tsx index aa9d1bf7..4c9373e7 100644 --- a/packages/components/modules/profiles/Members/MemberListItem/index.tsx +++ b/packages/components/modules/profiles/Members/MemberListItem/index.tsx @@ -18,6 +18,7 @@ const MemberListItem: FC = ({ const memberFragment = useFragment(MemberItemFragment, member) const nextMemberFragment = useFragment(MemberItemFragment, nextMember) const prevMemberFragment = useFragment(MemberItemFragment, prevMember) + const isActiveMember = memberFragment.status === MemberStatuses.active const isPreviousMemberInactive = prevMemberFragment?.status !== MemberStatuses.active const isPreviousMemberUndefined = !prevMemberFragment?.status @@ -25,7 +26,9 @@ const MemberListItem: FC = ({ const isFirstActiveMember = (isActiveMember && isPreviousMemberInactive) || (isActiveMember && isPreviousMemberUndefined) const isLastMemberInactive = !isActiveMember && isNextMemberUndefined + if (!memberFragment) return null + if (isFirstActiveMember) { return ( <> @@ -45,6 +48,7 @@ const MemberListItem: FC = ({ ) } + if (isLastMemberInactive) { return ( <> @@ -64,6 +68,7 @@ const MemberListItem: FC = ({ ) } + return (