Skip to content

Commit

Permalink
Fix some UI issues (#2251)
Browse files Browse the repository at this point in the history
* fix: error in redirecting chatroom

* fix: error in opening an wrong URL with query

* fix: to revoke invite link which are already revoked

* fix: styling issue inside pinned messages

* fix: reverted useless change
  • Loading branch information
Silver-IT committed Jul 25, 2024
1 parent 938161d commit cb73265
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
14 changes: 10 additions & 4 deletions frontend/views/containers/chatroom/ChatMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,21 @@ const ChatMixin: Object = {
},
methods: {
redirectChat (chatRoomID: string) {
const name = 'GroupChatConversation'
// Temporarily blocked the chatrooms which the user is not part of
// Need to open it later and display messages just like Slack
chatRoomID = chatRoomID || (this.isJoinedChatRoom(this.currentChatRoomId) ? this.currentChatRoomId : this.groupGeneralChatRoomId)

// NOTE: for better understanding created a variable `shouldUseAlternative` instead of using !chatRoomID.
// to skip passing `chatRoomID` parameter means an intention to redirect to another chatroom
// this happens when the wrong (or cannot accessable) chatRoomID is used while opening group-chat URL
const shouldUseAlternative = !chatRoomID
if (shouldUseAlternative) {
chatRoomID = this.isJoinedChatRoom(this.currentChatRoomId) ? this.currentChatRoomId : this.groupGeneralChatRoomId
}

this.$router.push({
name,
name: 'GroupChatConversation',
params: { chatRoomID },
query: { ...this.$route.query }
query: !shouldUseAlternative ? { ...this.$route.query } : {}
}).catch(logExceptNavigationDuplicated)
},
refreshTitle (title?: string): void {
Expand Down
6 changes: 5 additions & 1 deletion frontend/views/containers/chatroom/PinnedMessages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,11 @@ export default {
.c-pinned-message-content {
margin: 0.5rem 0;
word-break: break-word;
.c-text {
white-space: pre-line;
word-break: break-word;
}
.c-poll-inner {
position: relative;
Expand Down
12 changes: 8 additions & 4 deletions frontend/views/containers/group-settings/InvitationsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,14 @@ export default ({
}
},
showRevokeLinkMenu (inviteItem) {
return inviteItem.isAnyoneLink
? this.isUserGroupCreator &&
this.groupShouldPropose // 'Anyone' link must only be revokable when the group size is >= 3 (context: https://github.com/okTurtles/group-income/issues/1670)
: inviteItem.status.isActive
if (inviteItem.status.isActive) {
if (inviteItem.isAnyoneLink) {
// 'Anyone' link must only be revokable when the group size is >= 3 (context: https://github.com/okTurtles/group-income/issues/1670)
return this.isUserGroupCreator && this.groupShouldPropose
}
return true
}
return false
},
handleInviteClick (e) {
if (e.target.classList.contains('js-btnInvite')) {
Expand Down

0 comments on commit cb73265

Please sign in to comment.