Unverified Commit 5ecaffef authored by Christoph Wurst's avatar Christoph Wurst
Browse files

Show icon for events with attendees


Signed-off-by: default avatarChristoph Wurst <christoph@winzerhof-wurst.at>
parent cdeb7ffe
......@@ -32,18 +32,23 @@
<Bell v-if="hasAlarms"
class="icon-event-reminder"
:size="14"
:style="{ color: isDarkText ? 'var(--color-main-text)' : 'var(--fc-event-text-color)' }" />
:style="{ color: iconColor }" />
<AccountMultiple v-if="hasAttendees"
:size="14"
:style="{ color: iconColor }" />
</div>
</div>
</div>
</template>
<script>
import AccountMultiple from 'vue-material-design-icons/AccountMultiple.vue'
import Bell from 'vue-material-design-icons/Bell.vue'
export default {
name: 'EventRender',
components: {
AccountMultiple,
Bell,
},
props: {
......@@ -53,12 +58,18 @@ export default {
},
},
computed: {
iconColor() {
return this.isDarkText ? 'var(--color-main-text)' : 'var(--fc-event-text-color)'
},
viewType() {
return this.eventDetails?.view?.type
},
hasAlarms() {
return this.eventDetails?.event?._def?.extendedProps?.hasAlarms
},
hasAttendees() {
return this.eventDetails?.event?._def?.extendedProps?.hasAttendees
},
isDarkText() {
return this.eventDetails?.event?._def?.extendedProps?.darkText
},
......@@ -67,6 +78,9 @@ export default {
</script>
<style scoped>
.fc-event-title.fc-sticky {
flex-grow: 1;
}
.fc-event-main-frame--icons {
display: flex;
justify-content: space-between;
......
......@@ -146,6 +146,7 @@ export function eventSourceFunction(calendarObjects, calendar, start, end, timez
location: object.location,
description: object.description,
hasAlarms,
hasAttendees: object.hasProperty('ATTENDEE'),
},
}
......
......@@ -80,6 +80,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
}),
},
hasComponent: jest.fn().mockReturnValue(false),
hasProperty: jest.fn().mockReturnValue(false),
}, {
name: 'VEVENT',
id: '1-2',
......@@ -98,6 +99,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
}),
},
hasComponent: jest.fn().mockReturnValue(false),
hasProperty: jest.fn().mockReturnValue(false),
title: 'Untitled\nmultiline\nevent',
}, {
name: 'VEVENT',
......@@ -117,6 +119,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
}),
},
hasComponent: jest.fn().mockReturnValue(true),
hasProperty: jest.fn().mockReturnValue(false),
}]
const eventComponentSet2 = [{
name: 'VEVENT',
......@@ -136,6 +139,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
}),
},
hasComponent: jest.fn().mockReturnValue(false),
hasProperty: jest.fn().mockReturnValue(false),
}]
const eventComponentSet4 = [{
name: 'VEVENT',
......@@ -155,6 +159,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
}),
},
hasComponent: jest.fn().mockReturnValue(false),
hasProperty: jest.fn().mockReturnValue(false),
color: 'red',
}]
......@@ -220,6 +225,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
objectType: 'VEVENT',
percent: null,
hasAlarms: false,
hasAttendees: false,
},
},
{
......@@ -241,6 +247,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
objectType: 'VEVENT',
percent: null,
hasAlarms: false,
hasAttendees: false,
},
},
{
......@@ -262,6 +269,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
objectType: 'VEVENT',
percent: null,
hasAlarms: true,
hasAttendees: false,
},
},
{
......@@ -283,6 +291,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
objectType: 'VEVENT',
percent: null,
hasAlarms: false,
hasAttendees: false,
},
},
{
......@@ -304,6 +313,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
objectType: 'VEVENT',
percent: null,
hasAlarms: false,
hasAttendees: false,
},
backgroundColor: '#ff0000',
borderColor: '#ff0000',
......@@ -466,6 +476,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
}),
},
hasComponent: jest.fn().mockReturnValue(false),
hasProperty: jest.fn().mockReturnValue(false),
percent: null,
}, {
name: 'VTODO',
......@@ -485,6 +496,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
}),
},
hasComponent: jest.fn().mockReturnValue(false),
hasProperty: jest.fn().mockReturnValue(false),
percent: null,
}, {
name: 'VTODO',
......@@ -504,6 +516,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
}),
},
hasComponent: jest.fn().mockReturnValue(false),
hasProperty: jest.fn().mockReturnValue(false),
percent: 99,
}, {
name: 'VTODO',
......@@ -523,6 +536,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
}),
},
hasComponent: jest.fn().mockReturnValue(false),
hasProperty: jest.fn().mockReturnValue(false),
title: 'This task has a title',
percent: null,
}, {
......@@ -543,6 +557,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
}),
},
hasComponent: jest.fn().mockReturnValue(false),
hasProperty: jest.fn().mockReturnValue(false),
title: 'This task has a title and percent',
percent: 99,
}, {
......@@ -553,6 +568,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
getReferenceRecurrenceId: jest.fn().mockReturnValue({ unixTime: 123 }),
canModifyAllDay: jest.fn().mockReturnValue(false),
hasComponent: jest.fn().mockReturnValue(false),
hasProperty: jest.fn().mockReturnValue(false),
title: 'Task without Due',
startDate: null,
endDate: null,
......@@ -596,6 +612,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
percent: null,
recurrenceId: 123,
hasAlarms: false,
hasAttendees: false,
},
id: '1###1',
start: event1End,
......@@ -618,6 +635,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
percent: null,
recurrenceId: 123,
hasAlarms: false,
hasAttendees: false,
},
id: '1###2',
start: event2End,
......@@ -640,6 +658,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
percent: 99,
recurrenceId: 123,
hasAlarms: false,
hasAttendees: false,
},
id: '1###3',
start: event3End,
......@@ -662,6 +681,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
percent: null,
recurrenceId: 123,
hasAlarms: false,
hasAttendees: false
},
id: '1###4',
start: event4End,
......@@ -684,6 +704,7 @@ describe('fullcalendar/freeBusyResourceEventSourceFunction test suite', () => {
percent: 99,
recurrenceId: 123,
hasAlarms: false,
hasAttendees: false,
},
id: '1###5',
start: event5End,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment