0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-27 00:49:28 -05:00

🐛 Translate default team name in file menu

This commit is contained in:
Andrés Moya 2021-03-16 11:40:49 +01:00 committed by Andrey Antukh
parent 4d3142e826
commit 0cb816c16d
2 changed files with 9 additions and 3 deletions

View file

@ -96,7 +96,7 @@
(retrieve-all-projects conn profile-id))) (retrieve-all-projects conn profile-id)))
(def sql:all-projects (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 from project as p1
inner join team as t inner join team as t
on t.id = p1.team_id on t.id = p1.team_id
@ -108,7 +108,7 @@
tpr.is_admin = true)) tpr.is_admin = true))
and p1.deleted_at is null and p1.deleted_at is null
union 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 from project as p2
inner join team as t inner join team as t
on t.id = p2.team_id on t.id = p2.team_id

View file

@ -45,6 +45,11 @@
(tr "labels.drafts") (tr "labels.drafts")
(:name project))) (:name project)))
team-name (fn [team]
(if (:is-default team)
(tr "dashboard.your-penpot")
(:name team)))
on-new-tab on-new-tab
(mf/use-callback (mf/use-callback
(mf/deps file) (mf/deps file)
@ -147,6 +152,7 @@
#(if (nil? %) #(if (nil? %)
{:id (:team-id project) {:id (:team-id project)
:name (:team-name project) :name (:team-name project)
:is-default (:default-team project)
:projects [project]} :projects [project]}
(update % :projects conj project)))) (update % :projects conj project))))
{} {}
@ -176,7 +182,7 @@
(when (seq other-teams) (when (seq other-teams)
[(tr "dashboard.move-to-other-team") nil [(tr "dashboard.move-to-other-team") nil
(for [team other-teams] (for [team other-teams]
[(:name team) nil [(team-name team) nil
(for [sub-project (:projects team)] (for [sub-project (:projects team)]
[(project-name sub-project) [(project-name sub-project)
(on-move (:id team) (on-move (:id team)