Skip to content

Commit

Permalink
Merge pull request #29 from c4ll-m3-j4ck/master
Browse files Browse the repository at this point in the history
FEATURE: Compatibility with neos/flow v9.0
  • Loading branch information
dlubitz authored Oct 7, 2024
2 parents 98ddc8d + b2ca80d commit 0f97d15
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ And the corresponding Fusion object to render the Form Element:
```fusion
prototype(Your.Package:NameAndTitle) < prototype(Neos.Form.FusionRenderer:FormElement) {
fieldContainer {
field = Neos.Fusion:Array {
field = Neos.Fusion:Join {
title = Neos.Form.FusionRenderer:FormElementField {
tagName = 'select'
attributes {
Expand Down Expand Up @@ -243,7 +243,7 @@ prototype(Your.Package:NameAndTitle) < prototype(Neos.Form.FusionRenderer:FormEl
}
```

In this case we replace the `field` to be an `Neos.Fusion:Array`.
In this case we replace the `field` to be an `Neos.Fusion:Join`.

> **Note:** The element type of the composite element will be `array`, you can refer to the
individual values (e.g. in the ConfirmationFinisher message) via dot-syntax (for example `theElement.givenName`)
10 changes: 5 additions & 5 deletions Resources/Private/Fusion/ContainerElements/PreviewPage.fusion
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
prototype(Neos.Form:PreviewPage) < prototype(Neos.Form.FusionRenderer:AbstractSection) {
content.elements = Neos.Fusion:Tag {
tagName = 'table'
content = Neos.Fusion:Array {
content = Neos.Fusion:Join {
headerRow = Neos.Fusion:Tag {
tagName = 'tr'
content = Neos.Fusion:Array {
content = Neos.Fusion:Join {
1 = Neos.Fusion:Tag {
tagName = 'th'
content = ${Neos.Form.FusionRenderer.translate(containerElement, 'forms.pages.labelTitle', 'Label')}
Expand All @@ -15,8 +15,8 @@ prototype(Neos.Form:PreviewPage) < prototype(Neos.Form.FusionRenderer:AbstractSe
}
}
}
valueRows = Neos.Fusion:Collection {
collection = ${containerElement.rootForm.renderablesRecursively}
valueRows = Neos.Fusion:Loop {
items = ${containerElement.rootForm.renderablesRecursively}
itemName = 'element'
itemRenderer = Neos.Fusion:Case {
page {
Expand Down Expand Up @@ -45,7 +45,7 @@ prototype(Neos.Form:PreviewPage.PageRow) < prototype(Neos.Fusion:Tag) {

prototype(Neos.Form:PreviewPage.ElementRow) < prototype(Neos.Fusion:Tag) {
tagName = 'tr'
content = Neos.Fusion:Array {
content = Neos.Fusion:Join {
1 = Neos.Fusion:Tag {
tagName = 'td'
content = ${element.label}
Expand Down
6 changes: 3 additions & 3 deletions Resources/Private/Fusion/Core/AbstractSection.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ prototype(Neos.Form.FusionRenderer:AbstractSection) < prototype(Neos.Fusion:Tag)
class = ${containerElement.properties.elementClassAttribute}
class.@if.hasCustomClass = ${containerElement.properties.elementClassAttribute ? true : false}
}
content = Neos.Fusion:Array {
content = Neos.Fusion:Join {
legend = Neos.Fusion:Tag {
tagName = 'legend'
content = ${Neos.Form.FusionRenderer.translateAndEscapeProperty(containerElement, 'label')}
@if.hasLabel = ${containerElement.label ? true : false}
}
elements = Neos.Fusion:Collection {
collection = ${containerElement.elements}
elements = Neos.Fusion:Loop {
items = ${containerElement.elements}
itemName = 'element'
itemRenderer = Neos.Fusion:Renderer {
type = ${element.type}
Expand Down
12 changes: 6 additions & 6 deletions Resources/Private/Fusion/Core/Form.fusion
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
prototype(Neos.Form:Form) < prototype(Neos.Fusion:Tag) {
tagName = 'form'

attributes = Neos.Fusion:Attributes {
attributes = Neos.Fusion:DataStructure {
method = 'post'
enctype = 'multipart/form-data'
id = ${formRuntime.identifier}
action = ${request.httpRequest.uri + '#' + formRuntime.identifier}
}

content = Neos.Fusion:Array {
formHiddenFields = Neos.Fusion:Array {
content = Neos.Fusion:Join {
formHiddenFields = Neos.Fusion:Join {
formStateHiddenField = Neos.Form.FusionRenderer:FormStateHiddenField
@process.wrap = ${'<div style="display:none">' + value + '</div>'}
}
pages = Neos.Fusion:Collection {
collection = ${[formRuntime.currentPage]}
pages = Neos.Fusion:Loop {
items = ${[formRuntime.currentPage]}
itemName = 'page'
itemRenderer = Neos.Fusion:Renderer {
type = ${page.type}
Expand All @@ -27,7 +27,7 @@ prototype(Neos.Form:Form) < prototype(Neos.Fusion:Tag) {

prototype(Neos.Form:FormEditMode) < prototype(Neos.Form:Form) {
content.navigation >
content.pages.collection = ${formRuntime.pages}
content.pages.items = ${formRuntime.pages}
}

prototype(Neos.Form.FusionRenderer:FormStateHiddenField) < prototype(Neos.Fusion:Tag) {
Expand Down
12 changes: 6 additions & 6 deletions Resources/Private/Fusion/Core/FormElement.fusion
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prototype(Neos.Form.FusionRenderer:FormElement) < prototype(Neos.Fusion:Array) {
prototype(Neos.Form.FusionRenderer:FormElement) < prototype(Neos.Fusion:Join) {
@context.elementName = ${'--' + formRuntime.identifier + '[' + element.identifier + ']'}
@context.elementValue = ${Neos.Form.FusionRenderer.elementValue(formRuntime, element)}
@context.elementValidationErrors = ${Neos.Form.FusionRenderer.validationErrors(formRuntime, element)}
Expand Down Expand Up @@ -26,7 +26,7 @@ prototype(Neos.Form.FusionRenderer:FormElementLabel) < prototype(Neos.Fusion:Tag
attributes {
for = ${element.uniqueIdentifier}
}
content = Neos.Fusion:Array {
content = Neos.Fusion:Join {
value = ${Neos.Form.FusionRenderer.translateAndEscapeProperty(element, 'label')}
requiredFlag = Neos.Form.FusionRenderer:RequiredFlag
requiredFlag.@if.isRequired = ${element.required}
Expand All @@ -39,7 +39,7 @@ prototype(Neos.Form.FusionRenderer:RequiredFlag) < prototype(Neos.Fusion:Tag) {
content = '*'
}

prototype(Neos.Form.FusionRenderer:FormElementFieldContainer) < prototype(Neos.Fusion:Array) {
prototype(Neos.Form.FusionRenderer:FormElementFieldContainer) < prototype(Neos.Fusion:Join) {
field = Neos.Form.FusionRenderer:FormElementField
validationErrors = Neos.Form.FusionRenderer:FormElementValidationErrors
elementDescription = Neos.Form.FusionRenderer:FormElementDescription
Expand All @@ -54,7 +54,7 @@ prototype(Neos.Form.FusionRenderer:FormElementFieldContainer) < prototype(Neos.F
prototype(Neos.Form.FusionRenderer:FormElementField) < prototype(Neos.Fusion:Tag) {
attributes {
placeholder = ${element.properties.placeholder}
class = Neos.Fusion:Array {
class = Neos.Fusion:Join {
defaultClass = ${element.properties.elementClassAttribute ? element.properties.elementClassAttribute : null}
errorClass = ${element.properties.elementErrorClassAttribute ? element.properties.elementErrorClassAttribute : 'error'}
errorClass.@process.whitespace = ${' ' + value}
Expand All @@ -69,8 +69,8 @@ prototype(Neos.Form.FusionRenderer:FormElementValidationErrors) < prototype(Neos
attributes {
class = 'help-inline'
}
content = Neos.Fusion:Collection {
collection = ${elementValidationErrors}
content = Neos.Fusion:Loop {
items = ${elementValidationErrors}
itemName = 'error'
itemRenderer = ${Translation.translate(error.code, null, error.arguments, 'ValidationErrors', element.renderingOptions.validationErrorTranslationPackage)}
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Core/FormNavigation.fusion
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
prototype(Neos.Form.FusionRenderer:FormNavigation) < prototype(Neos.Fusion:Tag) {
tagName = 'nav'
attributes.class = 'form-navigation'
content = Neos.Fusion:Array {
content = Neos.Fusion:Join {
previousButton = Neos.Form.FusionRenderer:FormNavigationButton {
label = ${Neos.Form.FusionRenderer.translate(formRuntime, 'forms.navigation.previousPage', 'Previous page')}
class = ${formRuntime.renderingOptions.previousButtonClassAttribute}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Core/SelectionElement.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ prototype(Neos.Form.FusionRenderer:SelectionElement) < prototype(Neos.Form.Fusio

}

prototype(Neos.Form.FusionRenderer:SelectOptions) < prototype(Neos.Fusion:Collection) {
prototype(Neos.Form.FusionRenderer:SelectOptions) < prototype(Neos.Fusion:Loop) {
@class = 'Neos\\Form\\FusionRenderer\\Fusion\\SelectOptionsImplementation'
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ prototype(Neos.Form:MultipleSelectCheckboxes) < prototype(Neos.Form.FusionRender
tagName = 'li'
content = Neos.Fusion:Tag {
tagName = 'label'
content = Neos.Fusion:Array {
content = Neos.Fusion:Join {
radioButton = Neos.Fusion:Tag {
tagName = 'input'
attributes {
type = 'checkbox'
class = Neos.Fusion:Array {
class = Neos.Fusion:Join {
defaultClass = ${element.properties.elementClassAttribute ? element.properties.elementClassAttribute : null}
errorClass = ${element.properties.elementErrorClassAttribute ? element.properties.elementErrorClassAttribute : 'error'}
errorClass.@process.whitespace = ${' ' + value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ prototype(Neos.Form:PasswordWithConfirmation) < prototype(Neos.Form.FusionRender
tagName = 'input'
attributes {
placeholder = ${element.properties.confirmationPlaceholder}
class = Neos.Fusion:Array {
class = Neos.Fusion:Join {
defaultClass = ${element.properties.confirmationClassAttribute ? element.properties.confirmationClassAttribute : null}
errorClass = ${element.properties.elementErrorClassAttribute ? element.properties.elementErrorClassAttribute : 'error'}
errorClass.@process.whitespace = ${' ' + value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ prototype(Neos.Form:SingleSelectRadiobuttons) < prototype(Neos.Form.FusionRender
tagName = 'li'
content = Neos.Fusion:Tag {
tagName = 'label'
content = Neos.Fusion:Array {
content = Neos.Fusion:Join {
radioButton = Neos.Fusion:Tag {
tagName = 'input'
attributes {
type = 'radio'
class = Neos.Fusion:Array {
class = Neos.Fusion:Join {
defaultClass = ${element.properties.elementClassAttribute ? element.properties.elementClassAttribute : null}
errorClass = ${element.properties.elementErrorClassAttribute ? element.properties.elementErrorClassAttribute : 'error'}
errorClass.@process.whitespace = ${' ' + value}
Expand Down

0 comments on commit 0f97d15

Please sign in to comment.