Skip to content

Commit

Permalink
Merge pull request #11916 from nextcloud/backport/11868/stable28
Browse files Browse the repository at this point in the history
[stable28] fix(SharedItems): fetch after page reload + fix(Conversation): set warnings on max length
  • Loading branch information
Antreesy authored Mar 25, 2024
2 parents af8e823 + 2a5ad19 commit 4251bba
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/components/AvatarWrapper/AvatarWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ export default {
top: 0;
width: var(--avatar-size);
height: var(--avatar-size);
max-height: var(--avatar-size);
max-width: var(--avatar-size);
line-height: var(--avatar-size);
font-size: calc(var(--avatar-size) / 2);
border-radius: 50%;
Expand Down
7 changes: 6 additions & 1 deletion src/components/ConversationSettings/BasicInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
:loading="isNameLoading"
:placeholder="t('spreed', 'Enter a name for this conversation')"
:edit-button-aria-label="t('spreed', 'Edit conversation name')"
:max-length="CONVERSATION.MAX_NAME_LENGTH"
@submit-text="handleUpdateName"
@update:editing="handleEditName" />
<template v-if="!isOneToOne">
Expand All @@ -42,6 +43,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"
multiline
use-markdown
@submit-text="handleUpdateDescription"
Expand Down Expand Up @@ -92,7 +94,10 @@ export default {
},
setup() {
return { supportsAvatar }
return {
supportsAvatar,
CONVERSATION,
}
},
data() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,20 @@
v-model="conversationName"
:placeholder="t('spreed', 'Enter a name for this conversation')"
:label="t('spreed', 'Name')"
:error="!!nameErrorLabel"
label-visible
@keydown.enter="handleEnter" />
<span v-if="nameErrorLabel" class="new-group-conversation__error">
{{ nameErrorLabel }}
</span>
<NcTextArea v-model="conversationDescription"
:placeholder="t('spreed', 'Enter a description for this conversation')"
:label="t('spreed', 'Description')"
:error="!!descriptionErrorLabel"
label-visible />
<span v-if="descriptionErrorLabel" class="new-group-conversation__error">
{{ descriptionErrorLabel }}
</span>

<template v-if="supportsAvatar">
<label class="avatar-editor__label">
Expand Down Expand Up @@ -276,9 +284,20 @@ export default {
// Controls the disabled/enabled state of the first page's button.
disabled() {
return this.conversationNameTrimmed === '' || (this.passwordProtect && this.password === '')
|| this.conversationNameTrimmed.length > CONVERSATION.MAX_NAME_LENGTH
|| this.conversationDescription.length > CONVERSATION.MAX_DESCRIPTION_LENGTH
},
selectedParticipants() {
return this.$store.getters.selectedParticipants
nameErrorLabel() {
if (this.conversationNameTrimmed.length <= CONVERSATION.MAX_NAME_LENGTH) {
return
}
return t('spreed', 'Maximum length exceeded ({maxlength} characters)', { maxlength: CONVERSATION.MAX_NAME_LENGTH })
},
descriptionErrorLabel() {
if (this.conversationDescription.length <= CONVERSATION.MAX_DESCRIPTION_LENGTH) {
return
}
return t('spreed', 'Maximum length exceeded ({maxlength} characters)', { maxlength: CONVERSATION.MAX_DESCRIPTION_LENGTH })
},
},
Expand Down Expand Up @@ -532,6 +551,10 @@ export default {
&__button {
margin-left: auto;
}
&__error {
color: var(--color-error);
}
}
.conversation-form :deep(.modal-wrapper) {
Expand Down
9 changes: 6 additions & 3 deletions src/components/RightSidebar/SharedItems/SharedItemsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,12 @@ export default {
},
watch: {
sharedItemsIdentifier() {
if (this.token && this.active && this.isSidebarOpen) {
this.sharedItemsStore.getSharedItemsOverview(this.token)
sharedItemsIdentifier: {
immediate: true,
handler() {
if (this.token && this.active && this.isSidebarOpen) {
this.sharedItemsStore.getSharedItemsOverview(this.token)
}
}
},
},
Expand Down
5 changes: 4 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ export const CONVERSATION = {
VIDEO_VERIFICATION: 'share:password',
BREAKOUT_ROOM: 'room',
DEFAULT: '',
}
},

MAX_NAME_LENGTH: 255,
MAX_DESCRIPTION_LENGTH: 500,
}
export const ATTENDEE = {
ACTOR_TYPE: {
Expand Down

0 comments on commit 4251bba

Please sign in to comment.