-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonas Heinrich
committed
Aug 18, 2023
1 parent
79a24df
commit 0d8c975
Showing
4 changed files
with
103 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -23,52 +23,51 @@ | |
|
||
<template> | ||
<div class="invitees-list-item"> | ||
<AvatarParticipationStatus :attendee-is-organizer="false" | ||
:is-viewed-by-organizer="isViewedByOrganizer" | ||
:is-resource="false" | ||
:avatar-link="avatarLink" | ||
:participation-status="attendee.participationStatus" | ||
:organizer-display-name="organizerDisplayName" | ||
:common-name="commonName" /> | ||
<AvatarParticipationStatus :attendee-is-organizer="false" :is-viewed-by-organizer="isViewedByOrganizer" | ||
:is-resource="false" :avatar-link="avatarLink" :participation-status="attendee.participationStatus" | ||
Check failure on line 27 in src/components/Editor/Invitees/InviteesListItem.vue GitHub Actions / eslint
|
||
:organizer-display-name="organizerDisplayName" :common-name="commonName" :is-circle="isCircle" /> | ||
Check failure on line 28 in src/components/Editor/Invitees/InviteesListItem.vue GitHub Actions / eslint
|
||
<div class="invitees-list-item__displayname"> | ||
{{ commonName }} | ||
</div> | ||
<div class="invitees-list-item__actions"> | ||
<NcButton class="icon-collapse" v-if="isCircle" | ||
Check failure on line 33 in src/components/Editor/Invitees/InviteesListItem.vue GitHub Actions / eslint
|
||
:class="{ 'icon-collapse--open': memberListExpaneded }" | ||
type="tertiary" | ||
:aria-label="labelButton" @click="toggleMemberList"> | ||
Check failure on line 36 in src/components/Editor/Invitees/InviteesListItem.vue GitHub Actions / eslint
|
||
<template this#icon> | ||
<ChevronUp v-if="memberListExpaneded" :size="20" /> | ||
<ChevronDown v-else :size="20" /> | ||
</template> | ||
</NcButton> | ||
<Actions v-if="isViewedByOrganizer"> | ||
<ActionCheckbox :checked="attendee.rsvp" | ||
@change="toggleRSVP"> | ||
<ActionCheckbox :checked="attendee.rsvp" @change="toggleRSVP"> | ||
{{ $t('calendar', 'Send email') }} | ||
</ActionCheckbox> | ||
|
||
<ActionRadio :name="radioName" | ||
:checked="isChair" | ||
@change="changeRole('CHAIR')"> | ||
<ActionRadio :name="radioName" :checked="isChair" @change="changeRole('CHAIR')"> | ||
{{ $t('calendar', 'Chairperson') }} | ||
</ActionRadio> | ||
<ActionRadio :name="radioName" | ||
:checked="isRequiredParticipant" | ||
@change="changeRole('REQ-PARTICIPANT')"> | ||
<ActionRadio :name="radioName" :checked="isRequiredParticipant" @change="changeRole('REQ-PARTICIPANT')"> | ||
{{ $t('calendar', 'Required participant') }} | ||
</ActionRadio> | ||
<ActionRadio :name="radioName" | ||
:checked="isOptionalParticipant" | ||
@change="changeRole('OPT-PARTICIPANT')"> | ||
<ActionRadio :name="radioName" :checked="isOptionalParticipant" @change="changeRole('OPT-PARTICIPANT')"> | ||
{{ $t('calendar', 'Optional participant') }} | ||
</ActionRadio> | ||
<ActionRadio :name="radioName" | ||
:checked="isNonParticipant" | ||
@change="changeRole('NON-PARTICIPANT')"> | ||
<ActionRadio :name="radioName" :checked="isNonParticipant" @change="changeRole('NON-PARTICIPANT')"> | ||
{{ $t('calendar', 'Non-participant') }} | ||
</ActionRadio> | ||
|
||
<ActionButton @click="removeAttendee"> | ||
<template #icon> | ||
<Delete :size="20" decorative /> | ||
</template> | ||
{{ $t('calendar', 'Remove attendee') }} | ||
{{ removeAttendeeText }} | ||
</ActionButton> | ||
</Actions> | ||
</div> | ||
<div class="member-list"> | ||
hallo | ||
</div> | ||
</div> | ||
</template> | ||
|
||
|
@@ -81,6 +80,9 @@ import { | |
NcActionCheckbox as ActionCheckbox, | ||
} from '@nextcloud/vue' | ||
import { removeMailtoPrefix } from '../../../utils/attendee.js' | ||
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' | ||
import ChevronDown from 'vue-material-design-icons/ChevronDown.vue' | ||
import ChevronUp from 'vue-material-design-icons/ChevronUp.vue' | ||
import Delete from 'vue-material-design-icons/Delete.vue' | ||
|
@@ -93,6 +95,9 @@ export default { | |
ActionRadio, | ||
Actions, | ||
Delete, | ||
NcButton, | ||
ChevronDown, | ||
ChevronUp, | ||
}, | ||
props: { | ||
attendee: { | ||
|
@@ -108,6 +113,11 @@ export default { | |
required: true, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
memberListExpaneded: false | ||
}; | ||
}, | ||
computed: { | ||
/** | ||
* @return {string} | ||
|
@@ -116,6 +126,16 @@ export default { | |
// return this.$store.getters.getAvatarForContact(this.uri) || this.commonName | ||
return this.commonName | ||
}, | ||
/** | ||
* @return {string} | ||
*/ | ||
removeAttendeeText() { | ||
if (this.isCircle) { | ||
return this.$t('calendar', 'Remove circle') | ||
} else { | ||
return this.$t('calendar', 'Remove attendee') | ||
} | ||
}, | ||
/** | ||
* Common name of the organizer or the uri without the 'mailto:' prefix. | ||
* | ||
|
@@ -151,6 +171,12 @@ export default { | |
// TODO: check if also viewed by organizer | ||
return !this.isReadOnly | ||
}, | ||
isCircle() { | ||
return this.attendee.attendeeProperty.userType === 'GROUP' | ||
}, | ||
labelButton() { | ||
return this.memberListExpaneded ? t('Collapse menu') : t('Open menu') | ||
}, | ||
}, | ||
methods: { | ||
/** | ||
|
@@ -178,11 +204,22 @@ export default { | |
removeAttendee() { | ||
this.$emit('remove-attendee', this.attendee) | ||
}, | ||
/** | ||
Check warning on line 207 in src/components/Editor/Invitees/InviteesListItem.vue GitHub Actions / eslint
|
||
* Toggle member list if attendee is a group | ||
*/ | ||
toggleMemberList(e) { | ||
this.$emit('click', e) | ||
this.memberListExpaneded = !this.memberListExpaneded | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.invitees-list-item__actions { | ||
display: flex; | ||
} | ||
.invitees-list-item__displayname { | ||
margin-bottom: 17px; | ||
text-overflow: ellipsis; | ||
|
@@ -193,4 +230,9 @@ export default { | |
.avatar-participation-status { | ||
margin-top: 5px; | ||
} | ||
.member-list { | ||
flex-basis: 100%; | ||
width: 100%; | ||
} | ||
</style> |
This file contains 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