diff --git a/CHANGES.md b/CHANGES.md index 766e450904..a3a4177a8a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -59,6 +59,8 @@ - Fix issue with typographies panel cannot be collapsed [#707](https://github.com/penpot/penpot/issues/707) - Fix text selection in comments [#745](https://github.com/penpot/penpot/issues/745) - Update Work-Sans font [#744](https://github.com/penpot/penpot/issues/744) +- Fix issue with recent files not showing [Taiga #1493](https://tree.taiga.io/project/penpot/issue/1493) +- Fix issue when promoting to owner [Taiga #1494](https://tree.taiga.io/project/penpot/issue/1494) >>>>>>> origin/staging diff --git a/backend/src/app/rpc/mutations/teams.clj b/backend/src/app/rpc/mutations/teams.clj index be2c428a69..c1934de9d5 100644 --- a/backend/src/app/rpc/mutations/teams.clj +++ b/backend/src/app/rpc/mutations/teams.clj @@ -174,7 +174,10 @@ ;; convenience, if this bocomes a bottleneck or problematic, ;; we will change it to more efficient fetch mechanims. members (teams/retrieve-team-members conn team-id) - member (d/seek #(= member-id (:id %)) members)] + member (d/seek #(= member-id (:id %)) members) + + is-owner? (some :is-owner perms) + is-admin? (some :is-admin perms)] ;; If no member is found, just 404 (when-not member @@ -182,8 +185,7 @@ :code :member-does-not-exist)) ;; First check if we have permissions to change roles - (when-not (or (some :is-owner perms) - (some :is-admin perms)) + (when-not (or is-owner? is-admin?) (ex/raise :type :validation :code :insufficient-permissions)) @@ -193,21 +195,20 @@ :code :cant-change-role-to-owner)) ;; Don't allow promote to owner to admin users. - (when (and (= role :owner) - (not (:is-owner perms))) + (when (and (not is-owner?) (= role :owner)) (ex/raise :type :validation :code :cant-promote-to-owner)) (let [params (role->params role)] ;; Only allow single owner on team - (when (and (= role :owner) - (:is-owner perms)) + (when (= role :owner) (db/update! conn :team-profile-rel {:is-owner false} {:team-id team-id :profile-id profile-id})) - (db/update! conn :team-profile-rel params + (db/update! conn :team-profile-rel + params {:team-id team-id :profile-id member-id}) nil)))) diff --git a/backend/src/app/rpc/queries/recent_files.clj b/backend/src/app/rpc/queries/recent_files.clj index 1791b784be..e4f9b6b1f9 100644 --- a/backend/src/app/rpc/queries/recent_files.clj +++ b/backend/src/app/rpc/queries/recent_files.clj @@ -27,7 +27,7 @@ window w as (partition by f.project_id order by f.modified_at desc) order by f.modified_at desc ) - select * from recent_files where row_num <= 6;") + select * from recent_files where row_num <= 10;") (s/def ::team-id ::us/uuid) (s/def ::profile-id ::us/uuid) diff --git a/frontend/src/app/main/ui/dashboard/grid.cljs b/frontend/src/app/main/ui/dashboard/grid.cljs index a7653c3f5e..7c8f7b555e 100644 --- a/frontend/src/app/main/ui/dashboard/grid.cljs +++ b/frontend/src/app/main/ui/dashboard/grid.cljs @@ -256,14 +256,17 @@ itemsize 290 ratio (if (some? @width) (/ @width itemsize) 0) nitems (mth/floor ratio) - limit (if (and (some? @width) - (> (* itemsize (count files)) @width) - (< (- ratio nitems) 0.51)) - (dec nitems) ;; Leave space for the "show all" block - nitems) + limit (min 10 ;; Configuration in backend to return recent files + (if (and (some? @width) + (> (* itemsize (count files)) @width) + (< (- ratio nitems) 0.51)) + (dec nitems) ;; Leave space for the "show all" block + nitems)) + limit (if dragging? (dec limit) limit) + limit (max 1 limit)] (mf/use-effect diff --git a/manage.sh b/manage.sh index 01631cd7ac..b1e2546dc1 100755 --- a/manage.sh +++ b/manage.sh @@ -6,9 +6,18 @@ export DEVENV_IMGNAME="$ORGANIZATION/devenv"; export DEVENV_PNAME="penpotdev"; export CURRENT_USER_ID=$(id -u); -export CURRENT_VERSION=$(git describe --tags); +export CURRENT_VERSION=$(cat ./version.txt); export CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD); export CURRENT_HASH=$(git rev-parse --short HEAD); +export CURRENT_COMMITS=$(git rev-list --count HEAD) + +function print-current-version { + if [ $CURRENT_BRANCH != "main" ]; then + echo -n "$CURRENT_BRANCH-$CURRENT_VERSION-$CURRENT_COMMITS-g$CURRENT_HASH" + else + echo -n "$CURRENT_VERSION-$CURRENT_COMMITS-g$CURRENT_HASH" + fi +} function build-devenv { echo "Building development image $DEVENV_IMGNAME:latest..." @@ -74,7 +83,7 @@ function build { } function build-app-bundle { - local version="$CURRENT_VERSION"; + local version=$(print-current-version); local bundle_dir="./bundle-app"; build "frontend"; @@ -85,10 +94,6 @@ function build-app-bundle { cp -r ./frontend/target/dist $bundle_dir/frontend; cp -r ./backend/target/dist $bundle_dir/backend; - if [ $CURRENT_BRANCH != "main" ]; then - version="$CURRENT_BRANCH-$CURRENT_VERSION"; - fi; - echo $version > $bundle_dir/version.txt sed -i -re "s/\%version\%/$version/g" $bundle_dir/frontend/index.html; @@ -96,7 +101,7 @@ function build-app-bundle { } function build-exporter-bundle { - local version="$CURRENT_VERSION"; + local version=$(print-current-version); local bundle_dir="./bundle-exporter"; build "exporter"; @@ -104,10 +109,6 @@ function build-exporter-bundle { rm -rf $bundle_dir; cp -r ./exporter/target $bundle_dir; - if [ $CURRENT_BRANCH != "main" ]; then - version="$CURRENT_BRANCH-$CURRENT_VERSION"; - fi; - echo $version > $bundle_dir/version.txt } diff --git a/version.txt b/version.txt new file mode 100644 index 0000000000..06c33719e1 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.4.0-alpha