-
Notifications
You must be signed in to change notification settings - Fork 511
feat(integration): show out-of-office message in 1-1 conversation #10902
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| <!-- | ||
| - @copyright Copyright (c) 2023 Maksim Sukharev <antreesy.web@gmail.com> | ||
| - | ||
| - @author Maksim Sukharev <antreesy.web@gmail.com> | ||
| - | ||
| - @license AGPL-3.0-or-later | ||
| - | ||
| - This program is free software: you can redistribute it and/or modify | ||
| - it under the terms of the GNU Affero General Public License as | ||
| - published by the Free Software Foundation, either version 3 of the | ||
| - License, or (at your option) any later version. | ||
| - | ||
| - This program is distributed in the hope that it will be useful, | ||
| - but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| - GNU Affero General Public License for more details. | ||
| - | ||
| - You should have received a copy of the GNU Affero General Public License | ||
| - along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| --> | ||
|
|
||
| <!-- eslint-disable vue/singleline-html-element-content-newline --> | ||
| <template> | ||
| <NcNoteCard type="info" class="absence-reminder"> | ||
| <div class="absence-reminder__content"> | ||
| <AvatarWrapper :id="userAbsence.userId" | ||
| :name="displayName" | ||
| :size="AVATAR.SIZE.EXTRA_SMALL" | ||
| source="users" | ||
| disable-menu | ||
| disable-tooltip /> | ||
| <h4 class="absence-reminder__caption">{{ userAbsenceCaption }}</h4> | ||
| <NcButton v-if="userAbsenceMessage" | ||
| class="absence-reminder__button" | ||
| type="tertiary" | ||
| @click="toggleCollapsed"> | ||
| <template #icon> | ||
| <ChevronDown class="icon" :class="{'icon--reverted': !collapsed}" :size="20" /> | ||
| </template> | ||
| </NcButton> | ||
| </div> | ||
| <p class="absence-reminder__message" :class="{'absence-reminder__message--collapsed': collapsed}">{{ userAbsenceMessage }}</p> | ||
| </NcNoteCard> | ||
| </template> | ||
|
|
||
| <script> | ||
| import ChevronDown from 'vue-material-design-icons/ChevronDown.vue' | ||
|
|
||
| import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' | ||
| import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js' | ||
|
|
||
| import AvatarWrapper from '../AvatarWrapper/AvatarWrapper.vue' | ||
|
|
||
| import { AVATAR } from '../../constants.js' | ||
|
|
||
| export default { | ||
| name: 'NewMessageAbsenceInfo', | ||
|
|
||
| components: { | ||
| AvatarWrapper, | ||
| ChevronDown, | ||
| NcButton, | ||
| NcNoteCard, | ||
| }, | ||
|
|
||
| props: { | ||
| userAbsence: { | ||
| type: Object, | ||
| required: true, | ||
| }, | ||
|
|
||
| displayName: { | ||
| type: String, | ||
| required: true, | ||
| }, | ||
| }, | ||
|
|
||
| setup() { | ||
| return { AVATAR } | ||
| }, | ||
|
|
||
| data() { | ||
| return { | ||
| collapsed: true, | ||
| } | ||
| }, | ||
|
|
||
| computed: { | ||
| userAbsenceCaption() { | ||
| return t('spreed', '{user} is out of office and might not respond.', { user: this.displayName }) | ||
| }, | ||
|
|
||
| userAbsenceMessage() { | ||
| return this.userAbsence.message || this.userAbsence.status | ||
| }, | ||
| }, | ||
|
|
||
| methods: { | ||
| toggleCollapsed() { | ||
| this.collapsed = !this.collapsed | ||
| }, | ||
| }, | ||
| } | ||
| </script> | ||
|
|
||
| <style lang="scss" scoped> | ||
| @import '../../assets/variables'; | ||
|
|
||
| .absence-reminder { | ||
| margin: 0 16px 12px; | ||
| padding: 10px 10px 10px 6px; | ||
| border-radius: var(--border-radius-large); | ||
|
|
||
| // FIXME upstream: allow to hide or replace NoteCard default icon | ||
| & :deep(.notecard__icon) { | ||
| display: none; | ||
| } | ||
|
|
||
| & > :deep(div) { | ||
| width: 100%; | ||
| } | ||
|
|
||
| &__content { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 4px; | ||
| width: 100%; | ||
| } | ||
|
|
||
| &__caption { | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| &__message { | ||
| padding-left: 26px; | ||
| white-space: pre-line; | ||
| word-wrap: break-word; | ||
|
|
||
| &--collapsed { | ||
| text-overflow: ellipsis; | ||
| overflow: hidden; | ||
| display: -webkit-box; | ||
| -webkit-line-clamp: 1; | ||
| -webkit-box-orient: vertical; | ||
| } | ||
| } | ||
|
|
||
| &__button { | ||
| margin-left: auto; | ||
|
|
||
| & .icon { | ||
| transition: $transition; | ||
|
|
||
| &--reverted { | ||
| transform: rotate(180deg); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also check the dates. For example, I can set my OoO proactively from tomorrow and I am still working today. AbsenceInfo should be shown starting from tomorrow and not from now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then OoO should be set up from tommorow by BG job, I don't think it has to be double-checked on Talk side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if it should be from the server side to only render the active OoO or any OoO that exists because dates were given in the response.
Should we use them to show when they will be back for example ? like on Webex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the next iteration maybe