Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: removed unused references of group chat and direct chat #2394

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 0 additions & 99 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -214,25 +214,6 @@ type DeletePayload {
success: Boolean!
}

type DirectChat {
_id: ID!
createdAt: DateTime!
creator: User
messages: [DirectChatMessage]
updatedAt: DateTime!
users: [User!]!
}

type DirectChatMessage {
_id: ID!
createdAt: DateTime!
directChatMessageBelongsTo: DirectChat!
messageContent: String!
receiver: User!
sender: User!
updatedAt: DateTime!
}

type Donation {
_id: ID!
amount: Float!
Expand Down Expand Up @@ -470,26 +451,6 @@ type Group {
updatedAt: DateTime!
}

type GroupChat {
_id: ID!
title: String!
createdAt: DateTime!
creator: User
messages: [GroupChatMessage]
organization: Organization!
updatedAt: DateTime!
users: [User!]!
}

type GroupChatMessage {
_id: ID!
createdAt: DateTime!
groupChatMessageBelongsTo: GroupChat!
messageContent: String!
sender: User!
updatedAt: DateTime!
}

type InvalidCursor implements FieldError {
message: String!
path: [String!]!
Expand Down Expand Up @@ -579,31 +540,6 @@ type MembershipRequest {
user: User!
}

type Message {
_id: ID!
createdAt: DateTime!
creator: User
imageUrl: URL
text: String!
updatedAt: DateTime!
videoUrl: URL
}

type MessageChat {
_id: ID!
createdAt: DateTime!
languageBarrier: Boolean
message: String!
receiver: User!
sender: User!
updatedAt: DateTime!
}

input MessageChatInput {
message: String!
receiver: ID!
}

type MinimumLengthError implements FieldError {
limit: Int!
message: String!
Expand Down Expand Up @@ -659,10 +595,8 @@ type Mutation {
organizationId: ID!
): UserCustomData!
addUserImage(file: String!): User!
addUserToGroupChat(chatId: ID!, userId: ID!): GroupChat!
addUserToUserFamily(familyId: ID!, userId: ID!): UserFamily!
adminRemoveEvent(eventId: ID!): Event!
adminRemoveGroup(groupId: ID!): GroupChat!
assignUserTag(input: ToggleUserTagAssignInput!): User
blockPluginCreationBySuperadmin(
blockUser: Boolean!
Expand Down Expand Up @@ -692,7 +626,6 @@ type Mutation {
createAgendaCategory(input: CreateAgendaCategoryInput!): AgendaCategory!
createComment(data: CommentInput!, postId: ID!): Comment
createChat(data: chatInput!): Chat!
createDirectChat(data: createChatInput!): DirectChat!
createDonation(
amount: Float!
nameOfOrg: String!
Expand All @@ -706,9 +639,7 @@ type Mutation {
recurrenceRuleData: RecurrenceRuleInput
): Event!
createEventVolunteer(data: EventVolunteerInput!): EventVolunteer!
createGroupChat(data: createGroupChatInput!): GroupChat!
createMember(input: UserAndOrganizationInput!): Organization!
createMessageChat(data: MessageChatInput!): MessageChat!
createOrganization(data: OrganizationInput, file: String): Organization!
createPlugin(
pluginCreatedBy: String!
Expand Down Expand Up @@ -743,11 +674,9 @@ type Mutation {
removeAdmin(data: UserAndOrganizationInput!): AppUserProfile!
removeAdvertisement(id: ID!): Advertisement
removeComment(id: ID!): Comment
removeDirectChat(chatId: ID!, organizationId: ID!): DirectChat!
removeEvent(id: ID!): Event!
removeEventAttendee(data: EventAttendeeInput!): User!
removeEventVolunteer(id: ID!): EventVolunteer!
removeGroupChat(chatId: ID!): GroupChat!
removeMember(data: UserAndOrganizationInput!): Organization!
removeOrganization(id: ID!): UserData!
removeOrganizationCustomField(
Expand All @@ -759,22 +688,13 @@ type Mutation {
removeSampleOrganization: Boolean!
removeUserCustomData(organizationId: ID!): UserCustomData!
removeUserFamily(familyId: ID!): UserFamily!
removeUserFromGroupChat(chatId: ID!, userId: ID!): GroupChat!
removeUserFromUserFamily(familyId: ID!, userId: ID!): UserFamily!
removeUserImage: User!
removeUserTag(id: ID!): UserTag
revokeRefreshTokenForUser: Boolean!
saveFcmToken(token: String): Boolean!
sendMembershipRequest(organizationId: ID!): MembershipRequest!
sendMessageToChat(chatId: ID!, messageContent: String!, type: String!, replyTo: ID): ChatMessage!
sendMessageToDirectChat(
chatId: ID!
messageContent: String!
): DirectChatMessage!
sendMessageToGroupChat(
chatId: ID!
messageContent: String!
): GroupChatMessage!
signUp(data: UserInput!, file: String): AuthData!
togglePostPin(id: ID!, title: String): Post!
unassignUserTag(input: ToggleUserTagAssignInput!): User
Expand Down Expand Up @@ -1096,11 +1016,6 @@ type Query {
customFieldsByOrganization(id: ID!): [OrganizationCustomField]
chatById(id: ID!): Chat!
chatsByUserId(id: ID!): [Chat]
directChatsByUserID(id: ID!): [DirectChat]
directChatsMessagesByChatID(id: ID!): [DirectChatMessage]
directChatById(id: ID!): DirectChat
groupChatById(id: ID!): DirectChat
groupChatsByUserId(id: ID!): [GroupChat]
event(id: ID!): Event
eventVolunteersByEvent(id: ID!): [EventVolunteer]
eventsByOrganization(id: ID, orderBy: EventOrderByInput): [Event]
Expand Down Expand Up @@ -1195,10 +1110,7 @@ enum Status {
}

type Subscription {
directMessageChat: MessageChat
messageSentToChat(userId: ID!): ChatMessage
messageSentToDirectChat(userId: ID!): DirectChatMessage
messageSentToGroupChat(userId: ID!): GroupChatMessage
onPluginUpdate: Plugin
}

Expand Down Expand Up @@ -1592,17 +1504,6 @@ enum WeekDays {
WE
}

input createChatInput {
organizationId: ID
userIds: [ID!]!
}

input createGroupChatInput {
organizationId: ID!
title: String!
userIds: [ID!]!
}

type Venue {
_id: ID!
capacity: Int!
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQl/Mutations/OrganizationMutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const REMOVE_SAMPLE_ORGANIZATION_MUTATION = gql`
`;

/**
* GraphQL mutation to create a direct chat between users in an organization.
* GraphQL mutation to create a chat between users in an organization.
*
* @param userIds - An array of user IDs participating in the direct chat.
* @param organizationId - The ID of the organization where the direct chat is created.
Expand Down
8 changes: 3 additions & 5 deletions src/GraphQl/Queries/PlugInQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,12 @@ export const ORGANIZATION_EVENTS_CONNECTION = gql`
`;

/**
* GraphQL query to retrieve a list of direct chats based on user ID.
* GraphQL query to retrieve a list of chats based on user ID.
*
* @param id - The ID of the user for which direct chats are being retrieved.
* @returns The list of direct chats associated with the user, including details such as ID, creator, messages, organization, and participating users.
* @param id - The ID of the user for which chats are being retrieved.
* @returns The list of chats associated with the user, including details such as ID, creator, messages, organization, and participating users.
disha1202 marked this conversation as resolved.
Show resolved Hide resolved
*/

// directChatsMessagesByChatID(id: ID!): [DirectChatMessage]

export const CHAT_BY_ID = gql`
query chatById($id: ID!) {
chatById(id: $id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ const MESSAGE_SENT_TO_CHAT_MOCK = [
},
result: {
data: {
messageSentToGroupChat: {
messageSentToChat: {
_id: '668ec1f1df364e03ac47a151',
createdAt: '2024-07-10T17:16:33.248Z',
messageContent: 'Test ',
Expand All @@ -382,7 +382,7 @@ const MESSAGE_SENT_TO_CHAT_MOCK = [
},
result: {
data: {
messageSentToGroupChat: {
messageSentToChat: {
_id: '668ec1f13603ac4697a151',
createdAt: '2024-07-10T17:16:33.248Z',
messageContent: 'Test ',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ const MESSAGE_SENT_TO_CHAT_MOCK = [
},
result: {
data: {
messageSentToGroupChat: {
messageSentToChat: {
_id: '668ec1f1df364e03ac47a151',
createdAt: '2024-07-10T17:16:33.248Z',
messageContent: 'Test ',
Expand All @@ -1260,7 +1260,7 @@ const MESSAGE_SENT_TO_CHAT_MOCK = [
},
result: {
data: {
messageSentToGroupChat: {
messageSentToChat: {
_id: '668ec1f13603ac4697a151',
createdAt: '2024-07-10T17:16:33.248Z',
messageContent: 'Test ',
Expand Down
22 changes: 0 additions & 22 deletions src/components/UserPortal/CreateGroupChat/CreateGroupChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,28 +201,6 @@ export default function CreateGroupChat({
</Modal.Header>
<Modal.Body>
<Form>
{/* <FormControl fullWidth>
<InputLabel id="select-org">Select Organization</InputLabel>
<Select
labelId="select-org"
id="select-org"
data-testid="orgSelect"
label="Select Organization"
value={selectedOrganization}
onChange={(e) => handleChange(e)}
>
{organizations?.length &&
organizations.map((organization: InterfaceOrganization) => (
<MenuItem
data-testid="selectOptions"
key={organization._id}
value={organization._id}
>
{`${organization.name}(${organization.address?.city},${organization.address?.state},${organization.address?.countryCode})`}
</MenuItem>
))}
</Select>
</FormControl> */}
<FormControl fullWidth>
<InputLabel id="select-org">Select Organization</InputLabel>
<Select
Expand Down
4 changes: 2 additions & 2 deletions src/screens/UserPortal/Chat/Chat.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ const MESSAGE_SENT_TO_CHAT_MOCK = [
},
result: {
data: {
messageSentToGroupChat: {
messageSentToChat: {
_id: '668ec1f1df364e03ac47a151',
createdAt: '2024-07-10T17:16:33.248Z',
messageContent: 'Test ',
Expand All @@ -724,7 +724,7 @@ const MESSAGE_SENT_TO_CHAT_MOCK = [
},
result: {
data: {
messageSentToGroupChat: {
messageSentToChat: {
_id: '668ec1f13603ac4697a151',
createdAt: '2024-07-10T17:16:33.248Z',
messageContent: 'Test ',
Expand Down
Loading