From 55cd4e7158c5eff31011ba434f84962b4dd3ae58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Sat, 7 Mar 2020 17:24:00 +0100 Subject: [PATCH 1/5] Don't move non-PUBLIC tasks to calendars shared with me MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- src/components/TheDetails.vue | 11 ++++++++++- src/store/tasks.js | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/TheDetails.vue b/src/components/TheDetails.vue index 44cea408..6c1b6b67 100644 --- a/src/components/TheDetails.vue +++ b/src/components/TheDetails.vue @@ -184,7 +184,7 @@ License along with this library. If not, see . 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', diff --git a/src/store/tasks.js b/src/store/tasks.js index aa840b8f..ef4e5688 100644 --- a/src/store/tasks.js +++ b/src/store/tasks.js @@ -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. From 88da1030514655e9a8e5d51f3e04e22502bab188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Sat, 7 Mar 2020 17:24:30 +0100 Subject: [PATCH 2/5] Fix dnd hover background-color MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- css/src/style.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/css/src/style.scss b/css/src/style.scss index 19d57388..eae1c1fe 100644 --- a/css/src/style.scss +++ b/css/src/style.scss @@ -62,7 +62,8 @@ } &.dnd-hover { - background-color: rgba( $color-primary, .3 ); + // background-color: rgba( $color-primary, .1 ); didn't work for some reason + background-color: transparentize( $color-primary, .9 ); } button { @@ -446,7 +447,8 @@ } &.sortable-ghost .task-body { - background-color: rgba( $color-primary, .3 ); + // background-color: rgba( $color-primary, .1 ); didn't work for some reason + background-color: transparentize( $color-primary, .9 ); } .subtasks-container { From 2e7c2730f8cbc1cc8d375f1034e3190a8a6526c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Sat, 7 Mar 2020 18:30:11 +0100 Subject: [PATCH 3/5] Don't highlight calendars if not dropable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- src/components/AppNavigation/ListItemCalendar.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/AppNavigation/ListItemCalendar.vue b/src/components/AppNavigation/ListItemCalendar.vue index 48b1f2d2..fa6133b2 100644 --- a/src/components/AppNavigation/ListItemCalendar.vue +++ b/src/components/AppNavigation/ListItemCalendar.vue @@ -307,6 +307,15 @@ export default { if (this.calendar.readOnly) { return } + if (this.calendar.isSharedWithMe) { + const taskUri = e.dataTransfer.getData('text/plain') + if (taskUri) { + const task = this.getTask(taskUri) + if (task.class !== 'PUBLIC') { + return + } + } + } // Get the correct element, in case we hover a child. if (e.target.closest) { const target = e.target.closest('li.list') From fdcbc3a8c195e7eb5617165a03b9dbf83a624fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Sat, 7 Mar 2020 18:37:53 +0100 Subject: [PATCH 4/5] Show non-PUBLIC tasks in shared calendars readonly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- src/components/TaskBody.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/TaskBody.vue b/src/components/TaskBody.vue index 809f5ef6..0590d561 100644 --- a/src/components/TaskBody.vue +++ b/src/components/TaskBody.vue @@ -23,7 +23,7 @@ License along with this library. If not, see .