Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
New button to disable lobby in sidebar
Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 committed Jan 22, 2021
commit d96b4c3e432a0bf3ca27b991acc4c43cca1fa10f
65 changes: 65 additions & 0 deletions src/components/RightSidebar/LobbyStatus.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!--
- @copyright Copyright (c) 2020 Vincent Petry <[email protected]>
-
- @author Vincent Petry <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<template>
<button @click="disableLobby">
{{ t('spreed', 'Disable lobby' ) }}
</button>
</template>

<script>
import { showError, showSuccess } from '@nextcloud/dialogs'

export default {
name: 'LobbyStatus',

props: {
token: {
type: String,
required: true,
},
},

data() {
return {
isLobbyStateLoading: false,
}
},

methods: {
async disableLobby() {
this.isLobbyStateLoading = true
try {
await this.$store.dispatch('toggleLobby', {
token: this.token,
enableLobby: false,
})
showSuccess(t('spreed', 'You opened the conversation to everyone'))
} catch (e) {
console.error('Error occurred when opening the conversation to everyone', e)
showError(t('spreed', 'Error occurred when opening the conversation to everyone'))
}
this.isLobbyStateLoading = false
},
},
}

</script>
33 changes: 23 additions & 10 deletions src/components/RightSidebar/RightSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,18 @@
@submit-title="handleSubmitTitle"
@dismiss-editing="dismissEditing"
@close="handleClose">
<Description
v-if="showDescription"
slot="description"
:editable="canFullModerate"
:description="description"
:editing="isEditingDescription"
:loading="isDescriptionLoading"
:placeholder="t('spreed', 'Add a description for this conversation')"
@submit:description="handleUpdateDescription"
@update:editing="handleEditDescription" />
<template slot="description">
<Description
v-if="showDescription"
:editable="canFullModerate"
:description="description"
:editing="isEditingDescription"
:loading="isDescriptionLoading"
:placeholder="t('spreed', 'Add a description for this conversation')"
@submit:description="handleUpdateDescription"
@update:editing="handleEditDescription" />
<LobbyStatus v-if="canFullModerate && hasLobbyEnabled" :token="token" />
</template>
<AppSidebarTab
v-if="showChatInSidebar"
id="chat"
Expand Down Expand Up @@ -102,6 +104,7 @@ import isInLobby from '../../mixins/isInLobby'
import SetGuestUsername from '../SetGuestUsername'
import SipSettings from './SipSettings'
import Description from './Description/Description'
import LobbyStatus from './LobbyStatus'
import { EventBus } from '../../services/EventBus'
import { showError } from '@nextcloud/dialogs'

Expand All @@ -116,6 +119,7 @@ export default {
SetGuestUsername,
SipSettings,
Description,
LobbyStatus,
},

mixins: [
Expand Down Expand Up @@ -222,6 +226,11 @@ export default {
return this.description !== ''
}
},

hasLobbyEnabled() {
return this.conversation.lobbyState === WEBINAR.LOBBY.NON_MODERATORS
},

},

watch: {
Expand Down Expand Up @@ -321,6 +330,10 @@ export default {
display: flex;
}

::v-deep .app-sidebar-header__description {
flex-direction: column;
}

.app-sidebar-tabs__content #tab-chat {
/* Remove padding to maximize the space for the chat view. */
padding: 0;
Expand Down