0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-11 15:21:18 -05:00

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

This commit is contained in:
Andrey Antukh 2021-03-29 15:38:36 +02:00
commit efdfbbaf5e
6 changed files with 33 additions and 25 deletions

View file

@ -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

View file

@ -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))))

View file

@ -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)

View file

@ -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

View file

@ -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
}

1
version.txt Normal file
View file

@ -0,0 +1 @@
1.4.0-alpha