feat(20-02): replace TabloDetailPage stub with templ component + register tab route
- Remove stub templ.ComponentFunc from tablo_detail_view.go; real TabloDetailPage now comes from tablo_detail_templ.go
- Remove context/io/templ imports that were only used by the stub
- Register GET /tablos/{tabloID}/{tab} route in router.go after /tablos/{tabloID}
- All handler tests pass: TestGetTabloDetailPage_*, TestTabloDetailKanbanColumns, TestComputeTabloProgress, TestNewTabloDetailViewModel_*
This commit is contained in:
parent
4ae19faac9
commit
a60de1fc7a
2 changed files with 1 additions and 21 deletions
|
|
@ -1,11 +1,8 @@
|
|||
package views
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
tablomodel "xtablo-backend/internal/tablos"
|
||||
taskmodel "xtablo-backend/internal/tasks"
|
||||
)
|
||||
|
|
@ -176,21 +173,3 @@ func tabloStatusPresentation(status tablomodel.Status) (string, string, int, str
|
|||
}
|
||||
}
|
||||
|
||||
// TabloDetailPage is a stub templ component for the tablo detail page.
|
||||
// It will be replaced with a proper templ component in Plan 02.
|
||||
// The stub emits the tablo name and initTabloDetailSortable so tests pass.
|
||||
func TabloDetailPage(vm TabloDetailViewModel) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) error {
|
||||
// Emit column status IDs so TestTabloDetailKanbanColumns passes
|
||||
cols := ""
|
||||
for _, col := range vm.Columns {
|
||||
cols += `<div data-status="` + col.ID + `">` + col.Label + `</div>`
|
||||
}
|
||||
_, err := fmt.Fprintf(w,
|
||||
`<div>%s%s<script>function initTabloDetailSortable(){}</script></div>`,
|
||||
vm.TabloName,
|
||||
cols,
|
||||
)
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ func newRouterWithHandler(authHandler *handlers.AuthHandler) http.Handler {
|
|||
mux.Get("/feedback", authHandler.GetFeedbackPage())
|
||||
mux.Post("/tablos", authHandler.PostTablos())
|
||||
mux.Get("/tablos/{tabloID}", authHandler.GetTabloDetailPage())
|
||||
mux.Get("/tablos/{tabloID}/{tab}", authHandler.GetTabloDetailTab())
|
||||
mux.Get("/tablos/{tabloID}/edit", authHandler.GetEditTabloModal())
|
||||
mux.Post("/tablos/{tabloID}", authHandler.PostTabloUpdate())
|
||||
mux.Delete("/tablos/{tabloID}", authHandler.DeleteTablo())
|
||||
|
|
|
|||
Loading…
Reference in a new issue