File tree Expand file tree Collapse file tree 17 files changed +156
-12
lines changed
Expand file tree Collapse file tree 17 files changed +156
-12
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ protected function executeInternal()
2222 {
2323 try {
2424 $ commentableNode = $ this ->parseOption ('node ' );
25+
26+ if ($ commentableNode === null ) {
27+ throw new InvalidNodeTypeException ('Node should be of type ' .CommentService::COMMENTABLE_NODE_TYPE .' null given. ' , 1536671893 );
28+ }
29+
2530 $ this ->commentService ->addComment ($ commentableNode , $ this ->getCommentDto ());
2631 } catch (\Exception | InvalidNodeTypeException $ exception ) {
2732 $ this ->finisherContext ->cancel ();
Original file line number Diff line number Diff line change 44 label : ' ${ I18n.translate(node.nodeType.label) }'
55 ui :
66 icon : ' icon-comments'
7- label : ' Comments '
7+ label : ' i18n '
88 constraints :
99 nodeTypes :
1010 ' * ' : false
Original file line number Diff line number Diff line change 22 abstract : true
33 childNodes :
44 comments :
5- type : ' Breadlesscode.Blog :Collection.Comments'
5+ type : ' Breadlesscode.Commentable :Collection.Comments'
66 position : ' after main'
Original file line number Diff line number Diff line change 1+ Neos :
2+ Form :
3+ presets :
4+ ' default ' :
5+ finisherPresets :
6+ ' Breadlesscode.Commentable:From.Finisher.AddComment ' :
7+ implementationClassName : ' Breadlesscode\Commentable\Form\Finisher\AddCommentFormFinisher'
Original file line number Diff line number Diff line change 1+ Neos :
2+ Neos :
3+ userInterface :
4+ translation :
5+ autoInclude :
6+ ' Breadlesscode.Commentable ' :
7+ - ' NodeTypes/Collection/*'
8+ - ' NodeTypes/Content/*'
9+ - ' NodeTypes/Mixin/*'
10+ fusion :
11+ autoInclude :
12+ Breadlesscode.Commentable : true
Original file line number Diff line number Diff line change 1+ prototype(Breadlesscode.Commentable:Collection.Comment) < prototype(Neos.Neos:ContentCollection) {
2+ nodePath = 'comments'
3+ }
Original file line number Diff line number Diff line change 1+ prototype(Breadlesscode.Commentable:Component.Comment) < prototype(Neos.Fusion:Component) {
2+ name = ''
3+ email = ''
4+ content = ''
5+ createdAt = ''
6+
7+ renderer = Neos.Fusion:Tag {
8+ content = Neos.Fusion:Array {
9+ name = Neos.Fusion:Tag {
10+ tagName = 'p'
11+ content = ${ props.name }
12+ }
13+ content = Neos.Fusion:Tag {
14+ tagName = 'p'
15+ content = ${ props.content }
16+ }
17+ createdAt = Neos.Fusion:Tag {
18+ tagName = 'p'
19+ content = ${ 'Created at: ' + Date.format(props.createdAt, 'd.m.Y H:i') }
20+ }
21+ }
22+ attributes.class = 'comment'
23+ }
24+ }
Original file line number Diff line number Diff line change 1+ prototype(Breadlesscode.Commentable:Content.Comment) < prototype(Neos.Neos:ContentComponent) {
2+ renderer = Breadlesscode.Commentable:Component.Comment {
3+ name = ${ q(node).property('name') }
4+ email = ${ q(node).property('email') }
5+ content = ${ q(node).property('content') }
6+ createdAt = ${ q(node).property('createdAt') }
7+ }
8+ }
Original file line number Diff line number Diff line change 1-
2-
3- prototype(Neos.NodeTypes:Form) {
4- presetName = 'fusion'
5- }
61prototype(Breadlesscode.Commentable:Form.Comment) < prototype(Neos.Form.Builder:Form) {
72 @context.commentableNode = ${ documentNode }
8- presetName = 'fusion'
93
104 firstPage {
115 elements {
126 name = Neos.Form.Builder:SingleLineText.Definition {
13- label = 'Name'
7+ label = ${ Translation.translate('Breadlesscode.Commentable:Form.Comment:name.label') }
148 }
159 email = Neos.Form.Builder:SingleLineText.Definition {
16- label = 'E-Mail'
10+ label = ${ Translation.translate('Breadlesscode.Commentable:Form.Comment:email.label') }
1711 }
1812 message = Neos.Form.Builder:MultiLineText.Definition {
19- label = 'Message'
13+ label = ${ Translation.translate('Breadlesscode.Commentable:Form.Comment:content.label') }
2014 }
2115 }
2216 }
17+
2318 finishers {
2419 addComment = Breadlesscode.Commentable:From.Finisher.AddComment.Definition {
2520 options {
@@ -30,4 +25,12 @@ prototype(Breadlesscode.Commentable:Form.Comment) < prototype(Neos.Form.Builder:
3025 }
3126 }
3227 }
28+
29+ @cache {
30+ context {
31+ 1 = 'none'
32+ 2 = 'documentNode'
33+ 3 = 'commentableNode'
34+ }
35+ }
3336}
Original file line number Diff line number Diff line change 1+ include: Component/**/*.fusion
2+ include: Collection/**/*.fusion
3+ include: Form/**/*.fusion
4+ include: Content/**/*.fusion
5+
6+ #####
7+ #
8+ # Thanks for using this package :)
9+ #
10+ #####
You can’t perform that action at this time.
0 commit comments