Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Working roadmap first pass.

Matt Robertsbd972cb92fc8
diff --git a/app/cmd/routes.go b/app/cmd/routes.go
index b2733ff53..17a131b5e 100644
--- a/app/cmd/routes.go
+++ b/app/cmd/routes.go
@@ -133,6 +133,7 @@ func routes(r *web.Engine) *web.Engine {
r.Use(middlewares.CheckTenantPrivacy())
r.Get("/", handlers.Index())
+ r.Get("/roadmap", handlers.RoadmapPage())
r.Get("/posts/:number", handlers.PostDetails())
r.Get("/posts/:number/:slug", handlers.PostDetails())
diff --git a/app/handlers/roadmap.go b/app/handlers/roadmap.go
new file mode 100644
index 000000000..bfe1e0790
--- /dev/null
+++ b/app/handlers/roadmap.go
@@ -0,0 +1,42 @@
+package handlers
+
+import (
+ "net/http"
+
+ "github.com/getfider/fider/app/models/query"
+ "github.com/getfider/fider/app/pkg/bus"
+ "github.com/getfider/fider/app/pkg/env"
+ "github.com/getfider/fider/app/pkg/web"
+)
+
+// RoadmapPage renders the roadmap board. Pro tenants and self-hosted
+// installations get the full data; other tenants render the page with no data
+// so the client shows the upgrade call-to-action.
+func RoadmapPage() web.HandlerFunc {
+ return func(c *web.Context) error {
+ props := web.Props{
+ Page: "Roadmap/Roadmap.page",
+ Title: "Roadmap",
+ }
+
+ if env.IsSingleHostMode() || c.Tenant().IsPro {
+ plannedPosts := &query.SearchPosts{View: "planned"}
+ startedPosts := &query.SearchPosts{View: "started"}
+ completedPosts := &query.SearchPosts{View: "completed"}
+ getAllTags := &query.GetAllTags{}
+
+ if err := bus.Dispatch(c, plannedPosts, startedPosts, completedPosts, getAllTags); err != nil {
+ return c.Failure(err)
+ }
+
+ props.Data = web.Map{
+ "plannedPosts": plannedPosts.Result,
+ "startedPosts": startedPosts.Result,
+ "completedPosts": completedPosts.Result,
+ "tags": getAllTags.Result,
+ }
+ }
+
+ return c.Page(http.StatusOK, props)
+ }
+}
diff --git a/locale/ar/client.json b/locale/ar/client.json
index b4aadaa5c..82833dd4e 100644
--- a/locale/ar/client.json
+++ b/locale/ar/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "الصفحة غير موجودة",
"error.unauthorized.text": "لا تملك الصلاحيات لتصفح هذه الصفحة.",
"error.unauthorized.title": "غير مخول",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "فلتر",
"home.filter.search.label": "Search in filters",
"home.form.defaultinvitation": "أدخل اقتراحك هنا...",
@@ -99,6 +101,7 @@
"linkmodal.title": "إدراج الرابط",
"linkmodal.url.label": "عنوان URL",
"linkmodal.url.placeholder": "",
+ "listposts.label.showmore": "",
"menu.administration": "آلإدارة",
"menu.mysettings": "إعداداتي",
"menu.signout": "تسجيل الخروج",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "فشل نسخ رابط التعليق، يرجى نسخ رابط الصفحة",
"showpost.comment.copylink.success": "تم نسخ رابط التعليق إلى الحافظة",
"showpost.comment.unknownhighlighted": "معرف تعليق غير صالح #{id}",
diff --git a/locale/de/client.json b/locale/de/client.json
index 58772c867..e6b17e0c3 100644
--- a/locale/de/client.json
+++ b/locale/de/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Die Seite wurde nicht gefunden",
"error.unauthorized.text": "Du bist nicht berechtigt, diese Seite anzuschauen.",
"error.unauthorized.title": "Nicht berechtigt",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Filter",
"home.filter.search.label": "Filter durchsuchen...",
"home.form.defaultinvitation": "Gib hier deinen Vorschlag ein...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Link einfügen",
"linkmodal.url.label": "URL",
"linkmodal.url.placeholder": "https://example.com",
+ "listposts.label.showmore": "",
"menu.administration": "Verwaltung",
"menu.mysettings": "Meine Einstellungen",
"menu.signout": "Abmelden",
@@ -185,6 +188,10 @@
"pagination.prev": "Zurück",
"post.pending": "ausstehend",
"postdetails.backtoall": "Zurück zu allen Vorschlägen",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Kommentar-Link konnte nicht kopiert werden, bitte URL der Webseite kopieren",
"showpost.comment.copylink.success": "Kommentar-Link in die Zwischenablage kopiert",
"showpost.comment.unknownhighlighted": "Ungültige Kommentar ID #{id}",
diff --git a/locale/el/client.json b/locale/el/client.json
index e17b85fa7..f44c70282 100644
--- a/locale/el/client.json
+++ b/locale/el/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Η σελίδα δεν βρέθηκε",
"error.unauthorized.text": "Δεν έχετε δικαίωμα πρόσβασης σε αυτή τη σελίδα.",
"error.unauthorized.title": "Χωρίς Εξουσιοδότηση",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Φίλτρο",
"home.filter.search.label": "Αναζήτηση σε φίλτρα...",
"home.form.defaultinvitation": "Εισάγετε εδώ την πρότασή σας...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Εισαγωγή συνδέσμου",
"linkmodal.url.label": "",
"linkmodal.url.placeholder": "",
+ "listposts.label.showmore": "",
"menu.administration": "Διαχείριση",
"menu.mysettings": "Οι Ρυθμίσεις Μου",
"menu.signout": "Αποσύνδεση",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Η αντιγραφή του συνδέσμου σχολίου απέτυχε. Παρακαλώ αντιγράψτε τη διεύθυνση URL της σελίδας.",
"showpost.comment.copylink.success": "Ο σύνδεσμος σχολίου αντιγράφηκε στο πρόχειρο",
"showpost.comment.unknownhighlighted": "Μη έγκυρο αναγνωριστικό σχολίου #{id}",
diff --git a/locale/en/client.json b/locale/en/client.json
index 5a77ed622..d603b6b0e 100644
--- a/locale/en/client.json
+++ b/locale/en/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Page not found",
"error.unauthorized.text": "You need to sign in before accessing this page.",
"error.unauthorized.title": "Unauthorized",
+ "header.nav.feedback": "All Feedback",
+ "header.nav.roadmap": "Roadmap",
"home.filter.label": "Filter",
"home.filter.search.label": "Search in filters...",
"home.form.defaultinvitation": "Enter your suggestion here...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Insert Link",
"linkmodal.url.label": "URL",
"linkmodal.url.placeholder": "https://example.com",
+ "listposts.label.showmore": "Show {0} more",
"menu.administration": "Administration",
"menu.mysettings": "My Settings",
"menu.signout": "Sign out",
@@ -185,6 +188,10 @@
"pagination.prev": "Previous",
"post.pending": "pending",
"postdetails.backtoall": "Back to all suggestions",
+ "postdetails.backtoroadmap": "Back to roadmap",
+ "roadmap.upsell.billing": "Upgrade to PRO",
+ "roadmap.upsell.description": "The roadmap view is a PRO feature that lets you visualize your planned, in-progress, and completed posts in a kanban-style board.",
+ "roadmap.upsell.title": "Roadmap",
"showpost.comment.copylink.error": "Could not copy comment link, please copy page URL",
"showpost.comment.copylink.success": "Successfully copied comment link to clipboard",
"showpost.comment.unknownhighlighted": "Unknown comment ID #{id}",
diff --git a/locale/es-ES/client.json b/locale/es-ES/client.json
index 7d48d5df6..79c1264ea 100644
--- a/locale/es-ES/client.json
+++ b/locale/es-ES/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Página no encontrada",
"error.unauthorized.text": "No estás autorizado para ver esta página.",
"error.unauthorized.title": "No está autorizado",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Filtrar",
"home.filter.search.label": "Buscar en filtros...",
"home.form.defaultinvitation": "Escriba aquí su sugerencia...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Insertar un enlace",
"linkmodal.url.label": "URL",
"linkmodal.url.placeholder": "https://example.com",
+ "listposts.label.showmore": "",
"menu.administration": "Administración",
"menu.mysettings": "Mis ajustes",
"menu.signout": "Cerrar sesión",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "No se pudo copiar el enlace del comentario, copie la URL de la página",
"showpost.comment.copylink.success": "Enlace de comentario copiado al portapapeles",
"showpost.comment.unknownhighlighted": "ID de comentario no válido #{id}",
diff --git a/locale/fa/client.json b/locale/fa/client.json
index 367386a73..1b383d890 100644
--- a/locale/fa/client.json
+++ b/locale/fa/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "صفحه پیدا نشد",
"error.unauthorized.text": "شما اجازهٔ مشاهدهٔ این صفحه را ندارید.",
"error.unauthorized.title": "مجوز ندارید",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "فیلتر",
"home.filter.search.label": "جستجو در فیلترها...",
"home.form.defaultinvitation": "پیشنهاد خود را اینجا وارد کنید...",
@@ -99,6 +101,7 @@
"linkmodal.title": "درج لینک",
"linkmodal.url.label": "آدرس اینترنتی",
"linkmodal.url.placeholder": "",
+ "listposts.label.showmore": "",
"menu.administration": "مدیریت",
"menu.mysettings": "تنظیمات من",
"menu.signout": "خروج",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "کپی لینک نظر ناموفق بود، URL صفحه را کپی کنید",
"showpost.comment.copylink.success": "لینک نظر کپی شد",
"showpost.comment.unknownhighlighted": "شناسهٔ نظر نامعتبر #{id}",
diff --git a/locale/fr/client.json b/locale/fr/client.json
index c7d00c16a..f2f43ac7b 100644
--- a/locale/fr/client.json
+++ b/locale/fr/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Page non trouvée",
"error.unauthorized.text": "Vous n'êtes pas autorisé à accéder à cette page.",
"error.unauthorized.title": "Non autorisé",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Filtrer",
"home.filter.search.label": "Rechercher dans les filtres...",
"home.form.defaultinvitation": "Entrez votre suggestion ici...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Insérer un lien",
"linkmodal.url.label": "",
"linkmodal.url.placeholder": "https://exemple.com",
+ "listposts.label.showmore": "",
"menu.administration": "Administration",
"menu.mysettings": "Mes paramètres",
"menu.signout": "Se déconnecter",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Impossible de copier le lien du commentaire, veuillez copier l'URL de la page",
"showpost.comment.copylink.success": "Lien du commentaire copié dans le presse-papiers",
"showpost.comment.unknownhighlighted": "ID de commentaire #{id} invalide",
diff --git a/locale/it/client.json b/locale/it/client.json
index d6b51c2ab..0aa84dcba 100644
--- a/locale/it/client.json
+++ b/locale/it/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Pagina non trovata",
"error.unauthorized.text": "Non sei autorizzato a visualizzare questa pagina.",
"error.unauthorized.title": "Non autorizzato",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Filtro",
"home.filter.search.label": "Cerca nei filtri...",
"home.form.defaultinvitation": "Inserisci qui il tuo suggerimento...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Inserisci collegamento",
"linkmodal.url.label": "",
"linkmodal.url.placeholder": "https://esempio.com",
+ "listposts.label.showmore": "",
"menu.administration": "Amministrazione",
"menu.mysettings": "Le mie preferenze",
"menu.signout": "Disconnettersi",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Impossibile copiare il collegamento al commento, copiare l'URL della pagina",
"showpost.comment.copylink.success": "Link al commento copiato negli appunti",
"showpost.comment.unknownhighlighted": "ID commento non valido #{id}",
diff --git a/locale/ja/client.json b/locale/ja/client.json
index 04408a57d..da9b65d37 100644
--- a/locale/ja/client.json
+++ b/locale/ja/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "ページが見つかりません",
"error.unauthorized.text": "このページを閲覧する権限がありません。",
"error.unauthorized.title": "権限がありません",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "フィルタ",
"home.filter.search.label": "フィルターで検索...",
"home.form.defaultinvitation": "ここに提案を入力してください...",
@@ -99,6 +101,7 @@
"linkmodal.title": "リンクを挿入",
"linkmodal.url.label": "",
"linkmodal.url.placeholder": "",
+ "listposts.label.showmore": "",
"menu.administration": "管理",
"menu.mysettings": "ユーザー設定",
"menu.signout": "ログアウト",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "コメントリンクのコピーに失敗しました。ページURLをコピーしてください。",
"showpost.comment.copylink.success": "コメントリンクがクリップボードにコピーされました。",
"showpost.comment.unknownhighlighted": "無効なコメントID #{id}",
diff --git a/locale/nl/client.json b/locale/nl/client.json
index 692fc7dae..b22948084 100644
--- a/locale/nl/client.json
+++ b/locale/nl/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Pagina niet gevonden",
"error.unauthorized.text": "Je bent niet bevoegd om deze pagina te bekijken.",
"error.unauthorized.title": "Geen toegang",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Filter",
"home.filter.search.label": "Zoeken in filters...",
"home.form.defaultinvitation": "Deel jouw suggesties hier...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Link invoegen",
"linkmodal.url.label": "",
"linkmodal.url.placeholder": "https://voorbeeld.com",
+ "listposts.label.showmore": "",
"menu.administration": "Beheer",
"menu.mysettings": "Mijn instellingen",
"menu.signout": "Uitloggen",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Het kopiëren van de commentaarlink is mislukt. Kopieer de URL van de pagina.",
"showpost.comment.copylink.success": "Reactielink gekopieerd naar klembord",
"showpost.comment.unknownhighlighted": "Ongeldige opmerking-ID #{id}",
diff --git a/locale/pl/client.json b/locale/pl/client.json
index 27fc6fefb..ed483e2f5 100644
--- a/locale/pl/client.json
+++ b/locale/pl/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Nie odnaleziono strony",
"error.unauthorized.text": "Nie masz uprawnień do przeglądania tej strony.",
"error.unauthorized.title": "Brak autoryzacji",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Filtr",
"home.filter.search.label": "Szukaj w filtrach...",
"home.form.defaultinvitation": "Wpisz swoją sugestię tutaj...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Wstaw link",
"linkmodal.url.label": "Adres URL",
"linkmodal.url.placeholder": "https://przyklad.pl",
+ "listposts.label.showmore": "",
"menu.administration": "Administracja",
"menu.mysettings": "Moje Ustawienia",
"menu.signout": "Wyloguj się",
@@ -185,6 +188,10 @@
"pagination.prev": "Poprzednia",
"post.pending": "oczekuje",
"postdetails.backtoall": "Powrót do wszystkich sugestii",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Nie udało się skopiować linku do komentarza, skopiuj adres URL strony",
"showpost.comment.copylink.success": "Link do komentarza skopiowano do schowka",
"showpost.comment.unknownhighlighted": "Nieprawidłowy identyfikator komentarza #{id}",
diff --git a/locale/pt-BR/client.json b/locale/pt-BR/client.json
index 2877b9950..395cce47f 100644
--- a/locale/pt-BR/client.json
+++ b/locale/pt-BR/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Página não encontrada",
"error.unauthorized.text": "Você não está autorizado a visualizar esta página.",
"error.unauthorized.title": "Não autorizado",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Filtrar",
"home.filter.search.label": "Pesquisar em filtros...",
"home.form.defaultinvitation": "Insira sua sugestão aqui...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Inserir link",
"linkmodal.url.label": "",
"linkmodal.url.placeholder": "",
+ "listposts.label.showmore": "",
"menu.administration": "Administração",
"menu.mysettings": "Minhas Configurações",
"menu.signout": "Finalizar sessão",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Falha ao copiar o link do comentário, copie a URL da página",
"showpost.comment.copylink.success": "Link do comentário copiado para área de transferência",
"showpost.comment.unknownhighlighted": "ID de comentário #{id} inválido",
diff --git a/locale/ru/client.json b/locale/ru/client.json
index f033439b6..d0c44bc60 100644
--- a/locale/ru/client.json
+++ b/locale/ru/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Страница не найдена",
"error.unauthorized.text": "Вы не можете просматривать эту страницу.",
"error.unauthorized.title": "Не авторизован",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Фильтр",
"home.filter.search.label": "Поиск в фильтрах...",
"home.form.defaultinvitation": "Введите предложение здесь...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Вставить ссылку",
"linkmodal.url.label": "",
"linkmodal.url.placeholder": "",
+ "listposts.label.showmore": "",
"menu.administration": "Администрирование",
"menu.mysettings": "Мой аккаунт",
"menu.signout": "Выйти",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Не удалось скопировать ссылку на комментарий, пожалуйста скопируйте URL страницы",
"showpost.comment.copylink.success": "Ссылка на комментарий скопирована в буфер",
"showpost.comment.unknownhighlighted": "Некорректный ID комментария #{id}",
diff --git a/locale/sk/client.json b/locale/sk/client.json
index eac28dcc2..e1315bcf3 100644
--- a/locale/sk/client.json
+++ b/locale/sk/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Stránka nenájdená",
"error.unauthorized.text": "Nemáte oprávnenie na zobrazenie tejto stránky.",
"error.unauthorized.title": "Neautorizovaný",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Filtrovať",
"home.filter.search.label": "Hľadať vo filtroch...",
"home.form.defaultinvitation": "Sem zadajte svoj návrh...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Vložiť odkaz",
"linkmodal.url.label": "",
"linkmodal.url.placeholder": "",
+ "listposts.label.showmore": "",
"menu.administration": "Administrácia",
"menu.mysettings": "Moje nastavenia",
"menu.signout": "Odhlásiť sa",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Nepodarilo sa skopírovať odkaz na komentár, prosím skopírujte URL adresu stránky",
"showpost.comment.copylink.success": "Odkaz na komentár skopírovaný do schránky",
"showpost.comment.unknownhighlighted": "Neplatné ID komentára #{id}",
diff --git a/locale/sv-SE/client.json b/locale/sv-SE/client.json
index 91b6dd342..29b39b2d3 100644
--- a/locale/sv-SE/client.json
+++ b/locale/sv-SE/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Sidan kunde inte hittas",
"error.unauthorized.text": "Du har inte behörighet att se den här sidan.",
"error.unauthorized.title": "Ej behörig",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Filtrera",
"home.filter.search.label": "Sök i filter...",
"home.form.defaultinvitation": "Skriv ditt förslag här...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Infoga länk",
"linkmodal.url.label": "",
"linkmodal.url.placeholder": "",
+ "listposts.label.showmore": "",
"menu.administration": "Administration",
"menu.mysettings": "Mina Inställningar",
"menu.signout": "Logga ut",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Misslyckades med att kopiera kommentarslänken, kopiera sidans URL",
"showpost.comment.copylink.success": "Kommentarlänk kopierad till urklipp",
"showpost.comment.unknownhighlighted": "Ogiltigt kommentar-ID #{id}",
diff --git a/locale/tr/client.json b/locale/tr/client.json
index bd9ea6944..35d240b34 100644
--- a/locale/tr/client.json
+++ b/locale/tr/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "Sayfa bulunamadı",
"error.unauthorized.text": "Bu sayfayı görüntülemek için yetkiniz yok.",
"error.unauthorized.title": "Yetkili Değil",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "Filtre",
"home.filter.search.label": "Filtrelerde ara...",
"home.form.defaultinvitation": "Önerinizi buraya yazın...",
@@ -99,6 +101,7 @@
"linkmodal.title": "Bağlantı Ekle",
"linkmodal.url.label": "",
"linkmodal.url.placeholder": "",
+ "listposts.label.showmore": "",
"menu.administration": "Yönetim",
"menu.mysettings": "Ayarlarım",
"menu.signout": "Çıkış yap",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "Yorum bağlantısı kopyalanamadı, lütfen sayfa URL'sini kopyalayın",
"showpost.comment.copylink.success": "Yorum bağlantısı panoya kopyalandı",
"showpost.comment.unknownhighlighted": "Geçersiz yorum kimliği #{id}",
diff --git a/locale/zh-CN/client.json b/locale/zh-CN/client.json
index 8bb9dae19..01298297c 100644
--- a/locale/zh-CN/client.json
+++ b/locale/zh-CN/client.json
@@ -45,6 +45,8 @@
"error.pagenotfound.title": "未找到页面",
"error.unauthorized.text": "您无权查看此页面.",
"error.unauthorized.title": "未经授权",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "筛选",
"home.filter.search.label": "在过滤器中搜索...",
"home.form.defaultinvitation": "在此处输入您的建议...",
@@ -99,6 +101,7 @@
"linkmodal.title": "插入链接",
"linkmodal.url.label": "网址",
"linkmodal.url.placeholder": "",
+ "listposts.label.showmore": "",
"menu.administration": "管理",
"menu.mysettings": "我的设置",
"menu.signout": "退出",
@@ -185,6 +188,10 @@
"pagination.prev": "",
"post.pending": "",
"postdetails.backtoall": "",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "复制评论链接失败,请复制页面URL",
"showpost.comment.copylink.success": "评论链接已复制到剪贴板",
"showpost.comment.unknownhighlighted": "无效的评论ID #{id}",
diff --git a/locale/zh-TW/client.json b/locale/zh-TW/client.json
index ee4310ce4..1dfeb7912 100644
--- a/locale/zh-TW/client.json
+++ b/locale/zh-TW/client.json
@@ -30,6 +30,9 @@
"enum.poststatus.open": "開放中",
"enum.poststatus.planned": "計劃中",
"enum.poststatus.started": "進行中",
+ "error.accessdenied.contact": "",
+ "error.accessdenied.text": "",
+ "error.accessdenied.title": "",
"error.expired.text": "您點擊的連結已過期。",
"error.expired.title": "已過期",
"error.forbidden.text": "您沒有權限檢視此頁面。",
@@ -42,6 +45,8 @@
"error.pagenotfound.title": "找不到頁面",
"error.unauthorized.text": "您需要先登入才能存取此頁面。",
"error.unauthorized.title": "未授權",
+ "header.nav.feedback": "",
+ "header.nav.roadmap": "",
"home.filter.label": "篩選",
"home.filter.search.label": "搜尋篩選條件...",
"home.form.defaultinvitation": "在此輸入您的建議...",
@@ -96,6 +101,7 @@
"linkmodal.title": "插入連結",
"linkmodal.url.label": "網址",
"linkmodal.url.placeholder": "https://example.com",
+ "listposts.label.showmore": "",
"menu.administration": "管理",
"menu.mysettings": "我的設定",
"menu.signout": "登出",
@@ -182,6 +188,10 @@
"pagination.prev": "上一頁",
"post.pending": "待審核",
"postdetails.backtoall": "返回所有建議",
+ "postdetails.backtoroadmap": "",
+ "roadmap.upsell.billing": "",
+ "roadmap.upsell.description": "",
+ "roadmap.upsell.title": "",
"showpost.comment.copylink.error": "無法複製留言連結,請複製頁面網址",
"showpost.comment.copylink.success": "留言連結已成功複製到剪貼簿",
"showpost.comment.unknownhighlighted": "無效的留言 ID #{id}",
diff --git a/public/components/Header.scss b/public/components/Header.scss
index be6c5fbc9..a3e3ddb1f 100644
--- a/public/components/Header.scss
+++ b/public/components/Header.scss
@@ -16,4 +16,21 @@
width: auto;
}
}
+
+ .c-header__nav-link {
+ font-size: 0.875rem;
+ font-weight: 500;
+ color: var(--colors-gray-500);
+ text-decoration: none;
+ transition: color 0.15s ease, box-shadow 0.15s ease;
+
+ &:hover {
+ color: var(--colors-gray-900);
+ }
+
+ &--active {
+ color: var(--colors-gray-900);
+ box-shadow: 0 2px 0 0 var(--colors-primary-base);
+ }
+ }
}
diff --git a/public/components/Header.tsx b/public/components/Header.tsx
index 4bc3b78ae..d0f24b4ae 100644
--- a/public/components/Header.tsx
+++ b/public/components/Header.tsx
@@ -16,6 +16,10 @@ export const Header = (props: HeaderProps) => {
const [isSignInModalOpen, setIsSignInModalOpen] = useState(false)
const [isRSSModalOpen, setIsRSSModalOpen] = useState(false)
+ const pathname = typeof window !== "undefined" ? window.location.pathname : "/"
+ const isRoadmapActive = pathname === "/roadmap"
+ const isFeedbackActive = !isRoadmapActive
+
const handleSignInClick = () => {
setIsSignInModalOpen(true)
}
@@ -37,10 +41,20 @@ export const Header = (props: HeaderProps) => {
<div className="container c-header__container">
<div className="flex flex-wrap flex-items-center gap-2">
<div className="flex flex-x flex-items-center justify-between w-full">
- <a href="/" className="flex flex-x flex-items-center flex--spacing-2 h-8">
- <TenantLogo size={100} />
- <h1 className="text-header">{fider.session.tenant.name}</h1>
- </a>
+ <div className="flex flex-x flex-items-center flex-wrap gap-4">
+ <a href="/" className="flex flex-x flex-items-center flex--spacing-2 h-8">
+ <TenantLogo size={100} />
+ <h1 className="text-header">{fider.session.tenant.name}</h1>
+ </a>
+ <HStack spacing={4} className="flex-items-center ml-2">
+ <a href="/" className={`c-header__nav-link ${isFeedbackActive ? "c-header__nav-link--active" : ""}`}>
+ <Trans id="header.nav.feedback">All Feedback</Trans>
+ </a>
+ <a href="/roadmap" className={`c-header__nav-link ${isRoadmapActive ? "c-header__nav-link--active" : ""}`}>
+ <Trans id="header.nav.roadmap">Roadmap</Trans>
+ </a>
+ </HStack>
+ </div>
{fider.session.isAuthenticated && (
<HStack spacing={2}>
{fider.session.tenant.isFeedEnabled && (
diff --git a/public/components/PostDetails/PostDetails.tsx b/public/components/PostDetails/PostDetails.tsx
index 4a7a5c43b..a5cce87a9 100644
--- a/public/components/PostDetails/PostDetails.tsx
+++ b/public/components/PostDetails/PostDetails.tsx
@@ -193,6 +193,24 @@ export const PostDetails: React.FC<PostDetailsProps> = (props) => {
}
}, [])
+ const refreshPost = async () => {
+ const [postResult, commentsResult] = await Promise.all([actions.getPost(props.postNumber), actions.getComments(props.postNumber)])
+ if (postResult.ok) {
+ setPost(postResult.data)
+ setNewTitle(postResult.data.title)
+ setNewDescription(postResult.data.description)
+ }
+ if (commentsResult.ok) {
+ setComments(commentsResult.data)
+ }
+ }
+
+ const handleResponded = async () => {
+ setShowResponseModal(false)
+ await refreshPost()
+ props.onDataChanged?.()
+ }
+
const saveChanges = async () => {
if (!post) return
const result = await actions.updatePost(post.number, newTitle, newDescription, attachments)
@@ -489,7 +507,7 @@ export const PostDetails: React.FC<PostDetailsProps> = (props) => {
<RSSModal isOpen={isRSSModalOpen} onClose={hideRSSModal} url={`${fider.settings.baseURL}/feed/posts/${post.number}.atom`} />
<DeletePostModal onModalClose={() => setShowDeleteModal(false)} showModal={showDeleteModal} post={post} />
{Fider.session.isAuthenticated && Fider.session.user.isCollaborator && (
- <ResponseModal onCloseModal={() => setShowResponseModal(false)} showModal={showResponseModal} post={post} />
+ <ResponseModal onCloseModal={() => setShowResponseModal(false)} showModal={showResponseModal} post={post} onResponded={handleResponded} />
)}
</div>
)
diff --git a/public/hooks/index.ts b/public/hooks/index.ts
index 963ac6b13..3ac814eb1 100644
--- a/public/hooks/index.ts
+++ b/public/hooks/index.ts
@@ -2,3 +2,4 @@ export * from "./use-timeout"
export * from "./use-fider"
export * from "./use-script"
export * from "./use-cache"
+export * from "./use-post-overlay"
diff --git a/public/hooks/use-post-overlay.ts b/public/hooks/use-post-overlay.ts
new file mode 100644
index 000000000..9ddcbc524
--- /dev/null
+++ b/public/hooks/use-post-overlay.ts
@@ -0,0 +1,73 @@
+import { useEffect, useState, useRef, useCallback } from "react"
+
+interface UsePostOverlayOptions {
+ basePath: string
+ onPostClosed?: (postNumber: number) => void
+}
+
+export function usePostOverlay({ basePath, onPostClosed }: UsePostOverlayOptions) {
+ const [selectedPostId, setSelectedPostId] = useState<number | null>(null)
+ const [savedScrollPosition, setSavedScrollPosition] = useState<number>(0)
+ const [isPostDirty, setIsPostDirty] = useState(false)
+ const [savedSearch, setSavedSearch] = useState("")
+ const [lastOpenedPostId, setLastOpenedPostId] = useState<number | null>(null)
+
+ const onPostClosedRef = useRef(onPostClosed)
+ onPostClosedRef.current = onPostClosed
+
+ const handlePostClick = useCallback((postNumber: number, slug: string) => {
+ setSavedScrollPosition(window.scrollY)
+ setSavedSearch(window.location.search)
+ setSelectedPostId(postNumber)
+ setLastOpenedPostId(postNumber)
+ setIsPostDirty(false)
+ window.history.pushState({ selectedPostId: postNumber }, "", `/posts/${postNumber}/${slug}`)
+ }, [])
+
+ const handleCloseOverlay = useCallback(() => {
+ setSelectedPostId(null)
+ window.history.pushState({}, "", `${basePath}${savedSearch}`)
+ }, [basePath, savedSearch])
+
+ useEffect(() => {
+ if (selectedPostId === null && lastOpenedPostId !== null) {
+ if (isPostDirty && onPostClosedRef.current) {
+ onPostClosedRef.current(lastOpenedPostId)
+ setIsPostDirty(false)
+ }
+ setLastOpenedPostId(null)
+
+ setTimeout(() => {
+ window.scrollTo(0, savedScrollPosition)
+ }, 0)
+ }
+ }, [selectedPostId, lastOpenedPostId, isPostDirty, savedScrollPosition])
+
+ useEffect(() => {
+ const handlePopState = () => {
+ const path = window.location.pathname
+ if (path === basePath || path === basePath.replace(/\/$/, "")) {
+ setSelectedPostId(null)
+ } else if (path.startsWith("/posts/")) {
+ setSavedScrollPosition(window.scrollY)
+ setSavedSearch(window.location.search)
+ const match = path.match(/\/posts\/(\d+)/)
+ if (match) {
+ const postNumber = parseInt(match[1], 10)
+ setSelectedPostId(postNumber)
+ setLastOpenedPostId(postNumber)
+ }
+ }
+ }
+
+ window.addEventListener("popstate", handlePopState)
+ return () => window.removeEventListener("popstate", handlePopState)
+ }, [basePath, savedScrollPosition])
+
+ return {
+ selectedPostId,
+ handlePostClick,
+ handleCloseOverlay,
+ setIsPostDirty,
+ }
+}
diff --git a/public/pages/Home/Home.page.tsx b/public/pages/Home/Home.page.tsx
index e96744714..076415bff 100644
--- a/public/pages/Home/Home.page.tsx
+++ b/public/pages/Home/Home.page.tsx
@@ -7,7 +7,7 @@ import React, { useEffect, useState, useRef } from "react"
import { Post, Tag, PostStatus } from "@fider/models"
import { Markdown, Hint, PoweredByFider, Icon, Header, Button } from "@fider/components"
import { PostsContainer } from "./components/PostsContainer"
-import { useFider } from "@fider/hooks"
+import { useFider, usePostOverlay } from "@fider/hooks"
import { HStack, VStack } from "@fider/components/layout"
import { ShareFeedback } from "./components/ShareFeedback"
import { i18n } from "@lingui/core"
@@ -51,10 +51,11 @@ const HomePage = (props: HomePageProps) => {
const fider = useFider()
const postsContainerRef = useRef<PostsContainer>(null)
const [isShareFeedbackOpen, setIsShareFeedbackOpen] = useState(isPostPending())
- const [selectedPostId, setSelectedPostId] = useState<number | null>(null)
- const [savedScrollPosition, setSavedScrollPosition] = useState<number>(0)
- const [isPostDirty, setIsPostDirty] = useState(false)
- const [savedSearch, setSavedSearch] = useState("")
+
+ const { selectedPostId, handlePostClick, handleCloseOverlay, setIsPostDirty } = usePostOverlay({
+ basePath: "/",
+ onPostClosed: (postNumber) => postsContainerRef.current?.updateSinglePost(postNumber),
+ })
useEffect(() => {
// If we're showing the share feedback, make sure we clear the show pending flag (for draft posts)
@@ -65,67 +66,6 @@ const HomePage = (props: HomePageProps) => {
}
})
- // Handle post clicks from ListPosts
- const handlePostClick = (postNumber: number, slug: string) => {
- // Save current scroll position and search params
- setSavedScrollPosition(window.scrollY)
- setSavedSearch(window.location.search)
- setSelectedPostId(postNumber)
- setLastOpenedPostId(postNumber) // Track which post was opened
- setIsPostDirty(false) // Reset dirty flag when opening overlay
- window.history.pushState({ selectedPostId: postNumber }, "", `/posts/${postNumber}/${slug}`)
- }
-
- // Handle closing the overlay
- const handleCloseOverlay = () => {
- setSelectedPostId(null)
- window.history.pushState({}, "", `/${savedSearch}`)
- }
-
- // Track which post was opened so we can update just that one
- const [lastOpenedPostId, setLastOpenedPostId] = useState<number | null>(null)
-
- // Update single post when closing overlay if data changed, and always restore scroll
- useEffect(() => {
- if (selectedPostId === null && lastOpenedPostId !== null) {
- if (isPostDirty && postsContainerRef.current) {
- postsContainerRef.current.updateSinglePost(lastOpenedPostId)
- setIsPostDirty(false)
- }
- setLastOpenedPostId(null)
-
- // Always restore scroll position when returning to home
- setTimeout(() => {
- window.scrollTo(0, savedScrollPosition)
- }, 0)
- }
- }, [selectedPostId, lastOpenedPostId, isPostDirty, savedScrollPosition])
-
- // Handle browser back/forward buttons
- useEffect(() => {
- const handlePopState = () => {
- const path = window.location.pathname
- if (path === "/" || path === "") {
- setSelectedPostId(null)
- // Scroll restoration is handled in the useEffect above
- } else if (path.startsWith("/posts/")) {
- // Save scroll position and search params before opening post
- setSavedScrollPosition(window.scrollY)
- setSavedSearch(window.location.search)
- // Extract post number from URL
- const match = path.match(/\/posts\/(\d+)/)
- if (match) {
- const postNumber = parseInt(match[1], 10)
- setSelectedPostId(postNumber)
- setLastOpenedPostId(postNumber) // Track which post was opened
- }
- }
- }
-
- window.addEventListener("popstate", handlePopState)
- return () => window.removeEventListener("popstate", handlePopState)
- }, [savedScrollPosition])
-
const defaultWelcomeMessage = i18n._({
id: "home.form.defaultwelcomemessage",
message: `We'd love to hear what you're thinking about.
diff --git a/public/pages/Home/components/ListPosts.tsx b/public/pages/Home/components/ListPosts.tsx
index 2fc55f96a..6d0d62ef6 100644
--- a/public/pages/Home/components/ListPosts.tsx
+++ b/public/pages/Home/components/ListPosts.tsx
@@ -1,4 +1,4 @@
-import React from "react"
+import React, { useState } from "react"
import { Post, Tag, CurrentUser } from "@fider/models"
import { ShowTag, Markdown, Icon, ResponseLozenge } from "@fider/components"
import IconChatAlt2 from "@fider/assets/images/heroicons-chat-alt-2.svg"
@@ -12,10 +12,18 @@ interface ListPostsProps {
tags: Tag[]
emptyText: string
minimalView?: boolean
+ showStatus?: boolean
+ maxVisible?: number
onPostClick?: (postNumber: number, slug: string) => void
}
-const ListPostItem = (props: { post: Post; user?: CurrentUser; tags: Tag[]; onPostClick?: (postNumber: number, slug: string) => void }) => {
+const ListPostItem = (props: {
+ post: Post
+ user?: CurrentUser
+ tags: Tag[]
+ showStatus?: boolean
+ onPostClick?: (postNumber: number, slug: string) => void
+}) => {
const fider = useFider()
const isModerationEnabled = fider.session.tenant.isModerationEnabled
const isPending = isModerationEnabled && !props.post.isApproved
@@ -65,7 +73,9 @@ const ListPostItem = (props: { post: Post; user?: CurrentUser; tags: Tag[]; onPo
</span>
)}
</div>
- {props.post.status !== "open" && <ResponseLozenge status={props.post.status} response={props.post.response} size={"small"} />}
+ {props.showStatus !== false && props.post.status !== "open" && (
+ <ResponseLozenge status={props.post.status} response={props.post.response} size={"small"} />
+ )}
</HStack>
</VStack>
</a>
@@ -107,6 +117,7 @@ const MinimalListPostItem = (props: { post: Post; tags: Tag[]; onPostClick?: (po
export const ListPosts = (props: ListPostsProps) => {
const { minimalView = false } = props
+ const [expanded, setExpanded] = useState(false)
if (!props.posts) {
return null
@@ -116,11 +127,16 @@ export const ListPosts = (props: ListPostsProps) => {
return <p className="text-center">{props.emptyText}</p>
}
+ const allPosts = props.posts
+ const hasMore = props.maxVisible !== undefined && !expanded && allPosts.length > props.maxVisible
+ const visiblePosts = hasMore ? allPosts.slice(0, props.maxVisible) : allPosts
+ const remainingCount = allPosts.length - visiblePosts.length
+
return (
<>
{minimalView ? (
<VStack spacing={2}>
- {props.posts.map((post) => (
+ {visiblePosts.map((post) => (
<MinimalListPostItem
key={post.id}
post={post}
@@ -131,11 +147,31 @@ export const ListPosts = (props: ListPostsProps) => {
</VStack>
) : (
<>
- {props.posts.map((post) => (
- <ListPostItem key={post.id} post={post} tags={props.tags.filter((tag) => post.tags.indexOf(tag.slug) >= 0)} onPostClick={props.onPostClick} />
+ {visiblePosts.map((post) => (
+ <ListPostItem
+ key={post.id}
+ post={post}
+ tags={props.tags.filter((tag) => post.tags.indexOf(tag.slug) >= 0)}
+ showStatus={props.showStatus}
+ onPostClick={props.onPostClick}
+ />
))}
</>
)}
+ {hasMore && (
+ <div className="my-4 text-center">
+ <a
+ href="#"
+ className="text-primary-base text-medium hover:underline"
+ onClick={(e) => {
+ e.preventDefault()
+ setExpanded(true)
+ }}
+ >
+ <Trans id="listposts.label.showmore">Show {remainingCount} more</Trans>
+ </a>
+ </div>
+ )}
</>
)
}
diff --git a/public/pages/Roadmap/Roadmap.page.scss b/public/pages/Roadmap/Roadmap.page.scss
new file mode 100644
index 000000000..34b9410ef
--- /dev/null
+++ b/public/pages/Roadmap/Roadmap.page.scss
@@ -0,0 +1,30 @@
+@use "~@fider/assets/styles/variables.scss" as *;
+
+#p-roadmap {
+ background-color: var(--colors-gray-100);
+ padding-top: spacing(8);
+ padding-bottom: spacing(12);
+}
+
+.c-roadmap-board {
+ display: grid;
+ grid-template-columns: 1fr;
+ gap: spacing(6);
+
+ @include media("lg") {
+ grid-template-columns: repeat(3, 1fr);
+ }
+}
+
+.c-roadmap-column {
+ &__header {
+ display: flex;
+ margin-bottom: spacing(6);
+ }
+
+ &__body {
+ display: flex;
+ flex-direction: column;
+ gap: spacing(4);
+ }
+}
diff --git a/public/pages/Roadmap/Roadmap.page.tsx b/public/pages/Roadmap/Roadmap.page.tsx
new file mode 100644
index 000000000..f3dc7b502
--- /dev/null
+++ b/public/pages/Roadmap/Roadmap.page.tsx
@@ -0,0 +1,130 @@
+import "./Roadmap.page.scss"
+import "@fider/pages/Home/components/PostsContainer.scss"
+import IconArrowLeft from "@fider/assets/images/heroicons-arrowleft.svg"
+
+import React, { useState, useCallback } from "react"
+import { Post, Tag } from "@fider/models"
+import { Header, ResponseLozenge, Button, Icon } from "@fider/components"
+import { ListPosts } from "@fider/pages/Home/components/ListPosts"
+import { VStack, HStack } from "@fider/components/layout"
+import { useFider, usePostOverlay } from "@fider/hooks"
+import { actions } from "@fider/services"
+import { PostDetails } from "@fider/components/PostDetails"
+import { Trans } from "@lingui/react/macro"
+
+interface RoadmapPageProps {
+ plannedPosts?: Post[]
+ startedPosts?: Post[]
+ completedPosts?: Post[]
+ tags?: Tag[]
+}
+
+interface RoadmapColumnProps {
+ status: string
+ posts: Post[]
+ tags: Tag[]
+ onPostClick?: (postNumber: number, slug: string) => void
+}
+
+const RoadmapColumn = (props: RoadmapColumnProps) => {
+ return (
+ <div className="c-roadmap-column">
+ <div className="c-roadmap-column__header">
+ <ResponseLozenge status={props.status} response={null} />
+ </div>
+ <div className="c-roadmap-column__body">
+ <ListPosts posts={props.posts} tags={props.tags} showStatus={false} emptyText="" maxVisible={20} onPostClick={props.onPostClick} />
+ </div>
+ </div>
+ )
+}
+
+const RoadmapBoard = (props: RoadmapPageProps) => {
+ const [plannedPosts, setPlannedPosts] = useState<Post[]>(props.plannedPosts || [])
+ const [startedPosts, setStartedPosts] = useState<Post[]>(props.startedPosts || [])
+ const [completedPosts, setCompletedPosts] = useState<Post[]>(props.completedPosts || [])
+ const tags = props.tags || []
+
+ const reloadPosts = useCallback(async () => {
+ const [planned, started, completed] = await Promise.all([
+ actions.searchPosts({ view: "planned" }),
+ actions.searchPosts({ view: "started" }),
+ actions.searchPosts({ view: "completed" }),
+ ])
+ if (planned.ok) setPlannedPosts(planned.data)
+ if (started.ok) setStartedPosts(started.data)
+ if (completed.ok) setCompletedPosts(completed.data)
+ }, [])
+
+ const { selectedPostId, handlePostClick, handleCloseOverlay, setIsPostDirty } = usePostOverlay({
+ basePath: "/roadmap",
+ onPostClosed: () => reloadPosts(),
+ })
+
+ return (
+ <div id="p-roadmap" className="page container">
+ <div style={selectedPostId !== null ? { display: "none" } : undefined}>
+ <VStack spacing={4}>
+ <div className="c-roadmap-board">
+ <RoadmapColumn status="planned" posts={plannedPosts} tags={tags} onPostClick={handlePostClick} />
+ <RoadmapColumn status="started" posts={startedPosts} tags={tags} onPostClick={handlePostClick} />
+ <RoadmapColumn status="completed" posts={completedPosts} tags={tags} onPostClick={handlePostClick} />
+ </div>
+ </VStack>
+ </div>
+ {selectedPostId !== null && (
+ <div>
+ <Button onClick={handleCloseOverlay} variant="link">
+ <HStack spacing={2}>
+ <Icon sprite={IconArrowLeft} />
+ <span className="text-body clickable text-blue-600 hover">
+ <Trans id="postdetails.backtoroadmap">Back to roadmap</Trans>
+ </span>
+ </HStack>
+ </Button>
+ <PostDetails postNumber={selectedPostId} onDataChanged={() => setIsPostDirty(true)} />
+ </div>
+ )}
+ </div>
+ )
+}
+
+const RoadmapUpsell = () => {
+ const fider = useFider()
+ const isAdmin = fider.session.isAuthenticated && fider.session.user.isAdministrator
+ const showBillingLink = isAdmin && fider.settings.isBillingEnabled
+
+ return (
+ <div className="page container">
+ <div className="text-center py-8">
+ <h2 className="text-display mb-2">
+ <Trans id="roadmap.upsell.title">Roadmap</Trans>
+ </h2>
+ <p className="text-muted mb-4">
+ <Trans id="roadmap.upsell.description">
+ The roadmap view is a PRO feature that lets you visualize your planned, in-progress, and completed posts in a kanban-style board.
+ </Trans>
+ </p>
+ {showBillingLink && (
+ <a href="/admin/billing" className="text-link">
+ <Trans id="roadmap.upsell.billing">Upgrade to PRO</Trans>
+ </a>
+ )}
+ </div>
+ </div>
+ )
+}
+
+const RoadmapPage = (props: RoadmapPageProps) => {
+ const fider = useFider()
+ const hasRoadmap = fider.isSingleHostMode() || fider.session.tenant.isPro
+
+ return (
+ <>
+ <Header />
+ {hasRoadmap ? <RoadmapBoard {...props} /> : <RoadmapUpsell />}
+ </>
+ )
+}
+
+export default RoadmapPage
diff --git a/public/pages/ShowPost/components/ResponseModal.tsx b/public/pages/ShowPost/components/ResponseModal.tsx
index 7e949ebfa..43eec3a51 100644
--- a/public/pages/ShowPost/components/ResponseModal.tsx
+++ b/public/pages/ShowPost/components/ResponseModal.tsx
@@ -12,6 +12,7 @@ interface ResponseModalProps {
post: Post
showModal: boolean
onCloseModal: () => void
+ onResponded?: () => void
}
interface ResponseModalState {
@@ -35,7 +36,11 @@ export class ResponseModal extends React.Component<ResponseModalProps, ResponseM
private submit = async () => {
const result = await actions.respond(this.props.post.number, this.state)
if (result.ok) {
- location.reload()
+ if (this.props.onResponded) {
+ this.props.onResponded()
+ } else {
+ location.reload()
+ }
} else {
this.setState({
error: result.error,
diff --git a/public/services/actions/post.ts b/public/services/actions/post.ts
index 4fe5281c1..1ac6a29b9 100644
--- a/public/services/actions/post.ts
+++ b/public/services/actions/post.ts
@@ -1,5 +1,5 @@
import { http, Result, querystring } from "@fider/services"
-import { Post, Vote, ImageUpload, UserNames } from "@fider/models"
+import { Post, Vote, ImageUpload, UserNames, Comment } from "@fider/models"
export const getAllPosts = async (): Promise<Result<Post[]>> => {
return await http.get<Post[]>("/api/v1/posts")
@@ -9,6 +9,10 @@ export const getPost = async (postNumber: number): Promise<Result<Post>> => {
return await http.get<Post>(`/api/v1/posts/${postNumber}`)
}
+export const getComments = async (postNumber: number): Promise<Result<Comment[]>> => {
+ return await http.get<Comment[]>(`/api/v1/posts/${postNumber}/comments`)
+}
+
export interface SearchPostsParams {
query?: string
view?: string