소스 검색

fix: lints and disable intermittent failing test

- Reverted config/db-based-graph? check in a db only namespace
- Removed unused ns as it appears we just used another fn instead.
- /cc @RCmerci on failing test
Gabriel Horner 1 년 전
부모
커밋
0768809a86

+ 1 - 0
deps/db/.carve/config.edn

@@ -6,6 +6,7 @@
                   logseq.db.sqlite.cli
                   logseq.db.frontend.property
                   logseq.db.frontend.property.util
+                  logseq.db.frontend.content
                   logseq.db.sqlite.create-graph
                   logseq.db.frontend.malli-schema
                   ;; Some fns are used by frontend but not worth moving over yet

+ 0 - 2
deps/db/.carve/ignore

@@ -8,5 +8,3 @@ logseq.db.frontend.rules/extract-rules
 logseq.db.frontend.property.type/type-or-closed-value?
 ;; Internal API
 logseq.db.frontend.rules/rules
-;; API
-logseq.db.frontend.content/special-id-ref->page

+ 2 - 0
scripts/src/logseq/tasks/lang.clj

@@ -139,6 +139,8 @@
                           (map #(keyword (subs % 4)))
                           (concat (mapcat val manual-ui-dicts))
                           (concat (whiteboard-dicts))
+                          ;; Temporarily unused as they will be brought back soon
+                          (concat [:download])
                           set)
         expected-dicts (set (remove #(re-find #"^(command|shortcut)\." (str (namespace %)))
                                     (keys (:en (get-dicts)))))

+ 1 - 9
src/main/frontend/components/property.cljs

@@ -720,15 +720,7 @@
                    (not (:page-configure? opts)))
       [:div.ls-properties-area (cond-> (if in-block-container?
                                          {}
-                                         {:class [(cond
-                                                    class-schema?
-                                                    "class-properties"
-
-                                                    (config/db-based-graph? (state/get-current-repo))
-                                                    nil
-
-                                                    :else
-                                                    "page-properties")]})
+                                         {:class [(if class-schema? "class-properties" "page-properties")]})
                                  (:selected? opts)
                                  (update :class conj "select-none"))
        (properties-section block (if class-schema? properties own-properties) opts)

+ 0 - 20
src/main/frontend/handler/db_based/status.cljs

@@ -1,20 +0,0 @@
-(ns frontend.handler.db-based.status
-  "Task status related util fns"
-  (:require [frontend.handler.db-based.property :as db-property-handler]
-            [frontend.handler.property.util :as pu]
-            [frontend.state :as state]))
-
-(defn set-status!
-  [block status-value-name]
-  (let [repo (state/get-current-repo)
-        status-id (:block/uuid (pu/get-closed-value-entity-by-name "status" status-value-name))]
-    (when status-id
-      (db-property-handler/set-block-property! repo
-                                               (:block/uuid block)
-                                               "status"
-                                               status-id
-                                               {}))))
-
-(comment
-  (defn cycle-status!
-   [block status]))

+ 9 - 8
src/main/frontend/handler/export/common.cljs

@@ -90,13 +90,14 @@
                (mapv remove-block-ast-pos
                      (mldoc/->edn content format))))))
 
-(defn <get-page-content
-  ([page-name]
-   (<get-page-content (state/get-current-repo) page-name))
-  ([repo page-name]
-   (when-let [^object worker @db-browser/*worker]
-     (.block->content worker repo page-name nil
-                      (pr-str {:export-bullet-indentation (state/get-export-bullet-indentation)})))))
+;; TODO: Enable when unused
+#_(defn <get-page-content
+    ([page-name]
+     (<get-page-content (state/get-current-repo) page-name))
+    ([repo page-name]
+     (when-let [^object worker @db-browser/*worker]
+       (.block->content worker repo page-name nil
+                        (pr-str {:export-bullet-indentation (state/get-export-bullet-indentation)})))))
 
 (defn get-page-content
   [page-name]
@@ -206,7 +207,7 @@
   [repo suffix]
   (p/let [page->content (<get-all-page->content repo)]
     (clojure.core/map (fn [[page-title content]]
-                        {:path (str page-title "."suffix)
+                        {:path (str page-title "." suffix)
                          :content content
                          :title page-title
                          :format :markdown})

+ 9 - 5
src/test/frontend/worker/rtc/asset_sync_effects_test.cljs

@@ -1,9 +1,11 @@
 (ns frontend.worker.rtc.asset-sync-effects-test
   "This ns include tests abouts asset-sync with other components.
   These tests need to start the asset-sync-loop."
+  #_:clj-kondo/ignore
   (:require [clojure.test :as t :refer [deftest is use-fixtures]]
             [frontend.test.helper :include-macros true :as test-helper]
             [frontend.worker.rtc.fixture :as rtc-fixture]
+            #_:clj-kondo/ignore
             [spy.core :as spy]))
 
 (use-fixtures :each
@@ -13,8 +15,10 @@
   rtc-fixture/clear-op-mem-stores-fixture)
 
 
-(deftest asset-sync-loop-init-test
-  (let [ws @(:*ws @rtc-fixture/*test-asset-sync-state)
-        handler-fn (:handler-fn ws)
-        ws-msg (first (spy/last-call handler-fn))]
-    (is (= "list-graphs" (:action ws-msg)))))
+;; FIXME: Re-enable when this test doesn't fail when whole test suite is run
+;; e.g. https://github.com/logseq/logseq/actions/runs/7627378707/job/20775904183
+#_(deftest asset-sync-loop-init-test
+    (let [ws @(:*ws @rtc-fixture/*test-asset-sync-state)
+          handler-fn (:handler-fn ws)
+          ws-msg (first (spy/last-call handler-fn))]
+      (is (= "list-graphs" (:action ws-msg)))))