@@ -212,6 +217,7 @@
:search-text="searchTextThrottled"
:selected-tags="selectedTags"
@editTask="editTask"
+ @taskSummary="taskSummary"
@openBuyDialog="openBuyDialog($event)"
/>
@@ -382,6 +388,7 @@ import cloneDeep from 'lodash/cloneDeep';
import draggable from 'vuedraggable';
import TaskColumn from './column';
import TaskModal from './taskModal';
+import TaskSummary from './taskSummary';
import spells from './spells';
import markdown from '@/directives/markdown';
@@ -402,6 +409,7 @@ export default {
components: {
TaskColumn,
TaskModal,
+ TaskSummary,
spells,
brokenTaskModal,
draggable,
@@ -525,13 +533,19 @@ export default {
};
this.newTag = null;
},
+ // Need Vue.nextTick() otherwise the first time the modal is not rendered
editTask (task) {
this.editingTask = cloneDeep(task);
- // Necessary otherwise the first time the modal is not rendered
Vue.nextTick(() => {
this.$root.$emit('bv::show::modal', 'task-modal');
});
},
+ taskSummary (task) {
+ this.editingTask = cloneDeep(task);
+ Vue.nextTick(() => {
+ this.$root.$emit('bv::show::modal', 'task-summary');
+ });
+ },
createTask (type) {
this.openCreateBtn = false;
this.creatingTask = taskDefaults({ type, text: '' }, this.user);
diff --git a/website/client/src/mixins/syncTask.js b/website/client/src/mixins/syncTask.js
new file mode 100644
index 0000000000..b5fb79c3f0
--- /dev/null
+++ b/website/client/src/mixins/syncTask.js
@@ -0,0 +1,32 @@
+import clone from 'lodash/clone';
+
+export default {
+ methods: {
+ async syncTask () {
+ if (this.groupId) {
+ const members = await this.$store.dispatch('members:getGroupMembers', {
+ groupId: this.groupId,
+ includeAllPublicFields: true,
+ });
+ this.members = members;
+ this.membersNameAndId = [];
+ this.members.forEach(member => {
+ this.membersNameAndId.push({
+ id: member._id,
+ name: member.profile.name,
+ addlText: `@${member.auth.local.username}`,
+ });
+ this.memberNamesById[member._id] = member.profile.name;
+ });
+ this.assignedMembers = [];
+ if (this.task.group?.assignedUsers) {
+ this.assignedMembers = this.task.group.assignedUsers;
+ }
+ }
+
+ // @TODO: Task modal component is mutating a prop
+ // and that causes issues. We need to not copy the prop similar to group modals
+ if (this.task) this.checklist = clone(this.task.checklist);
+ },
+ },
+};
diff --git a/website/client/src/store/getters/tasks.js b/website/client/src/store/getters/tasks.js
index fe4f989c23..d5d3824247 100644
--- a/website/client/src/store/getters/tasks.js
+++ b/website/client/src/store/getters/tasks.js
@@ -101,11 +101,7 @@ export function canEdit (store) {
}
break;
case 'group':
- if (!onUserDashboard) {
- isUserCanEditTask = isUserGroupLeader || isUserGroupManager || isUserAdmin;
- } else {
- isUserCanEditTask = true;
- }
+ isUserCanEditTask = isUserGroupLeader || isUserGroupManager || isUserAdmin;
break;
default:
break;