mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: revert disallowed built-in block updates
1. built-in pages (non-classes) shouldn't be used as tags 2. some protected properties for built-in nodes shouldn't be updated, e.g. db/ident, block/title, block/name, logseq.property/type
This commit is contained in:
5
deps/outliner/src/logseq/outliner/core.cljs
vendored
5
deps/outliner/src/logseq/outliner/core.cljs
vendored
@@ -327,11 +327,6 @@
|
||||
(:block/title m*)
|
||||
(not= (:block/title m*) (:block/title block-entity)))
|
||||
(outliner-validate/validate-block-title db (:block/title m*) block-entity))
|
||||
_ (when (and db-based? (seq (:block/tags m*)))
|
||||
;; Add built-in? b/c it's not available here
|
||||
(doseq [tag (map #(assoc % :logseq.property/built-in?
|
||||
(contains? sqlite-create-graph/built-in-pages-names (:block/title %))) (:block/tags m*))]
|
||||
(outliner-validate/validate-built-in-pages tag {:message "Built-in page can't be a tag"})))
|
||||
m (cond-> m*
|
||||
db-based?
|
||||
(dissoc :block/format :block/pre-block? :block/priority :block/marker :block/properties-order))]
|
||||
|
||||
10
deps/outliner/src/logseq/outliner/validate.cljs
vendored
10
deps/outliner/src/logseq/outliner/validate.cljs
vendored
@@ -39,15 +39,6 @@
|
||||
|
||||
(def ^:api uneditable-page? ldb/built-in?)
|
||||
|
||||
(defn ^:api validate-built-in-pages
|
||||
"Validates built-in pages shouldn't be modified"
|
||||
[entity & {:keys [message]}]
|
||||
(when (uneditable-page? entity)
|
||||
(throw (ex-info "Rename built-in pages"
|
||||
{:type :notification
|
||||
:payload {:message (or message "Built-in pages can't be edited")
|
||||
:type :warning}}))))
|
||||
|
||||
(defn- find-other-ids-with-title-and-tags
|
||||
"Query that finds other ids given the id to ignore, title to look up and tags to consider"
|
||||
[entity]
|
||||
@@ -138,7 +129,6 @@
|
||||
(defn validate-block-title
|
||||
"Validates a block title when it has changed for a entity-util/page? or tagged node"
|
||||
[db new-title existing-block-entity]
|
||||
(validate-built-in-pages existing-block-entity)
|
||||
(validate-unique-by-name-and-tags db new-title existing-block-entity)
|
||||
(validate-disallow-page-with-journal-name new-title existing-block-entity))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user