Skip to content

Commit

Permalink
Introduce demo worklog tracker route and the composable
Browse files Browse the repository at this point in the history
  • Loading branch information
LSViana committed Oct 19, 2024
1 parent 393e0d4 commit 2907b51
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
18 changes: 18 additions & 0 deletions components/applications/worklog-tracker/useWorklogStorageDemo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { provide, ref } from 'vue'

import type { useWorklogStorage } from '~/components/applications/worklog-tracker/useWorklogStorage'
import type { WorklogItem } from '~/composables/server/worklog-tracker/types/worklogItem'

function buildWorklogStorage(): ReturnType<typeof useWorklogStorage> {
return {
operationLoading: ref(false),
load: () => Promise.resolve([]),
save: (worklogItem: WorklogItem) => Promise.resolve(worklogItem),
remove: () => Promise.resolve(),
update: () => Promise.resolve()
}
}

export function provideWorklogStorageDemo() {
provide('worklogStorage', buildWorklogStorage())
}
15 changes: 15 additions & 0 deletions pages/applications/worklog-tracker/demo/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<NuxtLayout name="home">
<WlContainer class="flex flex-col gap-3 p-3">
<WlWorklogTracker/>
</WlContainer>
</NuxtLayout>
</template>

<script setup lang="ts">
import { provideWorklogStorageDemo } from '~/components/applications/worklog-tracker/useWorklogStorageDemo'
import WlWorklogTracker from '~/components/applications/worklog-tracker/WlWorklogTracker.vue'
import WlContainer from '~/components/shared/layout/WlContainer.vue'
provideWorklogStorageDemo()
</script>

0 comments on commit 2907b51

Please sign in to comment.