diff --git a/resources/js/packages/ui/src/TimeEntry/TimeEntryMassUpdateModal.vue b/resources/js/packages/ui/src/TimeEntry/TimeEntryMassUpdateModal.vue index 9cef6811..d466ce71 100644 --- a/resources/js/packages/ui/src/TimeEntry/TimeEntryMassUpdateModal.vue +++ b/resources/js/packages/ui/src/TimeEntry/TimeEntryMassUpdateModal.vue @@ -16,6 +16,7 @@ import { } from '@/packages/api/src'; import { Checkbox } from '@/packages/ui/src'; import { TagIcon, ExclamationTriangleIcon } from '@heroicons/vue/20/solid'; +import { XMarkIcon } from '@heroicons/vue/16/solid'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '..'; import { Button } from '@/packages/ui/src/Buttons'; import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue'; @@ -60,6 +61,13 @@ const projectId = ref(null); const billable = ref(undefined); const selectedTags = ref([]); +// Clearing the project puts both fields back to "leave unchanged", the same state the form +// returns to after a successful submit. +function resetProject() { + projectId.value = null; + taskId.value = undefined; +} + const timeEntryBillable = computed({ get: () => { if (billable.value === undefined) { @@ -182,42 +190,59 @@ const showBreakWarning = computed( Project - +
+ +
+ +
+ +
Tag -
- - - +
+ +
+ + + +
Remove all tags diff --git a/resources/js/packages/ui/src/TimeTracker/TimeTrackerProjectTaskDropdown.vue b/resources/js/packages/ui/src/TimeTracker/TimeTrackerProjectTaskDropdown.vue index 700c585a..b1afca1a 100644 --- a/resources/js/packages/ui/src/TimeTracker/TimeTrackerProjectTaskDropdown.vue +++ b/resources/js/packages/ui/src/TimeTracker/TimeTrackerProjectTaskDropdown.vue @@ -12,7 +12,7 @@ import type { Client, } from '@/packages/api/src'; -import { PlusCircleIcon, MinusIcon, XMarkIcon } from '@heroicons/vue/16/solid'; +import { PlusCircleIcon, MinusIcon } from '@heroicons/vue/16/solid'; import ProjectCreateModal from '@/packages/ui/src/Project/ProjectCreateModal.vue'; import { twMerge } from 'tailwind-merge'; import { Button } from '@/packages/ui/src/Buttons'; @@ -58,7 +58,6 @@ const props = withDefaults( createClient: (client: CreateClientBody) => Promise; currency: string; emptyPlaceholder?: string; - allowReset?: boolean; noProjectValue?: string | null; enableEstimatedTime: boolean; organizationBillableRate: number | null; @@ -70,7 +69,6 @@ const props = withDefaults( }>(), { emptyPlaceholder: 'No Project', - allowReset: false, noProjectValue: NO_PROJECT_ID, variant: 'ghost', align: 'center', @@ -558,12 +556,6 @@ function selectProject(projectId: string) { emit('changed', project.value, task.value); } -function resetProject() { - project.value = null; - task.value = null; - emit('changed', project.value, task.value); -} - const showCreateProject = ref(false); @@ -571,40 +563,28 @@ const showCreateProject = ref(false);