From f52a629bacaef3d486ca7a0c6ec15d0a837a0a19 Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Wed, 24 Apr 2024 22:13:22 +0200 Subject: [PATCH] add manual time entry feature --- e2e/time.spec.ts | 2 + resources/css/app.css | 9 +- resources/js/Components/Common/Badge.vue | 3 +- resources/js/Components/Common/DatePicker.vue | 52 ++++++++ .../Common/Project/ProjectBadge.vue | 3 +- .../Common/TimeEntry/TimeEntryCreateModal.vue | 118 ++++++++++++++++++ .../Common/TimeEntry/TimeEntryRow.vue | 2 +- resources/js/Components/Common/TimePicker.vue | 56 ++++++--- .../TimeTrackerProjectTaskDropdown.vue | 4 +- .../Dashboard/RecentlyTrackedTasksCard.vue | 2 +- .../js/Components/NotificationContainer.vue | 2 +- resources/js/Pages/Time.vue | 25 +++- resources/js/utils/api.ts | 5 + resources/js/utils/notification.ts | 2 +- resources/js/utils/useTimeEntries.ts | 4 +- 15 files changed, 261 insertions(+), 28 deletions(-) create mode 100644 resources/js/Components/Common/DatePicker.vue create mode 100644 resources/js/Components/Common/TimeEntry/TimeEntryCreateModal.vue diff --git a/e2e/time.spec.ts b/e2e/time.spec.ts index 2ecb3dc5..e9b81382 100644 --- a/e2e/time.spec.ts +++ b/e2e/time.spec.ts @@ -461,3 +461,5 @@ test('test that load more works when the end of page is reached', async ({ // TODO: Test for resume button click works with project / task // TODO: Test that time entries are loaded at the end of the page + +// TODO: Test manual time entries diff --git a/resources/css/app.css b/resources/css/app.css index 3e9cbff4..8236cc91 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -4,20 +4,21 @@ :root{ - --theme-color-default-background: #040618; + --theme-color-default-background: #0b0d1c; --theme-color-icon-default: #42466C; --theme-color-card-background: #13152B; --theme-color-card-background-active: #1C1E34; - --theme-color-card-border: #242940; + --theme-color-card-background-separator: #1c2033; + --theme-color-card-border: #1c2033; --theme-color-card-border-active: #2A3461; + --theme-color-default-background-separator: #141a2f; --theme-color-tab-background: var(--theme-color-card-background); --theme-color-tab-background-active: var(--theme-color-card-background-active); --theme-color-tab-border: var(--theme-color-card-border); - --theme-color-row-separator-background: var(--theme-color-card-border); + --theme-color-row-separator-background: var(--theme-color-default-background-separator); --theme-color-row-heading-background: var(--theme-color-card-background); --theme-color-row-border: var(--theme-color-card-border); --theme-color-row-heading-border: var(--theme-color-card-border); - } *{ diff --git a/resources/js/Components/Common/Badge.vue b/resources/js/Components/Common/Badge.vue index 615dfc1f..52c32983 100644 --- a/resources/js/Components/Common/Badge.vue +++ b/resources/js/Components/Common/Badge.vue @@ -4,7 +4,7 @@ import { computed } from 'vue'; const props = withDefaults( defineProps<{ - size: 'base' | 'large'; + size: 'base' | 'large' | 'xlarge'; tag: string; class?: string; color: string; @@ -21,6 +21,7 @@ const props = withDefaults( const badgeClasses = { base: 'py-1 px-2 space-x-1.5 text-xs', large: 'py-1 sm:py-1.5 px-2 sm:px-3 space-x-1.5 sm:space-x-2 text-xs sm:text-sm text-muted', + xlarge: 'py-2 sm:py-2.5 px-3 sm:px-3.5 space-x-2 sm:space-x-3 text-sm sm:text-sm text-muted', }; const borderClasses = computed(() => { diff --git a/resources/js/Components/Common/DatePicker.vue b/resources/js/Components/Common/DatePicker.vue new file mode 100644 index 00000000..f5f0725b --- /dev/null +++ b/resources/js/Components/Common/DatePicker.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/resources/js/Components/Common/Project/ProjectBadge.vue b/resources/js/Components/Common/Project/ProjectBadge.vue index cd84fc87..777bbfec 100644 --- a/resources/js/Components/Common/Project/ProjectBadge.vue +++ b/resources/js/Components/Common/Project/ProjectBadge.vue @@ -5,7 +5,7 @@ import Badge from '@/Components/Common/Badge.vue'; const props = withDefaults( defineProps<{ name: string; - size: 'base' | 'large'; + size: 'base' | 'large' | 'xlarge'; tag: string; class?: string; color: string; @@ -23,6 +23,7 @@ const props = withDefaults( const indicatorClasses = { base: 'w-2.5 h-2.5', large: 'w-2 sm:w-3 h-2 sm:h-3', + xlarge: 'w-3 sm:w-4 h-3 sm:h-4', }; diff --git a/resources/js/Components/Common/TimeEntry/TimeEntryCreateModal.vue b/resources/js/Components/Common/TimeEntry/TimeEntryCreateModal.vue new file mode 100644 index 00000000..0279e58f --- /dev/null +++ b/resources/js/Components/Common/TimeEntry/TimeEntryCreateModal.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/resources/js/Components/Common/TimeEntry/TimeEntryRow.vue b/resources/js/Components/Common/TimeEntry/TimeEntryRow.vue index cba52d38..9dc53de5 100644 --- a/resources/js/Components/Common/TimeEntry/TimeEntryRow.vue +++ b/resources/js/Components/Common/TimeEntry/TimeEntryRow.vue @@ -80,7 +80,7 @@ function updateProjectAndTask(projectId: string, taskId: string) {