Added low priority page

This commit is contained in:
thepaperpilot 2024-04-29 23:19:49 -05:00
parent 2eadf6f25b
commit 8249bcc18c
4 changed files with 17 additions and 2 deletions

View file

@ -0,0 +1,11 @@
<template>
<ItemsView base-url="/low" :categories="lowCategories" title="Low priority" />
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { categories } from '../../state';
import ItemsView from './ItemsView.vue';
const lowCategories = computed(() => categories.value.filter(c => c.priority === "garden" && Object.keys(c.activeItems).length > 0));
</script>

View file

@ -3,6 +3,9 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { snoozedCategories } from '../../state'; import { computed } from 'vue';
import { categories } from '../../state';
import ItemsView from './ItemsView.vue'; import ItemsView from './ItemsView.vue';
const snoozedCategories = computed(() => categories.value.filter(c => Object.keys(c.snoozedItems).length > 0));
</script> </script>

View file

@ -5,11 +5,13 @@ import "./style.css";
import App from "./App.vue"; import App from "./App.vue";
import Todo from "./components/pages/Todo.vue"; import Todo from "./components/pages/Todo.vue";
import Snoozed from "./components/pages/Snoozed.vue"; import Snoozed from "./components/pages/Snoozed.vue";
import LowPriority from "./components/pages/LowPriority.vue";
const routes: RouteRecordRaw[] = [ const routes: RouteRecordRaw[] = [
{ path: '/', component: Todo, name: 'home' }, { path: '/', component: Todo, name: 'home' },
{ path: '/todo/:source(\\d+)?/:sourceItem(\\d+)?/:thread(\\d+)?', component: Todo, name: 'todo' }, { path: '/todo/:source(\\d+)?/:sourceItem(\\d+)?/:thread(\\d+)?', component: Todo, name: 'todo' },
{ path: '/snoozed/:source(\\d+)?/:sourceItem(\\d+)?/:thread(\\d+)?', component: Snoozed, name: 'snoozed' }, { path: '/snoozed/:source(\\d+)?/:sourceItem(\\d+)?/:thread(\\d+)?', component: Snoozed, name: 'snoozed' },
{ path: '/low/:source(\\d+)?/:sourceItem(\\d+)?/:thread(\\d+)?', component: LowPriority, name: 'low' },
]; ];
const router = createRouter({ const router = createRouter({

View file

@ -265,7 +265,6 @@ export const todoItems = computed(() =>
.reduce((acc, curr) => mergeSortedLists(acc, curr.activeItems), [] as Item[]) .reduce((acc, curr) => mergeSortedLists(acc, curr.activeItems), [] as Item[])
); );
export const todoCategories = computed(() => categories.value.filter(c => ["urgent", "notify", "todo"].includes(c.priority) && Object.keys(c.activeItems).length > 0)); export const todoCategories = computed(() => categories.value.filter(c => ["urgent", "notify", "todo"].includes(c.priority) && Object.keys(c.activeItems).length > 0));
export const snoozedCategories = computed(() => categories.value.filter(c => Object.keys(c.snoozedItems).length > 0));
watch( watch(
items, items,