Skip to content

Commit

Permalink
Merge pull request #47505 from nextcloud/backport/47448/stable30
Browse files Browse the repository at this point in the history
[stable30] fix(user_status): add link to Availability page if user set predefined 'Vacationing'
  • Loading branch information
AndyScherzinger authored Aug 29, 2024
2 parents c8bd41c + 637f2dd commit f81a349
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 18 deletions.
4 changes: 3 additions & 1 deletion apps/dav/src/views/Availability.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
-->
<template>
<div>
<NcSettingsSection :name="$t('dav', 'Availability')"
<NcSettingsSection id="availability"
:name="$t('dav', 'Availability')"
:description="$t('dav', 'If you configure your working hours, other people will see when you are out of office when they book a meeting.')">
<AvailabilityForm />
</NcSettingsSection>
<NcSettingsSection v-if="!hideAbsenceSettings"
id="absence"
:name="$t('dav', 'Absence')"
:description="$t('dav', 'Configure your next absence period.')">
<AbsenceForm />
Expand Down
36 changes: 28 additions & 8 deletions apps/user_status/src/components/SetStatusModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
<template>
<NcModal size="normal"
:name="$t('user_status', 'Set status')"
aria-labelledby="user_status-set-dialog"
:set-return-focus="setReturnFocus"
@close="closeModal">
<div class="set-status-modal">
<!-- Status selector -->
<div class="set-status-modal__header">
<h2>{{ $t('user_status', 'Online status') }}</h2>
</div>
<h2 id="user_status-set-dialog" class="set-status-modal__header">
{{ $t('user_status', 'Online status') }}
</h2>
<div class="set-status-modal__online-status"
role="radiogroup"
:aria-label="$t('user_status', 'Online status')">
Expand All @@ -25,15 +26,22 @@

<!-- Status message form -->
<form @submit.prevent="saveStatus" @reset="clearStatus">
<div class="set-status-modal__header">
<h2>{{ $t('user_status', 'Status message') }}</h2>
</div>
<h3 class="set-status-modal__header">
{{ $t('user_status', 'Status message') }}
</h3>
<div class="set-status-modal__custom-input">
<CustomMessageInput ref="customMessageInput"
:icon="icon"
:message="editedMessage"
@change="setMessage"
@select-icon="setIcon" />
<NcButton v-if="messageId === 'vacationing'"
:href="absencePageUrl"
target="_blank"
type="secondary"
:aria-label="$t('user_status', 'Set absence period')">
{{ $t('user_status', 'Set absence period and replacement') + ' ↗' }}
</NcButton>
</div>
<div v-if="hasBackupStatus"
class="set-status-modal__automation-hint">
Expand Down Expand Up @@ -69,6 +77,7 @@

<script>
import { showError } from '@nextcloud/dialogs'
import { generateUrl } from '@nextcloud/router'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import { getAllStatusOptions } from '../services/statusOptionsService.js'
Expand Down Expand Up @@ -135,6 +144,10 @@ export default {
return this.$store.state.userBackupStatus.message || ''
},

absencePageUrl() {
return generateUrl('settings/user/availability#absence')
},

resetButtonText() {
if (this.backupIcon && this.backupMessage) {
return this.$t('user_status', 'Reset status to "{icon} {message}"', {
Expand Down Expand Up @@ -324,9 +337,13 @@ export default {
padding: 8px 20px 20px 20px;

&__header {
font-size: 21px;
text-align: center;
font-weight: bold;
margin: 15px 0;
height: fit-content;
min-height: var(--default-clickable-area);
line-height: var(--default-clickable-area);
overflow-wrap: break-word;
margin-block: 0 12px;
}

&__online-status {
Expand All @@ -336,6 +353,9 @@ export default {

&__custom-input {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--default-grid-baseline);
width: 100%;
margin-bottom: 10px;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/dav-settings-personal-availability.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dav-settings-personal-availability.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/user-status-modal-5133.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/user-status-modal-5133.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/user_status-menu.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/user_status-menu.js.map

Large diffs are not rendered by default.

0 comments on commit f81a349

Please sign in to comment.