From 959abc1c766a2bbe25ef590126e83f3738f169ec Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 11 Nov 2020 12:22:22 +0100 Subject: [PATCH 1/2] Add "more settings" menu item to open sidebar settings Created a new dialog for conversation settings. It includes the share link settings (aka guest access), the moderation settings and the SIP settings. Added notifications after success/error when saving. Added field disabling logic while saving which provides some visual feedback. Refactored various "conversation" computed properties to all use the same dummy conversation object when the token was not found. Signed-off-by: Vincent Petry --- src/App.vue | 3 + .../ConversationSettingsDialog.vue | 90 ++++++++ .../LinkShareSettings.vue | 190 +++++++++++++++ .../ModerationSettings.vue | 218 ++++++++++++++++++ .../ConversationSettings/SipSettings.vue | 99 ++++++++ .../Participants/ParticipantsTab.vue | 11 +- src/components/RightSidebar/RightSidebar.vue | 14 +- src/components/TopBar/CallButton.vue | 12 +- src/components/TopBar/TopBar.vue | 217 ++--------------- src/store/conversationsStore.js | 20 +- 10 files changed, 638 insertions(+), 236 deletions(-) create mode 100644 src/components/ConversationSettings/ConversationSettingsDialog.vue create mode 100644 src/components/ConversationSettings/LinkShareSettings.vue create mode 100644 src/components/ConversationSettings/ModerationSettings.vue create mode 100644 src/components/ConversationSettings/SipSettings.vue diff --git a/src/App.vue b/src/App.vue index 1796123721f..3114ed0ab22 100644 --- a/src/App.vue +++ b/src/App.vue @@ -34,6 +34,7 @@ + @@ -65,6 +66,7 @@ import talkHashCheck from './mixins/talkHashCheck' import { generateUrl } from '@nextcloud/router' import UploadEditor from './components/UploadEditor' import SettingsDialog from './components/SettingsDialog/SettingsDialog' +import ConversationSettingsDialog from './components/ConversationSettings/ConversationSettingsDialog' import '@nextcloud/dialogs/styles/toast.scss' export default { @@ -77,6 +79,7 @@ export default { RightSidebar, UploadEditor, SettingsDialog, + ConversationSettingsDialog, }, mixins: [ diff --git a/src/components/ConversationSettings/ConversationSettingsDialog.vue b/src/components/ConversationSettings/ConversationSettingsDialog.vue new file mode 100644 index 00000000000..d9bf9baa105 --- /dev/null +++ b/src/components/ConversationSettings/ConversationSettingsDialog.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/src/components/ConversationSettings/LinkShareSettings.vue b/src/components/ConversationSettings/LinkShareSettings.vue new file mode 100644 index 00000000000..45d42c3453e --- /dev/null +++ b/src/components/ConversationSettings/LinkShareSettings.vue @@ -0,0 +1,190 @@ + + + + + + + diff --git a/src/components/ConversationSettings/ModerationSettings.vue b/src/components/ConversationSettings/ModerationSettings.vue new file mode 100644 index 00000000000..6e8dd29ddbe --- /dev/null +++ b/src/components/ConversationSettings/ModerationSettings.vue @@ -0,0 +1,218 @@ + + + + + + + diff --git a/src/components/ConversationSettings/SipSettings.vue b/src/components/ConversationSettings/SipSettings.vue new file mode 100644 index 00000000000..d6c13ea4954 --- /dev/null +++ b/src/components/ConversationSettings/SipSettings.vue @@ -0,0 +1,99 @@ + + + + + + diff --git a/src/components/RightSidebar/Participants/ParticipantsTab.vue b/src/components/RightSidebar/Participants/ParticipantsTab.vue index 24970663212..575b82e1363 100644 --- a/src/components/RightSidebar/Participants/ParticipantsTab.vue +++ b/src/components/RightSidebar/Participants/ParticipantsTab.vue @@ -119,16 +119,7 @@ export default { return this.$store.getters.getToken() }, conversation() { - if (this.$store.getters.conversation(this.token)) { - return this.$store.getters.conversation(this.token) - } - return { - token: '', - displayName: '', - isFavorite: false, - type: CONVERSATION.TYPE.PUBLIC, - lobbyState: WEBINAR.LOBBY.NONE, - } + return this.$store.getters.conversation(this.token) || this.$store.getters.dummyConversation }, isSearching() { return this.searchText !== '' diff --git a/src/components/RightSidebar/RightSidebar.vue b/src/components/RightSidebar/RightSidebar.vue index fc1632852e7..354fc3d97d5 100644 --- a/src/components/RightSidebar/RightSidebar.vue +++ b/src/components/RightSidebar/RightSidebar.vue @@ -143,19 +143,7 @@ export default { return this.$store.getters.getToken() }, conversation() { - if (this.$store.getters.conversation(this.token)) { - return this.$store.getters.conversation(this.token) - } - return { - token: '', - displayName: '', - isFavorite: false, - hasPassword: false, - type: CONVERSATION.TYPE.PUBLIC, - lobbyState: WEBINAR.LOBBY.NONE, - lobbyTimer: 0, - attendeePin: '', - } + return this.$store.getters.conversation(this.token) || this.$store.getters.dummyConversation }, getUserId() { diff --git a/src/components/TopBar/CallButton.vue b/src/components/TopBar/CallButton.vue index 4ffe0b7ed14..2d8eb5657e3 100644 --- a/src/components/TopBar/CallButton.vue +++ b/src/components/TopBar/CallButton.vue @@ -84,17 +84,7 @@ export default { }, conversation() { - if (this.$store.getters.conversation(this.token)) { - return this.$store.getters.conversation(this.token) - } - return { - participantFlags: PARTICIPANT.CALL_FLAG.DISCONNECTED, - participantType: PARTICIPANT.TYPE.USER, - readOnly: CONVERSATION.STATE.READ_ONLY, - hasCall: false, - canStartCall: false, - lobbyState: WEBINAR.LOBBY.NONE, - } + return this.$store.getters.conversation(this.token) || this.$store.getters.dummyConversation }, isBlockedByLobby() { diff --git a/src/components/TopBar/TopBar.vue b/src/components/TopBar/TopBar.vue index 1955b70b846..edd6c096925 100644 --- a/src/components/TopBar/TopBar.vue +++ b/src/components/TopBar/TopBar.vue @@ -81,14 +81,6 @@ @click="handleRenameConversation"> {{ t('spreed', 'Rename conversation') }} - - - {{ t('spreed', 'Share link') }} - {{ t('spreed', 'Copy link') }} - - + + + {{ t('spreed', 'More settings') }} + { return { @@ -55,6 +72,7 @@ const getters = { * @returns {object} The conversation object */ conversation: state => token => state.conversations[token], + dummyConversation: state => Object.assign({}, DUMMY_CONVERSATION), } const mutations = { From 828af670a6d49811b0faddb569b8a189fc11e2d6 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 20 Nov 2020 12:46:38 +0100 Subject: [PATCH 2/2] Replace Action components with plain HTML inputs Signed-off-by: Vincent Petry --- .../ConversationSettingsDialog.vue | 42 +++++- .../LinkShareSettings.vue | 141 +++++++++++------- .../ModerationSettings.vue | 132 ++++++++++------ .../ConversationSettings/SipSettings.vue | 28 ++-- .../Participants/ParticipantsTab.vue | 2 +- 5 files changed, 227 insertions(+), 118 deletions(-) diff --git a/src/components/ConversationSettings/ConversationSettingsDialog.vue b/src/components/ConversationSettings/ConversationSettingsDialog.vue index d9bf9baa105..bc2f8276b1b 100644 --- a/src/components/ConversationSettings/ConversationSettingsDialog.vue +++ b/src/components/ConversationSettings/ConversationSettingsDialog.vue @@ -20,14 +20,19 @@ -->