fix: apply default hourly rate from settings when creating new projects
This commit is contained in:
@@ -105,13 +105,12 @@
|
||||
<!-- Hourly Rate -->
|
||||
<div>
|
||||
<label class="block text-[0.6875rem] text-text-tertiary uppercase tracking-[0.08em] mb-1.5">Hourly Rate ($)</label>
|
||||
<input
|
||||
v-model.number="formData.hourly_rate"
|
||||
type="number"
|
||||
min="0"
|
||||
step="0.01"
|
||||
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"
|
||||
placeholder="0.00"
|
||||
<AppNumberInput
|
||||
v-model="formData.hourly_rate"
|
||||
:min="0"
|
||||
:step="1"
|
||||
:precision="2"
|
||||
prefix="$"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -196,14 +195,17 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { FolderKanban } from 'lucide-vue-next'
|
||||
import AppNumberInput from '../components/AppNumberInput.vue'
|
||||
import AppSelect from '../components/AppSelect.vue'
|
||||
import { useProjectsStore, type Project } from '../stores/projects'
|
||||
import { useClientsStore } from '../stores/clients'
|
||||
import { useSettingsStore } from '../stores/settings'
|
||||
|
||||
const colorPresets = ['#D97706', '#3B82F6', '#8B5CF6', '#EC4899', '#10B981', '#EF4444', '#06B6D4', '#6B7280']
|
||||
|
||||
const projectsStore = useProjectsStore()
|
||||
const clientsStore = useClientsStore()
|
||||
const settingsStore = useSettingsStore()
|
||||
|
||||
// Dialog state
|
||||
const showDialog = ref(false)
|
||||
@@ -232,7 +234,7 @@ function openCreateDialog() {
|
||||
editingProject.value = null
|
||||
formData.name = ''
|
||||
formData.client_id = undefined
|
||||
formData.hourly_rate = 0
|
||||
formData.hourly_rate = parseFloat(settingsStore.settings.hourly_rate) || 0
|
||||
formData.color = '#F59E0B'
|
||||
formData.archived = false
|
||||
showDialog.value = true
|
||||
@@ -292,7 +294,8 @@ async function handleDelete() {
|
||||
onMounted(async () => {
|
||||
await Promise.all([
|
||||
projectsStore.fetchProjects(),
|
||||
clientsStore.fetchClients()
|
||||
clientsStore.fetchClients(),
|
||||
settingsStore.fetchSettings()
|
||||
])
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user