edit title
This commit is contained in:
1 parent
e62747d62d
commit
9a3c3bb189
4 files changed
+38
-4
No files matched your search
@@ -30,9 +30,16 @@ const cancel = () => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="issue-content">
|
<div class="issue-content">
|
||||||
<template v-if="!editing">
|
<template v-if="!editing">
|
||||||
<v-sheet class="pa-4 cursor-pointer content-sheet" @click="startEdit">
|
<v-hover #default="{ isHovering, props }">
|
||||||
|
<v-sheet
|
||||||
|
v-bind="props"
|
||||||
|
:class="isHovering ? 'px-4' : 'px-0'"
|
||||||
|
class="py-1 cursor-pointer content-sheet"
|
||||||
|
@click="startEdit"
|
||||||
|
>
|
||||||
{{ text ?? 'click to add content' }}
|
{{ text ?? 'click to add content' }}
|
||||||
</v-sheet>
|
</v-sheet>
|
||||||
|
</v-hover>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@@ -50,4 +57,7 @@ const cancel = () => {
|
|||||||
.content-sheet:hover {
|
.content-sheet:hover {
|
||||||
background-color: rgba(var(--v-theme-on-surface), 0.06);
|
background-color: rgba(var(--v-theme-on-surface), 0.06);
|
||||||
}
|
}
|
||||||
|
.v-sheet {
|
||||||
|
transition: padding 0.2s ease-in-out;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
File renamed without changes.
@@ -7,6 +7,7 @@ import type { Issue } from '@/api/issue.api.ts'
|
|||||||
import StatusMenu from '@/components/StatusMenu.vue'
|
import StatusMenu from '@/components/StatusMenu.vue'
|
||||||
import AssigneeMenu from '@/components/AssigneeMenu.vue'
|
import AssigneeMenu from '@/components/AssigneeMenu.vue'
|
||||||
import ReporterInfo from '@/components/ReporterInfo.vue'
|
import ReporterInfo from '@/components/ReporterInfo.vue'
|
||||||
|
import IssueTitle from '@/components/IssueTitle.vue'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
ckey: string
|
ckey: string
|
||||||
@@ -40,6 +41,15 @@ async function fetch() {
|
|||||||
|
|
||||||
watchEffect(async () => fetch())
|
watchEffect(async () => fetch())
|
||||||
|
|
||||||
|
const onTitleChanged = async (title: string) => {
|
||||||
|
if (!issue.value) return
|
||||||
|
const updated = await issueStore.update(issue.value.id, { title })
|
||||||
|
if (updated) {
|
||||||
|
issue.value = updated
|
||||||
|
emit('assigneeChanged', updated)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const onContentChanged = async (content: string) => {
|
const onContentChanged = async (content: string) => {
|
||||||
if (!issue.value) return
|
if (!issue.value) return
|
||||||
const updated = await issueStore.update(issue.value.id, { content })
|
const updated = await issueStore.update(issue.value.id, { content })
|
||||||
@@ -78,7 +88,8 @@ defineExpose({
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="issue" class="d-flex flex-column ga-4 pa-4">
|
<div v-if="issue" class="d-flex flex-column ga-4 pa-4">
|
||||||
<div>{{ ckey }}</div>
|
<div>{{ ckey }}</div>
|
||||||
<div class="text-uppercase text-title-large">{{ issue.title }}</div>
|
|
||||||
|
<issue-title :text="issue.title" @changed="onTitleChanged" />
|
||||||
|
|
||||||
<v-card elevation="0" border>
|
<v-card elevation="0" border>
|
||||||
<v-card-text class="u-grid">
|
<v-card-text class="u-grid">
|
||||||
|
|||||||
@@ -30,9 +30,18 @@ const cancel = () => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="issue-title">
|
<div class="issue-title">
|
||||||
<template v-if="!editing">
|
<template v-if="!editing">
|
||||||
<v-sheet class="pa-4 cursor-pointer title-sheet" @click="startEdit">
|
<v-hover #default="{ isHovering, props }">
|
||||||
{{ text ?? 'click to add title' }}
|
<v-sheet
|
||||||
|
v-bind="props"
|
||||||
|
:class="isHovering ? 'px-3' : 'px-0'"
|
||||||
|
class="py-1 cursor-pointer title-sheet"
|
||||||
|
@click="startEdit"
|
||||||
|
>
|
||||||
|
<div class="text-uppercase text-title-large">
|
||||||
|
{{ text ?? 'click to write text' }}
|
||||||
|
</div>
|
||||||
</v-sheet>
|
</v-sheet>
|
||||||
|
</v-hover>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@@ -50,4 +59,8 @@ const cancel = () => {
|
|||||||
.title-sheet:hover {
|
.title-sheet:hover {
|
||||||
background-color: rgba(var(--v-theme-on-surface), 0.06);
|
background-color: rgba(var(--v-theme-on-surface), 0.06);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.v-sheet {
|
||||||
|
transition: padding 0.2s ease-in-out;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user