Skip to content

Commit 2e8b088

Browse files
committed
improve project edit modal: fix enter submit on billable input and add labels
1 parent e69a419 commit 2e8b088

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

resources/js/Components/Common/Project/ProjectEditBillableSection.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const billableOptionInfoTexts: { [key in BillableKey]: string } = {
4646
const billableOptionInfoText = computed(() => {
4747
return billableOptionInfoTexts[billableRateSelect.value];
4848
});
49+
const emit = defineEmits(['submit']);
4950
</script>
5051

5152
<template>
@@ -60,7 +61,10 @@ const billableOptionInfoText = computed(() => {
6061
class="sm:max-w-[120px]"
6162
v-if="billableRateSelect === 'custom-rate'">
6263
<InputLabel for="billableRate" value="Billable Rate" />
63-
<BillableRateInput v-model="billableRate" name="billableRate" />
64+
<BillableRateInput
65+
@keydown.enter="emit('submit')"
66+
v-model="billableRate"
67+
name="billableRate" />
6468
</div>
6569
</div>
6670
<div class="flex items-center text-muted pt-2 pl-1">

resources/js/Components/Common/Project/ProjectEditModal.vue

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import PrimaryButton from '@/Components/PrimaryButton.vue';
88
import { useProjectsStore } from '@/utils/useProjects';
99
import { useFocus } from '@vueuse/core';
1010
import ClientDropdown from '@/Components/Common/Client/ClientDropdown.vue';
11-
import { twMerge } from 'tailwind-merge';
1211
import Badge from '@/Components/Common/Badge.vue';
1312
import { useClientsStore } from '@/utils/useClients';
1413
import { storeToRefs } from 'pinia';
1514
import ProjectColorSelector from '@/Components/Common/Project/ProjectColorSelector.vue';
1615
import ProjectEditBillableSection from '@/Components/Common/Project/ProjectEditBillableSection.vue';
16+
import { UserCircleIcon } from '@heroicons/vue/20/solid';
17+
import InputLabel from '@/Components/InputLabel.vue';
1718
1819
const { updateProject } = useProjectsStore();
1920
const { clients } = storeToRefs(useClientsStore());
@@ -63,10 +64,14 @@ const currentClientName = computed(() => {
6364
<div
6465
class="sm:flex items-center space-y-2 sm:space-y-0 sm:space-x-4">
6566
<div class="flex-1 flex items-center">
66-
<div class="px-3">
67+
<div class="text-center pr-5">
68+
<InputLabel for="color" value="Color" />
6769
<ProjectColorSelector
6870
v-model="project.color"></ProjectColorSelector>
6971
</div>
72+
</div>
73+
<div class="w-full">
74+
<InputLabel for="projectName" value="Project name" />
7075
<TextInput
7176
id="projectName"
7277
ref="projectNameInput"
@@ -79,22 +84,26 @@ const currentClientName = computed(() => {
7984
autocomplete="projectName" />
8085
</div>
8186
<div class="">
82-
<ClientDropdown v-model="project.client_id">
87+
<InputLabel for="client" value="Client" />
88+
<ClientDropdown class="mt-2" v-model="project.client_id">
8389
<template #trigger>
84-
<Badge size="large">
85-
<div
86-
:class="
87-
twMerge('inline-block rounded-full')
88-
"></div>
89-
<span>
90-
{{ currentClientName }}
91-
</span>
90+
<Badge
91+
class="bg-input-background cursor-pointer hover:bg-tertiary"
92+
size="xlarge">
93+
<div class="flex items-center space-x-2">
94+
<UserCircleIcon
95+
class="w-5 text-icon-default"></UserCircleIcon>
96+
<span>
97+
{{ currentClientName }}
98+
</span>
99+
</div>
92100
</Badge>
93101
</template>
94102
</ClientDropdown>
95103
</div>
96104
</div>
97105
<ProjectEditBillableSection
106+
@submit="submit"
98107
v-model:isBillable="project.is_billable"
99108
v-model:billableRate="
100109
project.billable_rate

0 commit comments

Comments
 (0)