enhance: allow built-in pages to be renamed

`db/ident` shouldn't be updated, at least for those built-in pages.
pull/11491/head
Tienson Qin 2024-08-27 18:36:59 +08:00
parent d20f4d9b8e
commit 37d91f2e5d
4 changed files with 2 additions and 11 deletions

View File

@ -319,17 +319,13 @@ i.ti {
/** endregion **/
/* region FIXME: override elements (?) */
h1.title, h1.title input, .ls-page-title-container, .ls-page-icon {
h1.title, h1.title input, .ls-page-title-container {
@apply font-medium;
color: var(--lx-gray-12, var(--ls-title-text-color, hsl(var(--foreground))));
font-size: var(--ls-page-title-size, 32px);
}
.title .page-icon {
margin-right: 12px;
}
.block-highlight,
.content .selected {
transition: background-color 0.2s cubic-bezier(0, 1, 0, 1);

View File

@ -3106,7 +3106,7 @@
(when (ldb/property? block)
{:type :tabler-icon
:id "letter-p"}))))]
[:div {:class (when (:page-title? config) "ls-page-icon")}
[:div.flex.items-center.page-icon
(icon-component/icon-picker icon
{:on-chosen (fn [_e icon]
(db-property-handler/set-block-property!

View File

@ -149,8 +149,6 @@
(outliner-op/rename-page! page-uuid new-name))
result' (ldb/read-transit-str result)]
(case (if (string? result') (keyword result') result')
:built-in-page
(notification/show! "Built-in page's name cannot be modified" :warning)
:invalid-empty-name
(notification/show! "Please use a valid name, empty name is not allowed!" :warning)
:rename-page-exists

View File

@ -81,9 +81,6 @@
new-page-exists?
:rename-page-exists
(ldb/built-in? page-e)
:built-in-page
(and old-name new-name name-changed?)
(if (= old-page-name new-page-name) ; case changed
(ldb/transact! conn