0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-11 22:41:23 -05:00

Merge pull request #3357 from penpot/eva-bugfixin-8

🐛 Fix some bugs
This commit is contained in:
Alejandro 2023-07-03 14:04:42 +02:00 committed by GitHub
commit 6849a5b0e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 200 additions and 111 deletions

View file

@ -24,6 +24,12 @@
- Fix files can be opened from multiple urls [Taiga #5310](https://tree.taiga.io/project/penpot/issue/5310)
- Fix asset color item was created from the selected layer [Taiga #5180](https://tree.taiga.io/project/penpot/issue/5180)
- Fix unpublish more than one library at the same time [Taiga #5532](https://tree.taiga.io/project/penpot/issue/5532)
- Fix drag projects on dahsboard [Taiga #5531](https://tree.taiga.io/project/penpot/issue/5531)
- Fix allow team name to be all blank [Taiga #5527](https://tree.taiga.io/project/penpot/issue/5527)
- Fix search font visualitation [Taiga #5523](https://tree.taiga.io/project/penpot/issue/5523)
- Fix create and account only with spaces [Taiga #5518](https://tree.taiga.io/project/penpot/issue/5518)
- Fix context menu outside screen [Taiga #5524](https://tree.taiga.io/project/penpot/issue/5524)
### :arrow_up: Deps updates

View file

@ -60,7 +60,7 @@
font-size: $fs14;
background-color: $color-white;
display: flex;
min-width: 1000px;
max-width: 1000px;
width: 100%;
min-height: 97px;
align-items: center;

View file

@ -324,7 +324,7 @@
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.25);
z-index: 12;
top: 30px;
left: 6px;
left: -151px;
width: 155px;
hr {

View file

@ -466,20 +466,27 @@
.dashboard-templates-section {
position: absolute;
display: flex;
flex-direction: column;
justify-content: flex-end;
bottom: 0;
width: 100%;
height: 285px;
height: 228px;
transition: bottom 300ms;
pointer-events: none;
&.collapsed {
bottom: -228px;
transition: bottom 300ms;
}
.title {
width: 100%;
pointer-events: all;
width: fit-content;
top: -56px;
right: -28px;
text-align: right;
height: 56px;
position: absolute;
button {
border: none;
cursor: pointer;
@ -529,6 +536,7 @@
display: flex;
align-items: center;
justify-content: center;
pointer-events: all;
svg {
width: 12px;
height: 12px;
@ -550,6 +558,7 @@
}
.content {
pointer-events: all;
background-color: $color-white;
width: 200%;
height: 229px;

View file

@ -355,10 +355,12 @@ span.element-name {
.pages-tool-bar {
display: flex;
justify-content: space-between;
height: 32px;
margin-top: 8px;
height: 40px;
padding: 0;
&.search {
margin-top: 8px;
padding: 8px;
.search-box {
border: 1px solid $color-gray-20;
border-radius: $br4;
@ -403,6 +405,67 @@ span.element-name {
margin: 0 2px 0 5px;
cursor: pointer;
}
.page-name {
padding: 8px;
margin-top: 8px;
}
.icon-search {
margin-top: 8px;
}
.focus-title {
width: 100%;
height: 100%;
display: grid;
align-items: center;
grid-template-columns: 16px 1fr auto;
grid-column-gap: 8px;
cursor: pointer;
.back-button {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
background: none;
border: none;
padding: 0;
margin: 0;
svg {
width: 12px;
height: 12px;
fill: $color-gray-20;
transform: rotate(180deg);
}
&:hover {
svg {
fill: $color-primary;
}
}
}
.focus-name {
height: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.focus-mode {
color: $color-primary;
border: 1px solid $color-primary;
border-radius: $br3;
font-size: $fs10;
text-transform: uppercase;
padding: 0px 4px;
display: flex;
align-items: center;
}
}
}
}
.active-filters {

View file

@ -40,6 +40,7 @@
flex-shrink: 0;
padding: $size-2;
overflow: hidden;
margin: 0;
svg {
fill: $color-gray-20;
@ -136,52 +137,6 @@
padding: 0.25rem;
}
}
& .focus-title {
width: 100%;
height: 100%;
display: grid;
align-items: center;
grid-template-columns: auto 1fr auto;
grid-column-gap: 8px;
cursor: pointer;
& .back-button {
background: none;
border: none;
padding: 0;
margin: 0;
& svg {
fill: $color-white;
transform: rotate(180deg);
margin-top: 3px;
}
&:hover {
svg {
fill: $color-primary;
}
}
}
& .focus-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
& .focus-mode {
color: $color-primary;
border: 1px solid $color-primary;
border-radius: $br3;
font-size: $fs10;
text-transform: uppercase;
padding: 0px 4px;
display: flex;
align-items: center;
}
}
}
.assets-bar .tool-window {

View file

@ -22,6 +22,7 @@
[app.util.router :as rt]
[beicon.core :as rx]
[cljs.spec.alpha :as s]
[cuerdas.core :as str]
[rumext.v2 :as mf]))
(mf/defc demo-warning
@ -45,6 +46,13 @@
(= code ::us/email)
(assoc :message (tr "errors.email-invalid"))))))))
(defn- validate-password
[errors data]
(let [password (-> data :password str/trim)]
(cond-> errors
(str/empty? password)
(assoc :password {:message (tr "auth.password-not-empty")}))))
(s/def ::fullname ::us/not-empty-string)
(s/def ::password ::us/not-empty-string)
(s/def ::email ::us/email)
@ -87,7 +95,7 @@
[{:keys [params on-success-callback] :as props}]
(let [initial (mf/use-memo (mf/deps params) (constantly params))
form (fm/use-form :spec ::register-form
:validators [validate]
:validators [validate validate-password]
:initial initial)
submitted? (mf/use-state false)

View file

@ -25,7 +25,7 @@
on-key-down (gobj/get props "on-key-down")
id (gobj/get props "id")
klass (gobj/get props "klass")
key (gobj/get props "key")
key (gobj/get props "unique-key")
data-test (gobj/get props "data-test")]
[:li {:id id
:class klass

View file

@ -142,7 +142,11 @@
#(st/emit! (dd/set-file-shared (assoc file :is-shared true)))
del-shared
#(st/emit! (dd/set-file-shared (assoc file :is-shared false)))
(mf/use-fn
(mf/deps files)
(fn [_]
(run! #(st/emit! (dd/set-file-shared (assoc % :is-shared false))) files)))
on-add-shared
(fn [event]
@ -216,23 +220,23 @@
(when current-team
(let [sub-options (concat (vec (for [project current-projects]
{:option-name (get-project-name project)
:id (get-project-id project)
:option-handler (on-move (:id current-team)
(:id project))}))
(when (seq other-teams)
[{:option-name (tr "dashboard.move-to-other-team")
:id "move-to-other-team"
:sub-options
(for [team other-teams]
{:option-name (get-team-name team)
:id (get-project-id team)
:sub-options
(for [sub-project (:projects team)]
{:option-name (get-project-name sub-project)
:id (get-project-id sub-project)
:option-handler (on-move (:id team)
(:id sub-project))})})}]))
{:option-name (get-project-name project)
:id (get-project-id project)
:option-handler (on-move (:id current-team)
(:id project))}))
(when (seq other-teams)
[{:option-name (tr "dashboard.move-to-other-team")
:id "move-to-other-team"
:sub-options
(for [team other-teams]
{:option-name (get-team-name team)
:id (get-project-id team)
:sub-options
(for [sub-project (:projects team)]
{:option-name (get-project-name sub-project)
:id (get-project-id sub-project)
:option-handler (on-move (:id team)
(:id sub-project))})})}]))
options (if multi?
[{:option-name (tr "dashboard.duplicate-multi" file-count)

View file

@ -243,6 +243,7 @@
(when (kbd/enter? event)
(team-selected (:default-team-id profile) event)))
:id "teams-selector-default-team"
:unique-key "default-team"
:klass "team-name"}
[:span.team-icon i/logo-icon]
[:span.team-text (tr "dashboard.your-penpot")]
@ -256,7 +257,7 @@
(team-selected (:id team-item) event)))
:id (str "teams-selector-" (:id team-item))
:klass "team-name"
:key (dm/str (:id team-item))}
:unique-key (dm/str (:id team-item))}
[:span.team-icon
[:img {:src (cf/resolve-team-photo-url team-item)
:alt (:name team-item)}]]
@ -270,7 +271,7 @@
(on-create-clicked event)))
:id "teams-selector-create-team"
:klass "team-name action"
:key "teams-selector-create-team"}
:unique-key "teams-selector-create-team"}
[:span.team-icon.new-team i/close]
[:span.team-text (tr "dashboard.create-new-team")]]]))
@ -364,16 +365,16 @@
(when (kbd/enter? event)
(go-members)))
:id "teams-options-members"
:key "teams-options-members"
:data-test "team-members"}
:unique-key "teams-options-members"
:data-test "team-members"}
(tr "labels.members")]
[:& dropdown-menu-item {:on-click go-invitations
:on-key-down (fn [event]
(when (kbd/enter? event)
(go-invitations)))
:id "teams-options-invitations"
:key "teams-options-invitations"
:data-test "team-invitations"}
:unique-key "teams-options-invitations"
:data-test "team-invitations"}
(tr "labels.invitations")]
(when (contains? cf/flags :webhooks)
@ -382,7 +383,7 @@
(when (kbd/enter? event)
(go-webhooks)))
:id "teams-options-webhooks"
:key "teams-options-webhooks"}
:unique-key "teams-options-webhooks"}
(tr "labels.webhooks")])
[:& dropdown-menu-item {:on-click go-settings
@ -390,8 +391,8 @@
(when (kbd/enter? event)
(go-settings)))
:id "teams-options-settings"
:key "teams-options-settings"
:data-test "team-settings"}
:unique-key "teams-options-settings"
:data-test "team-settings"}
(tr "labels.settings")]
[:hr]
@ -401,8 +402,8 @@
(when (kbd/enter? event)
(on-rename-clicked)))
:id "teams-options-rename"
:key "teams-options-rename"
:data-test "rename-team"}
:unique-key "teams-options-rename"
:data-test "rename-team"}
(tr "labels.rename")])
(cond
@ -412,7 +413,7 @@
(when (kbd/enter? event)
(leave-and-close)))
:id "teams-options-leave-team"
:key "teams-options-leave-team"}
:unique-key "teams-options-leave-team"}
(tr "dashboard.leave-team")]
@ -422,8 +423,8 @@
(when (kbd/enter? event)
(on-leave-as-owner-clicked)))
:id "teams-options-leave-team"
:key "teams-options-leave-team"
:data-test "leave-team"}
:unique-key "teams-options-leave-team"
:data-test "leave-team"}
(tr "dashboard.leave-team")]
(> (count members) 1)
@ -432,7 +433,7 @@
(when (kbd/enter? event)
(on-leave-clicked)))
:id "teams-options-leave-team"
:key "teams-options-leave-team"}
:unique-key "teams-options-leave-team"}
(tr "dashboard.leave-team")])
@ -442,9 +443,9 @@
(when (kbd/enter? event)
(on-delete-clicked)))
:id "teams-options-delete-team"
:key "teams-options-delete-team"
:unique-key "teams-options-delete-team"
:klass "warning"
:data-test "delete-team"}
:data-test "delete-team"}
(tr "dashboard.delete-team")])]))

View file

@ -17,12 +17,20 @@
[app.util.router :as rt]
[beicon.core :as rx]
[cljs.spec.alpha :as s]
[cuerdas.core :as str]
[rumext.v2 :as mf]))
(s/def ::name ::us/not-empty-string)
(s/def ::team-form
(s/keys :req-un [::name]))
(defn- validate-name
[errors data]
(let [name (-> data :name str/trim)]
(cond-> errors
(str/empty? name)
(assoc :name {:message (tr "dashboard.team-name.not-empty-name")}))))
(defn- on-create-success
[_form response]
(let [msg "Team created successfully"]
@ -66,10 +74,11 @@
(on-create-submit form))))
(mf/defc team-form-modal {::mf/register modal/components
::mf/register-as :team-form}
::mf/register-as :team-form}
[{:keys [team] :as props}]
(let [initial (mf/use-memo (fn [] (or team {})))
form (fm/use-form :spec ::team-form
:validators [validate-name]
:initial initial)]
[:div.modal-overlay
[:div.modal-container.team-form-modal

View file

@ -14,6 +14,7 @@
[app.util.dom :as dom]
[app.util.i18n :as i18n :refer [t tr]]
[cljs.spec.alpha :as s]
[cuerdas.core :as str]
[rumext.v2 :as mf]))
(defn- on-error
@ -24,7 +25,7 @@
{:message (tr "errors.wrong-old-password")})
:email-as-password
(swap! form assoc-in [:errors :password-1]
{:message (tr "errors.email-as-password")})
{:message (tr "errors.email-as-password")})
(let [msg (tr "generic.error")]
(st/emit! (dm/error msg)))))
@ -62,6 +63,17 @@
(and password-1 (> 8 (count password-1)))
(assoc :password-1 {:message (tr "errors.password-too-short")}))))
(defn- validate-password
[errors data]
(let [password-1 (-> data :password-1 str/trim)
password-2 (-> data :password-2 str/trim)]
(cond-> errors
(str/empty? password-1)
(assoc :password-1 {:message (tr "auth.password-not-empty")})
(str/empty? password-2)
(assoc :password-2 {:message (tr "auth.password-not-empty")}))))
(s/def ::password-form
(s/keys :req-un [::password-1
::password-2
@ -71,8 +83,8 @@
[{:keys [locale] :as props}]
(let [initial (mf/use-memo (constantly {:password-old nil}))
form (fm/use-form :spec ::password-form
:validators [password-equality]
:initial initial)]
:validators [validate-password password-equality]
:initial initial)]
[:& fm/form {:class "password-form"
:on-submit on-submit
:form form}
@ -105,7 +117,7 @@
(mf/defc password-page
[{:keys [locale]}]
(mf/use-effect
#(dom/set-html-title (tr "title.settings.password")))
#(dom/set-html-title (tr "title.settings.password")))
[:section.dashboard-settings.form-container
[:div.form-container

View file

@ -93,13 +93,13 @@
:space-between i/align-content-row-between
:stretch nil))
(case val
:start i/align-content-row-start
:end i/align-content-row-end
:center i/align-content-row-center
:space-around i/align-content-row-around
:space-between i/align-content-row-between
:stretch nil)
(case val
:start i/align-content-row-start
:end i/align-content-row-end
:center i/align-content-row-center
:space-around i/align-content-row-around
:space-between i/align-content-row-between
:stretch nil)
:align-self
(if is-col?
@ -275,8 +275,8 @@
{:placeholder "--"
:on-change (partial on-change :simple :p1)
:on-focus #(do
(dom/select-target %)
(select-paddings true false true false))
(dom/select-target %)
(select-paddings true false true false))
:value p1}]]
[:div.padding-item.tooltip.tooltip-bottom-left
@ -354,7 +354,7 @@
i/auto-gap]
[:> numeric-input {:no-validate true
:placeholder "--"
:on-focus (fn [event]
:on-focus (fn [event]
(select-gap :row-gap)
(reset! gap-selected? :row-gap)
(dom/select-target event))
@ -638,12 +638,12 @@
(if (and (not multiple) (:layout values))
[:div.title-actions
#_[:div.layout-btns
[:button {:on-click set-flex
:class (dom/classnames
:active (= :flex layout-type))} "Flex"]
[:button {:on-click set-grid
:class (dom/classnames
:active (= :grid layout-type))} "Grid"]]
[:button {:on-click set-flex
:class (dom/classnames
:active (= :flex layout-type))} "Flex"]
[:button {:on-click set-grid
:class (dom/classnames
:active (= :grid layout-type))} "Grid"]]
[:button.remove-layout {:on-click on-remove-layout} i/minus]]
[:button.add-page {:on-click #(on-add-layout :flex)} i/close])]]

View file

@ -192,6 +192,8 @@
(if (= align-self value)
(st/emit! (dwsl/update-layout-child ids {:layout-item-align-self nil}))
(st/emit! (dwsl/update-layout-child ids {:layout-item-align-self value}))))
is-absolute? (:layout-item-absolute values)
is-col? (every? ctl/col? selection-parents)
@ -219,6 +221,8 @@
on-change-position
(fn [value]
(when (= value :static)
(st/emit! (dwsl/update-layout-child ids {:layout-item-z-index nil})))
(st/emit! (dwsl/update-layout-child ids {:layout-item-absolute (= value :absolute)})))
on-change-z-index
@ -254,6 +258,8 @@
{:placeholder "--"
:on-focus #(dom/select-target %)
:on-change #(on-change-z-index %)
:nillable true
:disabled (not is-absolute?)
:value (:layout-item-z-index values)}]]]])
(when (not (:layout-item-absolute values))

View file

@ -113,6 +113,10 @@ msgstr "Password"
msgid "auth.password-length-hint"
msgstr "At least 8 characters"
#: src/app/main/ui/auth/register.cljs
msgid "auth.password-not-empty"
msgstr "Password must contain some character other than space."
msgid "auth.privacy-policy"
msgstr "Privacy policy"
@ -371,6 +375,10 @@ msgstr "180 days"
msgid "dashboard.access-tokens.errors-required-name"
msgstr "The name is required"
#: src/app/main/ui/settings/team-form.cljs
msgid "dashboard.team-name.not-empty-name"
msgstr "The name must contain some character other than space."
#: src/app/main/ui/settings/access-tokens.cljs
msgid "dashboard.access-tokens.token-will-expire"
msgstr "The token will expire on %s"

View file

@ -118,6 +118,10 @@ msgstr "Contraseña"
msgid "auth.password-length-hint"
msgstr "8 caracteres como mínimo"
#: src/app/main/ui/auth/register.cljs
msgid "auth.password-not-empty"
msgstr "La contraseña debe contener algún caracter diferente de espacio"
msgid "auth.privacy-policy"
msgstr "Política de privacidad"
@ -378,6 +382,10 @@ msgstr "180 días"
msgid "dashboard.access-tokens.errors-required-name"
msgstr "El nombre es obligatorio"
#: src/app/main/ui/settings/team-form.cljs
msgid "dashboard.team-name.not-empty-name"
msgstr "El nombre debe contener algún carácter diferente de espacio"
#: src/app/main/ui/settings/access-tokens.cljs
msgid "dashboard.access-tokens.token-will-expire"
msgstr "El token expirará el %s"