Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show out of office replacement #12510

Merged
merged 1 commit into from
Jul 2, 2024
Merged
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
28 changes: 28 additions & 0 deletions src/components/NewMessage/NewMessageAbsenceInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
disable-tooltip />
</template>
<h4 class="absence-reminder__caption">{{ userAbsenceCaption }}</h4>
<div v-if="userAbsence.replacementUserId" class="absence-reminder__replacement">
<!-- TRANSLATORS An acting person during the period of absence of the main contact -->
<p>{{ t('spreed','Replacement: ') }}</p>
hamza221 marked this conversation as resolved.
Show resolved Hide resolved
<NcUserBubble class="absence-reminder__replacement__bubble"
:title="t('spreed','Open conversation')"
:display-name="userAbsence.replacementUserDisplayName"
:user="userAbsence.replacementUserId"
@click="openConversationWithReplacementUser" />
</div>
<NcButton v-if="userAbsenceMessage && isTextMoreThanOneLine"
class="absence-reminder__button"
type="tertiary"
Expand All @@ -34,6 +43,7 @@ import { t } from '@nextcloud/l10n'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
import NcUserBubble from '@nextcloud/vue/dist/Components/NcUserBubble.js'

import AvatarWrapper from '../AvatarWrapper/AvatarWrapper.vue'

Expand All @@ -47,6 +57,7 @@ export default {
ChevronUp,
NcButton,
NcNoteCard,
NcUserBubble,
},

props: {
Expand Down Expand Up @@ -107,6 +118,15 @@ export default {
setIsTextMoreThanOneLine() {
this.isTextMoreThanOneLine = this.$refs.absenceMessage?.scrollHeight > this.$refs.absenceMessage?.clientHeight
},

async openConversationWithReplacementUser() {
this.$router.push({
name: 'root',
query: {
callUser: this.userAbsence.replacementUserId,
}
}).catch(err => console.debug(`Error while pushing the new conversation's route: ${err}`))
},
},
}
</script>
Expand All @@ -123,6 +143,14 @@ export default {
margin: 5px 44px 5px 0;
}

&__replacement {
display: flex;

&__bubble {
padding: 3px;
}
}

&__message {
white-space: pre-line;
word-wrap: break-word;
Expand Down
Loading