Prefill project name in create modal

Add optional initialProjectName prop to ProjectCreateModal and use it
to initialize the project's name. Pass the TimeTracker dropdown's
searchValue as initial-project-name so the create form is prefilled.
This commit is contained in:
ShrootBuck
2026-03-26 21:04:49 -07:00
committed by Gregor Vostrak
parent 815abb5980
commit b1287c6a0a
2 changed files with 4 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ const props = defineProps<{
currency: string;
enableEstimatedTime: boolean;
organizationBillableRate: number | null;
initialProjectName?: string;
}>();
const activeClients = computed(() => {
@@ -34,7 +35,7 @@ const activeClients = computed(() => {
});
const project = ref<CreateProjectBody>({
name: '',
name: props.initialProjectName ?? '',
color: getRandomColor(),
client_id: null,
billable_rate: null,

View File

@@ -664,7 +664,8 @@ const showCreateProject = ref(false);
:organization-billable-rate="organizationBillableRate"
:currency="currency"
:clients="clients"
:create-project></ProjectCreateModal>
:create-project
:initial-project-name="searchValue"></ProjectCreateModal>
</template>
<style scoped></style>