From 59d8dcac4c7f72bde7f5657d71caa55c0ffe10ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marina=20L=C3=B3pez?= Date: Mon, 28 Sep 2026 11:11:19 +0200 Subject: [PATCH] :bug: Keep organizations visible without Personal Projects --- frontend/src/app/main/data/team.cljs | 13 +++++++++++++ frontend/src/app/main/ui/dashboard/sidebar.cljs | 6 +----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/data/team.cljs b/frontend/src/app/main/data/team.cljs index f6173b3876..c32691d571 100644 --- a/frontend/src/app/main/data/team.cljs +++ b/frontend/src/app/main/data/team.cljs @@ -842,3 +842,16 @@ (defn team->organization [team] (when-let [organization (:organization team)] (assoc organization :default-team-id (:id team)))) + +(defn teams->organizations + "Returns organizations indexed by id, preferring default teams as navigation targets." + [teams] + (let [teams (vals teams)] + (merge + (->> teams + (keep team->organization) + (d/index-by :id)) + (->> teams + (filter :is-default) + (map team->organization) + (d/index-by :id))))) diff --git a/frontend/src/app/main/ui/dashboard/sidebar.cljs b/frontend/src/app/main/ui/dashboard/sidebar.cljs index 1767ce9e23..4e2d36bf56 100644 --- a/frontend/src/app/main/ui/dashboard/sidebar.cljs +++ b/frontend/src/app/main/ui/dashboard/sidebar.cljs @@ -731,11 +731,7 @@ ;; show the current selection without leaking the team into the ;; teams dropdown. organizations (mf/with-memo [teams current-organization] - (cond-> (->> teams - vals - (filter :is-default) - (map dtm/team->organization) - (d/index-by :id)) + (cond-> (dtm/teams->organizations teams) (:id current-organization) (assoc (:id current-organization) current-organization)))