Refactoring & Fix: editing group and challenges from user dashboard (#11418)

* Refactoring & Feature: edit/delete group and challenge tasks

- Remove showOption from tasks props
- Pass all needed data to task for understand in mapGetter function which controls we should show
- Improve current solution with edit and delete logic

* Fix: this in template

* Fix & Test: extend tests, fix can Edit/Delete functions

* Fix: allow user edit challenge tasks on dashboard

* Fix: test case after code change

* fix import path

* Fix:

- Extend canEdit and canDelete functions with admin role
- Clarify canEdit and canDelete conditions
- Extend test cases
This commit is contained in:
Aleksey
2019-11-16 20:36:27 +03:00
committed by Matteo Pagliazzi
parent a859dbd646
commit eaad244181
7 changed files with 236 additions and 30 deletions

View File

@@ -90,8 +90,8 @@
:key="task.id"
:task="task"
:is-user="isUser"
:show-options="showOptions"
:group="group"
:challenge="challenge"
@editTask="editTask"
@moveTo="moveTo"
@taskDestroyed="taskDestroyed"
@@ -372,10 +372,7 @@ export default {
selectedTags: {},
taskListOverride: {},
group: {},
showOptions: {
type: Boolean,
default: true,
},
challenge: {},
}, // @TODO: maybe we should store the group on state?
data () {
const icons = Object.freeze({