mirror of
https://github.com/penpot/penpot.git
synced 2025-02-04 21:38:53 -05:00
Merge pull request #3459 from penpot/niwinz-staging-bugfixes
🐛 Bugfixes & Enhancements
This commit is contained in:
commit
17798dbf40
7 changed files with 31 additions and 24 deletions
|
@ -1,36 +1,30 @@
|
||||||
[{:id "material-design-3"
|
[{:id "material-design-3"
|
||||||
:name "Material Design 3"
|
:name "Material Design 3"
|
||||||
:thumbnail-uri "https://penpot.app/images/libraries/cover-md3.jpg"
|
|
||||||
:file-uri "https://github.com/penpot/penpot-files/raw/main/Material%20Design%203.penpot"}
|
:file-uri "https://github.com/penpot/penpot-files/raw/main/Material%20Design%203.penpot"}
|
||||||
{:id "tutorial-for-beginners"
|
{:id "tutorial-for-beginners"
|
||||||
:name "Tutorial for beginners"
|
:name "Tutorial for beginners"
|
||||||
:thumbnail-uri "https://penpot.app/images/libraries/tutorial-for-beginners.jpg"
|
|
||||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/tutorial-for-beginners.penpot"}
|
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/tutorial-for-beginners.penpot"}
|
||||||
{:id "penpot-design-system"
|
{:id "penpot-design-system"
|
||||||
:name "Penpot Design System"
|
:name "Penpot Design System"
|
||||||
:thumbnail-uri "https://penpot.app/images/libraries/cover-ds-penpot.jpg"
|
|
||||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Penpot-Design-system.penpot"}
|
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Penpot-Design-system.penpot"}
|
||||||
|
{:id "flex-layout-playground"
|
||||||
|
:name "Flex Layout Playground"
|
||||||
|
:file-uri "https://github.com/penpot/penpot-files/raw/main/Flex%20Layout%20Playground.penpot"}
|
||||||
{:id "wireframing-kit"
|
{:id "wireframing-kit"
|
||||||
:name "Wireframing Kit"
|
:name "Wireframing Kit"
|
||||||
:thumbnail-uri "https://penpot.app/images/libraries/cover-wireframes.jpg"
|
|
||||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/wireframing-kit.penpot"}
|
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/wireframing-kit.penpot"}
|
||||||
{:id "ant-design"
|
{:id "ant-design"
|
||||||
:name "Ant Design UI Kit (lite)"
|
:name "Ant Design UI Kit (lite)"
|
||||||
:thumbnail-uri "https://penpot.app/images/libraries/cover-ant-design.jpg"
|
|
||||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Ant-Design-UI-Kit-Lite.penpot"}
|
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Ant-Design-UI-Kit-Lite.penpot"}
|
||||||
{:id "cocomaterial"
|
{:id "cocomaterial"
|
||||||
:name "Cocomaterial"
|
:name "Cocomaterial"
|
||||||
:thumbnail-uri "https://penpot.app/images/libraries/cover-cocomaterial.jpg"
|
|
||||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Cocomaterial.penpot"}
|
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Cocomaterial.penpot"}
|
||||||
{:id "circum-icons"
|
{:id "circum-icons"
|
||||||
:name "Circum Icons pack"
|
:name "Circum Icons pack"
|
||||||
:thumbnail-uri "https://penpot.app/images/libraries/cover-circum.jpg"
|
|
||||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/CircumIcons.penpot"}
|
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/CircumIcons.penpot"}
|
||||||
{:id "coreui"
|
{:id "coreui"
|
||||||
:name "CoreUI"
|
:name "CoreUI"
|
||||||
:thumbnail-uri "https://penpot.app/images/libraries/cover-coreui.jpg"
|
|
||||||
:file-uri "https://github.com/penpot/penpot-files/raw/main/CoreUI%20DesignSystem%20(DEMO).penpot"}
|
:file-uri "https://github.com/penpot/penpot-files/raw/main/CoreUI%20DesignSystem%20(DEMO).penpot"}
|
||||||
{:id "whiteboarding-kit"
|
{:id "whiteboarding-kit"
|
||||||
:name "Whiteboarding Kit"
|
:name "Whiteboarding Kit"
|
||||||
:thumbnail-uri "https://penpot.app/images/libraries/cover-whiteboards.jpg"
|
|
||||||
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Whiteboarding-mapping-kit.penpot"}]
|
:file-uri "https://github.com/penpot/penpot-files/raw/binary-files/Whiteboarding-mapping-kit.penpot"}]
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
[app.util.services :as sv]
|
[app.util.services :as sv]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
[clojure.walk :as walk]))
|
[clojure.walk :as walk]
|
||||||
|
[promesa.exec :as px]))
|
||||||
|
|
||||||
;; --- COMMAND: Duplicate File
|
;; --- COMMAND: Duplicate File
|
||||||
|
|
||||||
|
@ -322,6 +323,18 @@
|
||||||
;; delete possible broken relations on moved files
|
;; delete possible broken relations on moved files
|
||||||
(db/exec-one! conn [sql:delete-broken-relations pids])
|
(db/exec-one! conn [sql:delete-broken-relations pids])
|
||||||
|
|
||||||
|
;; Update the modification date of the all affected projects
|
||||||
|
;; ensuring that the destination project is the most recent one.
|
||||||
|
(doseq [project-id (into (list project-id) source)]
|
||||||
|
|
||||||
|
;; NOTE: as this is executed on virtual thread, sleeping does
|
||||||
|
;; not causes major issues, and allows an easy way to set a
|
||||||
|
;; trully different modification date to each file.
|
||||||
|
(px/sleep 10)
|
||||||
|
(db/update! conn :project
|
||||||
|
{:modified-at (dt/now)}
|
||||||
|
{:id project-id}))
|
||||||
|
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
(s/def ::ids (s/every ::us/uuid :kind set?))
|
(s/def ::ids (s/every ::us/uuid :kind set?))
|
||||||
|
@ -423,9 +436,9 @@
|
||||||
{::doc/added "1.10"
|
{::doc/added "1.10"
|
||||||
::doc/deprecated "1.19"}
|
::doc/deprecated "1.19"}
|
||||||
[cfg _params]
|
[cfg _params]
|
||||||
(mapv #(select-keys % [:id :name :thumbnail-uri]) (::setup/templates cfg)))
|
(mapv #(select-keys % [:id :name]) (::setup/templates cfg)))
|
||||||
|
|
||||||
(sv/defmethod ::get-builtin-templates
|
(sv/defmethod ::get-builtin-templates
|
||||||
{::doc/added "1.19"}
|
{::doc/added "1.19"}
|
||||||
[cfg _params]
|
[cfg _params]
|
||||||
(mapv #(select-keys % [:id :name :thumbnail-uri]) (::setup/templates cfg)))
|
(mapv #(select-keys % [:id :name]) (::setup/templates cfg)))
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
[:map {:title "Template"}
|
[:map {:title "Template"}
|
||||||
[:id ::sm/word-string]
|
[:id ::sm/word-string]
|
||||||
[:name ::sm/word-string]
|
[:name ::sm/word-string]
|
||||||
[:thumbnail-uri ::sm/word-string]
|
|
||||||
[:file-uri ::sm/word-string]])
|
[:file-uri ::sm/word-string]])
|
||||||
|
|
||||||
(def ^:private schema:templates
|
(def ^:private schema:templates
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
|
@ -10,7 +10,6 @@
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.common.pages :as cp]
|
[app.common.pages :as cp]
|
||||||
[app.common.schema :as sm]
|
[app.common.schema :as sm]
|
||||||
[app.common.time :as dt]
|
|
||||||
[app.common.uri :as u]
|
[app.common.uri :as u]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
|
@ -23,6 +22,7 @@
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
|
[app.util.time :as dt]
|
||||||
[app.util.timers :as tm]
|
[app.util.timers :as tm]
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[beicon.core :as rx]
|
[beicon.core :as rx]
|
||||||
|
@ -863,6 +863,7 @@
|
||||||
[{:keys [ids project-id] :as params}]
|
[{:keys [ids project-id] :as params}]
|
||||||
(dm/assert! (sm/set-of-uuid? ids))
|
(dm/assert! (sm/set-of-uuid? ids))
|
||||||
(dm/assert! (uuid? project-id))
|
(dm/assert! (uuid? project-id))
|
||||||
|
|
||||||
(ptk/reify ::move-files
|
(ptk/reify ::move-files
|
||||||
IDeref
|
IDeref
|
||||||
(-deref [_]
|
(-deref [_]
|
||||||
|
@ -872,13 +873,13 @@
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(let [origin-project (get-in state [:dashboard-files (first ids) :project-id])
|
(let [origin-project (get-in state [:dashboard-files (first ids) :project-id])
|
||||||
update-project (fn [project]
|
update-project (fn [project delta]
|
||||||
(-> project
|
(-> project
|
||||||
(update :count #(+ % (count ids)))
|
(update :count #(+ % (count ids)))
|
||||||
(assoc :modified-at (dt/now))))]
|
(assoc :modified-at (dt/plus (dt/now) {:milliseconds delta}))))]
|
||||||
(-> state
|
(-> state
|
||||||
(d/update-in-when [:dashboard-projects origin-project] update-project)
|
(d/update-in-when [:dashboard-projects origin-project] update-project 0)
|
||||||
(d/update-in-when [:dashboard-projects project-id] update-project))))
|
(d/update-in-when [:dashboard-projects project-id] update-project 10))))
|
||||||
|
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ _ _]
|
(watch [_ _ _]
|
||||||
|
|
|
@ -296,10 +296,9 @@
|
||||||
:on-import on-import}]
|
:on-import on-import}]
|
||||||
|
|
||||||
[:span.info (str (tr "labels.num-of-files" (i18n/c file-count)))]
|
[:span.info (str (tr "labels.num-of-files" (i18n/c file-count)))]
|
||||||
(when (> file-count 0)
|
|
||||||
(let [time (-> (:modified-at project)
|
(let [time (-> (:modified-at project)
|
||||||
(dt/timeago {:locale locale}))]
|
(dt/timeago {:locale locale}))]
|
||||||
[:span.recent-files-row-title-info (str ", " time)]))
|
[:span.recent-files-row-title-info (str ", " time)])
|
||||||
[:div.project-actions
|
[:div.project-actions
|
||||||
(when-not (:is-default project)
|
(when-not (:is-default project)
|
||||||
[:button.pin-icon.tooltip.tooltip-bottom
|
[:button.pin-icon.tooltip.tooltip-bottom
|
||||||
|
|
|
@ -150,8 +150,9 @@
|
||||||
(mf/defc templates-section
|
(mf/defc templates-section
|
||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
[{:keys [default-project-id profile project-id team-id content-width]}]
|
[{:keys [default-project-id profile project-id team-id content-width]}]
|
||||||
(let [templates (->> (mf/deref builtin-templates)
|
(let [templates (mf/deref builtin-templates)
|
||||||
(filter #(not= (:id %) "tutorial-for-beginners")))
|
templates (mf/with-memo [templates]
|
||||||
|
(filterv #(not= (:id %) "tutorial-for-beginners") templates))
|
||||||
|
|
||||||
route (mf/deref refs/route)
|
route (mf/deref refs/route)
|
||||||
route-name (get-in route [:data :name])
|
route-name (get-in route [:data :name])
|
||||||
|
|
Loading…
Add table
Reference in a new issue