From 24a7e5ed3263671e8b1e9c704cf6ba6c6c3b7ce0 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 3 Mar 2019 18:10:56 +0100 Subject: [PATCH 1/4] Added new assignees --- src/components/lists/ShowList.vue | 73 +++++++++++++++++++++++++++-- src/components/sharing/userTeam.vue | 3 -- src/styles/theme.scss | 7 ++- todo.md | 1 + 4 files changed, 77 insertions(+), 7 deletions(-) diff --git a/src/components/lists/ShowList.vue b/src/components/lists/ShowList.vue index 14968a35e..9337e065b 100644 --- a/src/components/lists/ShowList.vue +++ b/src/components/lists/ShowList.vue @@ -183,6 +183,44 @@ +
+ +
+
+ {{a}} +
+
+
+ +
+
+ + + Oops! No user found. Consider changing the search query. + +
+ +
+ +
@@ -209,7 +247,7 @@
- +
@@ -232,11 +270,14 @@ import message from '../../message' import flatPickr from 'vue-flatpickr-component' import 'flatpickr/dist/flatpickr.css' + import multiselect from 'vue-multiselect' import ListService from '../../services/list' import TaskService from '../../services/task' import TaskModel from '../../models/task' import ListModel from '../../models/list' + import UserModel from '../../models/user' + import UserService from '../../services/user' import priorities from '../../models/priorities' export default { @@ -263,10 +304,15 @@ onOpen: this.updateLastReminderDate, onClose: this.addReminderDate, }, + + newAssignee: UserModel, + userService: UserService, + foundUsers: [], } }, components: { - flatPickr + flatPickr, + multiselect, }, beforeMount() { // Check if the user is already logged in, if so, redirect him to the homepage @@ -278,6 +324,7 @@ this.listService = new ListService() this.taskService = new TaskService() this.newTask = new TaskModel() + this.userService = new UserService() this.loadList() }, watch: { @@ -395,7 +442,27 @@ this.taskEditTask.reminderDates.splice(index, 1) // Reset the last to 0 to have the "add reminder" button this.taskEditTask.reminderDates[this.taskEditTask.reminderDates.length - 1] = null - } + }, + addAssignee() { + this.taskEditTask.assignees.push(this.newAssignee) + }, + findUser(query) { + if(query === '') { + this.$set(this, 'foundUsers', []) + return + } + + this.userService.getAll({}, {s: query}) + .then(response => { + this.$set(this, 'foundUsers', response) + }) + .catch(e => { + message.error(e, this) + }) + }, + clearAll () { + this.$set(this, 'foundUsers', []) + }, } } \ No newline at end of file diff --git a/src/components/sharing/userTeam.vue b/src/components/sharing/userTeam.vue index bc49b2d41..a0c27c78c 100644 --- a/src/components/sharing/userTeam.vue +++ b/src/components/sharing/userTeam.vue @@ -304,9 +304,6 @@ clearAll () { this.$set(this, 'found', []) }, - limitText (count) { - return `and ${count} others` - }, }, } diff --git a/src/styles/theme.scss b/src/styles/theme.scss index 4a58d7edb..18b8608a8 100644 --- a/src/styles/theme.scss +++ b/src/styles/theme.scss @@ -13,13 +13,18 @@ font-size: 0.85rem; font-weight: bold; height: 2.648em; - box-shadow: 0.3em 0.3em 1em lighten($dark, 75); + &.is-hovered, &:hover { box-shadow: 0.6em 0.6em 1em lighten($dark, 75); } + &.fullheight{ + padding-right: 7px; + height: 100%; + } + &.is-active, &.is-focused, &:active, diff --git a/todo.md b/todo.md index 04caaac8e..3ca0c56bf 100644 --- a/todo.md +++ b/todo.md @@ -120,3 +120,4 @@ * [ ] "Performance-Statistik" -> Wie viele Tasks man in bestimmten Zeiträumen so geschafft hat etc * [ ] Activity Feed, so à la "der und der hat das und das gemacht etc" * [ ] Attachments for tasks +* [ ] Search for users at new task assignees only in users who have access to the list -- 2.45.1 From a3fa9e3d34d3334a04ae0ed3031ddd6a4783429a Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 3 Mar 2019 20:33:52 +0100 Subject: [PATCH 2/4] Improved multiselect handling --- src/components/lists/ShowList.vue | 20 ++++++++++++-------- src/styles/_multiselect.scss | 4 ++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/lists/ShowList.vue b/src/components/lists/ShowList.vue index 9337e065b..7fb9e9a8a 100644 --- a/src/components/lists/ShowList.vue +++ b/src/components/lists/ShowList.vue @@ -185,11 +185,11 @@
-
-
+
    +
  • {{a}} -
-
+ +
@@ -206,7 +206,7 @@ label="username" track-by="id"> Oops! No user found. Consider changing the search query. @@ -220,7 +220,6 @@
-
@@ -271,6 +270,7 @@ import flatPickr from 'vue-flatpickr-component' import 'flatpickr/dist/flatpickr.css' import multiselect from 'vue-multiselect' + import {differenceWith} from 'lodash' import ListService from '../../services/list' import TaskService from '../../services/task' @@ -325,6 +325,7 @@ this.taskService = new TaskService() this.newTask = new TaskModel() this.userService = new UserService() + this.newAssignee = new UserModel() this.loadList() }, watch: { @@ -448,13 +449,16 @@ }, findUser(query) { if(query === '') { - this.$set(this, 'foundUsers', []) + this.clearAll() return } this.userService.getAll({}, {s: query}) .then(response => { - this.$set(this, 'foundUsers', response) + // Filter the results to not include users who are already assigned + this.$set(this, 'foundUsers', differenceWith(response, this.taskEditTask.assignees, (first, second) => { + return first.id === second.id + })) }) .catch(e => { message.error(e, this) diff --git a/src/styles/_multiselect.scss b/src/styles/_multiselect.scss index 3b2e5112b..c01c6bf79 100644 --- a/src/styles/_multiselect.scss +++ b/src/styles/_multiselect.scss @@ -268,6 +268,10 @@ fieldset[disabled] .multiselect { margin: 0; min-width: 100%; vertical-align: top; + + li + li { + margin: 0; + } } .multiselect--above .multiselect__content-wrapper { -- 2.45.1 From 89932c7eb5a3c4d10ee98a626d0789dd7075492d Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 3 Mar 2019 21:06:37 +0100 Subject: [PATCH 3/4] Implemented removing assigees --- src/components/lists/ShowList.vue | 8 ++++++-- src/styles/tasks.scss | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/components/lists/ShowList.vue b/src/components/lists/ShowList.vue index 7fb9e9a8a..c5843ea4b 100644 --- a/src/components/lists/ShowList.vue +++ b/src/components/lists/ShowList.vue @@ -186,8 +186,9 @@
    -
  • - {{a}} +
  • + {{a.username}} +
@@ -447,6 +448,9 @@ addAssignee() { this.taskEditTask.assignees.push(this.newAssignee) }, + deleteAssigneeByIndex(index) { + this.taskEditTask.assignees.splice(index, 1) + }, findUser(query) { if(query === '') { this.clearAll() diff --git a/src/styles/tasks.scss b/src/styles/tasks.scss index 09e5e5214..0fa1db1dc 100644 --- a/src/styles/tasks.scss +++ b/src/styles/tasks.scss @@ -120,4 +120,23 @@ width: 100%; } } + + ul.assingees { + list-style: none; + margin: 0; + + li{ + padding: 0.5em 0.5em 0; + + a{ + float: right; + color: $red; + transition: all $transition; + + &:hover{ + color: darken($red, 15); + } + } + } + } } \ No newline at end of file -- 2.45.1 From e08290eef241eb416c58624f5eb97a3f0d550a7f Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 3 Mar 2019 21:07:11 +0100 Subject: [PATCH 4/4] updated todo --- todo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo.md b/todo.md index 3ca0c56bf..a67012bb6 100644 --- a/todo.md +++ b/todo.md @@ -91,7 +91,7 @@ * [ ] Teams with access to a namespace * [x] Priorities * [x] Highlight tasks with high priority -* [ ] Assignees +* [x] Assignees * [ ] Labels * [ ] Timeline/Calendar view -> Dazu tasks die in einem Bestimmten Bereich due sind, macht dann das Frontend -- 2.45.1