Don't move non-PUBLIC tasks to calendars shared with me
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
parent
03a6c6290f
commit
55cd4e7158
2 changed files with 12 additions and 3 deletions
|
@ -184,7 +184,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|||
track-by="id"
|
||||
:placeholder="$t('tasks', 'Select a calendar')"
|
||||
label="displayName"
|
||||
:options="writableCalendars"
|
||||
:options="targetCalendars"
|
||||
:close-on-select="true"
|
||||
class="multiselect-vue"
|
||||
@input="changeCalendar"
|
||||
|
@ -656,6 +656,15 @@ export default {
|
|||
return 'icon-sprt-bw sprt-current'
|
||||
}
|
||||
},
|
||||
targetCalendars() {
|
||||
let calendars = this.writableCalendars
|
||||
// Tasks with an access class other than PUBLIC cannot be moved
|
||||
// into calendars shared with me
|
||||
if (this.task.class !== 'PUBLIC') {
|
||||
calendars = calendars.filter(calendar => !calendar.isSharedWithMe)
|
||||
}
|
||||
return calendars
|
||||
},
|
||||
...mapGetters({
|
||||
writableCalendars: 'getSortedWritableCalendars',
|
||||
task: 'getTaskByRoute',
|
||||
|
|
|
@ -1183,8 +1183,8 @@ const actions = {
|
|||
if (task.calendar.readOnly) {
|
||||
return task
|
||||
}
|
||||
// Don't move tasks in shared calendars with access class not PUBLIC
|
||||
if (task.calendar.isSharedWithMe && task.class !== 'PUBLIC') {
|
||||
// Don't move tasks with access class not PUBLIC from or to calendars shared with me
|
||||
if ((task.calendar.isSharedWithMe || calendar.isSharedWithMe) && task.class !== 'PUBLIC') {
|
||||
return
|
||||
}
|
||||
// Don't move if source and target calendar are the same.
|
||||
|
|
Loading…
Reference in a new issue