Skip to content

Commit

Permalink
fix: separate "assigned" and "created" tabs in my tasks
Browse files Browse the repository at this point in the history
closes #260
  • Loading branch information
netchampfaris committed Nov 21, 2024
1 parent ef65894 commit 1c5f332
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions frontend/src/pages/MyTasks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@
</header>

<div class="mx-auto w-full max-w-4xl px-5">
<div class="py-6">
<div class="flex pt-5">
<TabButtons
:buttons="[
{ label: 'Assigned to me', value: 'assigned' },
{ label: 'Created by me', value: 'owner' },
]"
v-model="currentTab"
/>
</div>
<div class="pb-6 mt-4">
<TaskList :listOptions="listOptions" :groupByStatus="true" />
<NewTaskDialog ref="newTaskDialog" />
</div>
Expand All @@ -22,14 +31,23 @@
</template>
<script setup>
import { ref, computed } from 'vue'
import { getCachedListResource, usePageMeta, Breadcrumbs } from 'frappe-ui'
import { getCachedListResource, usePageMeta, Breadcrumbs, TabButtons } from 'frappe-ui'
import { getUser } from '@/data/users'
let newTaskDialog = ref(null)
let currentTab = ref('assigned')
let listOptions = computed(() => ({
filters: { assigned_or_owner: getUser('sessionUser').name },
}))
let listOptions = computed(() => {
let me = getUser('sessionUser').name
if (currentTab.value === 'assigned') {
return {
filters: { assigned_to: me },
}
}
return {
filters: { owner: me },
}
})
function showNewTaskDialog() {
newTaskDialog.value.show({
Expand Down

0 comments on commit 1c5f332

Please sign in to comment.