From 0cb816c16db8b13a9b2670787d1a5647ec606e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Tue, 16 Mar 2021 11:40:49 +0100 Subject: [PATCH] :bug: Translate default team name in file menu --- backend/src/app/rpc/queries/projects.clj | 4 ++-- frontend/src/app/main/ui/dashboard/file_menu.cljs | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/src/app/rpc/queries/projects.clj b/backend/src/app/rpc/queries/projects.clj index b3c16fa0d..a69c5ffc8 100644 --- a/backend/src/app/rpc/queries/projects.clj +++ b/backend/src/app/rpc/queries/projects.clj @@ -96,7 +96,7 @@ (retrieve-all-projects conn profile-id))) (def sql:all-projects - "select p1.*, t.name as team_name + "select p1.*, t.name as team_name, t.is_default as default_team from project as p1 inner join team as t on t.id = p1.team_id @@ -108,7 +108,7 @@ tpr.is_admin = true)) and p1.deleted_at is null union - select p2.*, t.name as team_name + select p2.*, t.name as team_name, t.is_default as default_team from project as p2 inner join team as t on t.id = p2.team_id diff --git a/frontend/src/app/main/ui/dashboard/file_menu.cljs b/frontend/src/app/main/ui/dashboard/file_menu.cljs index baff7a735..ea00d75a0 100644 --- a/frontend/src/app/main/ui/dashboard/file_menu.cljs +++ b/frontend/src/app/main/ui/dashboard/file_menu.cljs @@ -45,6 +45,11 @@ (tr "labels.drafts") (:name project))) + team-name (fn [team] + (if (:is-default team) + (tr "dashboard.your-penpot") + (:name team))) + on-new-tab (mf/use-callback (mf/deps file) @@ -147,6 +152,7 @@ #(if (nil? %) {:id (:team-id project) :name (:team-name project) + :is-default (:default-team project) :projects [project]} (update % :projects conj project)))) {} @@ -176,7 +182,7 @@ (when (seq other-teams) [(tr "dashboard.move-to-other-team") nil (for [team other-teams] - [(:name team) nil + [(team-name team) nil (for [sub-project (:projects team)] [(project-name sub-project) (on-move (:id team)