slice-machine
slice-machine copied to clipboard
Custom Type that defines slices that arent saved to library are not synced to local correctly
Version
- Prismic CLI version (know it by running
prismic --version
): 3.8.13 - slice-machine-ui version (know it by running
prismic --version
): 0.1.0-alpha.6
Reproduction
In
{
"Main": {
"doc_name": {
"type": "StructuredText",
"config": {
"single": "heading1",
"label": "Document name"
}
},
"nav": {
"type": "Slices",
"fieldset": "Slice zone",
"config": {
"choices": {
"nav_item": {
"type": "Slice",
"fieldset": "Nav Item",
"description": "Nav Item with Sub Navigation",
"icon": "insert_link",
"non-repeat": {
"label": {
"type": "StructuredText",
"config": {
"single": "paragraph",
"label": "Label",
"placeholder": "Enter Link Label..."
}
},
"link": {
"type": "Link",
"config": {
"label": "Link",
"placeholder": "Select Link..."
}
}
},
"repeat": {
"sub_nav_link_label": {
"type": "StructuredText",
"config": {
"single": "paragraph",
"label": "Sub Nav Link Label",
"placeholder": "Enter Sub Nav Link Label..."
}
},
"sub_nav_link": {
"type": "Link",
"config": {
"label": "Sub Nav Link",
"placeholder": "Select Sub Nav Link..."
}
}
}
}
}
}
}
}
}
Open "Slice Machine" - prismic sm --develop
- and visit http://localhost:9999/
Go to "Custom Types" -> "Menu" and click "Save To Filesystem"
What is expected?
The file customtypes/menu/index.json
is created with the following content:
{
"id": "menu",
"label": "Menu",
"status": true,
"repeatable": false,
"json": {
"Main" : {
"doc_name" : {
"type" : "StructuredText",
"config" : {
"single" : "heading1",
"label" : "Document name"
}
},
"nav" : {
"type" : "Slices",
"fieldset" : "Slice zone",
"config" : {
"choices" : {
"nav_item" : {
"type" : "Slice",
"fieldset" : "Nav Item",
"description" : "Nav Item with Sub Navigation",
"icon" : "insert_link",
"non-repeat" : {
"label" : {
"type" : "StructuredText",
"config" : {
"single" : "paragraph",
"label" : "Label",
"placeholder" : "Enter Link Label..."
}
},
"link" : {
"type" : "Link",
"config" : {
"label" : "Link",
"placeholder" : "Select Link..."
}
}
},
"repeat" : {
"sub_nav_link_label" : {
"type" : "StructuredText",
"config" : {
"single" : "paragraph",
"label" : "Sub Nav Link Label",
"placeholder" : "Enter Sub Nav Link Label..."
}
},
"sub_nav_link" : {
"type" : "Link",
"config" : {
"label" : "Sub Nav Link",
"placeholder" : "Select Sub Nav Link..."
}
}
}
}
}
}
}
}
}
}
What is actually happening?
The file customtypes/menu/index.json
is created with the following content:
{
"id": "menu",
"label": "Menu",
"status": true,
"repeatable": false,
"json": {
"Main": {
"doc_name": {
"type": "StructuredText",
"config": {
"single": "heading1",
"label": "Document name"
}
}
}
}
}
As you can see, the "Slice zone" has not been synced correctly.
Hey @shainegordon, the local builder currently does not handle non shared slices. I'm adding this to our backlog, we'll start working on this as soon as 0.1 is released
Great, we will definitely work around this by using a shared slice