Skip to content

Commit

Permalink
refactor Attendee List, show avatar, rsvp, ...
Browse files Browse the repository at this point in the history
Signed-off-by: Georg Ehrke <[email protected]>
  • Loading branch information
georgehrke committed Oct 19, 2019
1 parent 68c5b2c commit cb84ebd
Show file tree
Hide file tree
Showing 15 changed files with 1,102 additions and 80 deletions.
165 changes: 94 additions & 71 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"nextcloud-dialogs": "0.0.3",
"nextcloud-l10n": "0.1.0",
"nextcloud-logger": "0.0.6",
"nextcloud-router": "0.0.8",
"nextcloud-router": "0.0.9",
"nextcloud-vue": "^0.12.2",
"p-limit": "^2.2.1",
"p-queue": "^6.1.1",
Expand Down
78 changes: 78 additions & 0 deletions src/components/Editor/Alarm/AlarmTimeBeforeAfterSelect.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!--
- @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
-
- @author Georg Ehrke <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- 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/>.
-
-->

<template>
<Multiselect
:allow-empty="false"
:options="options"
:value="selected"
track-by="type"
label="label"
@select="select"
/>
</template>

<script>
import {
Multiselect
} from 'nextcloud-vue'

export default {
name: 'AlarmTimeBeforeAfterSelect',
components: {
Multiselect
},
props: {
isBefore: {
type: Boolean,
required: true
},
},
computed: {
options () {
return [{
'label': t('calendar', 'before'),
'type': 'before',
}, {
'label': t('calendar', 'after'),
'type': 'after'
}]
},
selected () {
const type = this.isBefore
? 'before'
: 'after'

return this.options.find(o => o.type === type)
}
},
methods: {
select (value) {
if (!value) {
return
}

this.$emit('change', value.type)
}
}
}
</script>
44 changes: 44 additions & 0 deletions src/components/Editor/Alarm/AlarmTimeCustomAllDay.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
- @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
-
- @author Georg Ehrke <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- 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/>.
-
-->
<template>
<div>
<alarm-type-select />
<input type="number" />
<alarm-time-unit-select />
<span>before at</span>
<DatetimePicker type="time" />
</div>
</template>

<script>
import AlarmTypeSelect from './AlarmTypeSelect'
import AlarmTimeUnitSelect from './AlarmTimeUnitSelect'

export default {
name: 'AlarmTimeCustomAllDay',
components: {
AlarmTimeUnitSelect,
AlarmTypeSelect

}
}
</script>
49 changes: 49 additions & 0 deletions src/components/Editor/Alarm/AlarmTimeCustomTimed.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!--
- @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
-
- @author Georg Ehrke <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- 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/>.
-
-->

<template>
<div>
<alarm-type-select />
<input type="number" />
<alarm-time-unit-select />
<alarm-time-before-after-select />
<alarm-time-start-end-select />
</div>
</template>

<script>
import AlarmTypeSelect from './AlarmTypeSelect'
import AlarmTimeUnitSelect from './AlarmTimeUnitSelect'
import AlarmTimeBeforeAfterSelect from './AlarmTimeBeforeAfterSelect'
import AlarmTimeStartEndSelect from './AlarmTimeStartEndSelect'

export default {
name: 'AlarmTimeCustomTimed',
components: {
AlarmTimeStartEndSelect,
AlarmTimeBeforeAfterSelect,
AlarmTimeUnitSelect,
AlarmTypeSelect

}
}
</script>
80 changes: 80 additions & 0 deletions src/components/Editor/Alarm/AlarmTimeSelect.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!--
- @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
-
- @author Georg Ehrke <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- 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/>.
-
-->

<template>
<Multiselect
:allow-empty="false"
:options="options"
:value="selected"
track-by="trigger"
label="label"
@select="select"
/>
</template>

<script>
import {
Multiselect
} from 'nextcloud-vue'
import defaultAlarms from '../../../defaults/defaultAlarmProvider'

export default {
name: 'AlarmTimeSelect',
components: {
Multiselect
},
props: {
triggerType: {
type: String,
required: true
},
isAllDay: {
type: Boolean,
required: true
}
},
computed: {
options() {
const options = this.isAllDay
? defaultAlarms.allDayEvents
: defaultAlarms.timedEvents

options.push({
label: t('calendar', 'Custom'),
trigger: 'custom'
})
},
selected() {
return this.options.find(o => o.trigger === this.triggerType)
}
},
methods: {
select(value) {
if (!value) {
return
}

this.$emit('change', value.trigger)
}
}
}
</script>
78 changes: 78 additions & 0 deletions src/components/Editor/Alarm/AlarmTimeStartEndSelect.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!--
- @copyright Copyright (c) 2019 Georg Ehrke <oc.list@georgehrke.com>
-
- @author Georg Ehrke <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- 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/>.
-
-->

<template>
<Multiselect
:allow-empty="false"
:options="options"
:value="selected"
track-by="related"
label="label"
@select="select"
/>
</template>

<script>
import {
Multiselect
} from 'nextcloud-vue'

export default {
name: 'AlarmTimeStartEndSelect',
components: {
Multiselect
},
props: {
isRelatedToStart: {
type: Boolean,
required: true
},
},
computed: {
options () {
return [{
'label': t('calendar', 'before'),
'related': 'start',
}, {
'label': t('calendar', 'after'),
'related': 'end'
}]
},
selected () {
const type = this.isRelatedToStart
? 'start'
: 'end'

return this.options.find(o => o.related === type)
}
},
methods: {
select (value) {
if (!value) {
return
}

this.$emit('change', value.related)
}
}
}
</script>
Loading

0 comments on commit cb84ebd

Please sign in to comment.