Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dashboards): show appropriate messaging for deleted dashboards #823

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/elm/Pages/Dashboards.elm
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,18 @@ viewDashboards dashboards =
, div [ class "buttons" ]
[ a [ class "button", dashboardLink ] [ text "View" ]
]
, viewDashboardRepos dashboard.repos dashboard.dashboard.id
, viewDashboardRepos dashboard
]
)


{-| viewDashboardRepos : renders a list of repos belonging to a dashboard.
-}
viewDashboardRepos : List Vela.DashboardRepoCard -> String -> Html Msg
viewDashboardRepos repos dashboardId =
viewDashboardRepos : Vela.Dashboard -> Html Msg
viewDashboardRepos dashboard =
div [ class "dashboard-repos", Util.testAttribute "dashboard-repos" ]
(if List.length repos > 0 then
repos
(if List.length dashboard.repos > 0 then
dashboard.repos
|> List.map
(\repo ->
let
Expand All @@ -282,10 +282,16 @@ viewDashboardRepos repos dashboardId =
]
)

else if String.contains "(not found)" dashboard.dashboard.name then
[ text <|
"⚠️ This dashboard has been deleted. You can remove it from your list: vela update user --drop-dashboards "
++ dashboard.dashboard.id
]

else
[ text <|
"⚠️ No repositories in this dashboard. Use the CLI to add some: vela update dashboard --id "
++ dashboardId
"ℹ️ No repositories in this dashboard. Use the CLI to add some: vela update dashboard --id "
++ dashboard.dashboard.id
++ " --add-repos org/repo"
]
)
Loading