wip fix page
This commit is contained in:
parent
680a433734
commit
1d6ed73f2b
|
|
@ -175,7 +175,7 @@ export const EdPopPage = () => {
|
||||||
id: opt.dragSourceId as string,
|
id: opt.dragSourceId as string,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
parent_id: (opt.dropTargetId === "ROOT" ||
|
parent_id: (opt.dropTargetId === "root" ||
|
||||||
!opt.dropTargetId
|
!opt.dropTargetId
|
||||||
? null
|
? null
|
||||||
: opt.dropTargetId) as string,
|
: opt.dropTargetId) as string,
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ export const pagePicker = {
|
||||||
status: "ready" as "loading" | "ready",
|
status: "ready" as "loading" | "ready",
|
||||||
search: "",
|
search: "",
|
||||||
render: () => {},
|
render: () => {},
|
||||||
rename_id: ""
|
rename_id: "",
|
||||||
|
new_parent_id: ""
|
||||||
};
|
};
|
||||||
|
|
||||||
export const reloadPagePicker = async (p: PG) => {
|
export const reloadPagePicker = async (p: PG) => {
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,12 @@ export const edPageTreeRender: NodeRender<PageItem> = (
|
||||||
data: {
|
data: {
|
||||||
name: local.rename_to,
|
name: local.rename_to,
|
||||||
id_site: p.site.id,
|
id_site: p.site.id,
|
||||||
parent_id: validate(rename_id) ? rename_id : null,
|
parent_id: validate(pagePicker.new_parent_id)
|
||||||
|
? pagePicker.new_parent_id
|
||||||
|
: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
pagePicker.new_parent_id = "";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await db.page_folder.update({
|
await db.page_folder.update({
|
||||||
|
|
@ -126,7 +129,9 @@ export const edPageTreeRender: NodeRender<PageItem> = (
|
||||||
type: "folder",
|
type: "folder",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
pagePicker.rename_id = "NEW";
|
pagePicker.rename_id = "NEW";
|
||||||
|
pagePicker.new_parent_id = item.id;
|
||||||
p.render();
|
p.render();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -251,14 +251,16 @@ export const PageManager = () => {
|
||||||
data.pages = newTree;
|
data.pages = newTree;
|
||||||
local.render();
|
local.render();
|
||||||
|
|
||||||
|
const is_drop_root =
|
||||||
|
opt.dropTargetId === "ROOT" || opt.dropTargetId === "root";
|
||||||
|
|
||||||
if (!opt.dragSource?.droppable) {
|
if (!opt.dragSource?.droppable) {
|
||||||
await db.page.update({
|
await db.page.update({
|
||||||
where: {
|
where: {
|
||||||
id: opt.dragSourceId as string,
|
id: opt.dragSourceId as string,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
id_folder: (opt.dropTargetId === "ROOT" ||
|
id_folder: (is_drop_root || !opt.dropTargetId
|
||||||
!opt.dropTargetId
|
|
||||||
? null
|
? null
|
||||||
: opt.dropTargetId) as string,
|
: opt.dropTargetId) as string,
|
||||||
},
|
},
|
||||||
|
|
@ -270,8 +272,7 @@ export const PageManager = () => {
|
||||||
id: opt.dragSourceId as string,
|
id: opt.dragSourceId as string,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
parent_id: (opt.dropTargetId === "ROOT" ||
|
parent_id: (is_drop_root || !opt.dropTargetId
|
||||||
!opt.dropTargetId
|
|
||||||
? null
|
? null
|
||||||
: opt.dropTargetId) as string,
|
: opt.dropTargetId) as string,
|
||||||
},
|
},
|
||||||
|
|
@ -643,11 +644,9 @@ const Elbow = () => (
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
width={10}
|
width={10}
|
||||||
height={10}
|
height={10}
|
||||||
className={cx(
|
className={cx(css`
|
||||||
css`
|
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
`
|
`)}
|
||||||
)}
|
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 15 15"
|
viewBox="0 0 15 15"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue