diff --git a/backend/src/app/rpc/commands/auth.clj b/backend/src/app/rpc/commands/auth.clj index 062436dbe..cf9db7762 100644 --- a/backend/src/app/rpc/commands/auth.clj +++ b/backend/src/app/rpc/commands/auth.clj @@ -273,7 +273,8 @@ (merge {:viewed-tutorial? false :viewed-walkthrough? false :nudge {:big 10 :small 1} - :v2-info-shown true}) + :v2-info-shown true + :release-notes-viewed (:main cf/version)}) (db/tjson)) password (or (:password params) "!") diff --git a/backend/src/app/rpc/commands/files_thumbnails.clj b/backend/src/app/rpc/commands/files_thumbnails.clj index eb7bf3c16..c3a5cb5d4 100644 --- a/backend/src/app/rpc/commands/files_thumbnails.clj +++ b/backend/src/app/rpc/commands/files_thumbnails.clj @@ -402,7 +402,10 @@ [cfg {:keys [::rpc/profile-id file-id] :as params}] (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) (let [media (create-file-thumbnail! cfg params)] {:uri (files/resolve-public-uri (:id media)) diff --git a/backend/src/app/rpc/commands/verify_token.clj b/backend/src/app/rpc/commands/verify_token.clj index d725ceda2..27679536e 100644 --- a/backend/src/app/rpc/commands/verify_token.clj +++ b/backend/src/app/rpc/commands/verify_token.clj @@ -166,23 +166,26 @@ ;; invited team. (let [props {:team-id (:team-id claims) :role (:role claims) - :invitation-id (:id invitation)} + :invitation-id (:id invitation)}] - accept-invitation-event - (-> (audit/event-from-rpc-params params) - (assoc ::audit/name "accept-team-invitation") - (assoc ::audit/props props)) + (audit/submit! + cfg + (-> (audit/event-from-rpc-params params) + (assoc ::audit/name "accept-team-invitation") + (assoc ::audit/props props))) - accept-invitation-from-event - (-> (audit/event-from-rpc-params params) - (assoc ::audit/profile-id (:created-by invitation)) - (assoc ::audit/name "accept-team-invitation-from") - (assoc ::audit/props (assoc props - :profile-id (:id profile) - :email (:email profile))))] - - (audit/submit! cfg accept-invitation-event) - (audit/submit! cfg accept-invitation-from-event) + ;; NOTE: Backward compatibility; old invitations can + ;; have the `created-by` to be nil; so in this case we + ;; don't submit this event to the audit-log + (when-let [created-by (:created-by invitation)] + (audit/submit! + cfg + (-> (audit/event-from-rpc-params params) + (assoc ::audit/profile-id created-by) + (assoc ::audit/name "accept-team-invitation-from") + (assoc ::audit/props (assoc props + :profile-id (:id profile) + :email (:email profile)))))) (accept-invitation cfg claims invitation profile) (assoc claims :state :created)) diff --git a/frontend/src/app/main/ui.cljs b/frontend/src/app/main/ui.cljs index 7fef9a6f4..418c14ad5 100644 --- a/frontend/src/app/main/ui.cljs +++ b/frontend/src/app/main/ui.cljs @@ -169,6 +169,7 @@ show-release-modal? (and (contains? cf/flags :onboarding) + (not (contains? cf/flags :hide-release-modal)) (:onboarding-viewed props) (not= (:release-notes-viewed props) (:main cf/version)) (not= "0.0" (:main cf/version)))] diff --git a/frontend/src/app/main/ui/workspace/sidebar/assets.cljs b/frontend/src/app/main/ui/workspace/sidebar/assets.cljs index bd0fa05f6..3af7840fd 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/assets.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/assets.cljs @@ -90,6 +90,9 @@ reverse-sort? (= :desc ordering) num-libs (count (mf/deref refs/libraries)) + show-templates-02-test? + (and (cf/external-feature-flag "templates-02" "test") (zero? num-libs)) + toggle-ordering (mf/use-fn (mf/deps ordering) @@ -158,8 +161,7 @@ [:article {:class (stl/css :assets-bar)} [:div {:class (stl/css :assets-header)} (when-not ^boolean read-only? - (if (and (cf/external-feature-flag "templates-02" "test") - (zero? num-libs)) + (if show-templates-02-test? [:button {:class (stl/css :add-library-button) :on-click show-libraries-dialog :data-testid "libraries"} @@ -171,31 +173,32 @@ i/library] (tr "workspace.assets.libraries")])) - [:div {:class (stl/css :search-wrapper)} - [:& search-bar {:on-change on-search-term-change - :value term - :placeholder (tr "workspace.assets.search")} - [:button - {:on-click on-open-menu - :title (tr "workspace.assets.filter") - :class (stl/css-case :section-button true - :opened menu-open?)} - i/filter-icon]] - [:> context-menu* - {:on-close on-menu-close - :selectable true - :selected section - :show menu-open? - :fixed true - :min-width true - :width size - :top 158 - :left 18 - :options options}] - [:> icon-button* {:variant "ghost" - :aria-label (tr "workspace.assets.sort") - :on-click toggle-ordering - :icon (if reverse-sort? "asc-sort" "desc-sort")}]]] + (when-not show-templates-02-test? + [:div {:class (stl/css :search-wrapper)} + [:& search-bar {:on-change on-search-term-change + :value term + :placeholder (tr "workspace.assets.search")} + [:button + {:on-click on-open-menu + :title (tr "workspace.assets.filter") + :class (stl/css-case :section-button true + :opened menu-open?)} + i/filter-icon]] + [:> context-menu* + {:on-close on-menu-close + :selectable true + :selected section + :show menu-open? + :fixed true + :min-width true + :width size + :top 158 + :left 18 + :options options}] + [:> icon-button* {:variant "ghost" + :aria-label (tr "workspace.assets.sort") + :on-click toggle-ordering + :icon (if reverse-sort? "asc-sort" "desc-sort")}]])] [:& (mf/provider cmm/assets-filters) {:value filters} [:& (mf/provider cmm/assets-toggle-ordering) {:value toggle-ordering}