Skip to content

Commit

Permalink
Implement pinned messages (#2011)
Browse files Browse the repository at this point in the history
* chore: do not open new tab when user is signed in

* fix: wrong position of parentheses

* feat: implement pinned message tooltip

* chore: revert unrelated changes

* feat: created PinnedMessages component

* chore: removed ProfileCard inside pinned message

* chore: optimized codes

* feat: add tooltip for unpin button

* fix: css space issue between user avatar and sender name in message base component

* chore: reverted change which is not related to the current issue

* chore: do not open new tab when user is signed in

* feat: improved style of pin button

* feat: improve css for pinned messages

* feat: contract implemented for pinning message

* chore: improved getters name to keep consistency

* feat: linked pinned messages to the component

* chore: do not open new tab when user is signed in

* chore: reverted unrelated changes

* feat: updated style of Button to list pinned messages

* feat: pin message

* feat: unpin message & sort pinned messages

* feat: scroll to pinned message

* feat: pinned messages would be updated if the original message is changed

* feat: add poll to pinned messages

* feat: only text and poll can be pinned

* feat: update pinned messages whenever original message is updated

* feat: preview attachments inside pinned messages

* feat: stop propagation in download attachment action inside pinned messages

* feat: display reactions to the pinned messages

* feat: implemented pinned by

* chore: do not open new tab when user is signed in

* chore: reverted unrelated changes

* fix: css styles for responsive

* feat: mobile design for pinned messages

* feat: implementING cypress test cases

* feat: completed test cases for pinned messages

* feat: add confirm dialog when unpin message

* feat: handle mentions in pinned messages

* chore: do not open new tab when user is signed in

* chore: improved style removing margin

* fix: error in passing params

* fix: update pinnedMessages when the original messages are edited

* feat: implement markdown and all mentions inside pinned messages

* chore: remove useless args in chatroom contract functions and Travis retry

* chore: removed useless args and Travis retry

* chore: removed useless args

* fix: cypress error

* fix: errors from cypress and initializing new chatroom state in ChatMain

* fix: error in cypress

* chore: minor updates and Travis retry

* feat: updated position of *N Pinned* in GroupChat

* fix: error in using getter

* feat: improved pinned style

* fix: error in logout and wait invocations from UNREAD_MESSAGES_QUEUE

* fix: cypress error

* chore: updated comment

* fix: Cypress error in logout before waiting for UNREAD_MESSAGES_QUEUE

* fix: update readUntilMessage before update contract state in Cypress mode

* chore: added comment and Travis retry to check if it passes in a row

* chore: fix wrong indent

* chore: add comment and Travis retry

* chore: Travis passes in a rowgit add .!

* chore: reverted unrelated code changes

* chore: reverted changes

* fix: tiny error

* feat: added 'unpin message' in message actions

* fix: error to display pinned messages in DM

* fix: error while logging out

* fix: DRY

* fix: syntax errors

* fix: error in using variable 'hash'

* fix: remove useless ipmort

* fix: flow error regarding variable initialization

* fix: optimization and added comments

* fix: resolved flow lint error

* fix: text overflow error inside PinnedMessages

* fix: to remove mhash in the query after hightlight it
  • Loading branch information
Silver-IT committed Jun 20, 2024
1 parent 8e032da commit eda1beb
Show file tree
Hide file tree
Showing 38 changed files with 977 additions and 352 deletions.
1 change: 1 addition & 0 deletions frontend/assets/style/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ $icons: (
tag: "\f02b",
times: "\f00d",
times-circle: "\f057",
thumbtack: "\f08D",
undo: "\f0e2",
user: "\f007",
user-plus: "\f234",
Expand Down
2 changes: 2 additions & 0 deletions frontend/controller/actions/chatroom.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ export default (sbp('sbp/selectors/register', {
...encryptedAction('gi.actions/chatroom/deleteMessage', L('Failed to delete message.')),
...encryptedAction('gi.actions/chatroom/deleteAttachment', L('Failed to delete attachment of message.')),
...encryptedAction('gi.actions/chatroom/makeEmotion', L('Failed to make emotion.')),
...encryptedAction('gi.actions/chatroom/pinMessage', L('Failed to pin message.')),
...encryptedAction('gi.actions/chatroom/unpinMessage', L('Failed to unpin message.')),
...encryptedAction('gi.actions/chatroom/join', L('Failed to join chat channel.'), async (sendMessage, params, signingKeyId) => {
const rootState = sbp('state/vuex/state')
const userID = params.data.memberID || rootState.loggedIn.identityContractID
Expand Down
3 changes: 2 additions & 1 deletion frontend/controller/actions/identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,8 @@ export default (sbp('sbp/selectors/register', {
}

if (deleteResult?.some(r => r.status === 'rejected')) {
console.error('[gi.actions/identity/removeFiles] Some CIDs could not be deleted', deleteResult.map((r, i) => r.status === 'rejected' && toDelete[i]).filter(Boolean))
console.error('[gi.actions/identity/removeFiles] Some CIDs could not be deleted',
deleteResult?.map((r, i) => r.status === 'rejected' && toDelete[i]).filter(Boolean))
throw new Error('Some CIDs could not be deleted')
}
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/model/chatroom/vuexModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const getters = {
Object.keys(rootState[cId].chatRooms).includes(chatRoomID))
},
chatRoomsInDetail (state, getters, rootState) {
const chatRoomsInDetail = merge({}, getters.getGroupChatRooms)
const chatRoomsInDetail = merge({}, getters.groupChatRooms)
for (const contractID in chatRoomsInDetail) {
const chatRoom = rootState[contractID]
if (chatRoom && chatRoom.attributes &&
Expand Down
Loading

0 comments on commit eda1beb

Please sign in to comment.