mirror of
https://github.com/penpot/penpot.git
synced 2025-02-01 11:59:17 -05:00
♻️ Resolve minor errors on viewer role on dashboard
This commit is contained in:
parent
6fb65de100
commit
536c25c206
8 changed files with 27 additions and 42 deletions
|
@ -222,7 +222,7 @@
|
||||||
::webhooks/event? true}
|
::webhooks/event? true}
|
||||||
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id id team-id is-pinned] :as params}]
|
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id id team-id is-pinned] :as params}]
|
||||||
(db/with-atomic [conn pool]
|
(db/with-atomic [conn pool]
|
||||||
(check-edition-permissions! conn profile-id id)
|
(check-read-permissions! conn profile-id id)
|
||||||
(db/exec-one! conn [sql:update-project-pin team-id id profile-id is-pinned is-pinned])
|
(db/exec-one! conn [sql:update-project-pin team-id id profile-id is-pinned is-pinned])
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@
|
||||||
(t/is (th/ex-info? error))
|
(t/is (th/ex-info? error))
|
||||||
(t/is (th/ex-of-type? error :not-found))))
|
(t/is (th/ex-of-type? error :not-found))))
|
||||||
|
|
||||||
(t/deftest permissions-checks-delete-project
|
(t/deftest permissions-checks-pin-project
|
||||||
(let [profile1 (th/create-profile* 1)
|
(let [profile1 (th/create-profile* 1)
|
||||||
profile2 (th/create-profile* 2)
|
profile2 (th/create-profile* 2)
|
||||||
project (th/create-project* 1 {:team-id (:default-team-id profile1)
|
project (th/create-project* 1 {:team-id (:default-team-id profile1)
|
||||||
|
|
|
@ -284,8 +284,4 @@
|
||||||
(watch [_ state _]
|
(watch [_ state _]
|
||||||
(when (contains? (:workspace-libraries state) file-id)
|
(when (contains? (:workspace-libraries state) file-id)
|
||||||
(rx/of (dwl/ext-library-changed file-id modified-at revn changes)
|
(rx/of (dwl/ext-library-changed file-id modified-at revn changes)
|
||||||
(dwl/notify-sync-file file-id))))))
|
(dwl/notify-sync-file file-id))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -361,7 +361,8 @@
|
||||||
|
|
||||||
[:div {:class (stl/css :table-field :variants)}
|
[:div {:class (stl/css :table-field :variants)}
|
||||||
(for [{:keys [id] :as item} variants]
|
(for [{:keys [id] :as item} variants]
|
||||||
[:div {:class (stl/css :variant)
|
[:div {:class (stl/css-case :variant true
|
||||||
|
:inhert-variant you-viewer?)
|
||||||
:key (dm/str id)}
|
:key (dm/str id)}
|
||||||
[:span {:class (stl/css :label)}
|
[:span {:class (stl/css :label)}
|
||||||
[:& font-variant-display-name {:variant item}]]
|
[:& font-variant-display-name {:variant item}]]
|
||||||
|
@ -384,16 +385,17 @@
|
||||||
:on-click on-cancel}
|
:on-click on-cancel}
|
||||||
i/close]]
|
i/close]]
|
||||||
|
|
||||||
(when-not you-viewer? [:div {:class (stl/css :table-field :options)}
|
(when-not you-viewer?
|
||||||
[:span {:class (stl/css :icon)
|
[:div {:class (stl/css :table-field :options)}
|
||||||
:on-click on-menu-open}
|
[:span {:class (stl/css :icon)
|
||||||
i/menu]
|
:on-click on-menu-open}
|
||||||
|
i/menu]
|
||||||
|
|
||||||
[:& installed-font-context-menu
|
[:& installed-font-context-menu
|
||||||
{:on-close on-menu-close
|
{:on-close on-menu-close
|
||||||
:is-open menu-open?
|
:is-open menu-open?
|
||||||
:on-delete on-delete-font
|
:on-delete on-delete-font
|
||||||
:on-edit on-edit}]]))]))
|
:on-edit on-edit}]]))]))
|
||||||
|
|
||||||
(mf/defc installed-fonts
|
(mf/defc installed-fonts
|
||||||
[{:keys [fonts you-viewer?] :as props}]
|
[{:keys [fonts you-viewer?] :as props}]
|
||||||
|
|
|
@ -157,6 +157,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.inhert-variant {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-field {
|
.table-field {
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
:subtitle (when you-viewer? (tr "dashboard.empty-placeholder-libraries-subtitle-viewer-role"))
|
:subtitle (when you-viewer? (tr "dashboard.empty-placeholder-libraries-subtitle-viewer-role"))
|
||||||
:class (stl/css :empty-placeholder-libraries)}
|
:class (stl/css :empty-placeholder-libraries)}
|
||||||
(when-not you-viewer?
|
(when-not you-viewer?
|
||||||
[:> i18n/tr-html* {:content (tr "dashboard.empty-placeholder-drafts")
|
[:> i18n/tr-html* {:content (tr "dashboard.empty-placeholder-libraries")
|
||||||
:class (stl/css :placeholder-markdown)
|
:class (stl/css :placeholder-markdown)
|
||||||
:tag-name "span"}])]
|
:tag-name "span"}])]
|
||||||
|
|
||||||
|
|
|
@ -434,18 +434,11 @@ msgstr "Duplicate %s files"
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard/placeholder.cljs:33
|
#: src/app/main/ui/dashboard/placeholder.cljs:33
|
||||||
#, markdown
|
#, markdown
|
||||||
msgid "dashboard.empty-placeholder-drafts"
|
msgid "dashboard.empty-placeholder-libraries"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Files added to Libraries will appear here. Try sharing your files or add "
|
"Libraries added to the project will appear here. Try sharing your files or add "
|
||||||
"from our [Libraries & templates](https://penpot.app/libraries-templates)."
|
"from our [Libraries & templates](https://penpot.app/libraries-templates)."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard/placeholder.cljs
|
#: src/app/main/ui/dashboard/placeholder.cljs
|
||||||
msgid "dashboard.empty-placeholder-libraries-title"
|
msgid "dashboard.empty-placeholder-libraries-title"
|
||||||
msgstr "No libraries yet."
|
msgstr "No libraries yet."
|
||||||
|
@ -454,12 +447,12 @@ msgstr "No libraries yet."
|
||||||
#, markdown
|
#, markdown
|
||||||
msgid "dashboard.empty-placeholder-libraries-subtitle"
|
msgid "dashboard.empty-placeholder-libraries-subtitle"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Files added to Libraries will appear here. Try sharing your files or add "
|
"Libraries added to the project will appear here. Try sharing your files or add "
|
||||||
"from our [Libraries & templates](https://penpot.app/libraries-templates)."
|
"from our [Libraries & templates](https://penpot.app/libraries-templates)."
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard/placeholder.cljs
|
#: src/app/main/ui/dashboard/placeholder.cljs
|
||||||
msgid "dashboard.empty-placeholder-libraries-subtitle-viewer-role"
|
msgid "dashboard.empty-placeholder-libraries-subtitle-viewer-role"
|
||||||
msgstr "Files added to Libraries will appear here."
|
msgstr "Libraries added to the project will appear here."
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard
|
#: src/app/main/ui/dashboard
|
||||||
msgid "dashboard.empty-placeholder-drafts-title"
|
msgid "dashboard.empty-placeholder-drafts-title"
|
||||||
|
|
|
@ -436,20 +436,12 @@ msgstr "Duplicar %s archivos"
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard/placeholder.cljs:33
|
#: src/app/main/ui/dashboard/placeholder.cljs:33
|
||||||
#, markdown
|
#, markdown
|
||||||
msgid "dashboard.empty-placeholder-drafts"
|
msgid "dashboard.empty-placeholder-libraries"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Los archivos agregados a las bibliotecas aparecerán aquí. Si quieres probar "
|
"Las bibliotecas añadidas al proyecto aparecerán aquí. Si quieres probar "
|
||||||
"con alguna plantilla ve a [Bibliotecas y "
|
"con alguna plantilla ve a [Bibliotecas y "
|
||||||
"plantillas](https://penpot.app/libraries-templates)."
|
"plantillas](https://penpot.app/libraries-templates)."
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard/placeholder.cljs:33
|
|
||||||
msgid "dashboard.empty-placeholder-drafts-viewer-role"
|
|
||||||
msgstr ""
|
|
||||||
"Los archivos agregados a las bibliotecas aparecerán aquí."
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard/placeholder.cljs
|
#: src/app/main/ui/dashboard/placeholder.cljs
|
||||||
msgid "dashboard.empty-placeholder-libraries-title"
|
msgid "dashboard.empty-placeholder-libraries-title"
|
||||||
msgstr "Aún no existen librerías compartidas."
|
msgstr "Aún no existen librerías compartidas."
|
||||||
|
@ -458,14 +450,13 @@ msgstr "Aún no existen librerías compartidas."
|
||||||
#, markdown
|
#, markdown
|
||||||
msgid "dashboard.empty-placeholder-libraries-subtitle"
|
msgid "dashboard.empty-placeholder-libraries-subtitle"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Los archivos agregados a las bibliotecas aparecerán aquí. Si quieres probar "
|
"Las bibliotecas añadidas al proyecto aparecerán aquí. Si quieres probar "
|
||||||
"con alguna plantilla ve a [Bibliotecas y "
|
"con alguna plantilla ve a [Bibliotecas y "
|
||||||
"plantillas](https://penpot.app/libraries-templates)."
|
"plantillas](https://penpot.app/libraries-templates)."
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard/placeholder.cljs
|
#: src/app/main/ui/dashboard/placeholder.cljs
|
||||||
msgid "dashboard.empty-placeholder-libraries-subtitle-viewer-role"
|
msgid "dashboard.empty-placeholder-libraries-subtitle-viewer-role"
|
||||||
msgstr "Los archivos agregados a las bibliotecas aparecerán aquí."
|
msgstr "Las bibliotecas añadidas al proyecto aparecerán aquí."
|
||||||
|
|
||||||
|
|
||||||
#: src/app/main/ui/dashboard/files.cljs
|
#: src/app/main/ui/dashboard/files.cljs
|
||||||
msgid "dashboard.empty-placeholder-drafts-title"
|
msgid "dashboard.empty-placeholder-drafts-title"
|
||||||
|
|
Loading…
Add table
Reference in a new issue