From 791fd8e3918f2af71d9f615c9cee0613c63e1008 Mon Sep 17 00:00:00 2001 From: wass3rw3rk <49894298+wass3rw3rk@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:21:17 -0500 Subject: [PATCH] dont render link/button if there's no dashboard --- src/elm/Pages/Dashboards.elm | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/elm/Pages/Dashboards.elm b/src/elm/Pages/Dashboards.elm index 3f324558..74a17f58 100644 --- a/src/elm/Pages/Dashboards.elm +++ b/src/elm/Pages/Dashboards.elm @@ -245,15 +245,25 @@ viewDashboards dashboards = |> Route.Path.href in div [ class "item", Util.testAttribute "dashboard-item" ] - [ span [ class "dashboard-item-title" ] - [ a [ dashboardLink ] [ text dashboard.dashboard.name ] - , code [] [ text dashboard.dashboard.id ] + (if String.contains "(not found)" dashboard.dashboard.name then + [ span [ class "dashboard-item-title" ] + [ text dashboard.dashboard.name + , code [] [ text dashboard.dashboard.id ] + ] + , viewDashboardRepos dashboard ] - , div [ class "buttons" ] - [ a [ class "button", dashboardLink ] [ text "View" ] + + else + [ span [ class "dashboard-item-title" ] + [ a [ dashboardLink ] [ text dashboard.dashboard.name ] + , code [] [ text dashboard.dashboard.id ] + ] + , div [ class "buttons" ] + [ a [ class "button", dashboardLink ] [ text "View" ] + ] + , viewDashboardRepos dashboard ] - , viewDashboardRepos dashboard - ] + ) )