Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ function SortableItem({ item, selected, sortable = true }: { item: TItem; select
ref={ref}
data-item-id={item.key}
sx={[
{ position: 'relative', borderRadius: 1, cursor: 'grab' },
state.type === 'is-dragging' && { opacity: 0.4 }
{ position: 'relative', borderRadius: 1, cursor: sortable ? 'grab' : 'default' },
state.type === 'is-dragging' && { opacity: 0.4 },
!sortable && { background: 'none !important' }
]}
selected={selected}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ export function PageNavOrder(props: PageNavOrderProps) {
const orderDefaultAtom = formContext.atoms.valueByFieldId[ORDER_DEFAULT_FIELD_ID] as
| PrimitiveAtom<number | string | null | undefined>
| undefined;
if (!orderDefaultAtom) {
throw new Error(`Missing "${ORDER_DEFAULT_FIELD_ID}" atom; computed nav order was not applied to the form.`);
}
const effectRefs = useUpdateRefs({
initialValue,
contextItem,
Expand Down Expand Up @@ -217,10 +220,6 @@ export function PageNavOrder(props: PageNavOrderProps) {
}}
/>
</Typography>
{/* TODO: Remove this alert when the 'content/reorder-items' new v2 API is implemented. */}
<Alert severity="warning" sx={{ mt: 2 }}>
Development draft. Waiting for 'content/reorder-items' new v2 API to be implemented.
</Alert>
<Paper elevation={0} sx={{ mt: 2 }}>
<SortableList
items={pagesOrderState.order ?? []}
Expand Down