+
@IssueDetailCard(IssueDetailCardProps{
Issue: *props.SelectedIssue,
DisplayOwner: props.DisplayOwner,
diff --git a/pkg/web/components/issue.templ b/pkg/web/components/issue.templ
index 88a113b..9c92417 100644
--- a/pkg/web/components/issue.templ
+++ b/pkg/web/components/issue.templ
@@ -92,6 +92,7 @@ templ IssueTable(props IssueTableProps) {
base.PlainText("Status"),
base.PlainText("Type"),
base.PlainText("Priority"),
+ base.PlainText("Actions"),
},
[]templ.Component{
IssueRows(props.Issues),
@@ -124,6 +125,18 @@ templ IssueRows(issues []models.Issue) {
{ string(issue.Status) } |
{ string(issue.IssueType) } |
{ fmt.Sprintf("P%d", issue.Priority) } |
+
+
+ |
}
}
diff --git a/pkg/web/components/issue_detail_card.templ b/pkg/web/components/issue_detail_card.templ
index bba2d18..865585f 100644
--- a/pkg/web/components/issue_detail_card.templ
+++ b/pkg/web/components/issue_detail_card.templ
@@ -29,6 +29,17 @@ templ IssueDetailCard(props IssueDetailCardProps) {
Created
diff --git a/pkg/web/handler/issues.go b/pkg/web/handler/issues.go
index 28f2902..920a880 100644
--- a/pkg/web/handler/issues.go
+++ b/pkg/web/handler/issues.go
@@ -176,6 +176,7 @@ func UpdateIssue(w http.ResponseWriter, r *http.Request) {
func DeleteIssue(w http.ResponseWriter, r *http.Request) {
issue := r.Context().Value(issueKey).(*models.Issue)
+ hx := HTMX(r)
app := App(r)
if err := app.Issues.DeleteIssue(r.Context(), issue.ID); err != nil {
@@ -183,7 +184,9 @@ func DeleteIssue(w http.ResponseWriter, r *http.Request) {
return
}
- w.Header().Set("Content-Type", "application/json")
+ if hx.IsHxRequest() {
+ w.Header().Set("HX-Redirect", "/dashboard")
+ }
w.WriteHeader(http.StatusNoContent)
}
diff --git a/pkg/web/routes/issue_detail.templ b/pkg/web/routes/issue_detail.templ
index 25d8c32..9a6d418 100644
--- a/pkg/web/routes/issue_detail.templ
+++ b/pkg/web/routes/issue_detail.templ
@@ -14,7 +14,7 @@ type IssueDetailProps struct {
templ IssueDetailContent(props IssueDetailProps) {
-
+
@components.IssueDetailCard(components.IssueDetailCardProps{Issue: props.Issue, DisplayOwner: props.DisplayOwner, DisplayAssignee: props.DisplayAssignee})