Skip to content

Commit 99d0ab6

Browse files
committed
fixup! Improve free/busy UI
Signed-off-by: hamza mahjoubi <[email protected]>
1 parent 22492d7 commit 99d0ab6

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

src/components/Editor/FreeBusy/FreeBusy.vue

+32
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ import {
9999
import { NcModal as Modal } from '@nextcloud/vue'
100100
import ChevronRightIcon from 'vue-material-design-icons/ChevronRight.vue'
101101
import ChevronLeftIcon from 'vue-material-design-icons/ChevronLeft.vue'
102+
import Vue from 'vue'
103+
import OrganizerListItem from '../Invitees/OrganizerListItem.vue'
104+
import InviteesListItem from '../Invitees/InviteesListItem.vue'
102105

103106
import { getColorForFBType } from '../../../utils/freebusy.js'
104107

@@ -287,6 +290,13 @@ export default {
287290
height: 'auto',
288291
loading: this.loading,
289292
headerToolbar: false,
293+
// resourceLabelContent: this.customResourceRender,
294+
resourceAreaColumns: [
295+
{
296+
field: 'title',
297+
headerContent: 'Attendees',
298+
},
299+
],
290300
// Timezones:
291301
timeZone: this.timezoneId,
292302
// Formatting of the title
@@ -326,6 +336,28 @@ export default {
326336
break
327337
}
328338
},
339+
customResourceRender(arg) {
340+
const attendee = [this.organizer, ...this.attendees].find((a) => a.uri === arg.resource.id)
341+
let component = null
342+
if (attendee === this.organizer) {
343+
component = new Vue({
344+
render: h => h(OrganizerListItem, { props: { organizer: attendee, isReadOnly: false } }),
345+
}).$mount()
346+
} else {
347+
component = new Vue({
348+
render: h => h(InviteesListItem, { props: { attendee, organizerDisplayName: this.organizer.commonName, isReadOnly: false } }),
349+
}).$mount()
350+
351+
}
352+
353+
const html = document.createElement('div')
354+
html.style.position = 'absolute'
355+
html.innerText(component.$el.outerHTML)
356+
357+
return {
358+
html,
359+
}
360+
},
329361
},
330362
}
331363
</script>

src/utils/freebusy.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ export function getColorForFBType(type = 'BUSY') {
3737
return 'rgba(255,255,255,0)'
3838

3939
case 'BUSY-TENTATIVE':
40-
return 'rgb(221,203,85)'
40+
return 'rgba(184,129,0,0.3)'
4141

4242
case 'BUSY':
43-
return 'rgb(201,136,121)'
43+
return 'rgba(217,24,18,0.3)'
4444

4545
case 'BUSY-UNAVAILABLE':
46-
return 'rgb(182,70,157)'
46+
return 'rgba(219,219,219)'
4747

4848
default:
49-
return 'rgb(0,130,201)'
49+
return 'rgba(0,113,173,0.3)'
5050
}
5151
}
5252

0 commit comments

Comments
 (0)