fix: apply default hourly rate from settings when creating new projects

This commit is contained in:
Your Name
2026-02-17 23:35:24 +02:00
parent 7d43f02e59
commit a13dff96c8

View File

@@ -105,13 +105,12 @@
<!-- Hourly Rate --> <!-- Hourly Rate -->
<div> <div>
<label class="block text-[0.6875rem] text-text-tertiary uppercase tracking-[0.08em] mb-1.5">Hourly Rate ($)</label> <label class="block text-[0.6875rem] text-text-tertiary uppercase tracking-[0.08em] mb-1.5">Hourly Rate ($)</label>
<input <AppNumberInput
v-model.number="formData.hourly_rate" v-model="formData.hourly_rate"
type="number" :min="0"
min="0" :step="1"
step="0.01" :precision="2"
class="w-full px-3 py-2 bg-bg-inset border border-border-subtle rounded-lg text-[0.8125rem] text-text-primary focus:outline-none focus:border-border-visible" prefix="$"
placeholder="0.00"
/> />
</div> </div>
@@ -196,14 +195,17 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue'
import { FolderKanban } from 'lucide-vue-next' import { FolderKanban } from 'lucide-vue-next'
import AppNumberInput from '../components/AppNumberInput.vue'
import AppSelect from '../components/AppSelect.vue' import AppSelect from '../components/AppSelect.vue'
import { useProjectsStore, type Project } from '../stores/projects' import { useProjectsStore, type Project } from '../stores/projects'
import { useClientsStore } from '../stores/clients' import { useClientsStore } from '../stores/clients'
import { useSettingsStore } from '../stores/settings'
const colorPresets = ['#D97706', '#3B82F6', '#8B5CF6', '#EC4899', '#10B981', '#EF4444', '#06B6D4', '#6B7280'] const colorPresets = ['#D97706', '#3B82F6', '#8B5CF6', '#EC4899', '#10B981', '#EF4444', '#06B6D4', '#6B7280']
const projectsStore = useProjectsStore() const projectsStore = useProjectsStore()
const clientsStore = useClientsStore() const clientsStore = useClientsStore()
const settingsStore = useSettingsStore()
// Dialog state // Dialog state
const showDialog = ref(false) const showDialog = ref(false)
@@ -232,7 +234,7 @@ function openCreateDialog() {
editingProject.value = null editingProject.value = null
formData.name = '' formData.name = ''
formData.client_id = undefined formData.client_id = undefined
formData.hourly_rate = 0 formData.hourly_rate = parseFloat(settingsStore.settings.hourly_rate) || 0
formData.color = '#F59E0B' formData.color = '#F59E0B'
formData.archived = false formData.archived = false
showDialog.value = true showDialog.value = true
@@ -292,7 +294,8 @@ async function handleDelete() {
onMounted(async () => { onMounted(async () => {
await Promise.all([ await Promise.all([
projectsStore.fetchProjects(), projectsStore.fetchProjects(),
clientsStore.fetchClients() clientsStore.fetchClients(),
settingsStore.fetchSettings()
]) ])
}) })
</script> </script>