mirror of
https://github.com/colanode/colanode.git
synced 2025-12-29 00:25:03 +01:00
Fix page create name, sidebar items ordering and name popover placeholder
This commit is contained in:
@@ -45,6 +45,7 @@ export class PageCreateMutationHandler
|
||||
type: NodeTypes.Page,
|
||||
parentId: input.parentId,
|
||||
index: index,
|
||||
name: input.name,
|
||||
},
|
||||
},
|
||||
input.userId,
|
||||
|
||||
@@ -13,6 +13,7 @@ import { mapNode } from '@/lib/nodes';
|
||||
import { LocalNode } from '@/types/nodes';
|
||||
import { MutationChange } from '@/operations/mutations';
|
||||
import { isEqual } from 'lodash';
|
||||
import { compareString } from '@/lib/utils';
|
||||
|
||||
export class SidebarSpaceListQueryHandler
|
||||
implements QueryHandler<SidebarSpaceListQueryInput>
|
||||
@@ -101,7 +102,10 @@ export class SidebarSpaceListQueryHandler
|
||||
continue;
|
||||
}
|
||||
|
||||
const children = nodes.filter((n) => n.parentId === node.id);
|
||||
const children = nodes
|
||||
.filter((n) => n.parentId === node.id)
|
||||
.sort((a, b) => compareString(a.index, b.index));
|
||||
|
||||
spaces.push(this.buildSpaceNode(node, children));
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ export const BreadcrumbItemPopover = ({
|
||||
</AvatarPopover>
|
||||
<SmartTextInput
|
||||
value={node.name}
|
||||
placeholder="Unnamed"
|
||||
onChange={(newName) => {
|
||||
if (isPending) return;
|
||||
if (newName === node.name) return;
|
||||
|
||||
Reference in New Issue
Block a user