mirror of
https://github.com/logseq/logseq.git
synced 2026-05-25 21:24:21 +00:00
chore: DRY up duplicated vars and needless/confusing aliases
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
[logseq.db.sqlite.create-graph :as sqlite-create-graph]
|
||||
[logseq.db.frontend.property.util :as db-property-util]
|
||||
[logseq.outliner.cli.pipeline :as cli-pipeline]
|
||||
[logseq.common.util :as common-util]
|
||||
[logseq.db :as ldb]
|
||||
[clojure.string :as string]
|
||||
[datascript.core :as d]
|
||||
@@ -83,7 +84,7 @@
|
||||
(into {}))
|
||||
page-uuids (->> pages-and-blocks
|
||||
(map :page)
|
||||
(map (juxt #(or (:block/name %) (sqlite-util/sanitize-page-name (:block/original-name %)))
|
||||
(map (juxt #(or (:block/name %) (common-util/page-name-sanity-lc (:block/original-name %)))
|
||||
:block/uuid))
|
||||
(into {}))
|
||||
block-uuids (->> pages-and-blocks
|
||||
@@ -194,7 +195,7 @@
|
||||
(merge
|
||||
{:db/id page-id
|
||||
:block/original-name (or (:block/original-name page) (string/capitalize (:block/name page)))
|
||||
:block/name (or (:block/name page) (sqlite-util/sanitize-page-name (:block/original-name page)))
|
||||
:block/name (or (:block/name page) (common-util/page-name-sanity-lc (:block/original-name page)))
|
||||
:block/journal? false
|
||||
:block/format :markdown}
|
||||
(dissoc page :properties)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Also creates a page of queries that exercises most properties
|
||||
NOTE: This script is also used in CI to confirm graph creation works"
|
||||
(:require [logseq.tasks.db-graph.create-graph :as create-graph]
|
||||
[logseq.db.sqlite.util :as sqlite-util]
|
||||
[logseq.common.util :as common-util]
|
||||
[logseq.db.frontend.property.type :as db-property-type]
|
||||
[clojure.string :as string]
|
||||
[datascript.core :as d]
|
||||
@@ -14,7 +14,7 @@
|
||||
(defn- date-journal-title [date]
|
||||
(let [title (.toLocaleString date "en-US" #js {:month "short" :day "numeric" :year "numeric"})
|
||||
suffixes {1 "st" 21 "st" 31 "st" 2 "nd" 22 "nd" 3 "rd" 23 "rd" 33 "rd"}]
|
||||
(sqlite-util/sanitize-page-name
|
||||
(common-util/page-name-sanity-lc
|
||||
(string/replace-first title #"(\d+)" (str "$1" (suffixes (.getDate date) "th"))))))
|
||||
|
||||
(defn- date-journal-day [date]
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
type logseq doesnt' support yet
|
||||
* schema.org assumes no cardinality. For now, only :page properties are given a :cardinality :many"
|
||||
(:require [logseq.tasks.db-graph.create-graph :as create-graph]
|
||||
[logseq.db.sqlite.util :as sqlite-util]
|
||||
[logseq.common.util :as common-util]
|
||||
[clojure.string :as string]
|
||||
[datascript.core :as d]
|
||||
["path" :as node-path]
|
||||
@@ -170,7 +170,7 @@
|
||||
[property-ids class-ids {:keys [verbose]}]
|
||||
(let [conflicts
|
||||
(->> (concat property-ids class-ids)
|
||||
(group-by (comp sqlite-util/sanitize-page-name first))
|
||||
(group-by (comp common-util/page-name-sanity-lc first))
|
||||
(filter #(> (count (val %)) 1))
|
||||
vals)
|
||||
;; If this assertion fails then renamed-classes approach to resolving
|
||||
|
||||
Reference in New Issue
Block a user