From 06a1b69d6ef8afbc98ed645dc1fe2617de699d22 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 12 Sep 2023 08:34:20 -0400 Subject: [PATCH] fix: rename to create page with recent property type change --- src/main/frontend/components/editor.cljs | 12 ++++++------ src/main/frontend/modules/outliner/core.cljs | 4 ++-- src/main/frontend/state.cljs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/frontend/components/editor.cljs b/src/main/frontend/components/editor.cljs index 4cb22fd037..54ffbcf5fd 100644 --- a/src/main/frontend/components/editor.cljs +++ b/src/main/frontend/components/editor.cljs @@ -127,7 +127,7 @@ (rum/defcs page-search < rum/reactive {:init (fn [state] - (reset! (:editor/create-object? @state/state) true) + (reset! (:editor/create-page? @state/state) true) state) :will-unmount (fn [state] (reset! commands/*current-command nil) @@ -138,7 +138,7 @@ db? (config/db-based-graph? (state/get-current-repo)) embed? (and db? (= @commands/*current-command "Page embed")) tag? (= action :page-search-hashtag) - create-object? (state/sub :editor/create-object?)] + create-page? (state/sub :editor/create-page?)] (when (contains? #{:page-search :page-search-hashtag} action) (let [pos (state/get-editor-last-pos) input (gdom/getElement id)] @@ -182,10 +182,10 @@ [:div (when (and db? tag?) [:div.flex.flex-row.items-center.px-4.py-1.text-sm.opacity-70.gap-2 - "Create object:" - (ui/toggle create-object? + "Create page:" + (ui/toggle create-page? (fn [_e] - (swap! (:editor/create-object? @state/state) not)) + (swap! (:editor/create-page? @state/state) not)) true)]) (ui/auto-complete matched-pages @@ -707,7 +707,7 @@ (assoc state ::id (str (random-uuid)))) :will-unmount (fn [state] - (reset! (:editor/create-object? @state/state) false) + (reset! (:editor/create-page? @state/state) false) state) :did-mount (fn [state] (state/set-editor-args! (:rum/args state)) diff --git a/src/main/frontend/modules/outliner/core.cljs b/src/main/frontend/modules/outliner/core.cljs index 8d8ebe57bc..7507005fa7 100644 --- a/src/main/frontend/modules/outliner/core.cljs +++ b/src/main/frontend/modules/outliner/core.cljs @@ -170,7 +170,7 @@ :block/refs [] :block/link [:block/uuid (:block/uuid page-m)]}] merge-tx)))))) - (reset! (:editor/create-object? @state/state) false))) + (reset! (:editor/create-page? @state/state) false))) (defn rebuild-block-refs [block new-properties & {:keys [skip-content-parsing?]}] @@ -286,7 +286,7 @@ structured-tags? (and (config/db-based-graph? (state/get-current-repo)) (:block/page block-entity) (seq (:block/tags m)) - @(:editor/create-object? @state/state))] + @(:editor/create-page? @state/state))] (when id ;; Retract attributes to prepare for tx which rewrites block attributes (let [retract-attributes (if db-based? diff --git a/src/main/frontend/state.cljs b/src/main/frontend/state.cljs index 95a68ff8cc..b9b7612171 100644 --- a/src/main/frontend/state.cljs +++ b/src/main/frontend/state.cljs @@ -142,7 +142,7 @@ :editor/code-block-context {} - :editor/create-object? (atom false) + :editor/create-page? (atom false) :db/properties-changed-pages {} :db/last-transact-time (atom {})