summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaksim Sukharev <antreesy.web@gmail.com>2023-07-26 19:46:37 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-07-26 17:56:12 +0000
commit9fcd5bbe713cf4b5d1e602e159b5bc57547d5336 (patch)
tree4cda7263b224a715317db9810a1c0d2b6239cec4 /src
parentd322772b761814cb78f6136da3a38cf8af76a512 (diff)
hide description and status from 1-1 conversation settings
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/components/ConversationIcon.vue8
-rw-r--r--src/components/ConversationSettings/BasicInfo.vue31
-rw-r--r--src/components/ConversationSettings/ConversationAvatarEditor.vue1
3 files changed, 28 insertions, 12 deletions
diff --git a/src/components/ConversationIcon.vue b/src/components/ConversationIcon.vue
index f85bb27f1..014c0b0f1 100644
--- a/src/components/ConversationIcon.vue
+++ b/src/components/ConversationIcon.vue
@@ -36,6 +36,7 @@
:disable-menu="disableMenu"
:display-name="item.displayName"
:preloaded-user-status="preloadedUserStatus"
+ :show-user-status="showUserStatus"
:show-user-status-compact="disableMenu"
:menu-container="menuContainer"
menu-position="left"
@@ -97,6 +98,11 @@ export default {
default: false,
},
+ showUserStatus: {
+ type: Boolean,
+ default: true,
+ },
+
item: {
type: Object,
default() {
@@ -143,7 +149,7 @@ export default {
},
preloadedUserStatus() {
- if (Object.prototype.hasOwnProperty.call(this.item, 'statusMessage')) {
+ if (this.showUserStatus && Object.prototype.hasOwnProperty.call(this.item, 'statusMessage')) {
// We preloaded the status
return {
status: this.item.status || null,
diff --git a/src/components/ConversationSettings/BasicInfo.vue b/src/components/ConversationSettings/BasicInfo.vue
index 5c5531fe4..8a2d93465 100644
--- a/src/components/ConversationSettings/BasicInfo.vue
+++ b/src/components/ConversationSettings/BasicInfo.vue
@@ -32,17 +32,19 @@
:edit-button-aria-label="t('spreed', 'Edit conversation name')"
@submit-text="handleUpdateName"
@update:editing="handleEditName" />
- <h4 class="app-settings-section__subtitle">
- {{ t('spreed', 'Description') }}
- </h4>
- <EditableTextField :editable="canFullModerate"
- :initial-text="description"
- :editing="isEditingDescription"
- :loading="isDescriptionLoading"
- :edit-button-aria-label="t('spreed', 'Edit conversation description')"
- :placeholder="t('spreed', 'Enter a description for this conversation')"
- @submit-text="handleUpdateDescription"
- @update:editing="handleEditDescription" />
+ <template v-if="!isOneToOne">
+ <h4 class="app-settings-section__subtitle">
+ {{ t('spreed', 'Description') }}
+ </h4>
+ <EditableTextField :editable="canFullModerate"
+ :initial-text="description"
+ :editing="isEditingDescription"
+ :loading="isDescriptionLoading"
+ :edit-button-aria-label="t('spreed', 'Edit conversation description')"
+ :placeholder="t('spreed', 'Enter a description for this conversation')"
+ @submit-text="handleUpdateDescription"
+ @update:editing="handleEditDescription" />
+ </template>
<template v-if="supportsAvatar">
<h4 class="app-settings-section__subtitle">
{{ t('spreed', 'Picture') }}
@@ -62,6 +64,8 @@ import { showError } from '@nextcloud/dialogs'
import ConversationAvatarEditor from './ConversationAvatarEditor.vue'
import EditableTextField from './EditableTextField.vue'
+import { CONVERSATION } from '../../constants.js'
+
const supportsAvatar = getCapabilities()?.spreed?.features?.includes('avatar')
export default {
@@ -99,6 +103,11 @@ export default {
},
computed: {
+ isOneToOne() {
+ return this.conversation.type === CONVERSATION.TYPE.ONE_TO_ONE
+ || this.conversation.type === CONVERSATION.TYPE.ONE_TO_ONE_FORMER
+ },
+
conversationName() {
return this.conversation.displayName
},
diff --git a/src/components/ConversationSettings/ConversationAvatarEditor.vue b/src/components/ConversationSettings/ConversationAvatarEditor.vue
index 652da41b9..03e77d22a 100644
--- a/src/components/ConversationSettings/ConversationAvatarEditor.vue
+++ b/src/components/ConversationSettings/ConversationAvatarEditor.vue
@@ -33,6 +33,7 @@
<ConversationIcon v-else-if="!loading"
:item="conversation"
:is-big="true"
+ :show-user-status="false"
:disable-menu="true" />
<div v-else class="icon-loading" />
</div>