0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-04 13:50:12 -05:00

Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Andrey Antukh 2024-12-13 13:47:30 +01:00
commit 8f673885a0
5 changed files with 55 additions and 44 deletions

View file

@ -273,7 +273,8 @@
(merge {:viewed-tutorial? false (merge {:viewed-tutorial? false
:viewed-walkthrough? false :viewed-walkthrough? false
:nudge {:big 10 :small 1} :nudge {:big 10 :small 1}
:v2-info-shown true}) :v2-info-shown true
:release-notes-viewed (:main cf/version)})
(db/tjson)) (db/tjson))
password (or (:password params) "!") password (or (:password params) "!")

View file

@ -402,7 +402,10 @@
[cfg {:keys [::rpc/profile-id file-id] :as params}] [cfg {:keys [::rpc/profile-id file-id] :as params}]
(db/tx-run! cfg (fn [{:keys [::db/conn] :as cfg}] (db/tx-run! cfg (fn [{:keys [::db/conn] :as cfg}]
(files/check-edition-permissions! conn profile-id file-id) ;; TODO For now we check read permissions instead of write,
;; to allow viewer users to update thumbnails. We might
;; review this approach on the future.
(files/check-read-permissions! conn profile-id file-id)
(when-not (db/read-only? conn) (when-not (db/read-only? conn)
(let [media (create-file-thumbnail! cfg params)] (let [media (create-file-thumbnail! cfg params)]
{:uri (files/resolve-public-uri (:id media)) {:uri (files/resolve-public-uri (:id media))

View file

@ -166,23 +166,26 @@
;; invited team. ;; invited team.
(let [props {:team-id (:team-id claims) (let [props {:team-id (:team-id claims)
:role (:role claims) :role (:role claims)
:invitation-id (:id invitation)} :invitation-id (:id invitation)}]
accept-invitation-event (audit/submit!
(-> (audit/event-from-rpc-params params) cfg
(assoc ::audit/name "accept-team-invitation") (-> (audit/event-from-rpc-params params)
(assoc ::audit/props props)) (assoc ::audit/name "accept-team-invitation")
(assoc ::audit/props props)))
accept-invitation-from-event ;; NOTE: Backward compatibility; old invitations can
(-> (audit/event-from-rpc-params params) ;; have the `created-by` to be nil; so in this case we
(assoc ::audit/profile-id (:created-by invitation)) ;; don't submit this event to the audit-log
(assoc ::audit/name "accept-team-invitation-from") (when-let [created-by (:created-by invitation)]
(assoc ::audit/props (assoc props (audit/submit!
:profile-id (:id profile) cfg
:email (:email profile))))] (-> (audit/event-from-rpc-params params)
(assoc ::audit/profile-id created-by)
(audit/submit! cfg accept-invitation-event) (assoc ::audit/name "accept-team-invitation-from")
(audit/submit! cfg accept-invitation-from-event) (assoc ::audit/props (assoc props
:profile-id (:id profile)
:email (:email profile))))))
(accept-invitation cfg claims invitation profile) (accept-invitation cfg claims invitation profile)
(assoc claims :state :created)) (assoc claims :state :created))

View file

@ -169,6 +169,7 @@
show-release-modal? show-release-modal?
(and (contains? cf/flags :onboarding) (and (contains? cf/flags :onboarding)
(not (contains? cf/flags :hide-release-modal))
(:onboarding-viewed props) (:onboarding-viewed props)
(not= (:release-notes-viewed props) (:main cf/version)) (not= (:release-notes-viewed props) (:main cf/version))
(not= "0.0" (:main cf/version)))] (not= "0.0" (:main cf/version)))]

View file

@ -90,6 +90,9 @@
reverse-sort? (= :desc ordering) reverse-sort? (= :desc ordering)
num-libs (count (mf/deref refs/libraries)) num-libs (count (mf/deref refs/libraries))
show-templates-02-test?
(and (cf/external-feature-flag "templates-02" "test") (zero? num-libs))
toggle-ordering toggle-ordering
(mf/use-fn (mf/use-fn
(mf/deps ordering) (mf/deps ordering)
@ -158,8 +161,7 @@
[:article {:class (stl/css :assets-bar)} [:article {:class (stl/css :assets-bar)}
[:div {:class (stl/css :assets-header)} [:div {:class (stl/css :assets-header)}
(when-not ^boolean read-only? (when-not ^boolean read-only?
(if (and (cf/external-feature-flag "templates-02" "test") (if show-templates-02-test?
(zero? num-libs))
[:button {:class (stl/css :add-library-button) [:button {:class (stl/css :add-library-button)
:on-click show-libraries-dialog :on-click show-libraries-dialog
:data-testid "libraries"} :data-testid "libraries"}
@ -171,31 +173,32 @@
i/library] i/library]
(tr "workspace.assets.libraries")])) (tr "workspace.assets.libraries")]))
[:div {:class (stl/css :search-wrapper)} (when-not show-templates-02-test?
[:& search-bar {:on-change on-search-term-change [:div {:class (stl/css :search-wrapper)}
:value term [:& search-bar {:on-change on-search-term-change
:placeholder (tr "workspace.assets.search")} :value term
[:button :placeholder (tr "workspace.assets.search")}
{:on-click on-open-menu [:button
:title (tr "workspace.assets.filter") {:on-click on-open-menu
:class (stl/css-case :section-button true :title (tr "workspace.assets.filter")
:opened menu-open?)} :class (stl/css-case :section-button true
i/filter-icon]] :opened menu-open?)}
[:> context-menu* i/filter-icon]]
{:on-close on-menu-close [:> context-menu*
:selectable true {:on-close on-menu-close
:selected section :selectable true
:show menu-open? :selected section
:fixed true :show menu-open?
:min-width true :fixed true
:width size :min-width true
:top 158 :width size
:left 18 :top 158
:options options}] :left 18
[:> icon-button* {:variant "ghost" :options options}]
:aria-label (tr "workspace.assets.sort") [:> icon-button* {:variant "ghost"
:on-click toggle-ordering :aria-label (tr "workspace.assets.sort")
:icon (if reverse-sort? "asc-sort" "desc-sort")}]]] :on-click toggle-ordering
:icon (if reverse-sort? "asc-sort" "desc-sort")}]])]
[:& (mf/provider cmm/assets-filters) {:value filters} [:& (mf/provider cmm/assets-filters) {:value filters}
[:& (mf/provider cmm/assets-toggle-ordering) {:value toggle-ordering} [:& (mf/provider cmm/assets-toggle-ordering) {:value toggle-ordering}