Skip to content

Commit f8d6ab1

Browse files
authored
Merge pull request #6 from Q42/fix/preview-with-unpublished-parent
Fix: allow preview of page with unpublished parent
2 parents 2ad1e7e + fd3bb1a commit f8d6ab1

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ The basic studio example project, located in `examples/studio`, is a good starti
235235
### Example studio
236236

237237
- To run the example studio, go to the `examples/studio` directory.
238-
- Run `npx yalc add @q42/sanity-plugin-page-tree && npx yalc link @q42/sanity-plugin-page-tree && npm install`
238+
- Run `npx yalc add @q42/sanity-plugin-computed-page-tree && npx yalc link @q42/sanity-plugin-computed-page-tree && npm install`
239239
- Run `npm run dev`
240240

241241
This plugin uses [@sanity/plugin-kit](https://github.com/sanity-io/plugin-kit)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@q42/sanity-plugin-computed-page-tree",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"description": "A Sanity plugin to make managing nested pages in a tree easier",
55
"keywords": [
66
"sanity",

src/components/ComputedSlugField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const ComputedSlugInput: FC<ComputedSlugInputProps> = ({ value, config }) => {
1414
const parentRef = useFormValue(['parent']) as Reference;
1515

1616
const { onChange } = useFormCallbacks();
17-
const { page, isLoading } = usePageTreeItem(parentRef?._ref, config, 'published');
17+
const { page, isLoading } = usePageTreeItem(parentRef?._ref, config, 'drafts');
1818

1919
useEffect(() => {
2020
if (isLoading || !slug) {

0 commit comments

Comments
 (0)