Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
17971cd
Add listable flags attribute for conversations
PVince81 Dec 1, 2020
9646678
Added search provider for listed conversations
PVince81 Dec 1, 2020
f4d2622
WIP add listed conversation to the left sidebar results
PVince81 Dec 1, 2020
353206e
Adjust approach for search results for listable rooms
PVince81 Dec 2, 2020
65238d1
Adjustments for listable rooms after review
PVince81 Dec 2, 2020
fddac32
Tweak left sidebar behavior with listed search results
PVince81 Dec 2, 2020
6f8d1e6
Make it possible to join listed group conversations
PVince81 Dec 2, 2020
4b58da2
Fix filtering of listable rooms
PVince81 Dec 2, 2020
138aeb4
Fix participant service guest user check
PVince81 Dec 2, 2020
3276538
Switch+scroll to joined listed conversation
PVince81 Dec 3, 2020
89f05b4
Add conversation to store early when joining
PVince81 Dec 3, 2020
0aa0dcf
Apply suggestions from code review of listable rooms feature
PVince81 Dec 4, 2020
fea3c64
Post a system message when joining a listable room
PVince81 Dec 4, 2020
74dd434
Don't add conversation to list for guests
PVince81 Dec 4, 2020
506358d
Unit tests for system messages
PVince81 Dec 4, 2020
b7a118a
Check that guests app is enabled when checking
PVince81 Dec 7, 2020
52b88a9
Cleanup listed room code after review
PVince81 Dec 7, 2020
6d75ad2
Added integration tests for joining listable rooms
PVince81 Dec 7, 2020
7748fb9
Extend spreedcheats to allow creating guest account users
PVince81 Dec 8, 2020
0cdd452
Abort php test server on ctrl+c
PVince81 Dec 9, 2020
bcc9f8f
Fix updating listable attribute from occ
PVince81 Dec 9, 2020
10840fd
Fix tests for listable conversations
PVince81 Dec 9, 2020
0e1ed5d
Reword listable in UI by calling it findable
PVince81 Dec 10, 2020
2b54740
Moved ListableSettings into an own component
PVince81 Dec 10, 2020
777c7b6
Changed wording to say visible instead of listable
PVince81 Dec 10, 2020
4d4a484
Added listable settings to new conversation dialog
PVince81 Dec 10, 2020
549e9ec
Small adjustments to listable feature after reviews
PVince81 Dec 11, 2020
fa74ef3
Move listable and locking to new section
PVince81 Dec 11, 2020
5a3a552
Revert "Added search provider for listed conversations"
PVince81 Dec 11, 2020
a4a6c02
Improve room display name protection
PVince81 Dec 11, 2020
f04e3b5
Make listable column smallint
PVince81 Dec 11, 2020
63b020a
Remove redundant isset
PVince81 Dec 11, 2020
71fa517
Adjusted listable docs + increased version
PVince81 Dec 14, 2020
bedea3e
Adjust listable setting field width
PVince81 Dec 14, 2020
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
Prev Previous commit
Next Next commit
Switch+scroll to joined listed conversation
When joining a listed conversation, the left sidebar now switches back
to the full list and displays a temporary entry while the joining
process is running.

When joining a conversation, the conversation list now automatically
scrolls to the item. It often happens that listable conversation entries
appear lower in the list, so they need to be made visible.

Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 committed Dec 11, 2020
commit 3276538af5d504af56fc801688975213d678020f
15 changes: 13 additions & 2 deletions src/components/LeftSidebar/ConversationsList/Conversation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
<AppContentListItem
:title="item.displayName"
:anchor-id="`conversation_${item.token}`"
:to="{ name: 'conversation', params: { token: item.token }}"
:class="{ 'has-unread-messages': item.unreadMessages }">
:to="!isSearchResult ? { name: 'conversation', params: { token: item.token }} : ''"
:class="{ 'has-unread-messages': item.unreadMessages }"
@click="onClick">
<template v-slot:icon>
<ConversationIcon
:item="item"
Expand Down Expand Up @@ -196,6 +197,11 @@ export default {
},

conversationInformation() {
// temporary item while joining
if (!this.isSearchResult && !this.item.actorId) {
return t('spreed', 'Joining conversation...')
}

if (!Object.keys(this.lastChatMessage).length) {
return ''
}
Expand Down Expand Up @@ -361,6 +367,11 @@ export default {
await setNotificationLevel(this.item.token, level)
this.item.notificationLevel = level
},

// forward click event
onClick(event) {
this.$emit('click', event)
},
},
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,21 @@ export default {
mounted() {
EventBus.$on('routeChange', this.onRouteChange)
EventBus.$on('newMessagePosted', this.onMessagePosted)
EventBus.$on('joinedConversation', this.onJoinedConversation)
},

beforeDestroy() {
EventBus.$off('routeChange', this.onRouteChange)
EventBus.$off('newMessagePosted', this.onMessagePosted)
EventBus.$off('joinedConversation', this.onJoinedConversation)
},

methods: {
onMessagePosted({ token }) {
scrollToConversation(token) {
const conversation = document.getElementById(`conversation_${token}`)
if (!conversation) {
return
}
this.$nextTick(() => {
conversation.scrollIntoView({
behavior: 'smooth',
Expand All @@ -94,6 +99,12 @@ export default {
})
})
},
onJoinedConversation({ token }) {
this.scrollToConversation(token)
},
onMessagePosted({ token }) {
this.scrollToConversation(token)
},
onRouteChange({ from, to }) {
if (from.name === 'conversation'
&& to.name === 'conversation'
Expand Down
24 changes: 8 additions & 16 deletions src/components/LeftSidebar/LeftSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
:key="item.id"
:item="item"
:is-search-result="true"
@click="joinListedConversation" />
@click="joinListedConversation(item)" />
</template>
<template v-if="searchResultsUsers.length !== 0">
<Caption
Expand Down Expand Up @@ -299,13 +299,6 @@ export default {
this.focusInitialise()
},

async joinListedConversation(item) {
// there's already an event handler in Component.vue that will take care
// of switching the route,
// so all we need to do today is reset the UI
EventBus.$emit('resetSearchFilter')
},

/**
* Create a new conversation with the selected group/user/circle
* @param {Object} item The autocomplete suggestion to start a conversation with
Expand All @@ -325,6 +318,13 @@ export default {
EventBus.$emit('resetSearchFilter')
},

async joinListedConversation(conversation) {
// add as temporary item that will refresh after the joining process is complete
this.$store.dispatch('addConversation', conversation)
this.$router.push({ name: 'conversation', params: { token: conversation.token } }).catch(err => console.debug(`Error while pushing the new conversation's route: ${err}`))
EventBus.$emit('resetSearchFilter')
},

hasOneToOneConversationWith(userId) {
return !!this.conversationsList.find(conversation => conversation.type === CONVERSATION.TYPE.ONE_TO_ONE && conversation.name === userId)
},
Expand All @@ -341,14 +341,6 @@ export default {
handleClickSearchResult(selectedConversationToken) {
// End the search operation
this.abortSearch()
const selectedConversation = document.getElementById(`conversation_${selectedConversationToken}`)
this.$nextTick(() => {
selectedConversation.scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'nearest',
})
})
},

sortConversations(conversation1, conversation2) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/participantsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const joinConversation = async(token) => {
// FIXME Signaling should not be synchronous
await signalingJoinConversation(token, response.data.ocs.data.sessionId)
SessionStorage.setItem('joined_conversation', token)
EventBus.$emit('joinedConversation')
EventBus.$emit('joinedConversation', { token })
return response
} catch (error) {
if (error.response.status === 409) {
Expand Down