diff --git a/CHANGES.md b/CHANGES.md index ee26aed417..95964b094c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -35,6 +35,7 @@ - Fix cannot apply second token after creation while shape is selected [Taiga #13513](https://tree.taiga.io/project/penpot/issue/13513) - Fix error activating a set with invalid shadow token applied [Taiga #13528](https://tree.taiga.io/project/penpot/issue/13528) - Fix component "broken" after variant switch [Taiga #12984](https://tree.taiga.io/project/penpot/issue/12984) +- Fix incorrect query for file versions [Github #8463](https://github.com/penpot/penpot/pull/8463) ## 2.13.3 diff --git a/backend/src/app/features/file_snapshots.clj b/backend/src/app/features/file_snapshots.clj index cf40a08a79..192030cbf8 100644 --- a/backend/src/app/features/file_snapshots.clj +++ b/backend/src/app/features/file_snapshots.clj @@ -138,6 +138,7 @@ c.deleted_at FROM snapshots1 AS c WHERE c.file_id = ? + ORDER BY c.created_at DESC ), snapshots3 AS ( (SELECT * FROM snapshots2 WHERE created_by = 'system' @@ -150,8 +151,7 @@ AND deleted_at IS NULL LIMIT 500) ) - SELECT * FROM snapshots3 - ORDER BY created_at DESC")) + SELECT * FROM snapshots3;")) (defn get-visible-snapshots "Return a list of snapshots fecheable from the API, it has a limited diff --git a/common/src/app/common/time.cljc b/common/src/app/common/time.cljc index 3aca6d447b..fb5a5d1d1b 100644 --- a/common/src/app/common/time.cljc +++ b/common/src/app/common/time.cljc @@ -233,7 +233,7 @@ (dfn-format v "p") :localized-date-time - (dfn-format v "PPPp") + (dfn-format v "PPP . p") (if (string? fmt) (dfn-format v fmt) diff --git a/frontend/src/app/main/ui/ds/layout/tab_switcher.scss b/frontend/src/app/main/ui/ds/layout/tab_switcher.scss index f25fc4ccd9..56ecfe27f0 100644 --- a/frontend/src/app/main/ui/ds/layout/tab_switcher.scss +++ b/frontend/src/app/main/ui/ds/layout/tab_switcher.scss @@ -114,4 +114,5 @@ width: 100%; height: 100%; outline: $b-1 solid var(--tab-panel-outline-color); + overflow-y: auto; } diff --git a/frontend/src/app/main/ui/ds/product/milestone_group.cljs b/frontend/src/app/main/ui/ds/product/milestone_group.cljs index 2b8944d0fd..73452fc30b 100644 --- a/frontend/src/app/main/ui/ds/product/milestone_group.cljs +++ b/frontend/src/app/main/ui/ds/product/milestone_group.cljs @@ -39,7 +39,6 @@ (mf/spread-props props {:class [class class'] :data-testid "milestone"}) - open* (mf/use-state false) @@ -57,7 +56,13 @@ (dom/get-data "index") (d/parse-integer))] (when (fn? on-menu-click) - (on-menu-click index event)))))] + (on-menu-click index event))))) + + snapshots + (mf/with-memo [snapshots] + (map-indexed (fn [index date] + (d/vec2 date index)) + snapshots))] [:> :div props [:> text* {:as "span" :typography t/body-small :class (stl/css :name)} label] @@ -76,14 +81,14 @@ :icon-arrow-toggled open?)}]] (when ^boolean open? - (for [[idx d] (d/enumerate snapshots)] - [:div {:key (dm/str "entry-" idx) + (for [[date index] snapshots] + [:div {:key (dm/str "entry-" index) :class (stl/css :version-entry)} - [:> date* {:date d :class (stl/css :date) :typography t/body-small}] + [:> date* {:date date :class (stl/css :date) :typography t/body-small}] [:> icon-button* {:class (stl/css :entry-button) :variant "ghost" :icon i/menu :aria-label (tr "workspace.versions.version-menu") - :data-index idx + :data-index index :on-click on-menu-click}]]))]])) diff --git a/frontend/src/app/main/ui/ds/utilities/date.cljs b/frontend/src/app/main/ui/ds/utilities/date.cljs index f24cd11ac6..eadeeb187a 100644 --- a/frontend/src/app/main/ui/ds/utilities/date.cljs +++ b/frontend/src/app/main/ui/ds/utilities/date.cljs @@ -6,10 +6,8 @@ (ns app.main.ui.ds.utilities.date (:require-macros - [app.common.data.macros :as dm] [app.main.style :as stl]) (:require - [app.common.data :as d] [app.common.time :as ct] [app.main.ui.ds.foundations.typography :as t] [app.main.ui.ds.foundations.typography.text :refer [text*]] @@ -30,15 +28,10 @@ (mf/defc date* {::mf/schema schema:date} [{:keys [class date selected typography] :rest props}] - (let [class (d/append-class class (stl/css-case :date true :is-selected selected)) - date (cond-> date (not (ct/inst? date)) ct/inst) + (let [date (cond-> date (not (ct/inst? date)) ct/inst) typography (or typography t/body-medium)] [:> text* {:as "time" :typography typography - :class class + :class [class (stl/css-case :date true :is-selected selected)] :date-time (ct/format-inst date :iso)} - (dm/str - (ct/format-inst date :localized-date) - " . " - (ct/format-inst date :localized-time) - "h")])) + (ct/format-inst date :localized-date-time)])) diff --git a/frontend/src/app/main/ui/workspace/sidebar.scss b/frontend/src/app/main/ui/workspace/sidebar.scss index acceaf4f7d..3c5360b4f4 100644 --- a/frontend/src/app/main/ui/workspace/sidebar.scss +++ b/frontend/src/app/main/ui/workspace/sidebar.scss @@ -159,3 +159,7 @@ overflow: hidden; height: calc(100vh - deprecated.$s-88); } + +.history-tab { + overflow-y: auto; +}