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

Added features to filter chats, edit messages, add users to group chat, share images as messages, and create dedicated group chats for events #2360

Open
wants to merge 62 commits into
base: develop-postgres
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
1ca936b
Initial commit
disha1202 Jun 8, 2024
c42da5e
Updated the UI of chat screen
disha1202 Jun 27, 2024
3742346
feat: added support to create group chat
disha1202 Jun 30, 2024
06f4af4
implemented group chats
disha1202 Jul 2, 2024
c18b97b
Implemented logic to send messages in group chat
disha1202 Jul 7, 2024
cbde8f7
refactor chat functionality
disha1202 Jul 12, 2024
9950269
fix format
disha1202 Jul 12, 2024
77a392c
refactor code
disha1202 Jul 13, 2024
eb54545
fix failing tests
disha1202 Jul 15, 2024
09427e6
Merge branch 'develop' of https://github.com/PalisadoesFoundation/tal…
disha1202 Jul 15, 2024
6fbaaa2
removed unwanted code
disha1202 Jul 15, 2024
8fffdc5
fix: formatting issues and reverted unwanted changes
disha1202 Jul 15, 2024
f76dc3e
removed unwanted code
disha1202 Jul 15, 2024
d4864a8
implemented reply functionality for direct chat
disha1202 Jul 20, 2024
75fa6c3
implemented reply functionality
disha1202 Jul 27, 2024
58086e2
Updated chat schema
disha1202 Jul 28, 2024
4d6f9a6
fix: contact card ui
disha1202 Jul 31, 2024
a68dcb4
removed unwanted code
disha1202 Jul 31, 2024
3df2541
feat: implemented unseen message functionality
disha1202 Aug 15, 2024
15385ae
fix: create group chat functionality
disha1202 Aug 18, 2024
65fb52d
added filters
disha1202 Aug 25, 2024
6eff29e
feat: add member to group chat
disha1202 Sep 1, 2024
e355314
feat: implemented logic to update group image and name
disha1202 Sep 8, 2024
e125d96
feat: moved chat to organization & added functionality to share media…
disha1202 Sep 9, 2024
1ee07f3
Merge branch 'develop' into schema-update
disha1202 Sep 21, 2024
4525924
fix: formatting issues
disha1202 Sep 21, 2024
f4b6fd0
fix: formatting issue
disha1202 Sep 21, 2024
74899fd
fix: formatting issue
disha1202 Sep 21, 2024
450b587
fix: type errors
disha1202 Sep 21, 2024
b1790e2
fix: tsdoc error
disha1202 Sep 21, 2024
fe66f0a
fix: formatting errors
disha1202 Sep 21, 2024
352b6b5
improve code coverage
disha1202 Sep 21, 2024
9a661e5
improved code coverage
disha1202 Sep 22, 2024
580260a
Merge branch 'develop' of https://github.com/disha1202/talawa-admin i…
disha1202 Sep 22, 2024
a1ea33b
feat: implemented edit message functionality
disha1202 Oct 13, 2024
182eded
Merge branch 'develop' into schema-update
disha1202 Oct 17, 2024
e6e5c24
Update Chat.tsx
disha1202 Oct 17, 2024
789aa19
feat: added option for creating a dedicated group chat for an event
disha1202 Oct 19, 2024
426f34c
Merge branch 'schema-update' of https://github.com/disha1202/talawa-a…
disha1202 Oct 19, 2024
11265e0
fix: failing test cases
disha1202 Oct 20, 2024
bb9ddc8
feat: implemented notifications
disha1202 Oct 20, 2024
85f698c
Merge branch 'develop' of https://github.com/PalisadoesFoundation/tal…
disha1202 Oct 20, 2024
d541812
Merge branch 'develop' of https://github.com/PalisadoesFoundation/tal…
disha1202 Oct 23, 2024
635a115
fix: failing tests
disha1202 Oct 25, 2024
9d581e8
Merge branch 'develop' of https://github.com/PalisadoesFoundation/tal…
disha1202 Oct 25, 2024
4b3850a
reverted unwanted changes
disha1202 Oct 25, 2024
da51531
revert unwanted changes
disha1202 Oct 25, 2024
5f463b0
Merge branch 'develop' of https://github.com/disha1202/talawa-admin i…
disha1202 Oct 26, 2024
a06cfc0
Merge branch 'unseen-msgs' of https://github.com/disha1202/talawa-adm…
disha1202 Oct 26, 2024
2abde8c
feat: added missing queries
disha1202 Oct 26, 2024
972ce3e
fix: formatting issues
disha1202 Oct 27, 2024
a552e05
fix: formatting issues
disha1202 Oct 27, 2024
a0afd7c
fix: failing test cases
disha1202 Oct 27, 2024
14a127a
removed unwanted changes
disha1202 Oct 27, 2024
622e2b6
fix: failing test cases
disha1202 Oct 27, 2024
ad599a9
Merge branch 'develop' into group-chat-features
disha1202 Oct 28, 2024
431e77a
updated translation files
disha1202 Oct 29, 2024
e520ed8
Merge branch 'group-chat-features' of https://github.com/disha1202/ta…
disha1202 Oct 29, 2024
6539100
Merge branch 'develop' of https://github.com/PalisadoesFoundation/tal…
disha1202 Oct 29, 2024
1597197
improved: code coverage
disha1202 Oct 30, 2024
38426f0
Merge branch 'develop' into group-chat-features
disha1202 Oct 30, 2024
566e8c2
Update public/locales/hi/translation.json
disha1202 Oct 30, 2024
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
14 changes: 12 additions & 2 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@
"recurringEvent": "Recurring Event",
"isPublic": "Is Public",
"isRegistrable": "Is Registrable",
"createChat": "Create Chat",
"createEvent": "Create Event",
"enterFilter": "Enter Filter",
"enterTitle": "Enter Title",
Expand Down Expand Up @@ -505,6 +506,7 @@
"recurringEvent": "Recurring Event",
"isPublic": "Is Public",
"isRegistrable": "Is Registrable",
"createChat": "Create Chat",
"updatePost": "Update Post",
"eventDetails": "Event Details",
"eventDeleted": "Event deleted successfully.",
Expand Down Expand Up @@ -1104,6 +1106,7 @@
"enterDescription": "Enter Description",
"publicEvent": "Is Public",
"registerable": "Is Registerable",
"createChat": "Create Chat",
"monthlyCalendarView": "Monthly Calendar",
"yearlyCalendarView": "Yearly Calender",
"startTime": "startTime",
Expand Down Expand Up @@ -1159,14 +1162,21 @@
"endOfResults": "endOfResults"
},
"userChat": {
"add": "Add",
"chat": "Chat",
"search": "Search",
"messages": "Messages",
"contacts": "Contacts"
"contacts": "Contacts",
"create": "Create",
"newChat": "New Chat",
"newGroupChat": "New Group Chat",
"groupInfo": "Group Info",
"members": "Members"
},
"userChatRoom": {
"selectContact": "Select a contact to start conversation",
"sendMessage": "Send Message"
"sendMessage": "Send Message",
"reply": "Reply"
Comment on lines +1206 to +1207
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing translations for message editing.

While "reply" functionality is supported, the translations don't include strings for editing messages, which was mentioned in the PR objectives.

Add the following translation keys:

  "userChatRoom": {
    "selectContact": "Select a contact to start conversation",
    "sendMessage": "Send Message",
    "reply": "Reply",
+   "editMessage": "Edit message",
+   "saveEdit": "Save changes",
+   "cancelEdit": "Cancel edit"
  }

Committable suggestion was skipped due to low confidence.

},
"orgProfileField": {
"loading": "Loading...",
Expand Down
20 changes: 15 additions & 5 deletions public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@
"startDate": "Date de début",
"endDate": "Date de fin",
"talawaApiUnavailable": "API Talawa indisponible",
"done": "Fait"
"done": "Fait",
"createChat": "Créer une discussion"
},
"organizationActionItems": {
"actionItemCategory": "Catégorie d'élément d'action",
Expand Down Expand Up @@ -531,7 +532,8 @@
"registerEvent": "Inscrire à l'événement",
"close": "Fermer",
"talawaApiUnavailable": "API Talawa non disponible",
"done": "Terminé"
"done": "Terminé",
"createChat": "Créer une discussion"
Comment on lines +562 to +563
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix inconsistent translation for "done".

The key "done" is translated differently across sections:

  • "Fait" in organizationEvents
  • "Terminé" in eventListCard

This inconsistency should be resolved by using the same translation throughout.

},
"funds": {
"title": "Fonds",
Expand Down Expand Up @@ -1115,7 +1117,8 @@
"eventDescription": "Description de l'événement",
"eventLocation": "Lieu de l'événement",
"startDate": "Date de début",
"endDate": "Date de fin"
"endDate": "Date de fin",
"createChat": "Créer une discussion"
},
"userEventCard": {
"starts": "Départs",
Expand Down Expand Up @@ -1159,14 +1162,21 @@
"endOfResults": "Fin des résultats"
},
"userChat": {
"add": "Ajouter",
"chat": "Chat",
"contacts": "Contacts",
"search": "rechercher",
"messages": "messages"
"messages": "messages",
"create": "créer",
"newChat": "nouvelle discussion",
"newGroupChat": "Nouvelle discussion de groupe",
"groupInfo": "Informations sur le groupe",
"members": "Membres"
},
"userChatRoom": {
"selectContact": "Sélectionnez un contact pour démarrer la conversation",
"sendMessage": "Envoyer le message"
"sendMessage": "Envoyer le message",
"reply": "répondre"
},
"orgProfileField": {
"loading": "Chargement...",
Expand Down
20 changes: 15 additions & 5 deletions public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@
"startDate": "प्रारंभ तिथि",
"endDate": "समाप्ति तिथि",
"talawaApiUnavailable": "Talawa API अनुपलब्ध",
"done": "पूर्ण"
"done": "पूर्ण",
"createChat": "चैट बनाएं"
Comment on lines +426 to +427
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Move chat-related translations to the appropriate section.

The translations for "done" and "createChat" appear to be misplaced in the "organizationEvents" section. These strings are related to chat functionality and should be moved to the "userChat" or "userChatRoom" sections for better organization and maintainability.

Apply this diff to move the translations to the appropriate section:

  "organizationEvents": {
-   "done": "पूर्ण",
-   "createChat": "चैट बनाएं"
  },
  "userChat": {
+   "done": "पूर्ण",
+   "createChat": "चैट बनाएं"
  }

Committable suggestion was skipped due to low confidence.

},
"organizationActionItems": {
"actionItemCategory": "कार्य आइटम श्रेणी",
Expand Down Expand Up @@ -531,7 +532,8 @@
"registerEvent": "कार्यक्रम के लिए पंजीकरण करें",
"close": "बंद करें",
"talawaApiUnavailable": "Talawa API अनुपलब्ध",
"done": "समाप्त"
"done": "समाप्त",
"createChat": "चैट बनाएं"
Comment on lines +562 to +563
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Move chat-related translations to the appropriate section.

Similarly, the translations for "done" and "createChat" in the "eventListCard" section should be moved to the "userChat" section to maintain consistency and avoid duplication.

Apply this diff to consolidate chat-related translations:

  "eventListCard": {
-   "done": "समाप्त",
-   "createChat": "चैट बनाएं"
  },
  "userChat": {
+   "done": "समाप्त",
+   "createChat": "चैट बनाएं"
  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"done": "समाप्त",
"createChat": "चैट बनाएं"
"done": "समाप्त",
"createChat": "चैट बनाएं"

},
"funds": {
"title": "फंड",
Expand Down Expand Up @@ -1115,7 +1117,8 @@
"eventDescription": "कार्यक्रम विवरण",
"eventLocation": "कार्यक्रम स्थान",
"startDate": "प्रारंभ तिथि",
"endDate": "समाप्ति तिथि"
"endDate": "समाप्ति तिथि",
"createChat": "चैट बनाएं"
},
"userEventCard": {
"starts": "प्रारंभ होगा",
Expand Down Expand Up @@ -1159,14 +1162,21 @@
"endOfResults": "परिणाम समाप्त"
},
"userChat": {
"add": "जोड़ें",
"chat": "बात करना",
"contacts": "संपर्क",
"search": "खोज",
"messages": "संदेश"
"messages": "संदेश",
"create": "बनाएं",
"newChat": "नई चैट",
"newGroupChat": "नया समूह चैट",
"groupInfo": "समूह जानकारी",
"members": "सदस्यों"
},
"userChatRoom": {
"selectContact": "बातचीत शुरू करने के लिए एक संपर्क चुनें",
"sendMessage": "मेसेज भेजें"
"sendMessage": "मेसेज भेजें",
"reply": "जवाब"
},
"orgProfileField": {
"loading": "लोड हो रहा है...",
Expand Down
20 changes: 15 additions & 5 deletions public/locales/sp/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@
"on": "En",
"after": "Después de",
"occurences": "ocurrencias",
"done": "Hecho"
"done": "Hecho",
"createChat": "Crear chat"
},
"organizationActionItems": {
"actionItemCategory": "Categoría del ítem de acción",
Expand Down Expand Up @@ -531,7 +532,8 @@
"on": "En",
"after": "Después de",
"occurences": "ocurrencias",
"done": "Hecho"
"done": "Hecho",
"createChat": "Crear chat"
},
"funds": {
"title": "Fondos",
Expand Down Expand Up @@ -1116,7 +1118,8 @@
"publicEvent": "Es público",
"registerable": "Es registrable",
"monthlyCalendarView": "Calendario mensual",
"yearlyCalendarView": "Calendario anual"
"yearlyCalendarView": "Calendario anual",
"createChat": "Crear chat"
},
"userEventCard": {
"location": "Ubicación",
Expand Down Expand Up @@ -1160,14 +1163,21 @@
"createAdvertisement": "Crear publicidad"
},
"userChat": {
"add": "Agregar",
"chat": "Charlar",
"search": "Buscar",
"contacts": "Contactos",
"messages": "Mensajes"
"messages": "Mensajes",
"create": "crear",
"newChat": "nueva charla",
"newGroupChat": "Nuevo chat grupal",
"groupInfo": "Información del grupo",
"members": "Miembros"
},
"userChatRoom": {
"selectContact": "Seleccione un contacto para iniciar una conversación",
"sendMessage": "Enviar mensaje"
"sendMessage": "Enviar mensaje",
"reply": "responder"
},
"orgProfileField": {
"loading": "Cargando..",
Expand Down
20 changes: 15 additions & 5 deletions public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@
"startDate": "开始日期",
"endDate": "结束日期",
"talawaApiUnavailable": "塔拉瓦 API 不可用",
"done": "完成"
"done": "完成",
"createChat": "创建聊天"
Comment on lines +426 to +427
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Consolidate redundant "createChat" translations.

The translation key "createChat" with value "创建聊天" is duplicated across multiple sections. Consider consolidating it into a single location under the "userChat" section.

Apply this diff:

  "organizationEvents": {
    "done": "完成",
-   "createChat": "创建聊天"
  },
  "eventListCard": {
    "done": "完成",
-   "createChat": "创建聊天"
  },
  "userEvents": {
    "endDate": "结束日期",
-   "createChat": "创建聊天"
  },
  "userChat": {
    "add": "添加",
    "chat": "聊天",
    ...
+   "createChat": "创建聊天"
  }

Also applies to: 562-563, 1147-1148

},
"organizationActionItems": {
"actionItemCategory": "行动项目类别",
Expand Down Expand Up @@ -531,7 +532,8 @@
"registerEvent": "注册活动",
"close": "关闭",
"talawaApiUnavailable": "塔拉瓦 API 不可用",
"done": "完成"
"done": "完成",
"createChat": "创建聊天"
},
"funds": {
"title": "基金",
Expand Down Expand Up @@ -1115,7 +1117,8 @@
"eventDescription": "活动描述",
"eventLocation": "活动位置",
"startDate": "开始日期",
"endDate": "结束日期"
"endDate": "结束日期",
"createChat": "创建聊天"
},
"userEventCard": {
"starts": "开始",
Expand Down Expand Up @@ -1159,14 +1162,21 @@
"endOfResults": "结果结束"
},
"userChat": {
"add": "添加",
"chat": "聊天",
"contacts": "联系方式",
"search": "搜索",
"messages": "消息"
"messages": "消息",
"create": "创造",
"newChat": "新聊天",
"newGroupChat": "新群聊",
"groupInfo": "集团信息",
"members": "会员"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add missing translations for core chat features.

While basic chat translations are present, translations for several key features mentioned in the PR objectives are missing:

  • Filtering chats
  • Editing messages
  • Image sharing in messages

Add the following translations:

  "userChat": {
    "add": "添加",
    "chat": "聊天",
    "contacts": "联系方式",
    "search": "搜索",
    "messages": "消息",
    "create": "创造",
    "newChat": "新聊天",
    "newGroupChat": "新群聊",
    "groupInfo": "集团信息",
    "members": "会员",
+   "filterChats": "筛选聊天",
+   "editMessage": "编辑消息",
+   "shareImage": "分享图片"
  }

Committable suggestion was skipped due to low confidence.

},
"userChatRoom": {
"selectContact": "选择联系人开始对话",
"sendMessage": "发信息"
"sendMessage": "发信息",
"reply": "回复"
},
"orgProfileField": {
"loading": "加载中...",
Expand Down
14 changes: 2 additions & 12 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ type ChatMessage {
createdAt: DateTime!
chatMessageBelongsTo: Chat!
messageContent: String!
type: String!
replyTo: ChatMessage
sender: User!
deletedBy: [User]
Expand Down Expand Up @@ -692,7 +691,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,7 +704,6 @@ 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!
Expand Down Expand Up @@ -766,15 +763,8 @@ type Mutation {
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!
sendMessageToChat(chatId: ID!, messageContent: String!, replyTo: ID): ChatMessage!
markChatMessagesAsRead(chatId: ID!, userId: ID!): Chat
Comment on lines +766 to +767
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider enhancing markChatMessagesAsRead mutation.

The mutation could be improved by:

  1. Returning the number of messages marked as read
  2. Supporting batch operations for multiple chats

Consider this alternative design:

type MarkChatMessagesAsReadPayload {
  chat: Chat!
  markedMessagesCount: Int!
}

extend type Mutation {
  markChatMessagesAsRead(input: MarkChatMessagesAsReadInput!): MarkChatMessagesAsReadPayload!
}

input MarkChatMessagesAsReadInput {
  chatId: ID!
  userId: ID!
  """
  Optional: Mark messages as read up to this message ID
  If not provided, marks all messages as read
  """
  upToMessageId: ID
}

signUp(data: UserInput!, file: String): AuthData!
togglePostPin(id: ID!, title: String): Post!
unassignUserTag(input: ToggleUserTagAssignInput!): User
Expand Down
3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,14 @@ function app(): JSX.Element {
<Route element={<SecuredRouteForUser />}>
<Route path="/user/organizations" element={<Organizations />} />
<Route path="/user/settings" element={<Settings />} />
<Route path="/user/chat" element={<Chat />} />
{/* <Route path="/user/chat" element={<Chat />} /> */}
<Route element={<UserScreen />}>
<Route path="/user/organizations" element={<Organizations />} />
<Route path="/user/organization/:orgId" element={<Posts />} />
<Route path="/user/people/:orgId" element={<People />} />
<Route path="/user/donate/:orgId" element={<Donate />} />
<Route path="/user/events/:orgId" element={<Events />} />
<Route path="/user/chat/:orgId" element={<Chat />} />
<Route path="/user/campaigns/:orgId" element={<Campaigns />} />
<Route path="/user/pledges/:orgId" element={<Pledges />} />
<Route element={<EventDashboardScreen />}>
Expand Down
Loading
Loading