mirror of
https://github.com/nextcloud/spreed.git
synced 2025-07-21 10:37:10 +00:00
fix: add max description length as a capability
Signed-off-by: Dorra Jaouad <dorra.jaoued7@gmail.com>
This commit is contained in:
@ -27,7 +27,7 @@
|
||||
:loading="isDescriptionLoading"
|
||||
:edit-button-aria-label="t('spreed', 'Edit conversation description')"
|
||||
:placeholder="t('spreed', 'Enter a description for this conversation')"
|
||||
:max-length="CONVERSATION.MAX_DESCRIPTION_LENGTH"
|
||||
:max-length="maxDescriptionLength"
|
||||
multiline
|
||||
use-markdown
|
||||
@submit-text="handleUpdateDescription"
|
||||
@ -53,9 +53,10 @@ import ConversationAvatarEditor from './ConversationAvatarEditor.vue'
|
||||
import EditableTextField from '../UIShared/EditableTextField.vue'
|
||||
|
||||
import { CONVERSATION } from '../../constants.js'
|
||||
import { hasTalkFeature } from '../../services/CapabilitiesManager.ts'
|
||||
import { hasTalkFeature, getTalkConfig } from '../../services/CapabilitiesManager.ts'
|
||||
|
||||
const supportsAvatar = hasTalkFeature('local', 'avatar')
|
||||
const maxDescriptionLength = getTalkConfig('local', 'conversations', 'description-length') || 500
|
||||
|
||||
export default {
|
||||
name: 'BasicInfo',
|
||||
@ -82,6 +83,7 @@ export default {
|
||||
return {
|
||||
supportsAvatar,
|
||||
CONVERSATION,
|
||||
maxDescriptionLength
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -124,6 +124,7 @@ import LoadingComponent from '../LoadingComponent.vue'
|
||||
import { useId } from '../../composables/useId.ts'
|
||||
import { useIsInCall } from '../../composables/useIsInCall.js'
|
||||
import { CONVERSATION } from '../../constants.js'
|
||||
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
|
||||
import { addParticipant } from '../../services/participantsService.js'
|
||||
import { copyConversationLinkToClipboard } from '../../utils/handleUrl.ts'
|
||||
|
||||
@ -135,7 +136,7 @@ const NEW_CONVERSATION = {
|
||||
type: CONVERSATION.TYPE.GROUP,
|
||||
isDummyConversation: true,
|
||||
}
|
||||
|
||||
const maxDescriptionLength = getTalkConfig('local', 'conversations', 'description-length') || 500
|
||||
export default {
|
||||
name: 'NewConversationDialog',
|
||||
|
||||
@ -205,7 +206,7 @@ export default {
|
||||
disabled() {
|
||||
return this.conversationName === '' || (this.newConversation.hasPassword && (this.password === '' || !this.isPasswordValid))
|
||||
|| this.conversationName.length > CONVERSATION.MAX_NAME_LENGTH
|
||||
|| this.newConversation.description.length > CONVERSATION.MAX_DESCRIPTION_LENGTH
|
||||
|| this.newConversation.description.length > maxDescriptionLength
|
||||
},
|
||||
|
||||
isFilled() {
|
||||
|
@ -79,6 +79,7 @@ import generatePassword from '../../utils/generatePassword.ts'
|
||||
|
||||
const supportsAvatar = hasTalkFeature('local', 'avatar')
|
||||
const forcePasswordProtection = getTalkConfig('local', 'conversations', 'force-passwords')
|
||||
const maxDescriptionLength = getTalkConfig('local', 'conversations', 'description-length') || 500
|
||||
export default {
|
||||
|
||||
name: 'NewConversationSetupPage',
|
||||
@ -143,10 +144,10 @@ export default {
|
||||
},
|
||||
|
||||
descriptionErrorLabel() {
|
||||
if (this.conversationDescription.length <= CONVERSATION.MAX_DESCRIPTION_LENGTH) {
|
||||
if (this.conversationDescription.length <= maxDescriptionLength) {
|
||||
return
|
||||
}
|
||||
return t('spreed', 'Maximum length exceeded ({maxlength} characters)', { maxlength: CONVERSATION.MAX_DESCRIPTION_LENGTH })
|
||||
return t('spreed', 'Maximum length exceeded ({maxlength} characters)', { maxlength: maxDescriptionLength })
|
||||
},
|
||||
|
||||
isPublic: {
|
||||
|
@ -110,7 +110,6 @@ export const CONVERSATION = {
|
||||
},
|
||||
|
||||
MAX_NAME_LENGTH: 255,
|
||||
MAX_DESCRIPTION_LENGTH: 500,
|
||||
}
|
||||
|
||||
export const ATTENDEE = {
|
||||
|
Reference in New Issue
Block a user